Working with IDE

Since HMG-IDE is an Integrated Development Environment, it’s possible building an entire project from scratch under HMG-IDE.

But this doesn’t mean “without coding”.

So, we can develop all GUI necessities of our project via HMG-IDE; but what, always we will need some little coding.

Then we can begin our project by building a project file. This is the very first and the easiest step:

Simply run IDE.exe and then select “New Project”.

When IDE ask, select (or build a new) a working folder and give a name (say Viva_HMG) to the project. .hbp extension will be assigned by IDE to project file.

Whenever IDE build a new project, automatically build and open a module file with name Main.prg and a form file with name Main.fmg.

Module file open by your text editor and form file open by IDE itself.

The content of your module file will be like this :

#include <hmg.ch>
Function Main
        Load Window Main
        Main.Center
        Main.Activate
Return

Basic rules :

– Every HMG project have one ( and only one ) “MAIN” procedure / function

– For using GUI controls, every HMG project have one ( and only one ) “MAIN” form.

So, names of both module and form files are “Main“.

File names doesn’t mandatory;

– only name of first procedure / function of first module file must be “Main” and

– “Window Type” property of one form must be “MAIN“.

You can see “module” tab of Project Browser window “(Main)” sign adjacent to the Main.prg and at the bottom line of “Properties” tab of Object Inspector “Window Type” property of “Main” form already set “MAIN” by IDE.

Now, we can work on our first form.

First we can give a name to it.

But what happening?

There isn’t “Name” in the properties list of our form !

Yes, this is correct; because:

– Basic rule 3: Every HMG form has their own name. Only exception is: a form to be LOAD, has a unchangeable name: TEMPLATE.

In other hand, you give an “alias” to a loaded form. The way of this is using “AS” close in the LOAD command. FE:

Load Window Main AS frmIDEBS_01

In this case you have change “Center” and “Activate” commands too :

frmIDEBS_01.Center
frmIDEBS_01.Activate

If you don’t use an “alias” in that way, you will use in all references of form by its file name; in this example : “Main”.

Now, its time to give a “Title” to the form.

For this, we will use “TITLE” property of form:

Double click “Title” and give a title in the open Input Box, say “It’s a Wonderful Life”

We can change easily background color of form:

Double click BackColor in the properties list.

Click “Custom“.

In the Color Select Form select your favorite background color or simply enter these tree values. : 64, 220, 210

Press RUN button and look to your application in work.

That’s all !  

Download source files

Advertisements

User Interface Terms

Background Color :

The color that appears behind displayed text of another color (the foreground color).

See Also: Foreground Color

Column :

A numeric value that represents a position on the display screen or on the printed page.

Console Input/Output :

A style of operation of the keyboard and display that emulates a simple typewriter-like interface. Console input echoes each key typed and provides processing for the backspace and return keys. Console output wraps to the next line when the output reaches the right edge of the visible display, and scrolls the display when the output reaches the bottom of the visible display.

See Also: Full-screen Input/Output

Cursor :

An onscreen indicator used to show the current keyboard input focus and is displayed as a block or underline character. The cursor moves in response to characters or control keys typed by the user.

Enhanced Color :

The color used to display GETs or PROMPTs (if INTENSITY is ON).

See Also: Standard Color

Foreground Color :

The color of text appearing on the screen, usually on a different colored background.

See Also: Background Color

Full-screen Input/Output :

A style of operation of the keyboard and display used for complex data entry and display tasks. Full-screen input and output are generally performed using the @..SAY, @..GET and READ commands. Full-screen output is distinguished from console-style output by the fact that control characters (e.g., backspace, carriage return) are not processed, and wrapping and scrolling do not occur at the boundaries of the visible display area.

See Also: Console Input/Output

Highlight :

Indicates input focus for menus, browsers, or GETs. With menus and browsers, the currently selected item or cell has input focus and is displayed in the current enhanced color or inverse video. With GETs, the current GET is highlighted in the current enhanced color or inverse video while the other GETs are displayed in the current standard color if an unselected color setting is active.

See Also: Cell, Enhanced Color, Input Focus, Standard Color

Input Focus :

The GET, browse cell, or menu item where user interaction can take place is said to have input focus. The item with input focus usually is displayed in enhanced color or inverse video.

Insert Mode :

A data entry mode entered when the user presses the insert key. When this mode is active, characters are inserted at the cursor position. Text to the right of the cursor is shifted right.

See Also: Overstrike Mode

Keyboard Buffer :

An area of memory dedicated to storing input from the keyboard while a program is unable to process the input. When the program is able to accept the input, the keyboard buffer is emptied.

Menu :

An onscreen list of choices from which the user selects. Menus range from simple to elaborate forms. Two examples are menus that pull down from the top of the screen (an elaborate type requiring more programming), or a simple list of numbered items from which the user selects by entering the appropriate number.

Overstrike Mode :

A data entry mode entered when the user presses the insert key. When this mode is active, characters are entered at the cursor position and text to the right of the cursor remains stationary.

Picture :

A string that defines the format for data entry or display in a GET, SAY, or the return value of TRANSFORM(). Picture strings are comprised of functions which affect the formatting as a whole and a series of template characters that affect formatting on a character by character basis.

See Also: Template

Prompt :

A series of characters displayed on the screen indicating that input from the keyboard is expected.

Relative Addressing :

To refer to a memory address, array element, screen location, or printer location with respect to another value, rather than referring to a specific address or element.

Row :

A numeric expression that evaluates to an integer identifying a screen or printer row position.

See Also: Column, Field, Record

Scoreboard :

An area of the display on line 0 beginning at column 60 that displays status information during certain data entry operations.

Scrolling :

The action that takes place when the user attempts to move the cursor or highlight beyond the window boundary to access information not currently displayed.

See Also: Window

Standard Color :

The color pair definition that is used by all output options (such as SAY and ?), with the exception of GETs and PROMPTs, that use the enhanced color pair.

See Also : Enhanced Color

Template :

A mask that specifies the format in which data should be displayed. For example, you might want to store phone numbers as “9999999999” to save space, but use a template to display the number to the user as “(999) 999-9999.”

Typeahead Buffer :

See : Keyboard Buffer

Unselected Color :

The color pair definition used to display all but the current GET or the GET that has input focus. If this color setting is specified, the current GET is displayed using the current enhanced color.

See Also: Enhanced Color

User Function :

A user-defined function called by ACHOICE(), DBEDIT(), or MEMOEDIT() to handle key exceptions. A user function is supplied to one of these functions by passing a parameter consisting of a string containing the function’s name.

User Interface :

The way a program interacts with its user (i.e., menu operation and selection, data input methods, etc.)

Wait State :

A wait state is any mode that extracts keys from the keyboard except for INKEY(). These modes include ACHOICE(), DBEDIT(), MEMOEDIT(), ACCEPT, INPUT, READ and WAIT.

Window :

A rectangular screen region used for display. A window may be the same size or smaller than the physical screen. Attempting to display information that extends beyond the specified boundaries of the window clips the output at the window edge.

Word Wrapping :

The process of continuing the current text on the next line of a display when a boundary is reached and breaking the text on a word boundary.