AES 4.1 features toolbars utilities. However WinDom uses its own internal toolbar functions. For compatibility, WinDom uses the same AES 4.1 toolbar message when an object from a toolbar is selected. The WM_TOOLBAR message has the following structure :
evnt.buff[0] = WM_TOOLBAR
evnt.buff[1] = AES application identifier
evnt.buff[2] = always 0
evnt.buff[3] = window handle
evnt.buff[4] = selected object index
evnt.buff[5] = keyboard state
The event toolbar function is used exactly like the event menu function or the event formular function. Here, a typical example :
int main( void) {
int res;
WINDOW *win;
OBJECT *tool;
void do_menu( WINDOW *);
/* create the window
...
*/
/* Insert the toolbar and attach the do_toolbar
* function to toolbar events */
WindSet( win, WF_TOOLBAR, tool, do_toolbar);
while(1)
res = EvntWindom( MU_MESAG);
}
/* This function handles the toolbar events */
void do_toolbar( WINDOW *win) {
switch( evnt.buff[5]) {
case BUTTON1:
break;
case BUTTON2:
break;
}
ObjcChange( win, evnt.buff[4], 1);
}
Off course, as dialog box or menu, it is possible to binded object from a toolbar to a function (or a variable) with the ObjcAttach() function.