-
Notifications
You must be signed in to change notification settings - Fork 3
3. Button states
An AJUI_button can take on a different appearance and content depending on five states and the exceptions that will be defined for them.
This is the basic state of a button when a user does not interact with it or when it is not disabled.
This state occurs when the "On Mouse Enter" event is triggered and ends with the "On Mouse Leave" event. In concrete terms, the user is hovering over the button with the mouse.
This state intervenes on the "On Click" event and ends with the "On Mouse Up. Note that it has priority over the "Hover" state. In practice, the user clicks on the button and the status lasts until it is released.
This state takes place when the button is deactivated using the object's "Enable" member function. When the button is deactivated, only this state is taken into account.
This state occurs on the "On Getting Focus" event and ends with the "On Losing Focus”.
As you can see from the states, the component requires that several events be activated on the picture form object in order to be able to manage the different states. Here is the list of these :
- On Load
- On Click
- On Double Click (optionnel)
- On Mouse Enter
- On Mouse Leave
- On Mouse Up
- On Getting Focus
- On Losing Focus
Concerning the two events on click and on double-click, callbacks can be associated with them using the member functions. Basically, the event on the double-click is not necessary unless you use the callback.
In order to be able to modify the structure and content of a button, we have set up an exception mechanism in the component that will apply to all states except "Default" which retains all its basic properties.
To do this, most of the member functions (see the list of properties for details) expect a constant in the first parameter. Each constant represents one of the five states. Here is the list:
- AJUI_btn_default (no exceptions created)
- AJUI_btn_hover
- AJUI_btn_active
- AJUI_btn_disable
- AJUI_btn_focus
According to the constant that you will pass to a member function, it will create an exception in your AJUI Button instance that will replace the current value (Default) when the state that is linked to it is triggered.
Example of assigning a color to the text of the button for each state :
$Mybtn.FontColor(AJUI_btn_default;"lightblue")
$Mybtn.FontColor(AJUI_btn_hover;"blue")
$Mybtn.FontColor(AJUI_btn_active;"darkblue")
$Mybtn.FontColor(AJUI_btn_disable;"grey")
$Mybtn.FontColor(AJUI_btn_focus;"red")
AJUI Button 1.3.3 - Wednesday, 29 July 2020
User Manual 🇺🇸