Maptitude GISDK Help

Push Buttons

 

A push button item is a standard Windows button with a text label. The format of a button item definition is:

 

Button {"item name"} hpos, vpos {, width {, height}} {options} {do

     <statements go here>

     endItem}

 

If the do ... endItem section of the button definition is included, the statements are executed when the button is pressed.

 

Button Options

Description

Key: hotkey

The key sequence the user can press to activate the button instead of using the mouse. The hotkey has the format alt_character, where character must be a letter or number. For example, Key: alt_A indicates that holding the Alt key and pressing A activates the item. The specified key is underlined in the item's text. A hotkey only works if the key in question is part of the item's text and is case insensitive. Therefore, if icons are used for the button, hotkeys do not work, unless the prompt option is specified.

Disabled

The button is initially disabled.

Hidden

The button is initially hidden.

Help: help_specs

Help information displayed in a popup window and the status bar. Help strings can be string expressions.

Prompt: expression

The text of the button. If omitted, the name of the button item is used.

Icon: icon

Buttons can be graphical instead of textual. icon specifies the location of the button graphic, and can be a string constant or a string expression. If the string specifying the icon is of the format filename.bmp|i, where i is an integer, the bitmap file is assumed to contain a row of square icons, with no gaps between the icons, and the ith icon in the row will be displayed. The graphic of the icon should not contain borders, as any outlining of the button is now handled automatically.

Default

Indicates the Default button. The user can activate this button by pressing the Enter key. You may specify this option on only one button in the dialog box. You can change which button is the Default button with SetDefaultButton().

Cancel

Indicates the Cancel button. The user can activate this button by pressing the Escape key. You may specify this option on only one button in the dialog box. If a button has this option, the Close (X) box in the upper right corner of the dialog box will be enabled. You can change which button is the Cancel button with SetCancelButton().

 

For example:

 

Button "OK" 25, 2, 10 default do

     Return(1)

     endItem

 

Button 10, 10 icon:"file1.bmp" do

     ShowMessage("You clicked the button!")

     endItem

 

The button border and highlighting are now drawn automatically by the program, so the GISDK now needs to identify just a single bitmap that should show only the content of the button in its normal state, with no border. The standard toolbar button size is 16 x 16 pixels.

 

Any existing bitmaps will need to be cropped to remove the border. The bitmaps for the highlighted and disabled states can be dropped.

 

Where multiple icons are contained in a single BMP file and specified by position in the code, the bitmap file is assumed to contain a single row of square icons with their width and height equal to the height of the bitmap and no gaps between the icons. See Tools01.bmp in the BMP folder under the program folder for an example.

 

Any existing push button items that reference icons in the old buttons.bmp file will need to be updated to use icons from the files in the BMP folder.

 

 

©2025 Caliper Corporation www.caliper.com