Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BUG: OBJTOCLIENT(oPage,) return wrong values
Message
From
25/06/2004 12:18:44
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro Beta
Title:
BUG: OBJTOCLIENT(oPage,) return wrong values
Miscellaneous
Thread ID:
00917285
Message ID:
00917285
Views:
58
VFP : 6,7,8,9b

Observed:
the OBJTOCLIENT(oPage,1|2|3|4) return the values relative to the default Pageframe size (375,250);
only after that the PageFrame is painted, the OBJTOCLIENT values are correct.

Expected: OBJTOCLIENT(oPage,1|2|3|4) have to return correct values before the first paint event.

The next code SHOW only a different value for the OBJTOCLIENT(,1):
PUBLIC oform1

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

DEFINE CLASS form1 AS form

	Height = 356
	Width = 652
	DoCreate = .T.
	AutoCenter = .T.
	Caption = "Form1"
	AllowOutput = .F.
	Name = "Form1"


	ADD OBJECT pageframe1 AS pageframe WITH ;
		ErasePage = .T., ;
		PageCount = 2, ;
		Top = 10, ;
		Left = 25, ;
		Name = "Pageframe1", ;
		Page1.Caption = "Page1", ;
		Page1.Name = "Page1", ;
		Page2.Caption = "Page2", ;
		Page2.Name = "Page2"


	ADD OBJECT pageframe2 AS pageframe WITH ;
		ErasePage = .T., ;
		PageCount = 2, ;
		Top = 20, ;
		Left = 400, ;
		Width = 200, ;
		Height = 150, ;
		Name = "Pageframe2", ;
		Page1.FontSize = 15, ;
		Page1.Caption = "Page1", ;
		Page1.Name = "Page1", ;
		Page2.Caption = "Page2", ;
		Page2.Name = "Page2"


	PROCEDURE Activate
		? '------ FORM ACTIVATE -------'
		? "PAGEFRAME DEFAULT","Objtoclient"
		? OBJTOCLIENT(this.pageframe1.Pages[1],3),"Expected .",this.pageframe1.PageWidth
		? OBJTOCLIENT(this.pageframe1.Pages[1],4),"Expected .",this.pageframe1.Pageheight
		? OBJTOCLIENT(this.pageframe1.Pages[1],1),OBJTOCLIENT(this.pageframe1.Pages[1],2)," Observe the first value"

		? "PAGEFRAME NOT DEFAULT"," BUG: OBJTOCLIENT return the Page Height and Width relative to the default PageFrame size"
		? OBJTOCLIENT(this.pageframe2.Pages[1],3),"Expected .",this.pageframe2.PageWidth
		? OBJTOCLIENT(this.pageframe2.Pages[1],4),"Expected .",this.pageframe2.Pageheight
		? OBJTOCLIENT(this.pageframe2.Pages[1],1),OBJTOCLIENT(this.pageframe2.Pages[1],2)," Observe the first value"
	ENDPROC


	PROCEDURE Init
		? '------ FORM INIT -------'
		? "PAGEFRAME DEFAULT","Objtoclient"
		? OBJTOCLIENT(this.pageframe1.Pages[1],3),"Expected .",this.pageframe1.PageWidth
		? OBJTOCLIENT(this.pageframe1.Pages[1],4),"Expected .",this.pageframe1.Pageheight
		? OBJTOCLIENT(this.pageframe1.Pages[1],1),OBJTOCLIENT(this.pageframe1.Pages[1],2)," Observe this"

		? "PAGEFRAME NOT DEFAULT"," BUG: OBJTOCLIENT return the Page Height and Width relative to the default PageFrame size"
		? OBJTOCLIENT(this.pageframe2.Pages[1],3),"Expected .",this.pageframe2.PageWidth
		? OBJTOCLIENT(this.pageframe2.Pages[1],4),"Expected .",this.pageframe2.Pageheight
		? OBJTOCLIENT(this.pageframe2.Pages[1],1),OBJTOCLIENT(this.pageframe2.Pages[1],2)," Observe this"
	ENDPROC


	PROCEDURE Load
		CLEAR
	ENDPROC


	PROCEDURE Paint
		? 'Paint'
	ENDPROC

ENDDEFINE
Observed output:
------ FORM INIT -------
PAGEFRAME DEFAULT Objtoclient
       371 Expected .        371
       224 Expected .        224
        34         26  Observe this
PAGEFRAME NOT DEFAULT  BUG: OBJTOCLIENT return the Page Height and Width relative to the default PageFrame size
       196 Expected .        196
       124 Expected .        124
        44        401  Observe this
Paint
------ FORM ACTIVATE -------
PAGEFRAME DEFAULT Objtoclient
       371 Expected .        371
       224 Expected .        224
        38         26  Observe the first value
PAGEFRAME NOT DEFAULT  BUG: OBJTOCLIENT return the Page Height and Width relative to the default PageFrame size
       196 Expected .        196
       124 Expected .        124
        64        401  Observe the first value
If you replicate this into a SCX, you have this output.
------ FORM INIT -------
PAGEFRAME DEFAULT Objtoclient
       371 Expected .        371
       224 Expected .        224
        28          1
PAGEFRAME NOT DEFAULT  BUG: OBJTOCLIENT return the Page Height and Width relative to the default PageFrame size
       371 Expected .        196
       224 Expected .        104
        28          1
Paint
------ FORM ACTIVATE -------
PAGEFRAME DEFAULT Objtoclient
       371 Expected .        371
       224 Expected .        224
        38         26
PAGEFRAME NOT DEFAULT  BUG: OBJTOCLIENT return the Page Height and Width relative to the default PageFrame size
       196 Expected .        196
       104 Expected .        104
        64        401
Next
Reply
Map
View

Click here to load this message in the networking platform