Simple Tutorial - 15 : More Organization

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
esgici
Posts: 4253
Joined: Wed Jul 30, 2008 9:17 pm
Location: iskenderun / Turkiye
Has thanked: 132 times
Been thanked: 42 times
Contact:

Simple Tutorial - 15 : More Organization

Post by esgici » Fri Aug 01, 2008 1:48 am

Simple tutorial based upon HMG Offical Tutorial for beginners.

More Organization (TOOLBAR Control)


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

Code: Select all

#include "minigui.ch"

Function Main

    DEFINE WINDOW Win_1 ;
        AT 0,0 ;
        WIDTH 640 HEIGHT 480 ;
        TITLE 'ToolBar Test' ;
        MAIN

        DEFINE MAIN MENU
            POPUP '&File'
                ITEM '&Disable ToolBar Button' ACTION ;
                      Win_1.Button_1.Enabled := .F.
                ITEM '&Enable ToolBar Button'  ACTION ;
                      Win_1.Button_1.Enabled := .T.
                ITEM '&Exit' ACTION Win_1.Release
            END POPUP
        END MENU

        DEFINE TOOLBAR ToolBar_1 BUTTONSIZE 40,40 FLAT BORDER

            BUTTON Button_1 ;
                CAPTION '&New' ;
                PICTURE 'edit_new.bmp' ;
                ACTION MsgInfo('Click! New')

            BUTTON Button_2 ;
                CAPTION '&Edit' ;
                PICTURE 'edit_edit.bmp' ;
                ACTION MsgInfo('Click! Edit')

            BUTTON Button_3 ;
                CAPTION '&Find' ;
                PICTURE 'edit_find.bmp' ;
                ACTION MsgInfo('Click! Find') ;
                SEPARATOR

        END TOOLBAR

    END WINDOW

    CENTER   WINDOW Win_1
    ACTIVATE WINDOW Win_1

Return Nil
Image

Regards

esgici
Viva INTERNATIONAL HMG :D

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests