EGDS_MESSAGE_BOX_HEIGHT is now honoured, reported by Spkka

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2243 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
bitplane 2009-02-28 14:14:51 +00:00
parent 2940de0112
commit 410b95f946
2 changed files with 21 additions and 14 deletions

View File

@ -1,5 +1,10 @@
Changes in 1.6
- Fixed a bug in the edit box where events are sometimes sent to a null parent, reported by Sudi
- EGDS_MESSAGE_BOX_HEIGHT is now honoured, bug reported by Spkka
- Fixed a bug in the edit box where events are sometimes sent to a null parent, reported by Sudi.
- Coordinate system fix for OpenGL in SDL device
- Added generic console device. You can now use Irrlicht to create and manipuate graphics on a shell where no graphics hardware
or windowing system is available. To enable it uncomment #define _IRR_USE_CONSOLE_DEVICE_ in IrrCompileConfig.h

View File

@ -80,7 +80,7 @@ void CGUIMessageBox::refreshControls()
// add static multiline text
core::dimension2d<s32> dim(AbsoluteClippingRect.getWidth() - buttonWidth,
AbsoluteClippingRect.getHeight() - (buttonHeight * 3));
AbsoluteClippingRect.getHeight() - (buttonHeight * 2));
const core::position2d<s32> pos((AbsoluteClippingRect.getWidth() - dim.Width) / 2,
buttonHeight / 2 + titleHeight);
@ -104,12 +104,13 @@ void CGUIMessageBox::refreshControls()
core::rect<s32> tmp = StaticText->getRelativePosition();
tmp.LowerRightCorner.Y = tmp.UpperLeftCorner.Y + textHeight;
StaticText->setRelativePosition(tmp);
dim.Height = textHeight;
dim.Height = dim.Height - buttonHeight < tmp.getHeight() ? tmp.getHeight() : dim.Height - buttonHeight;
// adjust message box height
// adjust message box height if required
tmp = getRelativePosition();
s32 msgBoxHeight = textHeight + core::floor32(2.5f * buttonHeight) + titleHeight;
msgBoxHeight = tmp.getHeight() < msgBoxHeight ? msgBoxHeight : tmp.getHeight();
// adjust message box position
@ -133,7 +134,8 @@ void CGUIMessageBox::refreshControls()
btnRect.UpperLeftCorner.Y = pos.Y + dim.Height + buttonHeight / 2;
btnRect.LowerRightCorner.Y = btnRect.UpperLeftCorner.Y + buttonHeight;
btnRect.UpperLeftCorner.X = (AbsoluteClippingRect.getWidth() -
((buttonWidth + buttonDistance)*countButtons)) / 2;
(buttonWidth*countButtons + (buttonDistance*countButtons+1))) / 2 +
buttonDistance / 2;
btnRect.LowerRightCorner.X = btnRect.UpperLeftCorner.X + buttonWidth;
// add/remove ok button