This Question is Answered

1 "correct" answer available (5 pts) 14 "helpful" answers available (3 pts)
4 Replies Last post: Jul 20, 2008 6:44 PM by Rams

Changing controls's location

Jul 19, 2008 6:58 PM

Click to view Rams's profile Level 1 Rams 17 posts since
Jun 5, 2008

Using VLE, when a control is added to a canvas, values for "x" and "y" (the relative location on the canvas) are set.

Is there a way to change these values ... for example say...if the control needs to be moved as the canvas is resized?

Thank you

-Rams

Click to view Duke's profile Curl Duke 154 posts since
Oct 17, 2007
1. Re: Changing controls's location Jul 19, 2008 8:09 PM
Somebody else probably has better layout design advice, since I have not used the VLE that much. But if you are concerned about resizing, you might want to change your layout from using a canvas. You can make a new layout with a different container as the outermost container, such as a VBox. Then you can nest other things inside of that, and it will resize more flexibly. You could put a canvas inside of some of these other containers.
Click to view Rams's profile Level 1 Rams 17 posts since
Jun 5, 2008
2. Re: Changing controls's location Jul 19, 2008 10:43 PM
in response to: Duke

Just to clarify -

Resizing the Canvas works fine.. and through the resize-action proc I am able to change some of the properties of the controls on the Canvas..

For example, I am able to change the 'width' of a control from the resize-action proc.

Question is - how to re-position the controls on the canvas, based on canvas.actual-width and canvas.actual-height ? Can we set 'x' and 'y' at run-time?

Thank you

-Rams

Click to view fukuta's profile BlackBelt fukuta 105 posts since
Oct 17, 2007
3. Re: Changing controls's location Jul 20, 2008 4:05 AM
in response to: Rams
Canvas.add method accepts x = and y = keyword parameters, these are used to determine the position of a graphic on the canvas.
Click to view Rams's profile Level 1 Rams 17 posts since
Jun 5, 2008
4. Re: Changing controls's location Jul 20, 2008 6:44 PM
in response to: fukuta

Thanks for the information.

Could reposition the controls using canvas.move-to-xy and canvas.shift-to-xy methods.

-Rams