Hello again,
RightClick-event works with ListViews, but not with ListBoxes.
ListViews: The corresponding function is called and A_GuiEvent = "RightClick".
ListBoxes: Nothing happens. Left click works, then A_GuiEvent = "Normal".
Any hints are highly appreciated!
Many thanks and greetings
hotkeyguy
GUI ListView/ListBox RightClick-event with associated function object
Re: GUI ListView/ListBox RightClick-event with associated function object
Code: Select all
Gui, Add, ListBox, r5 vColorChoice, Red|Green|Blue|Black|White
Gui, Show, w220, List
OnMessage(0x0204, "WM_RBUTTONDOWN")
Return
WM_RBUTTONDOWN(wParam, lParam) {
x := lParam & 0xFFFF, y := lParam >> 16
If !A_GuiControl
Return
ToolTip, You right-clicked in GUI window #%A_Gui% at client coordinates (%x%`,%y%) in control %A_GuiControl%.
}
Re: GUI ListView/ListBox RightClick-event with associated function object
That look useful! Thank you, @just me.
Re: GUI ListView/ListBox RightClick-event with associated function object
I'm aware of
When GuiContextMenu is triggered, the context menu is shown. I use GuiContextMenu as function, and for the menu items (LabelOrSubmenu) I'm using functions, too.
My main question now is whether it's possible to pass an additional paramater from GuiContextMenu(...) to LabelOrSubmenu(...) via an function object for the menu item. Basically my function object for the menu item is working, but not with an additional parameter. Is ObjBindMethod() the solution?
but its use is not so smooth compared to the ListView and an function object.
When GuiContextMenu is triggered, the context menu is shown. I use GuiContextMenu as function, and for the menu items (LabelOrSubmenu) I'm using functions, too.
My main question now is whether it's possible to pass an additional paramater from GuiContextMenu(...) to LabelOrSubmenu(...) via an function object for the menu item. Basically my function object for the menu item is working, but not with an additional parameter. Is ObjBindMethod() the solution?
Re: GUI ListView/ListBox RightClick-event with associated function object
Why is the following not possible:
Menu, MenuItem, Add, % "MenuCaption", % FunctionObject.Call( "Parameter" )
or
Menu, MenuItem, Add, % "MenuCaption", %FunctionObject%( "Parameter" )
Menu, MenuItem, Add, % "MenuCaption", % FunctionObject.Call( "Parameter" )
or
Menu, MenuItem, Add, % "MenuCaption", %FunctionObject%( "Parameter" )