Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why doesn't this Status Message form show immediately
Message
From
31/08/2006 19:25:15
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Why doesn't this Status Message form show immediately
Miscellaneous
Thread ID:
01150265
Message ID:
01150265
Views:
85
Below is a little StatusMessage program which I picked up and modified ... the intent is to provide a little form in the middle of the screen during long operations to deceive the user into thinking that the computer is actually doing something.

However, when called, the form doesn't always show immediately; or, it shows just the outline and not the label inside, so it looks like just a simple transparent box.

Any ideas for changes at the end of the program, after it's all been created, to insure that it displays properly?

TIA,

James (Jim) Nelson
Parameters gcPrompt, lnXCenter, lnYCenter

*....... pauser.prg  .....

If Not Empty(gcPrompt)
	Release goPausing
	Public goPausing

	Local loTopLevelForm
	loTopLevelForm = GetTopLevelForm()
	goPausing = Createobject("ShowWindow1")

	*!*		If "O" = Vartype(loTopLevelForm)
	*!*			With loTopLevelForm
	*!*				SaveEventHistory(["] + gcPrompt + ["] + " - Message on ["+.Name+"]"+CR+"Form Name ["+.c_SourceFileName+"]"+CR+"  Caption ["+.Caption+"]", .T. )
	*!*			Endwith
	*!*		Endif

	If loTopLevelForm.ShowWindow # 2
		If Not _Screen.Visible
			_Screen.Visible=.T.
			goPausing.HideScreen = .T.
		Endif
	Endif

	With goPausing
		.WindowType = 0
		.Height 		= 36
		.Width 		= 134 && apparently, the minimum!
		.Caption 	= ""
		.Name 		= "pauser"
		.TitleBar	= 0

		.AddObject('myLabel','Label')
		With .myLabel
			.FontBold 	= .T.
			.FontSize 	= 9
			.Left 		= 20
			.Top 			= 10
			.Width 		= 20
			.Name 		= "myLabel"
			.ForeColor 	= Rgb(255,0,0)
			.BackStyle 	= 0
			.Caption		= gcPrompt
			.AutoSize	= .T.
			.Visible		= .T.
		Endwith

		.Width=.myLabel.Width+40
		.myLabel.Left = (.Width - .myLabel.Width)/2
		If Pcount() >= 3
			.Left = lnXCenter - .Width / 2
			.Top = lnYCenter - .Height / 2
		Else
			.AutoCenter = .T.
		Endif
		.Show
		.Refresh
	Endwith

Else
	If "O"=Vartype("goPausing") And goPausing.HideScreen
		_Screen.Visible=.F.
	Endif
	Release goPausing
Endif

Return


Define Class ShowWindow1 As Form
	ShowWindow = 1
	HideScreen = .F.
Enddefine
Jim Nelson
Newbury Park, CA
Next
Reply
Map
View

Click here to load this message in the networking platform