OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
Constructing Buttons

Buttons (sometimes called pushbuttons or command buttons) perform a task each time the button is pressed.

There are two kinds of buttons: default buttons and non-default buttons. A default button, distinguished by the button style BS_DEFPUSHBUTTON, has a bold border that indicates the default user response. Non-default buttons have the button style BS_PUSHBUTTON.

One of TButton's constructors takes the seven parameters commonly found in a control object constructor (a parent window, a resource identifier, the control's x, y, h, and w dimensions, and an optional module pointer), plus a text string that specifies the button's label, and a bool flag that indicates whether the button should be a default button. Here is the constructor declaration:

TButton(TWindow *parent, int resourceId, const char far *text, int X, int Y, int W, int H,
bool isDefault = false, TModule *module = 0);

A typical button would be constructed like this:

btn = new TButton(this, ID_BUTTON, "DO_IT!", 38, 48, 316, 24, true);

See Also