Cicode Programming Reference > Cicode Function Categories > Display Functions Introduction > DspButton

DspButton

Displays a button at a specified AN. When the button is selected, the key definition is put into the key command line. The font, width, height, and down and repeat keys of the button are optional. If you do not specify a width and height, the button adjusts to the size of the button Name.

Note: This function is only used for V3.xx and V4.xx animations, and was superseded in later releases.

Syntax

DspButton(AN, UpKey, Name [, hFont] [, Width] [, Height] [, DownKey] [, RepeatKey] [, Style])

AN:

The animation-point number.

UpKey:

The key generated when the command button is selected (when the mouse button is released after being clicked down). This is the default operation for commands activated by a button.

Name:

The name to display on the button.

hFont:

The handle of the font used to display the button name. Use the DspFont() function to create a new font and return the font handle. Use the DspFontHnd() function to return the font handle of an existing font. The Windows button font is used if the font is omitted or is not defined in the database.

Width:

The width of the button in pixels.

Height:

The height of the button in pixels.

DownKey:

The key generated when the mouse button is clicked down (over the command button). Normally this parameter is not used, because most buttons are configured to activate a command when the mouse button is released (returning to the `up' position).

RepeatKey:

The key generated repetitively, while the mouse button is being held down (over the command button).

Style:

A number indicating the visibility style of the button:

Return Value

0 (zero) if successful, otherwise an error is returned.

Related Functions

DspButtonFn, KeySetSeq, DspFont, DspFontHnd

Example

/* Display a self-sizing button at AN20 using the default font. 
The button is named "Help". When selected, the Key Code "KEY_F1" 
is put into the key command line. */
DspButton(20,KEY_F1,"Help");
/* Display the same button at AN20, but in an existing font called "BigFont". */
DspButton(20,KEY_F1,"Help",DspFontHnd("BigFont");

See Also

Display Functions