HMG 3.3.1 Patch 4

HMG 3.3.1 Patch 4

New features:

– <ParentWindowName>.<GridControlName>.CheckBoxes [ := | –>] lBoolean
– <ParentWindowName>.<GridControlName>.CheckBoxItem ( nRow ) [ := | –>] lBoolean
– <ParentWindowName>.<GridControlName>.GroupEnabled [ := | –>] lBoolean
– <ParentWindowName>.<GridControlName>.GroupDeleteAll
– <ParentWindowName>.<GridControlName>.GroupDelete ( nGroupID )
– <ParentWindowName>.<GridControlName>.GroupExpand ( nGroupID )
– <ParentWindowName>.<GridControlName>.GroupCollapsed ( nGroupID )
– <ParentWindowName>.<GridControlName>.GroupAdd ( nGroupID [, nPosition ] )
– <ParentWindowName>.<GridControlName>.GroupInfo ( nGroupID );
[ := | –>] { [ cHeader ] , [ nAlignHeader ] , [ cFooter ] , [ nAlingFooter ] , [ nState ] }
– <ParentWindowName>.<GridControlName>.GroupItemID ( nItem ) [ := | –>] nGroupID

nAlignHeader & nAlingFooter –> GRID_GROUP_LEFT | GRID_GROUP_CENTER | GRID_GROUP_RIGHT
nState –> GRID_GROUP_NORMAL | GRID_GROUP_COLLAPSED
See this demo:

#include "hmg.ch"

Function Main
Local aRows

   DEFINE WINDOW Form_1 ;
      AT 0,0 ;
      WIDTH 800 ;
      HEIGHT 600 ;
      TITLE "Demo: GRID Group" ;
      MAIN 

      aRows := ARRAY (20)
      aRows [1]   := {'Simpson',    'Homer',       '555-5555',   1,;
                     HMG_TimeToTime( TIME(), _TIMESHORT12H )}   
      aRows [2]   := {'Mulder',     'Fox',         '324-6432',   2,; 
                     HMG_TimeToTime( TIME(), _TIMESHORT12H )} 
      aRows [3]   := {'Smart',      'Max',         '432-5892',   3,; 
                     HMG_TimeToTime( TIME(), _TIMESHORT12H )} 
      aRows [4]   := {'Grillo',     'Pepe',        '894-2332',   4,; 
                     HMG_TimeToTime( TIME(), _TIMESHORT12H )} 
      aRows [5]   := {'Kirk',       'James',       '346-9873',   5,; 
                     HMG_TimeToTime( TIME(), _TIMESHORT12H )} 
      aRows [6]   := {'Barriga',    'Carlos',      '394-9654',   6,; 
                     HMG_TimeToTime( TIME(), _TIMESHORT12H )} 
      aRows [7]   := {'Flanders',   'Ned',         '435-3211',   7,; 
                     HMG_TimeToTime( TIME(), _TIMESHORT12H )} 
      aRows [8]   := {'Smith',      'John',        '123-1234',   8,;
                     HMG_TimeToTime( TIME(), _TIMESHORT12H )} 
      aRows [9]   := {'Pedemonti',  'Flavio',      '000-0000',   9,; 
                     HMG_TimeToTime( TIME(), _TIMESHORT12H )} 
      aRows [10]  := {'Gomez',      'Juan',        '583-4832',  10,; 
                     HMG_TimeToTime( TIME(), _TIMESHORT12H )} 
      aRows [11]  := {'Fernandez',  'Raul',        '321-4332',  11,;
                     HMG_TimeToTime( TIME(), _TIMESHORT12H )} 
      aRows [12]  := {'Borges',     'Javier',      '326-9430',  12,;
                     HMG_TimeToTime( TIME(), _TIMESHORT12H )} 
      aRows [13]  := {'Alvarez',    'Alberto',     '543-7898',  13,; 
                     HMG_TimeToTime( TIME(), _TIMESHORT12H )} 
      aRows [14]  := {'Gonzalez',   'Ambo',        '437-8473',  14,;
                     HMG_TimeToTime( TIME(), _TIMESHORT12H )} 
      aRows [15]  := {'Batistuta',  'Gol',         '485-2843',  15,;
                     HMG_TimeToTime( TIME(), _TIMESHORT12H )} 
      aRows [16]  := {'Vinazzi',    'Amigo',       '394-5983',  16,;
                     HMG_TimeToTime( TIME(), _TIMESHORT12H )} 
      aRows [17]  := {'Pedemonti',  'Flavio',      '534-7984',  17,; 
                     HMG_TimeToTime( TIME(), _TIMESHORT12H )} 
      aRows [18]  := {'Samarbide',  'Armando',     '854-7873',  18,; 
                     HMG_TimeToTime( TIME(), _TIMESHORT12H )} 
      aRows [19]  := {'Pradon',     'Alejandra',   '???-????',  19,; 
                     HMG_TimeToTime( TIME(), _TIMESHORT12H )} 
      aRows [20]  := {'Reyes',      'Monica',      '432-5836',  20,; 
                     HMG_TimeToTime( TIME(), _TIMESHORT12H )} 

      bColor := { || if ( This.CellRowIndex/2 == int(This.CellRowIndex/2),;
                          {128,128,128} , {192,192,192} ) }
      fColor := { || if ( This.CellRowIndex/2 == int(This.CellRowIndex/2),; 
                          BLUE , RED ) }



      @ 50,10 GRID Grid_1 ;
         WIDTH 750 ;
         HEIGHT 340 ;
         HEADERS {'Last Name', 'First Name', 'Phone', 'Row', 'Time'};
         WIDTHS  {140, 140, 140, 140, 140};
         ITEMS aRows; 
         COLUMNCONTROLS {NIL,NIL,NIL, { 'SPINNER', 0 , 50 },; 
                        { "TIMEPICKER", _TIMESHORT12H }};
         VALUE 1 EDIT;           
         DYNAMICBACKCOLOR {bColor, bColor, bColor, bColor, bColor};
         DYNAMICFORECOLOR {fColor, fColor, fColor, fColor, fColor};
         TOOLTIP 'Editable Grid Control'; 
         CELLNAVIGATION


/*
- ..CheckBoxes [ := | -->] lBoolean
- ..CheckBoxItem ( nRow ) [ := | -->] lBoolean


- ..GroupEnabled [ := | -->] lBoolean
- ..GroupDeleteAll
- ..GroupDelete ( nGroupID )
- ..GroupExpand ( nGroupID )
- ..GroupCollapsed ( nGroupID )
- ..GroupAdd    ( nGroupID [, nPosition ] )
- ..GroupInfo   ( nGroupID ) [ := | -->] { [;
                 cHeader ],; 
                 [ nAlignHeader ],; 
                 [ cFooter ],; 
                 [ nAlingFooter ],; 
                 [ nState ] }
- ..GroupItemID ( nItem )    [ := | -->] nGroupID

nAlignHeader & nAlingFooter   -->   
                 GRID_GROUP_LEFT | GRID_GROUP_CENTER | GRID_GROUP_RIGHT
nState -->   GRID_GROUP_NORMAL | GRID_GROUP_COLLAPSED

*/


      #define GROUP1_ID   100
      #define GROUP2_ID   200

      Form_1.Grid_1.GroupEnabled := .T.

      Form_1.Grid_1.GroupAdd ( GROUP1_ID , NIL )
      Form_1.Grid_1.GroupAdd ( GROUP2_ID , NIL )

      Form_1.Grid_1.GroupInfo ( GROUP1_ID ) := { "Header Group 1",; 
                    GRID_GROUP_CENTER , "Footer Group 1" ,;
                    GRID_GROUP_CENTER,; 
                    GRID_GROUP_NORMAL }
      Form_1.Grid_1.GroupInfo ( GROUP2_ID ) := { "Header Group 2",; 
                    GRID_GROUP_CENTER , "Footer Group 2",; 
                    GRID_GROUP_CENTER,;
                    GRID_GROUP_NORMAL }

      FOR i := 1 TO Form_1.Grid_1.ItemCount
         IF i <= Form_1.Grid_1.ItemCount/2
            Form_1.Grid_1.GroupItemID (i) := GROUP2_ID
         ELSE
            Form_1.Grid_1.GroupItemID (i) := GROUP1_ID
         ENDIF
      NEXT

      @ 450,  55 BUTTON Button_1 CAPTION "G1-NORMAL"    ACTION ;
                 Form_1.Grid_1.GroupExpand ( GROUP1_ID )
      @ 450, 155 BUTTON Button_2 CAPTION "G1-COLLAPSED" ACTION ;
                 Form_1.Grid_1.GroupCollapsed ( GROUP1_ID )
      @ 450, 355 BUTTON Button_3 CAPTION "G1-GetInfo"   ACTION ;
                 MsgDebug (Form_1.Grid_1.GroupInfo ( GROUP1_ID ))
      @ 500,  55 BUTTON Button_4 CAPTION "G2-NORMAL"    ACTION ;
                 Form_1.Grid_1.GroupExpand ( GROUP2_ID )
      @ 500, 155 BUTTON Button_5 CAPTION "G2-COLLAPSED" ACTION ;
                 Form_1.Grid_1.GroupCollapsed ( GROUP2_ID )
      @ 500, 355 BUTTON Button_6 CAPTION "G2-GetInfo"   ACTION ;
                 MsgDebug (Form_1.Grid_1.GroupInfo ( GROUP2_ID ))
      @ 450, 555 BUTTON Button_7 CAPTION "Group ON/OFF" ACTION ;
                 Form_1.Grid_1.GroupEnabled := .NOT.; 
                 Form_1.Grid_1.GroupEnabled

   END WINDOW

   CENTER WINDOW Form_1

   ACTIVATE WINDOW Form_1

Return

PS: this patch include all new features of previous patches.

GoVisitBlue324x48

DL_PatchFrHMGForum312x48
DL_PatchFrGogDrive312x48

 

 

How I can delete an item …

How I can delete an item in an array ?

Short Answer : We have a special function : ADel()
Long Answer :

ADel() function may cause some confusions when documentation not read carefully:

This function deletes the element found at the given subscript position in the array.

All elements in the array below the given subscript position will move up one positionin the array.

 

Let’s try:

?
 aTest1 := { 'One', 'Two', "Tree",'Four' }
 aTest := ACLONE( aTest1 )
 ADel( aTest, 3 )
 ? LEN( aTest )
 AEVAL( aTest, { | c1 | QQOUT( c1, '' ) } ) 
 

Result :
4
One Two Four NIL
Length of array not changed, last item moved up and new last item became NIL.

 

?
 ASIZE( aTest, 3 )
 ? LEN( aTest )
 ?
 AEVAL( aTest, { | c1 | QQOUT( c1, '' ) } )

Result :
3
One Two Four
Length of array changed, last item (NIL) removed

We have another possibility: a new Harbour function:

?
 aTest1 := { 'One', 'Two', "Tree",'Four' }
 aTest := ACLONE( aTest1 )
 HB_ADel( aTest, 3 )
 ? LEN( aTest )
 ?
 AEVAL( aTest, { | c1 | QQOUT( c1, '' ) } )
 

Result :
4
One Two Four NIL
Length of array not changed, last item moved up and new last item became NIL.
Same as ADel()

And we have a third parameter : Shrink or not:

 ?
 aTest1 := { 'One', 'Two', "Tree",'Four' }
 aTest := ACLONE( aTest1 )
 HB_ADel( aTest, 3, .T. )
 AEVAL( aTest, { | c1 | QQOUT( c1, '' ) } )

That’s all !

 

How I can insert a new …

How I can insert  a new item to an array ?

Short answer : We have a special function : AIns()
Long Answer :

AIns() function may cause some confusions when documentation not read carefully:

This function inserts a NIL value in the array named <aArray> at the <nPos>th position.

All array elements starting with the <nPos>th position will be shifted down one subscript position in the array list and the last item in the array will be removed completely.

 

Let’s try:

 aTest := { 'One', 'Two', 'Four' }
 AIns( aTest, 3 ) 
 AEVAL( aTest, { | c1 | QQOUT( c1, '' ) } ) 
 

Result : One Two NIL: “Four” lost !

Since it’s NIL, we can assign a value to it:

 aTest := { 'One', 'Two', 'Four' }
 AIns( aTest, 3 )
 aTest[ 3 ] := "Three"
 AEVAL( aTest, { | c1 | QQOUT( c1, '' ) } ) 
 

Result : One Two Three: “Four” lost !

Before insert we can add a dummy item to end of array:

 aTest := { 'One', 'Two', 'Four' }
 AADD( aTest, NIL )
 AIns( aTest, 3 )
 aTest[ 3 ] := "Three"
 AEVAL( aTest, { | c1 | QQOUT( c1, '' ) } ) 
 

Result : One Two Three Four : OK
Or we can change size of array :

 aTest := { 'One', 'Two', 'Four' }
 ASIZE( aTest, 4 )
 AIns( aTest, 3 )
 aTest[ 3 ] := "Three"
 AEVAL( aTest, { | c1 | QQOUT( c1, '' ) } ) 
 

Result : One Two Three Four : OK

But wait; we have another possibility: a new Harbour function:

 aTest := { 'One', 'Two', 'Four' }
 HB_AIns( aTest, 3, "Three" )
 AEVAL( aTest, { | c1 | QQOUT( c1, '' ) } ) 

Result : One Two Three: “Four” lost !

And we have a fourth parameter : Grow or not:

 aTest := { 'One', 'Two', 'Four' }
 HB_AIns( aTest, 3, "Three", .T. )
 AEVAL( aTest, { | c1 | QQOUT( c1, '' ) } ) 
 

Result : One Two Three Four

That’s all !

How I can use USB printer

Q: How I can use USB like modern printers within my DOS based applications ?

A: Easiest way for this is dosprint. Most of xBase programmers uses this method: there is a program name dosprint or dosprn.

Download this prg, run before your program and that is all, no modification required on your programs.

This program intercept data sent to printer by your program, convert it to required format and send to USB or anything else modern printers.

Ask Google, select one ( some are free, some aren’t ), download and use.

 

How I can protect my tables

Q: How I can protect my tables ( .dbf files ) against to open with any other Program (like Excel, access) ?

A: There is too many method to solve this problem. Sadly non of its has warranty, always there is a solution to open any file by experienced users. You can ask Google.

Against non experienced users one method will be changing file extensions ( .dbf ). In this case you need modify your programs to change “file name” ( open dbf ) parameter  in USE statements (USE commands or DBUSEAREA() functions).

 

How I have joined …

How I have joined HMG Family – A Story

It was in the year 1990, I had seen a computer, first time in my life.

I was a commerce student, studying in a 100+ years old school in my home town Sivakasi (famous for fireworks ), Tamilnadu, Southern part of India. I was studying +2 (12th and final year in school). Once, the exams were over, it was time to join a College. Not to waste the exam holidays, one of my friends had asked me to accompany him for a part time computer course in a near by Polytechnic College. I told him, “Ok”. We joined that course which was for six months, conducted on Saturdays and Sundays. I studied some basics about computers and languages like BASIC, Pascal, COBOL and an introduction to Lotus 1-2-3, Wordstar and dBase III Plus.

After that I had joined a college and my main subject was Commerce. After finishing my Under Graduation degree in the year 1993, I had joined Chartered Accountancy Course. And, once I had finished this course in the year 1996, I joined my brother to manage our family business.

Even though there was a computer in our office, I was not allowed to touch that.  The reason was, at that time, computers (AT 386) were costlier and one cannot take the risk of losing precious data and computers were operated only by computer professionals.

In the year 1997, I had purchased a computer on my own, and started implementing something which I had studied some seven years back.

I had studied under the DOS environment and I had got Windows ’95 in my new system as my operating environment. Even though it was easy to operate, I could not do any programming. I had so much of works before hand and I was involved in them for about 1 year. It was a Costing project in Excel with about 150 sheets, everything interlinked. It was a nice experience. I had done some macro programming in Excel for introducing thousand’s comma according to Indian tradition.

In the year 1998, the computer professional who had programmed for the accounting, invoice processing and payroll processing for our business firm had gone for a better job. We could not create new reports according to the requirements and we had to play only with the old options. Only at that time, I had realized about the importance of Database programming. Having the knowledge of DBase III+ programming, I had started to write small utilities to take self configured reports from the existing tables. I had the reference of the source codes for the existing software. It was done in Clipper Summer ’87 version.

There is a saying, ‘Necessity is the mother of invention’. Yes. Necessity had driven me to do more and more programming. Actually, I had started staring huge prg files with various do while .not. eof() loops and virtually indefinite nested if … endif conditions. Once understood, I had the confidence of creating bigger software too. So, in addition to the accounting software, I had created order processing and inventory maintenance and integrated the same with the existing project.

It was in the mid, 1998, I could get an internet connection with a dial up modem. In the mean time, I had a dream of using GUI in my programming. I had tried Visual Basic. I could not link with my existing dbf tables and dropped. In the beginning, I misunderstood about OOPS and GUI. Actually I had an allergy over this OOPS, I don’t know why even now.  So, I had abandoned my dream  of GUI because of OOPS.

In the year 1999, while searching the net, I had come across a site called Oasis, a site which had shared source code/libraries for Clipper and many utilities. From that site, I had got an excellent library called Super. It had some assembly language routines too to capture mouse gestures and enabled Clipper code to be ‘RAT’ified. Apart from this mouse functionality, the library had so many small utilities like sorting multiple arrays, finding out Day of the week like that. Actually I had realized about the advantages of Open Source on seeing that library source codes. I had studied in depth, and I had known about optimization of codes, effective memory management, different routes to a same destination in programming etc.

With the SuperLib, I had changed all my projects to be mouse enabled, there by satisfying half of my dreams. However, I could not stop dreaming about creating a full fledged Windows program eliminating the dark DOS command box. As new versions of Windows came in the market, I was afraid that, one day there won’t be this DOS Command Box and all my programs would not be useful at all.

I was, why was? even now am, very fond of Open Source. In my system I don’t use any copyright protected software except the Windows Operating System. I would list all the open source software I use in a separate thread for all my requirements.

I had found out Harbour from the Oasis site I had already mentioned. I had tested a lot but could not use it because of SuperLib, as it could not be linked with Harbour.

I was in a confused state. I liked Harbour a lot because of its open nature. I could not abandon SuperLib too, since all of my projects were linked with this library. So, I was desperately searching for a GUI library (at least mouse enabled for Harbour).

On one fine day in my life, my search was fruitful.

I could even remember the date. It was 4th of October, 2002, I had downloaded Harbour MiniGUI and could create a window with my limited xBase programming knowledge. Hurray! I could not describe my feelings in words!

Immediately on compiling my hello world prg, I had commented in the yahoo group from where I had downloaded the 0.40 version of the library with the following words,

Dear Roberto,

It is wonderful to use your Harbour Minigui Library, an open
source library for Harbour.

Thank you very much for your sincere efforts.

I would like to make a small suggestion regarding text boxes.

Shall you please make provision for right aligning the text boxes
for numeric fields?

Thank you once again.

srgiri

From that day, Harbour MiniGUI page was literally my home page.  I read all the messages from various users of the library. It helped me a lot to understand programming, inside out of the library, even about calling C API.

I had happily started to convert all of my projects to HMG. As the product matured, all my projects were fully converted to HMG and I had seen my dream come true.

Most of my programs are used in-house. However, I had created software for many of my friends. I had earned some money from my programs too. As you know, my income is not based on programming, since basically I am a Chartered Accountant and managing business.

I wish to list some of my major HMG projects,

  1. PyroERP (an ERP software for manufacturing companies with accounting, inventory, order processing,payroll)
  2. PyroBase (a License maintenance software given to Explosives department, Government of India)
  3. FACE (Financial Accounting under Computer Environment)
  4. Interest(ing) Calculator (Calculate interesting part of interest for loans and deposits) – An open source product, hosted in Sourceforge.net.
  5. FBT Reference (Fringe Benefit Tax referencer)
  6. Phataka (A Cultural Event maintenance software used by local Rotary Club)
  7. DBU
  8. GSM Calculator

There are many tiny projects too. I am not listing them to show my talents. It shows the simplicity of HMG and my craze on HMG.

It is my nature, to escape from any politics. I wish to be good for all. During July 2005, when Roberto had decided to move on MingW and introduced HMG, MiniGUI Extended product had also born. I didn’t tell a word about anything in the group. I believe in Karma and thought, “if this happens, this is also for the good”.

I had actively participated in the yahoo group up to April, 2006 and kept silence after that.

However, I used HMG in a full fledged manner and I liked MingW version as Roberto distributed them. This is mainly because of the single installation of the whole thing (ie., MiniGUI library + Harbour Compiler + C Compiler) and full utilization of Open Source Software.

All the software projects listed above where developed by me during the period from 2004 till now. I too had contributed some parts like drawing pie graph, alternative syntax (with the valuable guidance of Roberto) (now Roberto had revamped in a better way!), Grid2Print which Roberto has accepted kindly.

Can you believe that this forum had been created in just 2 days time? On 29th of July 2008, I had asked Roberto, breaking my long silence, by an email about the need for a forum exclusively for HMG. Roberto also liked and generously accepted to guide and participate in the forum. On that day itself, I registered this domain hmgforum.com and installed PHPBB forum software and on 1st of August 2008, the forum was officially opened.

I am so HAPPY and PROUD to be part of the HMG family.

Thus, this story has a happy ending.

Sri Rathinagiri
Sivakasi, India

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Courtesy of author, this article borrowed from here.

Is application running ?

In post-DOS Oss it’s possible running multiple applications, even multiple instance of same application simultaneously. Sometime running multiple instance of same application may cause unpredictable results. So requires impeding, For this purpose HMG offers SET MULTIPLE ON | OFF [WARNING] command which impedes (OFF) or allow (ON) attempts to run multiple instances of the application with optional warning for both situation.

Sometime may be requires decide to allowing at run time. In this case you need know either a running instance exist or not before allowing or impeding.

IsAppRunning() function is for help this situation.

#include <hmg.ch>

PROCEDURE Main()

   LOCAL cCurrApp := HB_ProgName()
   
   IF IsAppRunning( cCurrApp )
      MsgSTop( cCurrApp + CRLF + CRLF +;
               "Application is running already !", "Error")
   ELSE
      
      DEFINE WINDOW frmIsAppRunTest ;
         ROW 0 ;
         COL 0 ;
         WIDTH 650 ;
         HEIGHT 450 ;
         TITLE "Testing 'IsAppRunning()' function" ;
         ON INIT MsgInfo( cCurrApp + CRLF + CRLF + ;
                          "Application is running for first time !",;
                          "No problem") ;
         MAIN
      
         ON KEY ESCAPE ACTION ThisWindow.Release
      END WINDOW // frmIsAppRunTest

      frmIsAppRunTest.Center()

      frmIsAppRunTest.Activate()
   ENDIF
   
RETURN // IsAppRunTest.Main()      

*-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.

PROCEDURE IsAppRunning(;
                        cAppName )

   LOCAL aProcess := EnumProcessesID(),;      // --> return array { nProcessID1, nProcessID2, ... }      
         nInstance := 0,;
         n1ProcID,;
         lRVal := .F.
         
   FOR EACH n1ProcID IN aProcess 
      IF cAppName == GetProcessFullName( n1ProcID ) 
         IF ++nInstance > 1
            lRVal := .T.
            EXIT 
         ENDIF   
      ENDIF                                      
   NEXT n1ProcID
   
RETURN lRVal // IsAppRunning()

*-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.

Relations and differences …

Q: What are relations and differences between this 3 services you’ve been provided: Harbour Compiler, Harbour HMG, HMG-IDE. We need to know exactly when and why use them?

Short Answer :

Harbour : Is a multi-platform open source compiler for xBase programming language, as a continuation of Clipper Programming Language. You can use Harbour with or without HMG; as pure console mode or with another GUI facility.

HMG / MiniGUI : is also an open source GUI Library developed by Roberto Lopez, for Harbour Compiler, designed exclusively Windows platform only. You can’t use HMG without Harbour.

HMG-IDE is a free utility developed by Roberto Lopez, builder of HMG. An Integrated Development Environment including a project builder and a form designer; plus a DB Manager. You can use HMG library with or without HMG-IDE.

As you easily see and cited here with this three products we have a comprehensive and complete Windows programming toolkit or Clipper for Windows ➡

Long Answer

An explanation about HMG …

An explanation about Harbour, HMG and HMG-IDE

By Sri  Rathinagiri » Mon Sep 08, 2014 12:44 pm

Clipper programmers sometimes find it difficult to accommodate with HMG. The reason is the difference between TUI (Text User Interface) and GUI. In GUI, the program control is in the hands of the user and it is event driven. User can click on anything (say minimize button, maximize button, even another program running behind or any controls). So, it is our duty to design the whole window and wait for user’s action and write procedures for each and every action of the user.

GUI offers many innovative controls like Grid, Combobox, Button, Spinner etc., as against only textbox in TUI. So, we have to eventually accommodate events for all these controls.

Now, coming to HMG as not only a GUI library but a bundle of all. Even though HMG is directly based on the latest Harbour versions, HMG comes as a bundle. You need not install any other software to build a windows application. Full stop. 🙂 It contains the GUI library, PRG compiler, C Compiler and all the supporting software products to successfully build an application.

People (at least me) sometimes misunderstand GUI and OOP as one and the same. GUI and OOP are different and independent to each other. GUI can be made to work with or without OOP and vice versa. HMG is based on Win32 API system. Win32 API system works on handles and hooks. Every window/control in HMG is provided with a handle (like the file handle in clipper) and events are hooked on that particular handle. Once any hooked event is fired by the user (say a click of a button) immediately Win32 API searches for a CallBack function which is provided by the developer via HMG. The beauty of HMG would be, the developer is made free from handling all these internal affairs, handles, hooks and callback procedures. Instead he can concentrate on what is to be done if the event is fired.

You will be astonished to see how a ‘define window’ statement in HMG invokes 100s of lines of Harbour and C code. Please see the source folder of HMG if you want to know in detail.

Again, the advantage of HMG is, you need not include any dlls with your executable code as it is based on Win32 API. The application would run in XP to Windows version 8 (even in Windows 97 some cases).

Now coming to your questions.

1) How to get a lot of of source codes containing of samples to handle screen-menus ; from basic up to complex/advanced screen-menus?

To answer this questions, pls help us by showing links which permit us to download. And by sharing your source-code available for public.

Screenshoot attached herein, is a sample screen handle we need to implement on our application, ASAP. Being programmers for long time, we need any advanced skill in order to satisfy our users/clients currently still using our DOS-apps-versions.

You can start with Your HMG Directory\SAMPLES\Basics\TUTORIAL folder. It contains various tutorials for basic programmers. Then you can see basic and controls sub-folders of samples. I don’t think that any advanced skill set is required to satisfy our existing DOS clients. Actually ther will be happy to update their programs to Windows version as it is user friendly and more flexible.

2) How to avoid one app/EXE is double-run by users in the same computer?

This problem never arise under DOS who own a single window. I noticed when exercising HMG-ID (executing IDE.EXE) to build project, the RUN (F5) function fails to detect the problem. that’s way HMG-IDE made run-time error as if the mistake came from source program.

Yes, it is a valid point. In HMG-IDE previous version there was an error marking ‘Is the program still running?’. I don’t know what happened to that in the recent versions. I will request Claudio to look into this. Thanks for reporting.

3) Why stable version release from official Harbour-Project differ from this forum?

The project says the latest stable version is 3.0.0. while this forum says HMG 3.3.1. Any clarification in this matter is urgently needed to avoid confusion.

Because they are entirely different projects. As I have discussed earlier, HMG is based on Harbour. But it is a bundle by itself. Some major implementations have been made after the versions HMG 3.0. Introducing Unicode in 3.1. Made it to a stable version in 3.2. And the latest and significant achievement is HMG in 64 Bits, which made it to 3.3 series.

HMG Extended is also developed and released parallelly and they have their own version numbering system.

IMHO, we can use the latest stable versions for the development.

4) Pls help us describe what the differences between this 3 services you’ve been provided: Harbour Compiler, Harbour Mini GIU, Harbour-IDE. We need to know exactly when and why use them?

Harbour compiler is the core. Habour MiniGUI is the Win32 wrapper library to access the GUI aspects of the programs. HMG IDE is a tool to develop and build our software in Harbour MiniGUI.

You can use simply Harbour if you need only console mode. If you want GUI support, you can use Harbour MiniGUI and its build.bat ( even without using HMG IDE at all).

If you need Forms Designer and an easy build system, you can use HMG IDE which can co-ordinate your forms, database, resources (icons, pictures etc) and linking other third party libraries.

Sri Rathinagiri
Sivakasi, India

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Courtesy of author, this article borrowed from here.