Page 1 of 1

Simple Tutorial - 2: Main Menu

Posted: Fri Aug 01, 2008 12:58 am
by esgici
Simple tutorial based upon HMG Offical Tutorial for beginners.

Adding The Main Menu

Lets add a main menu to the program now:

#include "minigui.ch"

Function Main

DEFINE WINDOW Win_1 ;
AT 0,0 ;
WIDTH 400 ;
HEIGHT 200 ;
TITLE 'Main Menu' ;
MAIN

DEFINE MAIN MENU
POPUP "First Popup"
ITEM 'Change Window Title' ACTION Win_1.Title := 'New Title'
ITEM 'Retrieve Window Title' ACTION MsgInfo ( Win_1.Title )
END POPUP
END MENU

END WINDOW

CENTER WINDOW Win_1
ACTIVATE WINDOW Win_1

Return

Image

As you can see it is pretty easy and intuitive.

All the main menu stuff will be between DEFINE MAIN MENU / END MENU statements.
Each individual menu popup will be between POPUP / END POPUP statements.
Each individual menu item will be coded via the ITEM statement.

You can use as popups as you need and you can nest it without any limit.

This is HMG power !

Regards

esgici

Re: Simple Tutorial - 2: Main Menu

Posted: Fri Aug 01, 2008 3:49 am
by Rathinagiri
Simple and nice. Thanks a lot for your efforts with screen shots too.