Page 1 of 1
Armed Buttons
Posted: Tue Mar 29, 2011 4:47 pm
by xclntdesign
I am trying to arm a button using the following code:
Code: Select all
set the armed of button btnToArm of stack mainProgram to true
And it doesn't work as I expected, unless I am reading the Dictionary wrong. What this code does for me is it changes to the Armed icon only after I move the mouse over the button, and when I move my mouse off the button, it stays armed. What I need it to do is show the Armed icon as soon as that line is processed.
I've tried autoArm, and that didn't seem to make any difference.
Can anyone help?
Re: Armed Buttons
Posted: Tue Mar 29, 2011 9:52 pm
by BvG
The armed should happen automatically whenever you interact with a menu. For other buttons, you might want to use the hilite or maybe mouseEnter/Leave, or simply the hoverIcon, I guess? So it depends on why you are actually doing this and when and for what, respectively with what message and for what goal you trigger it?
Re: Armed Buttons
Posted: Wed Mar 30, 2011 3:01 am
by dunbarx
I also don't know what you have in mind, but to test, why not put these in the button script:
on mouseEnter
set the armed of me to "true"
end mouseEnter
on mouseLeave
set the armed of me to "false"
end mouseLeave
At least you can see what changes. You need to have an armedIcon and a hoverIcon.
Re: Armed Buttons
Posted: Thu Apr 07, 2011 3:12 pm
by xclntdesign
Probably should've elaborated more in my original post.
I have setup an interface that is supposed to function like tabs, but with icons instead of text. When the program loads, I want to set the default "tab" as visible and its icon to the Armed state.
I have set both the Armed and Hover Icons to the same icon, and the Hover part works.
I have tried the MouseEnter and MouseLeave functions and they did not function as I needed, my fault for not explaining better.
Re: Armed Buttons
Posted: Thu Apr 07, 2011 3:26 pm
by Klaus
Hi xclntdesign,
hmm, I never understood the meaning of this property, except when using STACKS as popup menus.
Can't you just:
1. Group all of your buttons into a "radiobutton" group!
This way you will not need to manage the hilite icons and you can use all the groups "hilitedbutton" stuff etc. in your scripts!
Know what I mean? This will act just like a "simple" "radiobutton" group with custom icons!
2. Use hover icons instead of armed icons, so you will not need to script the icon change "on mouseenter/mouseleave"!
But maybe I do not understand your problem
Best
Klaus
Re: Armed Buttons
Posted: Thu Apr 07, 2011 3:58 pm
by xclntdesign
Maybe this pic will help.
Basically, the Menu icons control what is displayed in the Content Area. When the program starts, I want to change the icon for the Invoice button from the Normal state (shown) to the Armed state. I have to do it with code, because the very first time the program is run, the Settings button needs to be selected.