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
find clicked menu
Moderators: Víctor Paredes, Belgarath, slowtiger
- davoodice2
- Posts: 381
- Joined: Tue Jun 15, 2021 1:14 pm
find clicked menu
خیام اگر ز باده مستی خوش باش
با ماهرخی اگر نشستی خوش باش
چون عاقبت کار جهان نیستی است
انگار که نیستی چو هستی خوش باش
با ماهرخی اگر نشستی خوش باش
چون عاقبت کار جهان نیستی است
انگار که نیستی چو هستی خوش باش
- hayasidist
- Posts: 3562
- Joined: Wed Feb 16, 2011 8:12 pm
- Location: Kent, England
Re: find clicked menu
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_BASEdavoodice2 wrote: ↑Sun Sep 05, 2021 8:54 am in bone select pop up dialog how to find witch menu is clicked?
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)
- synthsin75
- Posts: 10012
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: find clicked menu
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.
- Wes
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
- davoodice2
- Posts: 381
- Joined: Tue Jun 15, 2021 1:14 pm
Re: find clicked menu
its true. but I detect that by change msg for each menu when MOHO.BuildBoneChoiceMenusynthsin75 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.
خیام اگر ز باده مستی خوش باش
با ماهرخی اگر نشستی خوش باش
چون عاقبت کار جهان نیستی است
انگار که نیستی چو هستی خوش باش
با ماهرخی اگر نشستی خوش باش
چون عاقبت کار جهان نیستی است
انگار که نیستی چو هستی خوش باش
- synthsin75
- Posts: 10012
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: find clicked menu
Cool, you solved your own problem.davoodice2 wrote: ↑Sun Sep 05, 2021 12:06 pmits true. but I detect that by change msg for each menu when MOHO.BuildBoneChoiceMenusynthsin75 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.
- Wes
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/