Wait Window & MsgInfo()

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
karweru
Posts: 220
Joined: Fri Aug 01, 2008 1:51 pm
DBs Used: DBF,mysql,mariadb,postgresql,sqlite,odbc
Contact:

Wait Window & MsgInfo()

Post by karweru »

Hello friends,

I have a queer need,...is there anyway i can force msgInfo() to close a waitWindow()?
Kind regards,
Gilbert.
edk
Posts: 914
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: Wait Window & MsgInfo()

Post by edk »

To be honest I don't understand what the problem is.
If you want to close WAIT WINDOW before MsgInfo() appears:

Code: Select all

(...)
WaitWindow()
MsgInfo ("Some info")
(...)
and if you want to close after confirming MsgInfo():

Code: Select all

(...)
MsgInfo ("Some info")
WaitWindow()
(...)
User avatar
karweru
Posts: 220
Joined: Fri Aug 01, 2008 1:51 pm
DBs Used: DBF,mysql,mariadb,postgresql,sqlite,odbc
Contact:

Re: Wait Window & MsgInfo()

Post by karweru »

edk wrote: Fri Jul 03, 2020 1:49 pm To be honest I don't understand what the problem is.
If you want to close WAIT WINDOW before MsgInfo() appears:

Code: Select all

(...)
WaitWindow()
MsgInfo ("Some info")
(...)
and if you want to close after confirming MsgInfo():

Code: Select all

(...)
MsgInfo ("Some info")
WaitWindow()
(...)
Thanks Edk,

I'm actually looking for a way to AUTOMATICALLY hide/close the WaitWindow() if a program issues a msginfo(). I have a lot of code as follows;

...
WaitWindow("processing.....")
if error()
msgInfo(<errorMsg>")
return .f.
endif
.....

Of course i can issue a waitWindow() after the msgInfo(),...was just wondering if msgInfo() could automatically issue the waitWindow()....more of being lazy :)
Kind regards,
Gilbert.
User avatar
mustafa
Posts: 1160
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Contact:

Re: Wait Window & MsgInfo()

Post by mustafa »

Hi karweru
Could inkey () work?

Code: Select all


#include "hmg.ch"

FUNCTION MAIN

  DEFINE WINDOW MAINx AT 0, 0 WIDTH 800 HEIGHT 600 TITLE ""ICON '' Main NOSIZE  NOMINIMIZE NOMAXIMIZE ON INIT Export()

   ON KEY ESCAPE ACTION Mainx.Release

   DEFINE BUTTON Button_1
        ROW    440
        COL    370
        WIDTH  110
        HEIGHT 040
        ACTION  Export()
        CAPTION "Wait"
        FONTNAME "Arial"
        FONTSIZE 9
        TOOLTIP ""
        FONTBOLD .T.
        FONTITALIC .F.
    END BUTTON

           
   END WINDOW

  Mainx.Center
  Mainx.Activate

Return

*-------------------------------------*
Function Export()
*-------------------------------------*

SetProperty("_HMG_CHILDWAITWINDOW","Width ", 450)  
SetProperty("_HMG_CHILDWAITWINDOW","Height", 130)           
SetProperty("_HMG_CHILDWAITWINDOW","Message","Width" ,450)
SetProperty("_HMG_CHILDWAITWINDOW","Message","Height",130 ) 
SetProperty("_HMG_CHILDWAITWINDOW","Message","Row",2)
SetProperty("_HMG_CHILDWAITWINDOW","Message","COL",2)

SetProperty("_HMG_CHILDWAITWINDOW","Message","FontColor", {128,000,000})
SetProperty("_HMG_CHILDWAITWINDOW","Message","BACKCOLOR", {198,245,183}) 

SetProperty("_HMG_CHILDWAITWINDOW","Message","FONTNAME"  ,"Times New Roman")  // <--- "Arial"
SetProperty("_HMG_CHILDWAITWINDOW","Message","FONTSIZE"  , 16 )
SetProperty("_HMG_CHILDWAITWINDOW","Message","FONTBOLD"  ,.T.)
SetProperty("_HMG_CHILDWAITWINDOW","Message","FONTITALIC",.T.)

wait window   CRLF +'Processing Table - »'  + CRLF+  'stock.db3' nowait 

inkey(3)  
wait clear
 
Return Nil

Regards
Mustafa
Post Reply