i have some trobles with Harbour Mini Gui

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
raumi75
Posts: 135
Joined: Wed Dec 17, 2008 2:31 am
Location: Lünen, Germany
Contact:

Re: i have some trobles with Harbour Mini Gui

Post by raumi75 »

rpiccioli wrote: I noticed instructions as:

Code: Select all

AnagCorsi.Activate
I don't remember in clipper language this statement. I think it is a statemente to activate the form in the window.. or better ... to activate the form inside the procedure.

Have you got a list about this statement? I don't have them, and I cant' found them on the site.
If you are simply looking for the hmg-reference, you may find this link useful: http://harbourminigui.googlepages.com/reference.htm

I found the code in the folder SAMPLES very useful. They are also documented here: http://harbourminigui.googlepages.com/tutorial
rpiccioli wrote:At the moment i'm looking for a 'windows statement' to close a window pushing a button...

Rick
windowname.release() will close a previously activated window
windowname.hide() wil hide a window, that was displayed with windowname.show()

So you will need to define a button and make the on action property "windowname.release()"

Have a merry christmas

Jan

rpiccioli
Posts: 17
Joined: Sun Dec 21, 2008 8:43 am
Location: Roma - Italy

Post by rpiccioli »

Lovely.. i will study!

Thanks for all and Happy xmas to you all!!!
--
Riccardo Piccioli

User avatar
esgici
Posts: 4538
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 410 times
Been thanked: 118 times
Contact:

Post by esgici »

Hello Riccardo and Jan

Since you are using HMG, all necessary documents are in your own PC too;
simply look at C:\hmg\DOC folder ;)

Alternatively, our forum too have some useful documentation, especially for beginners :)


Happy HMG'ing

Regards

--

esgici
Viva INTERNATIONAL HMG :D

rpiccioli
Posts: 17
Joined: Sun Dec 21, 2008 8:43 am
Location: Roma - Italy

Post by rpiccioli »

Ok...
lovely!

Thanking to all of you.. and aof course to Harbour Miniguide, I am able now to build a navigation system through the windows.

I'm just filling the field and now i have to store data into a database.

At the moment I an trying to do it in this way:

Code: Select all

Procedure P_AggiungiIstruttore()

  local numerorecord	

  DEFINE WINDOW AggiungiIstruttore ;
    AT      70, 535  ;
    WIDTH   905 ;
    HEIGHT  610 ;
    TITLE "Aggiungi Nuovo Istruttore" ;
    MODAL

        *******************************
        *** Fields in the windows to fill later ***
        *******************************

	@  30, 20 FRAME Frame_1 OF AggiungiIstruttore CAPTION "&Generalità Istruttore:"; 
         WIDTH  500 HEIGHT 95 FONT "Arial" SIZE 9 BACKCOLOR NIL FONTCOLOR NIL OPAQUE

	@  56, 30 LABEL L_nome OF AggiungiIstruttore VALUE "&Nome:"; 
         ACTION Nil WIDTH  120 HEIGHT 12 FONT "Arial" SIZE 9
	@  52, 90 TEXTBOX tb_nome_istr OF AggiungiAllievo HEIGHT 24 VALUE "" WIDTH  120;
         FONT "Arial" SIZE 9 TOOLTIP "" MAXLENGTH 30 ON LOSTFOCUS Nil

[...]
  END WINDOW
   AggiungiIstruttore.Center
   AggiungiIstruttore.Activate

   *** Apre ed conta record sul file istrutori.DBF
   *** Open and Counts the records in istruttori.DBF

   USE istruttori NEW
       numerorecord := RECNO()
       ? numerorecord 
   CLOSE istruttori

Return 

Well, in this way, the compiler doesn't return any error, but the RECNO() is not displayed in the Window.

So, maybe I have to put this part of the code inside of window definition.

Is it true?

I tried to do it at the beginning but i didn't see the result inside the window.
--
Riccardo Piccioli

User avatar
esgici
Posts: 4538
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 410 times
Been thanked: 118 times
Contact:

Post by esgici »

rpiccioli wrote:Ok...
lovely!

Thanking to all of you.. and aof course to Harbour Miniguide, I am able now to build a navigation system through the windows.
...
Well, in this way, the compiler doesn't return any error, but the RECNO() is not displayed in the Window.

So, maybe I have to put this part of the code inside of window definition.

Is it true?

I tried to do it at the beginning but i didn't see the result inside the window.
Hello Riccardo

Well, very good advances :)

You are working while holiday, like me :)

Unfortunately we can't use "?" command in GUI, within a window, it left only console mode.

You may open a TEXTBOX and put RECNO() in it or you can show RECNO() as a part of STATUSBAR.

And please don't forget, within a procedure / function, code written after ACTIVATE command never excuted !

Instead, you have coding it a separate procedure / function or codeblock and call with a GUI way. For example USE istruttori NEW command may be in ON INIT clause and CLOSE istruttori command may be in ON RELEASE clause of DEFINE WINDOW AggiungiIstruttore command.

For displaying record no, you have add an another GUI command and probably a button for calling this "display recno" procedure.

Probably you will add navigation commands "next record", "previous record", "go top" and "go bottom". So you can add "display recno" statement inside of these navigation procedur / function.

By the way, when graphical control defined inside of a window/form definition, yo have't use OF <windowName> clause.

Happy HMG'ing

Regards

--

esgici
Viva INTERNATIONAL HMG :D

User avatar
esgici
Posts: 4538
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 410 times
Been thanked: 118 times
Contact:

Post by esgici »

esgici wrote: ... within a procedure / function, code written after ACTIVATE command never executed !
Sorry, this isn't fully correct :(

The correct explanation must be such as :

Within a procedure / function, code written after ACTIVATE command can't be executed until activated form released.

Since when MAIN window released program terminated, if that form is MAIN window, that code never executed.
For displaying record no, you have add an another GUI command and probably a button for calling this "display recno" procedure.
Alternatively, you may use Msgxxx() functions for displaying intermediate results / infos; like WAIT command or Alert() function of Clipper / console mode. Since HMG's native Msgxxx() functions accept only CHAR type data, you may use STR( RECNO() ) notation for RECNO(), or simply use MsgMulty() function by downloading from my web page.

Regards

--

esgici
Viva INTERNATIONAL HMG :D

User avatar
mol
Posts: 3409
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 268 times
Been thanked: 173 times
Contact:

Post by mol »

Hello Esgici!

It isn't true that MgsBox accepts only char data!
Please try MsgBox(recno())
it will open message box with record number!
Naturally, we can't mix data with different types.

User avatar
esgici
Posts: 4538
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 410 times
Been thanked: 118 times
Contact:

Post by esgici »

mol wrote:Hello Esgici!

It isn't true that MgsBox accepts only char data!
Please try MsgBox(recno())
it will open message box with record number!
Naturally, we can't mix data with different types.
Hi Mol

Thanks, I have tried, but message box open withOUT record number!

What is different between you and me ?

Regards

--

esgici
Viva INTERNATIONAL HMG :D

User avatar
mol
Posts: 3409
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 268 times
Been thanked: 173 times
Contact:

Post by mol »

uppps!
maybe I'm wrong?
I use MsgBox() sometimes to debug some variables in program and I was sure that calling this function with number is enabled and will convert it to string automatically.

Maybe I automatically called it with msgbox(str(... etc.?

Best regards, Marek

rpiccioli
Posts: 17
Joined: Sun Dec 21, 2008 8:43 am
Location: Roma - Italy

Post by rpiccioli »

OhMyGod ..

i made some updates in my code.. trying to follow the suggests ..

:twisted: :twisted: Syntax error on a line and i'm looking for the error... since three hours.. and i can't found the error :(((((

1st rule: Always backup your code before changes :lol: :lol:
--
Riccardo Piccioli

Post Reply