mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 13:23:53 +00:00
Make InfoBoxDialog use the new WindowBase
This commit is contained in:
parent
6c7f59725f
commit
0d97200e18
2 changed files with 3 additions and 16 deletions
|
@ -291,8 +291,7 @@ void InfoBoxDialog::layoutVertically(MyGUI::WidgetPtr widget, int margin)
|
|||
}
|
||||
|
||||
InfoBoxDialog::InfoBoxDialog(MWWorld::Environment& environment)
|
||||
: Layout("openmw_infobox_layout.xml")
|
||||
, environment(environment)
|
||||
: WindowBase("openmw_infobox_layout.xml", environment)
|
||||
, currentButton(-1)
|
||||
{
|
||||
getWidget(textBox, "TextBox");
|
||||
|
@ -373,16 +372,6 @@ void InfoBoxDialog::onButtonClicked(MyGUI::WidgetPtr _sender)
|
|||
}
|
||||
}
|
||||
|
||||
void InfoBoxDialog::center()
|
||||
{
|
||||
// Centre dialog
|
||||
MyGUI::IntSize gameWindowSize = environment.mWindowManager->getGui()->getViewSize();
|
||||
MyGUI::IntCoord coord = mMainWidget->getCoord();
|
||||
coord.left = (gameWindowSize.width - coord.width)/2;
|
||||
coord.top = (gameWindowSize.height - coord.height)/2;
|
||||
mMainWidget->setCoord(coord);
|
||||
}
|
||||
|
||||
/* ClassChoiceDialog */
|
||||
|
||||
ClassChoiceDialog::ClassChoiceDialog(MWWorld::Environment& environment)
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include <MyGUI.h>
|
||||
|
||||
#include "widgets.hpp"
|
||||
#include "window_base.hpp"
|
||||
|
||||
namespace MWWorld
|
||||
{
|
||||
|
@ -23,7 +24,7 @@ namespace MWGui
|
|||
{
|
||||
using namespace MyGUI;
|
||||
|
||||
class InfoBoxDialog : public OEngine::GUI::Layout
|
||||
class InfoBoxDialog : public WindowBase
|
||||
{
|
||||
public:
|
||||
InfoBoxDialog(MWWorld::Environment& environment);
|
||||
|
@ -49,9 +50,6 @@ namespace MWGui
|
|||
void onButtonClicked(MyGUI::WidgetPtr _sender);
|
||||
|
||||
private:
|
||||
void center();
|
||||
|
||||
MWWorld::Environment& environment;
|
||||
|
||||
void fitToText(MyGUI::StaticTextPtr widget);
|
||||
void layoutVertically(MyGUI::WidgetPtr widget, int margin);
|
||||
|
|
Loading…
Reference in a new issue