Posts: 763
Threads: 261
Joined: Jul 2012
Is it possible to render a tooltip within a QM menu item (when mouse is on a menu item).
I an referring to these menu's:
1)
File >> New >> Menu
Example:
Menu item 1 :mac "macro1" "0"
Menu item 2 :mac "macro2" "0"
2)
And when using the
ShowMenu command?
I think this might take too much of your time, I understand if you can not cover this due to time limitations.
Posts: 12,075
Threads: 141
Joined: Dec 2002
Function
qm_menu_item_tooltip
Trigger
$a 133 -4 "" "#32768" "" "" "" "" 12
;\
function hwnd idObject idChild
;edit this list
lpstr mapItemTextToTooltipText=
;one tooltip for one
;two multiline[]''tooltip''
;Cut tooltip for QM menu Edit -> Cut
;___________________________________
int pid; GetWindowThreadProcessId(hwnd &pid); if(pid!=GetCurrentProcessId) ret ;;only QM process
Acc a.FromEvent(hwnd idObject idChild) ;;menu item accessible object
RECT r; a.Location(r.left r.top r.right r.bottom); r.right+r.left; r.bottom+r.top ;;rectangle in screen
str s=a.Name
if !s.len ;;QM menus are owner-drawn
,RECT u=r; MapWindowPoints 0 hwnd +&u 2
,WindowText wt.Init(hwnd u); wt.Capture; if(wt.n<1) ret
,s=wt.a[0].txt
s.gett(s 0 "[9]") ;;remove hotkey
;out s
err+ ret
IStringMap m._create; m.AddList(mapItemTextToTooltipText)
if(!m.Get2(s s)) ret
s.escape(0)
;out s
OnScreenDisplay s 0 r.right r.top "" 10 1 4|16 "qm_menu_item" 0xE0FFFF
;ShowTooltip s 5 r.right r.top 800 2 ;;shows multiple, not good
Menus for testing.
Menu
Menu58
Macro
Macro506
Posts: 763
Threads: 261
Joined: Jul 2012