Wait window is visible not enough

Creative ideas/suggestions for HMG

Moderator: Rathinagiri

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

Wait window is visible not enough

Post by mol » Wed Apr 21, 2010 10:39 am

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: 5243
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 162 times
Been thanked: 161 times
Contact:

Post by Rathinagiri » Wed Apr 21, 2010 1:34 pm

:)

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: 3919
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 15 times
Been thanked: 140 times

Post by Roberto Lopez » Wed Apr 21, 2010 2:17 pm

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 » Sat Jul 02, 2011 6:32 pm

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: 5243
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 162 times
Been thanked: 161 times
Contact:

Post by Rathinagiri » Sun Jul 03, 2011 7:21 am

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: 179 times

Post by Pablo César » Thu Dec 11, 2014 1:54 pm

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 1222 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: 2117
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 437 times
Been thanked: 95 times
Contact:

Post by serge_girard » Thu Dec 11, 2014 5:35 pm

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 » Thu Dec 11, 2014 6:34 pm

Gracias Pablo César por compartir!

Saludos

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

Post by vagblad » Fri Dec 12, 2014 9:07 am

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

User avatar
quartz565
Posts: 516
Joined: Mon Oct 01, 2012 12:37 pm
Location: Thessaloniki, Greece
Has thanked: 143 times
Been thanked: 13 times
Contact:

Post by quartz565 » Fri Dec 12, 2014 11:32 am

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