1. Ronnie Po
  2. PowerBuilder
  3. Tuesday, 2 August 2022 17:37 PM UTC

Most controls in a DataWindow object - column, compute, text, etc. - have .Moveable and .Resizeable properties (misspelled in the DW painter BTW). When these are enabled, then the user, as expected, can move and resize the controls at runtime. Is there an event, custom or otherwise, where I can trap whenever this moving or resizing occurs?

Olan Knight Accepted Answer Pending Moderation
  1. Tuesday, 2 August 2022 22:56 PM UTC
  2. PowerBuilder
  3. # 1

Won't the RESIZE event in the DW capture the change in size when a user resizes the dw?

When the user moves an object, they always use the MOUSE. Therefore I'd put code in the LBUTTONUP event of the datawindow and check for the X and Y positions.

1. Capture the X and Y positions when you open the DW, and set those values in ll_Current_x and ll_current_y;
    then set ll_prev_x = 0 and ll_prev_y = 0

In the LBUTTONUP event check the current X and Y against the ll_current_X and ll_current_Y values, and if they are different, then reset your variables and you know the control has been moved.

 

Comment
  1. Roland Smith
  2. Wednesday, 3 August 2022 01:59 AM UTC
He is talking about resizing the column/label controls on the datawindow itself.
  1. Helpful 1
  1. Olan Knight
  2. Wednesday, 3 August 2022 13:36 PM UTC
Doh!

Thanks, Roland!
  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Tuesday, 2 August 2022 19:27 PM UTC
  2. PowerBuilder
  3. # 2

HI, Ronnie -

I think the best you can do is check the DataWindow.Syntax.Modified property in the LButtonUp event. If "yes" is returned, something in the DW's internal structure/layout has changed. Of course, this property can also become "yes" if sorting or filtering has changed, so it's not a slam dunk.

Regards, John

Comment
  1. John Fauss
  2. Tuesday, 2 August 2022 21:07 PM UTC
I understand where you're coming from. After thinking about this a little more, if it was me doing this, I would note when the mousemove event occurred with only the left mouse button down (indicating a drag or lasso operation in progress), then check Syntax.Modified in the LButtonUp event only if a possible drag operation had been observed.
  1. Helpful
  1. Ronnie Po
  2. Tuesday, 2 August 2022 21:28 PM UTC
Good ideas! I should be able to get pretty close to the desired result with those events and checking Syntax.Modified. Thanks again John.
  1. Helpful
  1. John Fauss
  2. Tuesday, 2 August 2022 22:28 PM UTC
FYI - You can "reset" or explicitly set Syntax.Modified to "no" in the LButtonDown event or at the end of the Clicked event. I hope this works for you!
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.