1. Home
  2. Image button controls (Genstat Resource Language)

Image button controls (Genstat Resource Language)

The IMAGEBUTTON Genstat resource-definition statement creates a push button control containing a ‘Help’, ‘Clear’ or pin dialog image. These buttons will activate in the same way as within the standard Genstat menus. The control is a round-cornered rectangle containing an image which is centred in the control. Each push button must have an associated action flag which is activated when the user clicks the button.

IMAGEBUTTON id, [x, y, width, height,] flags [, helptext [, chmtext]]

The id is a string used to identify controls within the resource file.

x, y, width, height
The x, y, width and height specify the position and dimensions of the image button. These are optional and if they are not specified then the button will appear in the bottom left hand corner of the dialog. When specifying the dimensions of the image button the width should be at least 15 and height should be a minimum of 14.

The flags for the image button must be one of the following:

BS_PINDIALOG Creates a pin button that allows the dialog to remain open when the Run button is activated.
BS_RESTORE Creates a Restore button that allows the dialog fields to be reset to the values that were used when the dialog was last activated after clicking Run. This button will be disabled when the dialog is first opened.
BS_CLEAR Creates a button that Clears any edit controls.
BS_HELP Creates a Help button. When this is selected the helptext parameter must be set.


Additional flags that can be combined with the above.

GW_SEL This can be combined with the BS_PINDIALOG flag to specify that the button is to be initially pressed down.


helptext (BS_HELP flag only)
When the BS_HELP flag is set the helptext parameter is used to specify an html file or compiled Help file (chm) name that contains Help for the dialog. You must specify the filename in double quotes. If an html filename is specified the file will be opened using the user’s default browser. For a compiled Help (chm) file a topic within the file can be supplied using the chmtext parameter. If the Help file is stored in one of the add-in folders then you do not need to specify the path. Genstat will search for the file by first looking in the user add-in folder then the system add-in folder. For Help files not stored in an add-in folder you must supply the full path and filename.

chmtext (BS_HELP flag only)
If the helptext specifies a compiled Help file (chm) name then the chmfile parameter can be used to identify the topic within that helpfile. You must supply the topic name within double quotes. For example, if the topic is in a file called MYTOPIC.chm in the compiled Help file you can use “MYTOPIC.chm” to display that topic.

The following example demonstrates how to create a pin dialog, Restore, Clear and Help image buttons to appear at the bottom left of the dialog:


See also

Updated on May 8, 2019

Was this article helpful?