PDA

View Full Version : A Busy / Please Wait box



David Lack
4-Aug-2006, 03:30 AM
Hi Folks,

A quick class that can be used to popup a "Please wait" box. A quirk
to it is that if the waitbox object is not a child of the object that
calls it, it won't disappear on close_panel *if* called from the
Procedure Activating of the "main" view object. Sorry if that last
sentence is rather tortured!

Dave

================================================== ==========

// cWaitBox - DJL 03/08/2006
// Thanks to Erik Zimmerman in the VDF newsgroup for the idea
// of using a ToolPanel as the base. See:
//-------------------------------------------------
// From: "Erik Zimmerman" <erikz@compadmin.com>
// Subject: Re: A "Busy" box.
// Date: Fri, 28 Jul 2006 10:47:46 -0400
// Message-ID: <3DhUrTlsGHA.2072@dacmail.dataaccess.com>
// Newsgroups: visual-dataflex

Class cWaitBox Is A ToolPanel

Procedure Construct_Object

Forward Send Construct_Object

Set Locate_Mode To Smart_Locate
Set Size To 43 200
Set Caption_Bar To True
Set Label to "Please Wait"
Set Minimize_Icon To False
Set Maximize_Icon To False
Set Sysmenu_Icon To False
Set Color To clBtnFace
Set Border_Style To Border_Dialog

Object oWaitText is a Textbox
Set Label to "Message to display"
Set TextColor to clBlue
Set FontSize to 16 9
Set Location to 6 6
Set Size to 10 113
Set FontWeight to 800
Set TypeFace to "Arial"
End_Object // oTextBox1

End_Procedure


Procedure WaitBox String sLabel
Set Label of oWaitText to sLabel
Send Activate
End_Procedure

End_Class // cWaitBox

// At top of grid, above green line:
//=======================================
// Object oWaitBox Is A cWaitBox
// End_Object

// In the *same* grid object, when you fill the grid:
//================================================== ======
// Send WaitBox to oWaitBox "Searching customer database..."
// ..... do the fill grid stuff .....
// Send Close_Panel to oWaitBox

// If the oWaitBox object is not a child of the grid, it won't
// if the grid is called as part of Activating. God knows why.

================================================== ======

--
David Lack
FocusINet Ltd
dl@focusinet.com
Tel: 01453 753351

David Martinko
4-Aug-2006, 06:56 AM
Tip:

Create a Global variable to hold the object ID of the view. This should
resolve any issues of calling the close_panel and VDF not being able to
resolve the object because they aren't sister objects.

ghoWaitBox

Also, the package should go ahead and create the object and assign the
variable so all you have to do is USE it, Call it, and Close it.

handle ghoWaitBox
Object oWaitBox Is A cWaitBox
Move (Self) to ghoWaitBox
End_Object

Adding a global method can then make it easier to use...

Procedure StartWaitBox GLOBAL String sLabel
Set Label of (oWaitText(ghoWaitBox)) to sLabel
Send Popup of ghoWaitBox
End_Procedure // StartWaitBox

Procedure StopWaitBox Global String sLabel
Send Close_Panel of ghoWaitBox
End_Procedure // StopWaitBox

// Use:
// Send StartWaitBox "Printing... please wait."
// Send StopWaitBox

--
David Martinko
248-535-7495
Tracker Systems, Inc.
Redeemed Software
Redeemed Hosting
www.trackersys.com
www.redeemedsoftware.com
www.redeemedhosting.com
Proud member of the Northeast DataFlex Consortium: (NEDC)
www.NEDataFlex.com

"David Lack" <dl@focusinet.com> wrote in message
news:9516d29ku6pdnq58950hpg329v704vrvit@4ax.com...
Hi Folks,

A quick class that can be used to popup a "Please wait" box. A quirk
to it is that if the waitbox object is not a child of the object that
calls it, it won't disappear on close_panel *if* called from the
Procedure Activating of the "main" view object. Sorry if that last
sentence is rather tortured!

Dave

================================================== ==========

// cWaitBox - DJL 03/08/2006
// Thanks to Erik Zimmerman in the VDF newsgroup for the idea
// of using a ToolPanel as the base. See:
//-------------------------------------------------
// From: "Erik Zimmerman" <erikz@compadmin.com>
// Subject: Re: A "Busy" box.
// Date: Fri, 28 Jul 2006 10:47:46 -0400
// Message-ID: <3DhUrTlsGHA.2072@dacmail.dataaccess.com>
// Newsgroups: visual-dataflex

Class cWaitBox Is A ToolPanel

Procedure Construct_Object

Forward Send Construct_Object

Set Locate_Mode To Smart_Locate
Set Size To 43 200
Set Caption_Bar To True
Set Label to "Please Wait"
Set Minimize_Icon To False
Set Maximize_Icon To False
Set Sysmenu_Icon To False
Set Color To clBtnFace
Set Border_Style To Border_Dialog

Object oWaitText is a Textbox
Set Label to "Message to display"
Set TextColor to clBlue
Set FontSize to 16 9
Set Location to 6 6
Set Size to 10 113
Set FontWeight to 800
Set TypeFace to "Arial"
End_Object // oTextBox1

End_Procedure


Procedure WaitBox String sLabel
Set Label of oWaitText to sLabel
Send Activate
End_Procedure

End_Class // cWaitBox

// At top of grid, above green line:
//=======================================
// Object oWaitBox Is A cWaitBox
// End_Object

// In the *same* grid object, when you fill the grid:
//================================================== ======
// Send WaitBox to oWaitBox "Searching customer database..."
// ..... do the fill grid stuff .....
// Send Close_Panel to oWaitBox

// If the oWaitBox object is not a child of the grid, it won't
// if the grid is called as part of Activating. God knows why.

================================================== ======

--
David Lack
FocusINet Ltd
dl@focusinet.com
Tel: 01453 753351