Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Strange Problem - Height & Width Not Found
Message
From
29/10/2007 20:17:23
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
01264812
Message ID:
01264929
Views:
15
Have you shutdown your computer, restarted and then tried to see height and width?

>No, nothing in this class is hidden.
>
>
>
>>Just thought, is the shpBorder object set to hidden?
>>
>>>Ok, I'm really miffed here. I have no clue why this is happening.
>>>
>>>Here's the code that adds the panel to the page on the pageframe:
>>>
>>>
>>>** Add the panel to the page
>>>oPage.AddObject("MyPanel", sPanelClass)
>>>
>>>** Get a reference to the panel
>>>oPanel = .pgfPages.Pages(iNewPage).Controls(1)
>>>
>>>** Set up the panel
>>>WITH oPanel
>>>
>>>	.Left = 0
>>>	.Top = 0
>>>	.Height = .Parent.Parent.Height
>>>	.Width = .Parent.Parent.Width
>>>	.Resize()
>>>	.Setup()
>>>	.Visible = TRUE
>>>
>>>ENDWITH
>>>
>>>
>>>And here's the Resize code from the Panel class:
>>>
>>>
>>>WITH This
>>>
>>>  .shpBorder.Height = .Height - (.shpBorder.Top * 2)
>>>  .shpBorder.Width = .Width - (.shpBorder.Left * 2)
>>>
>>>ENDWITH
>>>
>>>RETURN
>>>
>>>
>>>
>>>When I step into the Resize, the .shpBorder object becomes inaccessable. When I step out of the resize,
>>>the .shpBorder object is then accessable. While in Resize, all the shape's PEM's disappear.
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>>>The Shape was placed on the container in Design time, not Run-time.
>>>>>
>>>>>I have tried removing the shape and adding it on code, and then all works ok. When I added
>>>>>it back on in the designer, this problem started again.
>>>>
>>>>All I can think of is another SWAG - is it possible the container (call it ChildContainer) is itself contained in something else (call it ParentContainer), and that when you're adding the Shape you're by mistake adding it as a child of ParentContainer instead of ChildContainer? It's an easy mistake to make, I've done it multiple times myself. It should be easy to check, though, in the hierarchy of controls in the Properties window.
>>>>
>>>>>>>I am creating a tab set for displaying multiple pages on the desktop, just like VS and SQL do.
>>>>>>>
>>>>>>>I have created a container with a pageframe on it called App_TabSet.
>>>>>>>
>>>>>>>App_TabSet has an AddPane method. A Pane is just a container that gets added to a new page on
>>>>>>>the App_TabSet pageframe.
>>>>>>>
>>>>>>>The Resize of App_TabSet loops through all the pages on the pageframe and calls the Resize of
>>>>>>>the pane container on each page.
>>>>>>>
>>>>>>>The base class Pane container has a shape on it, as a border around the edge. The resize of
>>>>>>>this base class Pane container has:
>>>>>>>
>>>>>>>
>>>>>>>This.shpBorder.Height = This.Height - (This.shpBorder.Top * 2)
>>>>>>>This.shpBorder.Width = This.Width - (This.shpBorder.Left * 2)
>>>>>>>
>>>>>>>
>>>>>>>The 'This.Height' and 'This.Width' parts are ok. In the debugger I can see their values.
>>>>>>>
>>>>>>>But any reference to This.shpBorder appears in the debugger as an object, but the '+' sign
>>>>>>>to expand the object and look at its properties is not there. When I drag 'This.shpBorder.Top'
>>>>>>>down into the Watch Window, it cannot be evaluated.
>>>>>>>
>>>>>>>The Pane and the Shape are native VFP controls, not subclassed. All PEM's are public.
>>>>>>>
>>>>>>>Anyone know what is happening here?
>>>>>>
>>>>>>Just a SWAG - if you're adding shapes via AddObject, might you need to set .Visible = .T. before you start manipulating properties?
I ain't skeert of nuttin eh?
Yikes! What was that?
Previous
Reply
Map
View

Click here to load this message in the networking platform