Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tooltip
#31
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:

Code:
Copy      Help
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.
#32
Function qm_menu_item_tooltip
Trigger $a 133 -4 "" "#32768" "" "" "" "" 12     Help - how to add the trigger to the macro
Code:
Copy      Help
;\
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
Code:
Copy      Help
one :out 1
two :out 2

Macro Macro506
Code:
Copy      Help
ShowMenu("one[]two")
#33
Wow....thank you!!!


Forum Jump:


Users browsing this thread: 1 Guest(s)