BUTTON

BUTTON N

CREATES A SYSTEM OBJECT BUTTON AND ALLOCATES IT NUMBER N AS REFERENCE

  • Type: Command
  • Parameter: 1
  • Group: System Objects Creation

ACTION

The command BUTTON N creates a system object BUTTON, and allocates it a number N. The number N will be used to designate the BUTTON.

The created BUTTON can then be used through the appropriated commands.

The BUTTON is created at position (0,0) : that is TOP = 0 pixel and LEFT = 0 pixel, with dimensions WIDTH = 75 pixels and HEIGHT = 25 pixels.

A BUTTON is a mean for the user to trigger an action.

A BUTTON can generate the events : ON_CLICK, ON_KEY_UP, ON_KEY_DOWN.

Remark: by default, the BUTTON is created on the FORM number 0, but another FORM can be used. For that, create a FORM by FORM N, and send it all the commands by COMMAND_TARGET_IS N before creating the BUTTON.

SYNTAX: BUTTON N

  • N = system object number (integer or real). Must be greater than 0 and less than or equal to the allowed maximum number of system objects.

USE

  • A BUTTON is used to initiate actions (with command ON_CLICK or function CLICKED) when it is pushed.
  • The command CAPTION gives it an explaining text.

ERROR

  • If number N is not a correct expression.
  • If number N exceeds the allowed maximum number of system objects.
  • If number N is less than or equal to 0.
  • If number N is already used for a system object number.

EXAMPLE

rem create a BUTTON with default position and dimensions

button 1

rem display an explaining text about its role (its number is used as reference)

caption 1,"Save File"

SEE ALSO

CAPTION

TOP

LEFT

WIDTH

HEIGHT

HINT

HINT_HIDE

FULL_SPACE

ON_CLICK

ON_KEY_UP

ON_KEY_DOWN