Help with using IDE

Utilities like DBU, Make, IDE written in HMG/ used to create HMG based applications

Moderator: Rathinagiri

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

Re: Help with using IDE

Post by esgici »

Hi Mark
MGOLDFARB wrote:... I was able to get the application compiled.
Congrats :D This is an important step :!:
MGOLDFARB wrote: 1. I noticed when I go from menu window to a sub-menu window (different forms), the previous form stays open. What is the command to close a form when moving to the next form.
What kind of sub-form you are using; STANDARD, CHILD, MODAL, SPLITCHILD, PANEL?

My preference is : if I haven't any compelling reason, I'm using always MODAL.

MODAL means preliminary : without closed this form, user can't activate another one, including MAIN form.

Anyway, without regarding form kind, you can use HIDE method for hiding or SETFOCUS for changing active form ( I guess what you want is this ).

Also you can use RELEASE method to close a form permanently.
MGOLDFARB wrote: 2. If I want to have a menu option to Quit the program, do I just make a function with a QUIT in it? Or is there a better way of doing this.
RELEASE'ing MAIN form is equivalent to QUIT command.
MGOLDFARB wrote: 3. Initially, the application needs to be hybrid of the new forms created in IDE, and the old @ SAY GET forms. When I compile the application in Console mode (with no windows menus), all works fine. When I create the menus in IDE, and they call the older @say get screens, the @ SAY "xxxx" (what is in quotes) does not appear. The value of the filed in the GET does appear....
In my humble opinion, this isn't a good way.

Yes, a hybrid ( use both console and GUI screen) application is possible. But isn't a rational method. Before all, programmer will more struggle. And since at last everything goes the GUI, the best way is design everything for GUI upward the beginning.
MGOLDFARB wrote: Slowly, I will convert the hundreds of screens over.
Yes, almost every programmer who want migrate DOS to Windows, want change everything in a single step. IMHO this approach too isn't correct. Instead please be calm and patient, divide your old code into un-dividable, manageable and applicable parts and then convert these parts one to one to GUI. After a few conversion you will reach the "chemical" of process and after that, you will go high speed.

I hope this long chattering of an old man will help you ;)

A last point : please don't hesitate asking anything; here you are between friends and everybody here was past these problems.

Happy HMG'in :D
Viva INTERNATIONAL HMG :D
MGOLDFARB
Posts: 71
Joined: Thu Jun 21, 2012 7:46 am

Re: Help with using IDE

Post by MGOLDFARB »

I got the menus to navigate. I am able to hide the menus that are not in use. My only problem is that I was able to hide the main form (main.hide). However, it would not allow me to do main.show. Is there a special syntax needed here.

I will try to go with GUI for all. But you will get many more questions :).

The first, how do I link fields from the table to the form. I am sure I am missing something stupid here.
I need one form to show a list of all customer # and customer names. The user should be able to select one.
The other form will be more standard, all the fields from the table for the user to enter/edit (simulating the @ SAY GET).

Thanks.
User avatar
danielmaximiliano
Posts: 2611
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: Help with using IDE

Post by danielmaximiliano »

Hi Mark :
can you

Code: Select all

DBselectarea("Product")      
    Product->( DBGOTOP() ) 
     IF  Product->(DBSEEK(Ventas.Text_1.Value))
                  Ventas.Text_2.Value := Product->SCS
                  Ventas.Text_3.Value := Product->P_Public
                  Ventas.Text_4.Value := 1
                  Ventas.Text_1.SETFOCUS
Else add to grid

Code: Select all

 Ventas.Articulos.AddItem ( { Ventas.Text_4.Value                         , ;
                                Product->Code                           , ;
                                Product->SCS                              , ;
                                Product->P_Public                        , ;
				Product->P_Public * Ventas.Text_4.Value  } )		
					
   Ventas.Text_1.Value    := ''
   Ventas.Text_2.Value    := ''
   Ventas.Text_3.Value    := 0.00
   Ventas.Text_4.Value    := 0
   Ventas.Text_1.SETFOCUS
Look Example : C:\hmg.3.0.42\SAMPLES\GRID.07
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Help with using IDE

Post by esgici »

Hi Mark
MGOLDFARB wrote:My only problem is that I was able to hide the main form (main.hide).
Here a very simple ( but working ) sample for Hide/Show Main.

Main.prg :

Code: Select all

#include <hmg.ch>

Function Main

        Load Window Main
        Main.Center
        Main.Activate

Return

PROC OpenSubForm()

        Load Window SubForm
        SubForm.Center
        SubForm.Activate

RETU

Main.Fmg

Code: Select all

* HMG-IDE Form Designer Generated Code
* (c) Roberto Lopez - http://sites.google.com/site/hmgweb

DEFINE WINDOW TEMPLATE AT 216 , 345 WIDTH 550 HEIGHT 350 VIRTUAL WIDTH Nil VIRTUAL HEIGHT Nil TITLE "Main to hide ..." ICON NIL MAIN CURSOR NIL ON INIT OpenSubForm() ON RELEASE Nil ON INTERACTIVECLOSE Nil ON MOUSECLICK Nil ON MOUSEDRAG Nil ON MOUSEMOVE Nil ON SIZE Nil ON MAXIMIZE Nil ON MINIMIZE Nil ON PAINT Nil BACKCOLOR Nil NOTIFYICON NIL NOTIFYTOOLTIP NIL ON NOTIFYCLICK Nil ON GOTFOCUS Nil ON LOSTFOCUS Nil ON SCROLLUP Nil ON SCROLLDOWN Nil ON SCROLLLEFT Nil ON SCROLLRIGHT Nil ON HSCROLLBOX Nil ON VSCROLLBOX Nil

END WINDOW
SubForm.Fmg :

Code: Select all

* HMG-IDE Form Designer Generated Code
* (c) Roberto Lopez - http://sites.google.com/site/hmgweb

DEFINE WINDOW TEMPLATE AT 230 , 411 WIDTH 550 HEIGHT 350 VIRTUAL WIDTH Nil VIRTUAL HEIGHT Nil TITLE "Sub form" ICON NIL  CURSOR NIL ON INIT Nil ON RELEASE Nil ON INTERACTIVECLOSE Nil ON MOUSECLICK Nil ON MOUSEDRAG Nil ON MOUSEMOVE Nil ON SIZE Nil ON MAXIMIZE Nil ON MINIMIZE Nil ON PAINT Nil BACKCOLOR Nil NOTIFYICON NIL NOTIFYTOOLTIP NIL ON NOTIFYCLICK Nil ON GOTFOCUS Nil ON LOSTFOCUS Nil ON SCROLLUP Nil ON SCROLLDOWN Nil ON SCROLLLEFT Nil ON SCROLLRIGHT Nil ON HSCROLLBOX Nil ON VSCROLLBOX Nil

    DEFINE BUTTON btnHideMain
        ROW    50
        COL    60
        WIDTH  100
        HEIGHT 28
        ACTION Main.Hide
        CAPTION "Hide Main"
        FONTNAME "Arial"
        FONTSIZE 9
        TOOLTIP ""
        FONTBOLD .F.
        FONTITALIC .F.
        FONTUNDERLINE .F.
        FONTSTRIKEOUT .F.
        ONGOTFOCUS Nil
        ONLOSTFOCUS Nil
        HELPID Nil
        FLAT .F.
        TABSTOP .T.
        VISIBLE .T.
        TRANSPARENT .F.
        MULTILINE .F.
        PICTURE Nil
        PICTALIGNMENT TOP
    END BUTTON

    DEFINE BUTTON btnShowMain
        ROW    50
        COL    360
        WIDTH  100
        HEIGHT 28
        ACTION Main.Show
        CAPTION "Show Main"
        FONTNAME "Arial"
        FONTSIZE 9
        TOOLTIP ""
        FONTBOLD .F.
        FONTITALIC .F.
        FONTUNDERLINE .F.
        FONTSTRIKEOUT .F.
        ONGOTFOCUS Nil
        ONLOSTFOCUS Nil
        HELPID Nil
        FLAT .F.
        TABSTOP .T.
        VISIBLE .T.
        TRANSPARENT .F.
        MULTILINE .F.
        PICTURE Nil
        PICTALIGNMENT TOP
    END BUTTON

END WINDOW
I hope that this will give you an idea :idea:

MGOLDFARB wrote:I will try to go with GUI for all. But you will get many more questions :).
No problem :)
MGOLDFARB wrote:The first, how do I link fields from the table to the form. I am sure I am missing something stupid here.
I need one form to show a list of all customer # and customer names. The user should be able to select one.
The other form will be more standard, all the fields from the table for the user to enter/edit (simulating the @ SAY GET).
In addition to hints of Daniel, you can try BROWSE too. Though It's a bit old against GRID, sometimes will be more handy.

Regards
Viva INTERNATIONAL HMG :D
MGOLDFARB
Posts: 71
Joined: Thu Jun 21, 2012 7:46 am

Re: Help with using IDE

Post by MGOLDFARB »

Ok. I am moving along. I also feel like I am back in first grade with all the questions I am asking...

I got the data into a text field on the form, but how do I simulate the READ of clipper, so the user can enter data.

What is the syntax to populate the GRID control?

What I am trying to do with the GRID (not sure if this is the right way)... The user should see a list of clients (client code and client name), they can either choose one (and will be brought to a screen to edit information about the client) or they can click someplace and a client.

Thanks.

Mark
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: Help with using IDE

Post by Rathinagiri »

Hi Mark,

There is some basic differences between a MS-DOS text application and a GUI application. In text application we have full control over the user's actions. We can put many 'Read's for a single data entry screen. Here in GUI applications, user is given freedom to choose anything he wants. He may press the close button of the window at any time, minimize it, switch to another application like that. Text applications are procedure driven. On the other hand, GUI applications are event driven. We write procedures for the events users do.

Therefore, we may put a 'Save' button and a 'Cancel' button in a data entry window. While pressing these buttons, corresponding button click events are fired by the system. And, we write appropriate procedures to either save the data or omit the data from saving. Here, 'Save' button acts like a 'Read' command in the Clipper programs.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Help with using IDE

Post by esgici »

Hi Rathi,

Good explanation, thanks :)

As some additions:
MGOLDFARB wrote:Ok. I am moving along. I also feel like I am back in first grade with all the questions I am asking...
Again, please don't worry about asking questions; questions indicate to wonder and wondering is precondition of learning; nobody come to postgraduate without first grade;)
MGOLDFARB wrote:... how do I simulate the READ of clipper...
READ command is out of usage now ! You don't need it at all. TextBox control have all possibilities of @ ... GET command. In short, TextBox = @ ... GET + READ.
MGOLDFARB wrote:... What is the syntax to populate the GRID control?
All necessary syntax are documented in HMG-Doc. Moreover we have tons of examples. Especially GRID control is one of most exampled control (GRID_01 through GRID_39). If you follow and inspect these examples, surely you will find answer to all your questions.

Happy HMG'ing :D
Viva INTERNATIONAL HMG :D
MGOLDFARB
Posts: 71
Joined: Thu Jun 21, 2012 7:46 am

Re: Help with using IDE

Post by MGOLDFARB »

Where do I find HMG-doc? I do not see it under hmg.4 directory. I could not find it online.
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Help with using IDE

Post by esgici »

Hi Mark
MGOLDFARB wrote:Where do I find HMG-doc? I do not see it under hmg.4 directory. I could not find it online.
Sorry, I didn't understood your are about HMG.4 :(

When talked about HMG, personally I'm understanding only HMG_3.xxx.

And sadly I have almost zero knowledge on HMG.4 :(

Regards
Viva INTERNATIONAL HMG :D
MGOLDFARB
Posts: 71
Joined: Thu Jun 21, 2012 7:46 am

Re: Help with using IDE

Post by MGOLDFARB »

How different is HMG.4 from HMG.3? Where can I found documentation on the syntax for using the controls like BROWSE or GRID?

Thanks.
Post Reply