Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ActivePage Works Only During Trace/Debug
Message
De
02/08/2001 19:32:42
Nancy Folsom
Pixel Dust Industries
Washington, États-Unis
 
 
À
02/08/2001 10:42:51
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00538807
Message ID:
00539150
Vues:
13
>>From a button on Page3 of a pageframe, calling SetFocus for an object on Page2 and setting ActivePage = 2 leaves Page3 visible instead of Page2. Except when I Suspend and then immediately Resume from the debugger it does display correctly. Is this a Refresh issue? I have used the Event Tracking, but still can't seem to see why Page2 will not display. Everything says that it should be, but it's not. Also, it seems that the Page3.Activate occurs right after the Page2.Object.SetFocus call from the button on Page3. Why would that happen? Event Tracking shows me when events are fired; is there anything that tells e why? Thanks!
>
>Ok, it works now. All I did was move the SetFocus and ActivePage outside a conditional logic.
>
>This does not work:
>
>
>If ThisCondition
>   Stay on Page3
>Else
>   Page2.Object.SetFocus
>   ActivePage = 2
>Endif
>
>
>This does:
>
>
>If ThisCondition
>   Stay on Page3
>   Return
>Endif
>
>Page2.Object.SetFocus
>ActivePage = 2
>
>
>
>Still curious about why and the other stuff I mentioned.

Curious. I don't know what the code really is, so can't really hzard a guess, but I tried it to see if a NODEFAULT was required. I couldn't remember off the top of my head, but it doesn't seem to be a problem. It seems to work like you were expecting it to. What version of VFP (and build #) are you using?

I ran this in VFP 7.0 Build 9262, but I don't really think anything's changed from 6.0
PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.SHOW
RETURN


*-- Form:         form1 (c:\nec\temp.scx)
*-- ParentClass:  form
*-- BaseClass:    form
*-- Time Stamp:   08/02/01 04:09:01 PM
*
DEFINE CLASS form1 AS FORM


	TOP = 0
	LEFT = 0
	HEIGHT = 295
	WIDTH = 416
	DOCREATE = .T.
	CAPTION = "Form1"
	VISIBLE = .T.
	NAME = "Form1"

	PROCEDURE INIT

	WITH THIS
		.ADDOBJECT( "pageframe1", "PAGEFRAME" )
		WITH .pageframe1

			.PAGECOUNT = 1
			.TOP = 49
			.LEFT = 79
			.WIDTH = 241
			.HEIGHT = 169

			WITH .Page1
				.CAPTION = "Page1"
				.ADDOBJECT( "text1", "TEXTBOX" )
				.ADDOBJECT( "text2", "TEXTBOX" )
				.Text2.TOP = 40
				.SETALL("Visible",.T.)
			ENDWITH

			.ADDOBJECT('Page2', 'MyPage')

			WITH .Page2
				.CAPTION = "Page2"
			ENDWITH

			.ACTIVEPAGE = 1
			.VISIBLE = .T.
		ENDWITH

	ENDWITH


ENDPROC


ENDDEFINE
*
*-- EndDefine: form1
**************************************************

DEFINE CLASS MyPage AS PAGE
	PROCEDURE ACTIVATE
	IF !EMPTY( THIS.PARENT.Page1.Text2.VALUE )
		WAIT "Okey dokey!" WINDOW TIMEOUT .5
	ELSE
		THIS.PARENT.Page1.Text2.VALUE = "Feed me!"
		THIS.PARENT.Page1.Text2.SETFOCUS()
		THIS.PARENT.ACTIVEPAGE = 1
	ENDIF
ENDPROC
ENDDEFINE
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform