[Gambas-user] Feature Request: Reparent function behaviour change.

Steven James Drinnan steven at ...2097...
Fri Nov 6 02:49:12 CET 2009


Beniot - I tough I'd better break this out as it does not relate to the
original thread.

Lets say that you have a label name 'label1' and 2 frames named frame1
and 'frame2'. And you placed 'label1' in 'frame1'. For some reason you
wish to move in code. So you use the 'reparent' function. 

The pseudo code

frame1.move(10,10,100,100) 
frame1.move(500,10,100,100) 

label1.X = 10
label1.Y = 10 

'the label box is already in 'frame1' so it has relative x y position to
'frame1'

'now reparent the label

label1.reparent(frame2)

Now what happens is that frame2 now moves to X and Y location of the
label. If you use ...

label1.reparent(frame2,500,10)

the frame is in the correct place but 'label1' has now got x=0 and y=0

I would like to see the following default behavior: 
	1. New parent retains its properties. I.e stay where it is and does not
move.
	2. The label gets re-parented and all all its values remain the same.
	3. The x and y optional values should be for new position for the
control inside the new parent.

If you are not sure what I mean take a look at the enclosed example.
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Reparent.tar.gz
Type: application/x-compressed-tar
Size: 9283 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20091106/e5dc813a/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20091106/e5dc813a/attachment.sig>


More information about the User mailing list