mmenti
03-14-2006, 09:03 AM
Hi there,
I have a view that has both a dragstate and a resizestate. It contains a subview (in the bottom right corner). If there is a mousedown event on the subview, the parent view gets resized, and if there is a mousedown event on the parent view, the parent view gets dragged.
The aim is basically to resize the view if the user clicks somewhere near the bottom right corner, and drag it if the user clicks anywhere else.
It works, with one exception: for some reason, whenever the resizestate is applied, the "x" coordinate of the view is lost, and/or set to "0", so it jumps to the left, rather than being resized in place.
From debugging I can see that just before the resizestate is applied, the x value is OK, but inside the "onapply" event of the resizestate, the x value is 0. Changing it by force inside the "onapply" event doesn't seem to help, it's already moved at that point.
To illustrate, you can see an example here: http://www.msurveys.com/testcase/
Drag the rectangle, then click on the resize arrow in the bottom right corner -> the rectangle jumps back to the left.
Code for this simple test case is attached.
Any help/pointers appreciated!
Cheers,
Mario.
I have a view that has both a dragstate and a resizestate. It contains a subview (in the bottom right corner). If there is a mousedown event on the subview, the parent view gets resized, and if there is a mousedown event on the parent view, the parent view gets dragged.
The aim is basically to resize the view if the user clicks somewhere near the bottom right corner, and drag it if the user clicks anywhere else.
It works, with one exception: for some reason, whenever the resizestate is applied, the "x" coordinate of the view is lost, and/or set to "0", so it jumps to the left, rather than being resized in place.
From debugging I can see that just before the resizestate is applied, the x value is OK, but inside the "onapply" event of the resizestate, the x value is 0. Changing it by force inside the "onapply" event doesn't seem to help, it's already moved at that point.
To illustrate, you can see an example here: http://www.msurveys.com/testcase/
Drag the rectangle, then click on the resize arrow in the bottom right corner -> the rectangle jumps back to the left.
Code for this simple test case is attached.
Any help/pointers appreciated!
Cheers,
Mario.