Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why doesn't this Status Message form show immediately
Message
De
31/08/2006 19:25:15
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Why doesn't this Status Message form show immediately
Divers
Thread ID:
01150265
Message ID:
01150265
Vues:
86
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform