|
@@ -68,6 +68,8 @@ IMPLEMENT_CALLBACK( GuiWindowCtrl, onRestore, void, (), (),
|
|
|
"Called when the window is restored from minimized, maximized, or collapsed state." );
|
|
|
IMPLEMENT_CALLBACK(GuiWindowCtrl, onResize, void, (S32 posX, S32 posY, S32 width, S32 height), (0, 0, 0, 0),
|
|
|
"Called when the window is resized in a regular manner by mouse manipulation.");
|
|
|
+IMPLEMENT_CALLBACK(GuiWindowCtrl, onMouseDragged, void, (), (),
|
|
|
+ "Called when the height has changed.");
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
@@ -87,7 +89,8 @@ GuiWindowCtrl::GuiWindowCtrl()
|
|
|
mCollapseGroup(-1),
|
|
|
mCollapseGroupNum(-1),
|
|
|
mIsCollapsed(false),
|
|
|
- mIsMouseResizing(false)
|
|
|
+ mIsMouseResizing(false),
|
|
|
+ mButtonOffset(0, 3)
|
|
|
{
|
|
|
// mTitleHeight will change in instanciation most likely...
|
|
|
mTitleHeight = 24;
|
|
@@ -154,6 +157,8 @@ void GuiWindowCtrl::initPersistFields()
|
|
|
"Script code to execute when the window is closed." );
|
|
|
addField( "edgeSnap", TypeBool, Offset( mEdgeSnap,GuiWindowCtrl ),
|
|
|
"If true, the window will snap to the edges of other windows when moved close to them." );
|
|
|
+ addField( "buttonOffset", TypePoint2I, Offset (mButtonOffset, GuiWindowCtrl),
|
|
|
+ "Margin between window edge and the button(s).");
|
|
|
|
|
|
endGroup( "Window" );
|
|
|
|
|
@@ -1019,6 +1024,9 @@ void GuiWindowCtrl::onMouseDragged(const GuiEvent &event)
|
|
|
}
|
|
|
else // Normal window sizing functionality
|
|
|
resize(newPosition, newExtent);
|
|
|
+
|
|
|
+ // Add a callback for the GUI scripts
|
|
|
+ onMouseDragged_callback();
|
|
|
}
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
@@ -1409,7 +1417,7 @@ void GuiWindowCtrl::onRender(Point2I offset, const RectI &updateRect)
|
|
|
}
|
|
|
|
|
|
drawUtil->clearBitmapModulation();
|
|
|
- drawUtil->drawBitmapSR(mTextureObject, offset + mCloseButton.point, mBitmapBounds[bmp]);
|
|
|
+ drawUtil->drawBitmapSR(mTextureObject, mButtonOffset + offset + mCloseButton.point, mBitmapBounds[bmp]);
|
|
|
}
|
|
|
|
|
|
// Draw the maximize button
|
|
@@ -1428,7 +1436,7 @@ void GuiWindowCtrl::onRender(Point2I offset, const RectI &updateRect)
|
|
|
}
|
|
|
|
|
|
drawUtil->clearBitmapModulation();
|
|
|
- drawUtil->drawBitmapSR( mTextureObject, offset + mMaximizeButton.point, mBitmapBounds[bmp] );
|
|
|
+ drawUtil->drawBitmapSR( mTextureObject, mButtonOffset + offset + mMaximizeButton.point, mBitmapBounds[bmp] );
|
|
|
}
|
|
|
|
|
|
// Draw the minimize button
|
|
@@ -1447,7 +1455,7 @@ void GuiWindowCtrl::onRender(Point2I offset, const RectI &updateRect)
|
|
|
}
|
|
|
|
|
|
drawUtil->clearBitmapModulation();
|
|
|
- drawUtil->drawBitmapSR( mTextureObject, offset + mMinimizeButton.point, mBitmapBounds[bmp] );
|
|
|
+ drawUtil->drawBitmapSR( mTextureObject, mButtonOffset + offset + mMinimizeButton.point, mBitmapBounds[bmp] );
|
|
|
}
|
|
|
|
|
|
if( !mMinimized )
|