ToolBar Control

HMG Tutor 18

More Organization (TOOLBAR Control)

Toolbars are used to group command buttons in a bar located (usually) at window top (under main menu bar).

#include "hmg.ch"
Function Main
DEFINE WINDOW Win_1 ;
   AT 0,0 ;
   WIDTH 640 HEIGHT 480 ;
   TITLE 'Tutor 18: ToolBar Test' ;
   MAIN ;
   FONT 'Arial' SIZE 10
   DEFINE MAIN MENU
      POPUP '&File'
         ITEM '&Disable ToolBar Button' ACTION ;
               Win_1. ToolBar_1.Button_1.Enabled := .F.
         ITEM '&Enable ToolBar Button' ACTION ;
               Win_1. ToolBar_1.Button_1.Enabled := .T.
         ITEM '&Exit' ACTION Win_1.Release
      END POPUP
   END MENU
   DEFINE TOOLBAR ToolBar_1 BUTTONSIZE 80,80 FLAT BORDER
      BUTTON Button_1 ;
         CAPTION '&Button &1' ;
         PICTURE 'button1.bmp' ;
         ACTION MsgInfo('Click! 1')
      BUTTON Button_2 ;
         CAPTION '&Button 2' ;
         PICTURE 'button2.bmp' ;
         ACTION MsgInfo('Click! 2') ;
         SEPARATOR
      BUTTON Button_3 ;
         CAPTION 'Button &3' ;
         PICTURE 'button3.bmp' ;
         ACTION MsgInfo('Click! 3')
    END TOOLBAR
END WINDOW
CENTER WINDOW Win_1
ACTIVATE WINDOW Win_1
Return Nil

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.