WAIT WINDOW

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

RPC
Posts: 308
Joined: Fri Feb 10, 2017 4:12 am
DBs Used: DBF

WAIT WINDOW

Post by RPC »

Hi
I am trying to use WAIT WINDOW...NOWAIT command in my program but getting error msg as per enclosed ss
What am I doing wrong ? please help
Thanks
Attachments
Error msg-WAIT WINDOW.png
Error msg-WAIT WINDOW.png (950.33 KiB) Viewed 2596 times
User avatar
mol
Posts: 3817
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: WAIT WINDOW

Post by mol »

Use
Declare window _hmg_childwaitwindow
on the begin of your app
RPC
Posts: 308
Joined: Fri Feb 10, 2017 4:12 am
DBs Used: DBF

Re: WAIT WINDOW

Post by RPC »

mol wrote: Sat Feb 01, 2020 5:30 pm Use
Declare window _hmg_childwaitwindow
on the begin of your app
Hi mol
Thanks for your reply.
I tried as advised by you but it didn't work.
I am enclosing my program . Please indicate where I have to add the command you have mentioned.
Attachments
Testwait.zip
(1.75 KiB) Downloaded 152 times
User avatar
mol
Posts: 3817
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: WAIT WINDOW

Post by mol »

You didn't attach TestWait.fmg file.
I'm using such a function to call wait window:

Code: Select all

function TurnOnWaitWindow
	param cMessage
	local nW

	nW := 1 + round(getTextWidth(NIL,cMessage,"ARIAL")/ GetProperty("_HMG_CHILDWAITWINDOW","Message","Width"),0)
	nHeight :=  50+ 25*nW
	//SetProperty("_HMG_CHILDWAITWINDOW","Message", "BackColor", {255,255,0} )
	//SetProperty("_HMG_CHILDWAITWINDOW","Message", "AutoSize", .t. )
	SetProperty("_HMG_CHILDWAITWINDOW","Height", nHeight)
	SetProperty("_HMG_CHILDWAITWINDOW","Message","Height", 25 * nW)
	SetProperty("_HMG_CHILDWAITWINDOW","Message","Row", nHeight - 25*(nW+1) )
	SetProperty("_HMG_CHILDWAITWINDOW","Message","FONTBOLD",.t.)
	
	Wait Window cMessage NOWAIT
 return .t.
It works fine to me.

I hope it helps you
RPC
Posts: 308
Joined: Fri Feb 10, 2017 4:12 am
DBs Used: DBF

Re: WAIT WINDOW

Post by RPC »

mol wrote: Sat Feb 01, 2020 8:29 pm You didn't attach TestWait.fmg file.
I'm using such a function to call wait window:

Code: Select all

function TurnOnWaitWindow
	param cMessage
	local nW

	nW := 1 + round(getTextWidth(NIL,cMessage,"ARIAL")/ GetProperty("_HMG_CHILDWAITWINDOW","Message","Width"),0)
	nHeight :=  50+ 25*nW
	//SetProperty("_HMG_CHILDWAITWINDOW","Message", "BackColor", {255,255,0} )
	//SetProperty("_HMG_CHILDWAITWINDOW","Message", "AutoSize", .t. )
	SetProperty("_HMG_CHILDWAITWINDOW","Height", nHeight)
	SetProperty("_HMG_CHILDWAITWINDOW","Message","Height", 25 * nW)
	SetProperty("_HMG_CHILDWAITWINDOW","Message","Row", nHeight - 25*(nW+1) )
	SetProperty("_HMG_CHILDWAITWINDOW","Message","FONTBOLD",.t.)
	
	Wait Window cMessage NOWAIT
 return .t.
It works fine to me.

I hope it helps you
Hi mol
Thanks for the code. Alas ! I am still getting the same error message.
I am enclosing all the files again(including fmg file).
Please correct the program.
Many thanks
Attachments
TestWait2.zip
(2.8 KiB) Downloaded 136 times
User avatar
serge_girard
Posts: 3364
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: WAIT WINDOW

Post by serge_girard »

You have NOT declared _HMG_CHILDWAITWINDOW !

Serge
There's nothing you can do that can't be done...
RPC
Posts: 308
Joined: Fri Feb 10, 2017 4:12 am
DBs Used: DBF

Re: WAIT WINDOW

Post by RPC »

Hi Serge_girard
Thanks for your reply.
If you check line no 17(which is commented now) I did declare it , but since my problem still persisted I commented it.
Can you pls tell where should I DECLARE it for the program to work.
Many thanks.
User avatar
serge_girard
Posts: 3364
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: WAIT WINDOW

Post by serge_girard »

Please, send it in a new ZIP file!
Serge
There's nothing you can do that can't be done...
User avatar
mustafa
Posts: 1175
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Contact:

Re: WAIT WINDOW

Post by mustafa »

Hello friend RPC
The file 'TestWait.Fmg'
it is giving me Error
if you move everything to 'TestWait.prg'
it's giving me OK

Code: Select all


#include "hmg.ch"

FUNCTION Main()

PUBLIC lPIsNet := .f.

 DEFINE WINDOW TESTWAIT               ;
      AT 265 , 551                              ;
      WIDTH 620 HEIGHT 487            ;
      MAIN                                     ;                   
      ON INIT isInternet()

      ON KEY ESCAPE ACTION TESTWAIT.Release      

   DEFINE BUTTON Button_1
        ROW    30
        COL    30
        WIDTH  100
        HEIGHT 28
        ACTION Dnld()
        CAPTION "Button_1"
        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 STATUSBAR FONT "Courier New" SIZE 9
        STATUSITEM "HMG Power !!!"
        KEYBOARD // will show status of Caps lock,Nums lock and insert mode. it is equal to 3 items on statusbar
        DATE
        CLOCK
        STATUSITEM "Internet OFF" ACTION isInternet()
    END STATUSBAR

END WINDOW

  Center Window TESTWAIT
  Activate Window TESTWAIT

Return Nil
All the rest code is the same

Regards

Mustafa
RPC
Posts: 308
Joined: Fri Feb 10, 2017 4:12 am
DBs Used: DBF

Re: WAIT WINDOW

Post by RPC »

Hi Mustafa
Many thanks for your reply.
Yes, you are right if everything is moved to .prg file it is working. 8-)
I wonder why. :?
Post Reply