Wait window is visible not enough

Creative ideas/suggestions for HMG

Moderator: Rathinagiri

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

Wait window is visible not enough

Post by mol »

There is no possibility to determine look of WAIT WINDOW. But often, this window is visible not enough.
It would be great to have control about background color, font color, maybe font size.

regards, Marek

User avatar
Rathinagiri
Posts: 5275
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 174 times
Been thanked: 190 times
Contact:

Post by Rathinagiri »

:)

I was about to ask. I think Roberto is busy on other preferential work.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

User avatar
Roberto Lopez
HMG Founder
Posts: 3986
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 27 times
Been thanked: 168 times

Post by Roberto Lopez »

mol wrote:There is no possibility to determine look of WAIT WINDOW. But often, this window is visible not enough.
It would be great to have control about background color, font color, maybe font size.

regards, Marek
I'll think about that...

I'm busy working in other of your wishes right now :)
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
gert_w
Posts: 3
Joined: Fri Jun 17, 2011 6:42 pm
Location: Germany

Post by gert_w »

My Wait Window

I am wondering why nobody had the idea yet to define a window as TOPMOST and activate it by 'Show' and 'Hide'. This works fine for me and you can define the layout, text and colors as you need.
For some "waiting" operations you can also include a progress bar.

Gert

Code: Select all

#include "hmg.ch"
#define C_LIGHTBLUE  {165,175,245}

Function Main

  DEFINE WINDOW Win_1 ;
    AT 0,0  WIDTH 400  HEIGHT 400 ;
    TITLE "Gert's WAIT WINDOW DEMO" ;
    MAIN

  @  70,70 BUTTON Button_1 CAPTION 'WAIT WINDOW "Processing..." NOWAIT' ACTION Test1() WIDTH 250
  @ 100,70 BUTTON Button_2 CAPTION 'WAIT CLEAR' ACTION Test2() WIDTH 250

  END WINDOW

  DEFINE WINDOW Win_Wait    ;
     AT 0,0    WIDTH  225 HEIGHT 80 ;
     TOPMOST NOSHOW NOSIZE NOCAPTION NOAUTORELEASE BACKCOLOR C_LIGHTBLUE
  
  @ 20,30   LABEL L1 VALUE 'please wait...' WIDTH 180 HEIGHT 40;
    FONT 'ARIAL' SIZE 20 FONTCOLOR BLUE BOLD BACKCOLOR C_LIGHTBLUE
    
  END WINDOW

  CENTER WINDOW Win_1
  CENTER WINDOW Win_Wait
  ACTIVATE WINDOW Win_1
  ACTIVATE WINDOW Win_Wait

Return

procedure test1()

  Win_Wait.show

return

procedure test2()

   Win_Wait.hide

return

User avatar
Rathinagiri
Posts: 5275
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 174 times
Been thanked: 190 times
Contact:

Post by Rathinagiri »

Nice one. It is very much useful. Thanks a lot Gert.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil
Has thanked: 100 times
Been thanked: 182 times

Post by Pablo César »

Hi All !

I prepared an improved version of our colleague Gert:

Code: Select all

#include <hmg.ch>

#define C_LIGHTBLUE  {165,175,245}

Function Main()
Set Century On
DEFINE WINDOW Win_1 ;
    AT 0,0 WIDTH 600 HEIGHT 450 BACKCOLOR BLUE ;
    TITLE "WAIT WINDOW DEMO" MAIN
	
	ON KEY ESCAPE ACTION ThisWindow.Release

    @ 030,160 BUTTON Button_1 CAPTION 'WAIT/CLEAR WINDOW "Auto-Release" NOWAIT' ACTION Test1() WIDTH 290
    @ 070,160 BUTTON Button_2 CAPTION 'WAIT WINDOW   "Start Processing" NOWAIT' ACTION Test2() WIDTH 290
    @ 100,160 BUTTON Button_3 CAPTION 'WAIT CLEAR     "Stop Processing"       ' ACTION Test3() WIDTH 290
	
	DEFINE STATUSBAR FONT  "Courier New" SIZE 9
		DATE  WIDTH 85
		STATUSITEM HMG_PadC("Press [Esc] to exit",64) ACTION ThisWindow.Release RAISED WIDTH 450
		CLOCK WIDTH 65
	END STATUSBAR

END WINDOW

DEFINE WINDOW Win_Wait AT 0,0 WIDTH 400 HEIGHT 64 ;
    TOPMOST NOSHOW NOCAPTION NOSYSMENU NOAUTORELEASE BACKCOLOR C_LIGHTBLUE
  
    @ 20,10 LABEL L1 VALUE 'Please wait...' WIDTH 380 HEIGHT 20 CENTERALIGN ;
            FONT 'ARIAL' SIZE 14 FONTCOLOR BLUE BOLD BACKCOLOR C_LIGHTBLUE
    
END WINDOW
CENTER WINDOW Win_1
CENTER WINDOW Win_Wait
ACTIVATE WINDOW Win_1, Win_Wait
Return Nil

Function Test1()
Local i

Win_1.Button_2.Enabled := .F.
Win_1.Button_3.Enabled := .F.
Win_Wait.show
For i=1 To 10
    Win_Wait.L1.VALUE := 'Please wait '+Alltrim(Str(i))+" second"+If(i=1,"","s")
    hb_IdleSleep( 0.5 )
Next
Win_Wait.hide
Win_1.Button_2.Enabled := .T.
Win_1.Button_3.Enabled := .T.
Return Nil

Function Test2()
Win_1.Button_1.Enabled := .F.
Win_Wait.show
Win_Wait.L1.VALUE := 'Please wait...'
Return Nil

Function Test3()
Win_1.Button_1.Enabled := .T.
Win_Wait.hide
Return Nil
Screen1.png
Screen1.png (19.68 KiB) Viewed 2295 times
I hope you enjoy it and be usefull too :!: :D
Last edited by Pablo César on Wed Dec 14, 2016 12:06 am, edited 1 time in total.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein

User avatar
serge_girard
Posts: 2412
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 726 times
Been thanked: 133 times
Contact:

Post by serge_girard »

Yes, it is!

Thanks, Serge

Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México
Has thanked: 1 time
Been thanked: 2 times

Post by Javier Tovar »

Gracias Pablo César por compartir!

Saludos

User avatar
vagblad
Posts: 123
Joined: Tue Jun 18, 2013 12:18 pm
DBs Used: MySQL,DBF
Location: Thessaloniki, Greece
Has thanked: 18 times
Been thanked: 24 times

Post by vagblad »

Thanks Gert and Pablo!
Vagelis Prodromidis
Email: vagblad@gmail.com, Skype: vagblad

User avatar
quartz565
Posts: 577
Joined: Mon Oct 01, 2012 12:37 pm
Location: Thessaloniki, Greece
Has thanked: 185 times
Been thanked: 21 times
Contact:

Post by quartz565 »

Thank you Gert and Pablo!
Best Regards,
Nikos.

os: Windows Server 2012 - 64
hw: HP Server E5606, 2.13GHz, 8.00 GB - Intel Xeon CPU

Post Reply