System.gui.transform error trying to resize container

i am trying to resize the container width when i drag the line . its working

but when i drag the line. line is not visible i don’t know where i am making mistake.

can any one check the video and script and give correct solution.

Is the line you’re dragging part of the ‘Dial Template’ that you’re making wider?

no its not part of it . dial template is actually a container

line is belong to root container

can you give correct script for this issue

You’re transforming the Dial Template only, you’re not moving the line, so it’s staying still. You can see it still there in the gaps. You need to transform the line as well

line = event.source
component = event.source.parent.getComponent('Dial Template')

mouseX = event.x
lineX = line.getX()
lineY = line.getY()

newComponentWidth = component.width + mouseX
newLineX = lineX + mouseX

system.gui.transform(component, newwidth = newComponentWidth, duration = 10)
system.gui.transform(line, newLineX, lineY, duration = 10)

its not working wrongly when i press the line ( Dial template container expands to same range)

i just what to drag the line and want the container to expand

i have pasted your script in mouse dragged

is there anything to change?

whether i have to put the line inside the (dial template container)???

i don’t want line to scale upwards . i want move sides only

Here’s the window I developed against.

dragTest_2021-03-09_0646.zip (3.4 KB)

yes its working i checked i will use this. thanks for your support

You should have all the code you need, you just need to apply the same concepts to the other container

1 Like

This example

  • will calculate by the margins between the line and other components
  • has margins as limits to not run beyond the component locations

DragTest2.zip (3.8 KB)

script working fine for margin control for not run beyond the component locations . but still space between (left side container and line) and (right side container and line is not equal). i have executed your script in client

this is the issue i am facing spacing between container and line is not equal

You’ll need to take the width of your line component into account, and adjust your math accordingly.

1 Like

yes i have hard coded the value its working fine

One dobut scripting is working fine but right container size is vary depending upon the windows size (example HD display and for Full HD display) size of the container changing.
I tired anchoring and relative both not working properly.

How to automatic resize the conatiner width and position depends upon the window size?

Whether I need to get window size and do some calculation?

Try setting the coordinate space of the transform function to use the Designer space. The default is the screen coords which will stuff up your values.
E.g.

system.gui.transform(...., coordSpace=system.gui.COORD_DESIGNER)
1 Like