CONTROL ADD TOOLBAR

<< Click to Display Table of Contents >>

Navigation:  ThinBASIC Modules > UI (User Interface) > CONTROLS > Control Types > ToolBar Control > ToolBar Control Creation >

CONTROL ADD TOOLBAR

 

Description

 

Add a toolbar to a dialog

 

Syntax

 

hndl = CONTROL ADD TOOLBAR [Name ControlName], hwnd, ctrlID, txt, xPos, yPos, Width, Height [, [Style] [, [ExStyle]]] [[,] CALL CallBack]

 

Returns

 

Number

Control window handler.

 

Parameters

 

Name

Type

Optional

Meaning

ControlName

String

Yes

Optional name for the control.

 

This name must be globally unique, and is used to create a global variable to be used with control name methods and properties.

hwnd

Number

No

Handle of the dialog containing the control

ctrlID

Number

No

Control identifier

txt

String

No

---Ignored---

xPos

Number

No

---Ignored---

yPos

Number

No

---Ignored---

Width

Number

No

---Ignored---

Height

Number

No

---Ignored---

Style

Number

Yes

Optional primary style of the ToolBar control.  The default ToolBar style is %WS_CHILD or %WS_VISIBLE or %WS_BORDER or %CCS_TOP or %TBSTYLE_FLAT.

%CCS_TOPThe ToolBar is placed at the top of the dialog.
%CCS_BOTTOMThe ToolBar is placed at the bottom of the dialog.
%CCS_LEFTThe ToolBar is placed on the left side of the dialog.
%CCS_RIGHTThe ToolBar is placed on the right side of the dialog.

ExStyle

Number

Yes

Extended style of the ToolBar control.  The extended ToolBar style  value can be a combination of the values below, combined together with  the OR operator to form a bitmask:

%WS_EX_CLIENTEDGEApply a sunken edge border to the control.
%WS_EX_STATICEDGEApply a three-dimensional border style to the control (intended to be used for items that do not accept user input).
%WS_EX_WINDOWEDGEApply a raised edge border to the control.

CallBack

Function

Yes

Optional name of a Callback Function that receives all %WM_COMMAND and %WM_NOTIFY messages for the control.

 

ToolBar command messages result from clicking a ToolBar Button, so the message is sent to the callback specified in TOOLBAR_ADDBUTTON or the dialog callback specified in.

Message routing by button allows you to easily determine which button generated the event, and eliminates virtually all %WM_COMMAND messages here.  This callback is primarily used to process %WM_NOTIFY messages.

 

If the Callback Function processes a message, it should return %TRUE (non-zero) to prevent the message being passed unnecessarily to the dialog callback (if one exists).  The dialog callback should also return %TRUE if the notification message is processed by that Callback Function.

 

Remarks

 

Restrictions

 

See also

 

Examples