Page 1 of 1

find clicked menu

Posted: Sun Sep 05, 2021 8:54 am
by davoodice2
hi.
in bone select pop up dialog how to find witch menu is clicked?

for these menus
target
angle control bone
position control bone
scale control bone

if target menu clicked do something
but if position control menu clicked do something other



I work on im_select_bone

Re: find clicked menu

Posted: Sun Sep 05, 2021 10:42 am
by hayasidist
davoodice2 wrote: Sun Sep 05, 2021 8:54 am in bone select pop up dialog how to find witch menu is clicked?
The UI is built from various base widgets e.g. TextControl https://mohoscripting.com/methods/395 and in each there's a reference to "msg" - and that's what's sent to HandleMessage(moho, view, msg) (see https://mohoscripting.com/script_structure). Convention demands use of message numbers as some positive offset from MOHO.MSG_BASE

to answer your specific question about select bone: take a look the code (C:\Program Files\Moho\Resources\Support\Scripts\Tool\lm_select_bone.lua)

Re: find clicked menu

Posted: Sun Sep 05, 2021 11:15 am
by synthsin75
Since a popup menu itself doesn't send a message, just clicking on one cannot be detected. You can only detect when one of it's options has been selected.

Re: find clicked menu

Posted: Sun Sep 05, 2021 12:06 pm
by davoodice2
synthsin75 wrote: Sun Sep 05, 2021 11:15 am Since a popup menu itself doesn't send a message, just clicking on one cannot be detected. You can only detect when one of it's options has been selected.
its true. but I detect that by change msg for each menu when MOHO.BuildBoneChoiceMenu

Re: find clicked menu

Posted: Sun Sep 05, 2021 12:11 pm
by synthsin75
davoodice2 wrote: Sun Sep 05, 2021 12:06 pm
synthsin75 wrote: Sun Sep 05, 2021 11:15 am Since a popup menu itself doesn't send a message, just clicking on one cannot be detected. You can only detect when one of it's options has been selected.
its true. but I detect that by change msg for each menu when MOHO.BuildBoneChoiceMenu
Cool, you solved your own problem.