Action Buttons
*** UNDER CONSTRUCTION ***
Action Buttons: Turning On and Off
-
Action Buttons: Bitmap Labels
- To display an image on an action button, follow these steps:
- Create a bitmap label using drawing software such as paint.exe. First size the image file to the size of the button (i.e. 17 X 17 pels), zoom the image from 400% to 800%, and, perhaps, toggle grid on. Draw the image and outline the edge of the button with a black perimeter. Save the image in bitmap format to TRIMhome\cis (i.e. uparrow.bmp).
- Create an action button by right clicking the application canvas to display a drop down menu. Select Create and then 'Action'. In the Define Action dialogue, name the button, define the height and width of the button (i.e. 1 X 2), and check the Bit Map box.
- Open the window trigger and place the following code near the top so that the image appears as the window opens:
file_copy("uparrow.bmp","gui!image:sortup.bmp");
Note that the name of the source file, 'uparrow.bmp', doesn't matter. However, the name of the target file, 'sortup.bmp', must match the name of the Action Button. In this example, the Action Button must be named 'sortup'. Note that the extension is not kept as part of the name of the Action Button.
- Run the application.
- To remove an image simply use delete(). For example:
delete("gui!image:sortup.bmp");
The extension is optional and if specified it is ignored.
How it works:
A list of all loaded images are kept in GUIslave. This is the dynamic image
area. The resources compiled into the .exe file is the static image area.
When a bitmap is needed (Buttons or graphic lists) the dynamic area is
searched first. This mean that you can override a built in bitmap with a
dynamically loaded one.
Analytical Balance: Linking to the CIS