HMG IDE
Quick Start
à Download latest release of HMG package and run HMG setup wizard for installation.
à Install HMG at normal and default path for location, this is the best practice.
Installer will create with following HMG folders structure:

At above picture where's hmg.x.x.x means that is the hmgroot folder. Which folder name is composed by HMG version installed.
Regarding HARBOUR and MINGW sub-folders, means you haven't need to download or install neither and have been included for use with more convenience and assurance of its versions that can work with each specific HMG version.
Regarding IDE, there two version: ANSI and UNICODE and are available to use in IDE folders.

In this case MyApp.prg will appears with default source code, like this.This code is used for loading a previous fmg file done.If your project you make manually (without using fmg files) you can exclude following lines:Load Window Main Main.Center Main.Activate Then you write your own code.In case your fmg was previous renamed, you will need to replace Main by the new name. |
|
à To add a new prgs just click at menubar Project / New Module will creates a prg file with the name given.
à In case you have others prgs files you can bring to actual project by clicking at menubar Project / Import File.
à By double click on your main name in module tab of Project Browser, will open automatically for file editing.
à Then we can start to make MyApp demonstration. So at first line when we wish to work in GUI functions of HMG we have to include this as follows:
#include <hmg.ch>
This line is standard as GUI for all HMG modules. Unless you want build a project for console mode only, this line is not necessary.
à Next, we'll add the Main
function as follows:
Function Main()
DEFINE WINDOW Win_1 ;
AT 0,0 ;
WIDTH 400 ;
HEIGHT 200 ;
TITLE 'Hello World!' ;
MAIN
END WINDOW
ACTIVATE WINDOW Win_1
Return Nil
à Save your program file and then build and run your project by selecting Project \ Run from menu or simply click "Run" button.
That's
all !
Function Main statement should it be at every HMG project.
It must be with the name of "Function Main" or "Procedure Main" and could add parenthesis for parameters separated by comma.
DEFINE
WINDOW command will
create the main window for the program.
Win_1 is the name of the window.
AT 0,0 indicates the window
position (row=0,col=0).
WIDTH
400 means that the window
will have 400 pixels width.
HEIGHT
200 means that the
window will have 200 pixels height.
TITLE
'Hello World!' indicated text for
window title at bar.
MAIN indicates that we are
defining the main application window. Main window is required for all HMG
applications.
ACTIVATE
WINDOW Win_1 will show the window
and start the event loop.
Return Nil will ends of function "main" return nothing.
This ";" character indicates carriage return and used to facilitate to avoid code all in the same line. Breaking down lines helps for better understanding.