Simple Tutorial - 2: Main Menu

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Simple Tutorial - 2: Main Menu

Post 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
Viva INTERNATIONAL HMG :D
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Simple Tutorial - 2: Main Menu

Post by Rathinagiri »

Simple and nice. Thanks a lot for your efforts with screen shots too.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
Post Reply