on 25-04-2006 22:21, CV at [EMAIL PROTECTED] wrote:

> 
> On Apr 25, 2006, at 7:23 AM, Erne wrote:
> 
>> Hello List,
>> 
>> I find this weird so I filed a report (uxmusysv):
>> 
>> Summary:
>> Coordinates of controls inside a Container are relative to their
>> initial position
>> 
>> Incorrect Functionality
>> 
>> Description
>> Coordinates of RectControls inside a ContainerControl are relative
>> to their container and that's fine,
>> but if you resize or move the ContainerControl and check for the
>> contained RectControls coordinates they're relative to their
>> container INITIAL position and not to its actual current position.
>> 
>> IDE Version
>> REALbasic 2006r2
>> 
>> Target and Platform Run on
>> Macintosh - OS X 10.4.5
>> 
>> Steps to Reproduce
>> Create a ContainerControl
>> Put a RectControl into it
>> Drag the ContainerControl into a resizable window
>> Lock it to the right
>> Run the app, resize the window and check the left coordinate of the
>> RectControl inside the ContainerControl
>> You see it's ever changing even if it's position relative to the
>> container is still the same
>> 
>> Workaround
>> Keep track of the initial position of the ContainerControl,
>> Subtract the actual ContainerControl coordinate value from that
>> initial position
>> and add that offset to the coordinates returned by contained controls
>> 
> 
> Yes, the behavior is the same on 2006r1 and I'm sure a bug is
> involved here.
> 
> The behavior of a Canvas containing a RectControl is interesting too.
> In 2006r1(I don't have access to r2 right now) a Canvas behaves
> similarly to the post-resize behavior of the ContainerControl as you
> describe above. In other words, if I drag a button onto a Canvas and
> put msgbox(me.Left) in the button, the coordinate returned is
> relative to the window, not the Canvas. Going back to 5.5, I see that
> this is not true. In 5.5 the coordinate reported is relative to the
> Canvas.
> 
> I wonder what the intended behavior is for a Canvas?; for a
> ContainerControl?
> 

I think that for a canvas the correct behaviour is contained controls coords
relative to the window

For ContainerControl should be (and in effect they are) contained controls
coords relative to the CC (since it is a window subclass and can live
outside a given window)

I found in fact that moving or resizing the CC via code resets the coords of
contained controls to the correct values so the easy workaround is to put:

me.Top = me.Top
me.Left = me.Left

in every appropriate event like Moved, Resized and Resizing


HTH


Cool Runnings,
Erne.
-- 

/ |\ |\  | /
­ |/ | \ | ­
\ |\ |  \| \


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to