Author Topic: Callback for GuiWindowCtrl being moved  (Read 2172 times)

Does such a callback exist, or will I have to resort to hacky loops?

No callback for moving, resizing, maximizing, or anything like that.

You could try packaging the ::resize command.

Quote
resize( ulX , ulY , width , height )
Purpose
Use the resize method to resize and/or re-position a control. The upper-left corner of
the control will be placed at <uliX, ulY> in its parent and the control will be given an
extent of "width height".
Syntax
ulX – The upper-left X coordinate of this control in pixels.
ulY – The upper-left Y coordinate of this control in pixels.
width – The width of this control in pixels.
height – The height of this control in pixels.
Returns
No return value.

Log original GUI size. Package resize to check for difference in GUI size. Ambiguously elaborating on what greek2me said

Less ambiguous
$OriginalGuiPosX = 123;
$OriginalGuiPosY = 321;
Package MyPackage
{
  Function ForgotThisOne::resize(%this, %ulX, %ulY)
  {
    If(!$OriginalGuiPosX == %ulX)
    {
      dostuff();
      ParentSmorstuff();
}
  }

};


Sent from my iDevice so sorry in advance for mistakes

Are you guys sure the re-size function can be packaged?

Are you guys sure the re-size function can be packaged?
"You have the source anything is possible nothing is disallowed" or something like that. That quote was given to me on the GG forums. This is true unless you are badspot in which case you can disallow stuff. Such as packaging GameConnection::OnConnect.
Only one way to find out

Are you guys sure the re-size function can be packaged?

I don't even know if it's called when the window is resized. It's just an idea.

I tried that already. I don't actually know or care if it works for resizing windows, but it does NOT work for dragging windows.

virtual void GuiCanvas::mouseLock   (   GuiControl *    lockingControl    )     [virtual]
When a control gets the mouse lock this means that that control gets ALL mouse input and no other control recieves any input.

Parameters:
lockingControl    Control to lock mouse to
Reimplemented from GuiControl.


virtual void GuiCanvas::mouseUnlock   (   GuiControl *    lockingControl    )     [virtual]
Unlocks the mouse from a control.


This may not be exactly what your looking for but if you were trying to make sure that the user only inputs on your GUI this would do it.

Just searched the whole GuiCanvas class reference and found nothing for resizing the window

"GuiScriptNotifyCtrl Class Reference:

bool    onChildResized"

Close?


Found it!
void    onResize (SimObjectId ID)
http://docs.garagegames.com/torque-3d/reference/classGuiScriptNotifyCtrl.html
Did I win?
 :cookieMonster:

I don't think we're using this version of Torque.

I tried that already. I don't actually know or care if it works for resizing windows, but it does NOT work for dragging windows.

If the dragging is going to be done only by a user, maybe you can put a mouse control event in the blue box (top of the control) and call functons when a mouse enters and exits it respectively.