Login Page - Create Account

Support Board


Date/Time: Mon, 20 Jan 2025 11:27:08 +0000



Post From: ACSIL Toolbar Button Status

[2018-06-04 10:08:59]
User553714 - Posts: 184
I found it useful not to think of a button press as having an On/Off status but rather a good way of executing a one-off instruction, (it's probably one of the best ways to do this.)
Advanced Custom Study Interaction With Menus, Control Bar Buttons, Pointer Events
"The ACSIL variable sc.MenuEventID indicates which ACS Control Bar Button is currently selected.
The possible values are one of the ACS_BUTTON_# constants. Where # equals 1 through 50."

My recollection from the testing I did is that sc.MenuEventID does not hold the integer value of the button pressed in a persistent manner and gets reset to zero shortly after each event?
If that is the case, you probably need to use a secondary "persistent variable" to keep track of the on-off status of a button if that is something that is important to you.

Because I use buttons for one-off executions, I always reset the appearance of the button to unpressed after each conditional test, for example;
if (sc.MenuEventID == Input_ACS1button.GetInt())
{  
  do whatever you need ....
}
sc.SetACSToolEnable(Input_ACS1button.GetInt(),FALSE);  // This resets the button to an unpressed appearance
Regards