Renamed handleScreenChanged() -> reflowLayout() in the GUI code
svn-id: r23662
This commit is contained in:
parent
ca7880df6c
commit
1a10cacfb9
23 changed files with 60 additions and 60 deletions
|
@ -262,7 +262,7 @@ SaveLoadChooser::SaveLoadChooser(const String &title, const String &buttonLabel,
|
||||||
_chooseButton = new GUI::ButtonWidget(this, "scummsaveload_choose", buttonLabel, kChooseCmd, 0);
|
_chooseButton = new GUI::ButtonWidget(this, "scummsaveload_choose", buttonLabel, kChooseCmd, 0);
|
||||||
_chooseButton->setEnabled(false);
|
_chooseButton->setEnabled(false);
|
||||||
|
|
||||||
handleScreenChanged();
|
reflowLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
SaveLoadChooser::~SaveLoadChooser() {
|
SaveLoadChooser::~SaveLoadChooser() {
|
||||||
|
@ -322,7 +322,7 @@ void SaveLoadChooser::handleCommand(CommandSender *sender, uint32 cmd, uint32 da
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SaveLoadChooser::handleScreenChanged() {
|
void SaveLoadChooser::reflowLayout() {
|
||||||
if (g_gui.evaluator()->getVar("scummsaveload_extinfo.visible") == 1) {
|
if (g_gui.evaluator()->getVar("scummsaveload_extinfo.visible") == 1) {
|
||||||
int thumbX = g_gui.evaluator()->getVar("scummsaveload_thumbnail.x");
|
int thumbX = g_gui.evaluator()->getVar("scummsaveload_thumbnail.x");
|
||||||
int thumbY = g_gui.evaluator()->getVar("scummsaveload_thumbnail.y");
|
int thumbY = g_gui.evaluator()->getVar("scummsaveload_thumbnail.y");
|
||||||
|
@ -365,7 +365,7 @@ void SaveLoadChooser::handleScreenChanged() {
|
||||||
_playtime->setFlags(GUI::WIDGET_INVISIBLE);
|
_playtime->setFlags(GUI::WIDGET_INVISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
Dialog::handleScreenChanged();
|
Dialog::reflowLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SaveLoadChooser::updateInfos() {
|
void SaveLoadChooser::updateInfos() {
|
||||||
|
@ -512,17 +512,17 @@ void MainMenuDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainMenuDialog::handleScreenChanged() {
|
void MainMenuDialog::reflowLayout() {
|
||||||
ScummDialog::handleScreenChanged();
|
ScummDialog::reflowLayout();
|
||||||
|
|
||||||
_optionsDialog->handleScreenChanged();
|
_optionsDialog->reflowLayout();
|
||||||
_aboutDialog->handleScreenChanged();
|
_aboutDialog->reflowLayout();
|
||||||
|
|
||||||
_saveDialog->handleScreenChanged();
|
_saveDialog->reflowLayout();
|
||||||
_loadDialog->handleScreenChanged();
|
_loadDialog->reflowLayout();
|
||||||
|
|
||||||
#ifndef DISABLE_HELP
|
#ifndef DISABLE_HELP
|
||||||
_helpDialog->handleScreenChanged();
|
_helpDialog->reflowLayout();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -556,7 +556,7 @@ void MainMenuDialog::load() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainMenuDialog::open() {
|
void MainMenuDialog::open() {
|
||||||
handleScreenChanged();
|
reflowLayout();
|
||||||
Dialog::open();
|
Dialog::open();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -686,8 +686,8 @@ HelpDialog::HelpDialog(const GameSettings &game)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void HelpDialog::handleScreenChanged() {
|
void HelpDialog::reflowLayout() {
|
||||||
ScummDialog::handleScreenChanged();
|
ScummDialog::reflowLayout();
|
||||||
|
|
||||||
_drawingHints &= ~GUI::THEME_HINT_SPECIAL_COLOR;
|
_drawingHints &= ~GUI::THEME_HINT_SPECIAL_COLOR;
|
||||||
|
|
||||||
|
@ -781,10 +781,10 @@ void InfoDialog::setInfoText(const String& message) {
|
||||||
// Width and height are dummy
|
// Width and height are dummy
|
||||||
_text = new StaticTextWidget(this, 4, 4, 10, 10, _message, kTextAlignCenter);
|
_text = new StaticTextWidget(this, 4, 4, 10, 10, _message, kTextAlignCenter);
|
||||||
|
|
||||||
handleScreenChanged();
|
reflowLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
void InfoDialog::handleScreenChanged() {
|
void InfoDialog::reflowLayout() {
|
||||||
const int screenW = g_system->getOverlayWidth();
|
const int screenW = g_system->getOverlayWidth();
|
||||||
const int screenH = g_system->getOverlayHeight();
|
const int screenH = g_system->getOverlayHeight();
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,7 @@ public:
|
||||||
void setList(const StringList& list);
|
void setList(const StringList& list);
|
||||||
int runModal();
|
int runModal();
|
||||||
|
|
||||||
void handleScreenChanged();
|
void reflowLayout();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ public:
|
||||||
MainMenuDialog(ScummEngine *scumm);
|
MainMenuDialog(ScummEngine *scumm);
|
||||||
~MainMenuDialog();
|
~MainMenuDialog();
|
||||||
virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data);
|
virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data);
|
||||||
virtual void handleScreenChanged();
|
virtual void reflowLayout();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
ScummEngine *_vm;
|
ScummEngine *_vm;
|
||||||
|
@ -110,7 +110,7 @@ public:
|
||||||
HelpDialog(const GameSettings &game);
|
HelpDialog(const GameSettings &game);
|
||||||
virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data);
|
virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data);
|
||||||
|
|
||||||
virtual void handleScreenChanged();
|
virtual void reflowLayout();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
typedef Common::String String;
|
typedef Common::String String;
|
||||||
|
@ -174,7 +174,7 @@ public:
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void handleScreenChanged();
|
virtual void reflowLayout();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void setInfoText (const String& message);
|
void setInfoText (const String& message);
|
||||||
|
|
|
@ -32,7 +32,7 @@ EditTextWidget::EditTextWidget(GuiObject *boss, int x, int y, int w, int h, cons
|
||||||
_flags = WIDGET_ENABLED | WIDGET_CLEARBG | WIDGET_RETAIN_FOCUS | WIDGET_WANT_TICKLE;
|
_flags = WIDGET_ENABLED | WIDGET_CLEARBG | WIDGET_RETAIN_FOCUS | WIDGET_WANT_TICKLE;
|
||||||
_type = kEditTextWidget;
|
_type = kEditTextWidget;
|
||||||
|
|
||||||
handleScreenChanged();
|
reflowLayout();
|
||||||
setEditString(text);
|
setEditString(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ EditTextWidget::EditTextWidget(GuiObject *boss, const String &name, const String
|
||||||
_type = kEditTextWidget;
|
_type = kEditTextWidget;
|
||||||
_hints |= THEME_HINT_USE_SHADOW;
|
_hints |= THEME_HINT_USE_SHADOW;
|
||||||
|
|
||||||
handleScreenChanged();
|
reflowLayout();
|
||||||
setEditString(text);
|
setEditString(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,8 +51,8 @@ void EditTextWidget::setEditString(const String &str) {
|
||||||
_backupString = str;
|
_backupString = str;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditTextWidget::handleScreenChanged() {
|
void EditTextWidget::reflowLayout() {
|
||||||
EditableWidget::handleScreenChanged();
|
EditableWidget::reflowLayout();
|
||||||
_leftPadding = g_gui.evaluator()->getVar("EditTextWidget.leftPadding", 0);
|
_leftPadding = g_gui.evaluator()->getVar("EditTextWidget.leftPadding", 0);
|
||||||
_rightPadding = g_gui.evaluator()->getVar("EditTextWidget.rightPadding", 0);
|
_rightPadding = g_gui.evaluator()->getVar("EditTextWidget.rightPadding", 0);
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ public:
|
||||||
|
|
||||||
virtual bool wantsFocus() { return true; }
|
virtual bool wantsFocus() { return true; }
|
||||||
|
|
||||||
virtual void handleScreenChanged();
|
virtual void reflowLayout();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void drawWidget(bool hilite);
|
void drawWidget(bool hilite);
|
||||||
|
|
|
@ -446,8 +446,8 @@ void ListWidget::abortEditMode() {
|
||||||
g_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, false);
|
g_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ListWidget::handleScreenChanged() {
|
void ListWidget::reflowLayout() {
|
||||||
Widget::handleScreenChanged();
|
Widget::reflowLayout();
|
||||||
|
|
||||||
_leftPadding = g_gui.evaluator()->getVar("ListWidget.leftPadding", 0);
|
_leftPadding = g_gui.evaluator()->getVar("ListWidget.leftPadding", 0);
|
||||||
_rightPadding = g_gui.evaluator()->getVar("ListWidget.rightPadding", 0);
|
_rightPadding = g_gui.evaluator()->getVar("ListWidget.rightPadding", 0);
|
||||||
|
|
|
@ -93,7 +93,7 @@ public:
|
||||||
virtual bool handleKeyUp(uint16 ascii, int keycode, int modifiers);
|
virtual bool handleKeyUp(uint16 ascii, int keycode, int modifiers);
|
||||||
virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data);
|
virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data);
|
||||||
|
|
||||||
virtual void handleScreenChanged();
|
virtual void reflowLayout();
|
||||||
|
|
||||||
virtual bool wantsFocus() { return true; }
|
virtual bool wantsFocus() { return true; }
|
||||||
|
|
||||||
|
|
|
@ -344,7 +344,7 @@ void PopUpDialog::drawMenuEntry(int entry, bool hilite) {
|
||||||
|
|
||||||
PopUpWidget::PopUpWidget(GuiObject *boss, const String &name, const String &label, uint labelWidth)
|
PopUpWidget::PopUpWidget(GuiObject *boss, const String &name, const String &label, uint labelWidth)
|
||||||
: Widget(boss, name), CommandSender(boss), _label(label), _labelWidth(labelWidth) {
|
: Widget(boss, name), CommandSender(boss), _label(label), _labelWidth(labelWidth) {
|
||||||
handleScreenChanged();
|
reflowLayout();
|
||||||
|
|
||||||
_flags = WIDGET_ENABLED | WIDGET_CLEARBG | WIDGET_RETAIN_FOCUS;
|
_flags = WIDGET_ENABLED | WIDGET_CLEARBG | WIDGET_RETAIN_FOCUS;
|
||||||
setHints(THEME_HINT_SAVE_BACKGROUND);
|
setHints(THEME_HINT_SAVE_BACKGROUND);
|
||||||
|
@ -369,12 +369,12 @@ void PopUpWidget::handleMouseDown(int x, int y, int button, int clickCount) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PopUpWidget::handleScreenChanged() {
|
void PopUpWidget::reflowLayout() {
|
||||||
_leftPadding = g_gui.evaluator()->getVar("PopUpWidget.leftPadding", 0);
|
_leftPadding = g_gui.evaluator()->getVar("PopUpWidget.leftPadding", 0);
|
||||||
_rightPadding = g_gui.evaluator()->getVar("PopUpWidget.rightPadding", 0);
|
_rightPadding = g_gui.evaluator()->getVar("PopUpWidget.rightPadding", 0);
|
||||||
_labelSpacing = g_gui.evaluator()->getVar("PopUpWidget.labelSpacing", 0);
|
_labelSpacing = g_gui.evaluator()->getVar("PopUpWidget.labelSpacing", 0);
|
||||||
|
|
||||||
Widget::handleScreenChanged();
|
Widget::reflowLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PopUpWidget::appendEntry(const String &entry, uint32 tag) {
|
void PopUpWidget::appendEntry(const String &entry, uint32 tag) {
|
||||||
|
|
|
@ -82,7 +82,7 @@ public:
|
||||||
void handleMouseEntered(int button) { setFlags(WIDGET_HILITED); draw(); }
|
void handleMouseEntered(int button) { setFlags(WIDGET_HILITED); draw(); }
|
||||||
void handleMouseLeft(int button) { clearFlags(WIDGET_HILITED); draw(); }
|
void handleMouseLeft(int button) { clearFlags(WIDGET_HILITED); draw(); }
|
||||||
|
|
||||||
virtual void handleScreenChanged();
|
virtual void reflowLayout();
|
||||||
protected:
|
protected:
|
||||||
void drawWidget(bool hilite);
|
void drawWidget(bool hilite);
|
||||||
};
|
};
|
||||||
|
|
|
@ -169,13 +169,13 @@ bool TabWidget::handleKeyDown(uint16 ascii, int keycode, int modifiers) {
|
||||||
return Widget::handleKeyDown(ascii, keycode, modifiers);
|
return Widget::handleKeyDown(ascii, keycode, modifiers);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TabWidget::handleScreenChanged() {
|
void TabWidget::reflowLayout() {
|
||||||
Widget::handleScreenChanged();
|
Widget::reflowLayout();
|
||||||
|
|
||||||
for (uint i = 0; i < _tabs.size(); ++i) {
|
for (uint i = 0; i < _tabs.size(); ++i) {
|
||||||
Widget *w = _tabs[i].firstWidget;
|
Widget *w = _tabs[i].firstWidget;
|
||||||
while (w) {
|
while (w) {
|
||||||
w->handleScreenChanged();
|
w->reflowLayout();
|
||||||
w = w->next();
|
w = w->next();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,7 +80,7 @@ public:
|
||||||
virtual bool handleKeyDown(uint16 ascii, int keycode, int modifiers);
|
virtual bool handleKeyDown(uint16 ascii, int keycode, int modifiers);
|
||||||
virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data);
|
virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data);
|
||||||
|
|
||||||
virtual void handleScreenChanged();
|
virtual void reflowLayout();
|
||||||
|
|
||||||
virtual void draw();
|
virtual void draw();
|
||||||
|
|
||||||
|
|
|
@ -308,8 +308,8 @@ void AboutDialog::handleKeyUp(uint16 ascii, int keycode, int modifiers) {
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AboutDialog::handleScreenChanged() {
|
void AboutDialog::reflowLayout() {
|
||||||
Dialog::handleScreenChanged();
|
Dialog::reflowLayout();
|
||||||
const int screenW = g_system->getOverlayWidth();
|
const int screenW = g_system->getOverlayWidth();
|
||||||
const int screenH = g_system->getOverlayHeight();
|
const int screenH = g_system->getOverlayHeight();
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ public:
|
||||||
void handleKeyDown(uint16 ascii, int keycode, int modifiers);
|
void handleKeyDown(uint16 ascii, int keycode, int modifiers);
|
||||||
void handleKeyUp(uint16 ascii, int keycode, int modifiers);
|
void handleKeyUp(uint16 ascii, int keycode, int modifiers);
|
||||||
|
|
||||||
void handleScreenChanged();
|
void reflowLayout();
|
||||||
};
|
};
|
||||||
|
|
||||||
} // End of namespace GUI
|
} // End of namespace GUI
|
||||||
|
|
|
@ -162,7 +162,7 @@ void ConsoleDialog::open() {
|
||||||
// the console, or even outright crashes. This means _scrollLine is not
|
// the console, or even outright crashes. This means _scrollLine is not
|
||||||
// preserved, but that's a tiny sacrifice.
|
// preserved, but that's a tiny sacrifice.
|
||||||
|
|
||||||
handleScreenChanged();
|
reflowLayout();
|
||||||
|
|
||||||
Dialog::open();
|
Dialog::open();
|
||||||
if (_promptStartPos == -1) {
|
if (_promptStartPos == -1) {
|
||||||
|
@ -214,7 +214,7 @@ void ConsoleDialog::drawLine(int line, bool restoreBg) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConsoleDialog::handleScreenChanged() {
|
void ConsoleDialog::reflowLayout() {
|
||||||
init();
|
init();
|
||||||
|
|
||||||
_scrollLine = _promptEndPos / kLineWidth;
|
_scrollLine = _promptEndPos / kLineWidth;
|
||||||
|
@ -222,7 +222,7 @@ void ConsoleDialog::handleScreenChanged() {
|
||||||
_scrollLine = _linesPerPage - 1;
|
_scrollLine = _linesPerPage - 1;
|
||||||
updateScrollBuffer();
|
updateScrollBuffer();
|
||||||
|
|
||||||
Dialog::handleScreenChanged();
|
Dialog::reflowLayout();
|
||||||
draw();
|
draw();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -105,7 +105,7 @@ public:
|
||||||
void drawDialog();
|
void drawDialog();
|
||||||
|
|
||||||
void handleTickle();
|
void handleTickle();
|
||||||
void handleScreenChanged();
|
void reflowLayout();
|
||||||
void handleMouseWheel(int x, int y, int direction);
|
void handleMouseWheel(int x, int y, int direction);
|
||||||
void handleKeyDown(uint16 ascii, int keycode, int modifiers);
|
void handleKeyDown(uint16 ascii, int keycode, int modifiers);
|
||||||
void handleCommand(CommandSender *sender, uint32 cmd, uint32 data);
|
void handleCommand(CommandSender *sender, uint32 cmd, uint32 data);
|
||||||
|
|
|
@ -98,7 +98,7 @@ void Dialog::close() {
|
||||||
releaseFocus();
|
releaseFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Dialog::handleScreenChanged() {
|
void Dialog::reflowLayout() {
|
||||||
// The screen has changed. That means the screen visual may also have
|
// The screen has changed. That means the screen visual may also have
|
||||||
// changed, so any cached image may be invalid. The subsequent redraw
|
// changed, so any cached image may be invalid. The subsequent redraw
|
||||||
// should be treated as the very first draw.
|
// should be treated as the very first draw.
|
||||||
|
@ -106,12 +106,12 @@ void Dialog::handleScreenChanged() {
|
||||||
_drawingHints |= THEME_HINT_FIRST_DRAW;
|
_drawingHints |= THEME_HINT_FIRST_DRAW;
|
||||||
Widget *w = _firstWidget;
|
Widget *w = _firstWidget;
|
||||||
while (w) {
|
while (w) {
|
||||||
w->handleScreenChanged();
|
w->reflowLayout();
|
||||||
w->setHints(THEME_HINT_FIRST_DRAW);
|
w->setHints(THEME_HINT_FIRST_DRAW);
|
||||||
w = w->_next;
|
w = w->_next;
|
||||||
}
|
}
|
||||||
|
|
||||||
GuiObject::handleScreenChanged();
|
GuiObject::reflowLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Dialog::releaseFocus() {
|
void Dialog::releaseFocus() {
|
||||||
|
|
|
@ -62,7 +62,7 @@ public:
|
||||||
|
|
||||||
void releaseFocus();
|
void releaseFocus();
|
||||||
|
|
||||||
virtual void handleScreenChanged();
|
virtual void reflowLayout();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void open();
|
virtual void open();
|
||||||
|
|
|
@ -116,7 +116,7 @@ class EditGameDialog : public OptionsDialog {
|
||||||
public:
|
public:
|
||||||
EditGameDialog(const String &domain, const String &desc);
|
EditGameDialog(const String &domain, const String &desc);
|
||||||
|
|
||||||
virtual void handleScreenChanged();
|
virtual void reflowLayout();
|
||||||
|
|
||||||
void open();
|
void open();
|
||||||
void close();
|
void close();
|
||||||
|
@ -267,8 +267,8 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc)
|
||||||
new ButtonWidget(this, "gameoptions_ok", "OK", kOKCmd, 0);
|
new ButtonWidget(this, "gameoptions_ok", "OK", kOKCmd, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditGameDialog::handleScreenChanged() {
|
void EditGameDialog::reflowLayout() {
|
||||||
OptionsDialog::handleScreenChanged();
|
OptionsDialog::reflowLayout();
|
||||||
|
|
||||||
int labelWidth = g_gui.evaluator()->getVar("gameOptionsLabelWidth");
|
int labelWidth = g_gui.evaluator()->getVar("gameOptionsLabelWidth");
|
||||||
|
|
||||||
|
@ -805,7 +805,7 @@ void LauncherDialog::updateButtons() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LauncherDialog::handleScreenChanged() {
|
void LauncherDialog::reflowLayout() {
|
||||||
#ifndef DISABLE_FANCY_THEMES
|
#ifndef DISABLE_FANCY_THEMES
|
||||||
if (g_gui.evaluator()->getVar("launcher_logo.visible") == 1) {
|
if (g_gui.evaluator()->getVar("launcher_logo.visible") == 1) {
|
||||||
StaticTextWidget *ver = (StaticTextWidget*)findWidget("launcher_version");
|
StaticTextWidget *ver = (StaticTextWidget*)findWidget("launcher_version");
|
||||||
|
@ -839,7 +839,7 @@ void LauncherDialog::handleScreenChanged() {
|
||||||
_w = g_system->getOverlayWidth();
|
_w = g_system->getOverlayWidth();
|
||||||
_h = g_system->getOverlayHeight();
|
_h = g_system->getOverlayHeight();
|
||||||
|
|
||||||
Dialog::handleScreenChanged();
|
Dialog::reflowLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End of namespace GUI
|
} // End of namespace GUI
|
||||||
|
|
|
@ -51,7 +51,7 @@ protected:
|
||||||
StringList _domains;
|
StringList _domains;
|
||||||
BrowserDialog *_browser;
|
BrowserDialog *_browser;
|
||||||
|
|
||||||
virtual void handleScreenChanged();
|
virtual void reflowLayout();
|
||||||
|
|
||||||
void updateListing();
|
void updateListing();
|
||||||
void updateButtons();
|
void updateButtons();
|
||||||
|
|
|
@ -56,10 +56,10 @@ enum {
|
||||||
// HACK. FIXME. This doesn't belong here. But otherwise it creates compilation problems
|
// HACK. FIXME. This doesn't belong here. But otherwise it creates compilation problems
|
||||||
GuiObject::GuiObject(const Common::String &name) : _firstWidget(0) {
|
GuiObject::GuiObject(const Common::String &name) : _firstWidget(0) {
|
||||||
_name = name;
|
_name = name;
|
||||||
handleScreenChanged();
|
reflowLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GuiObject::handleScreenChanged() {
|
void GuiObject::reflowLayout() {
|
||||||
if (!_name.empty()) {
|
if (!_name.empty()) {
|
||||||
if ((_x = g_gui.evaluator()->getVar(_name + ".x")) == EVAL_UNDEF_VAR)
|
if ((_x = g_gui.evaluator()->getVar(_name + ".x")) == EVAL_UNDEF_VAR)
|
||||||
error("Undefined variable %s.x", _name.c_str());
|
error("Undefined variable %s.x", _name.c_str());
|
||||||
|
@ -262,7 +262,7 @@ void NewGui::runLoop() {
|
||||||
_theme->refresh();
|
_theme->refresh();
|
||||||
// refresh all dialogs
|
// refresh all dialogs
|
||||||
for (int i = 0; i < _dialogStack.size(); ++i) {
|
for (int i = 0; i < _dialogStack.size(); ++i) {
|
||||||
_dialogStack[i]->handleScreenChanged();
|
_dialogStack[i]->reflowLayout();
|
||||||
}
|
}
|
||||||
// We need to redraw immediately. Otherwise
|
// We need to redraw immediately. Otherwise
|
||||||
// some other event may cause a widget to be
|
// some other event may cause a widget to be
|
||||||
|
|
|
@ -78,7 +78,7 @@ public:
|
||||||
|
|
||||||
virtual void draw() = 0;
|
virtual void draw() = 0;
|
||||||
|
|
||||||
virtual void handleScreenChanged();
|
virtual void reflowLayout();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void releaseFocus() = 0;
|
virtual void releaseFocus() = 0;
|
||||||
|
|
|
@ -606,8 +606,8 @@ int OptionsDialog::getSubtitleMode(bool subtitles, bool speech_mute) {
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
void OptionsDialog::handleScreenChanged() {
|
void OptionsDialog::reflowLayout() {
|
||||||
Dialog::handleScreenChanged();
|
Dialog::reflowLayout();
|
||||||
|
|
||||||
int labelWidth = g_gui.evaluator()->getVar("tabPopupsLabelW");
|
int labelWidth = g_gui.evaluator()->getVar("tabPopupsLabelW");
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ public:
|
||||||
void close();
|
void close();
|
||||||
void handleCommand(CommandSender *sender, uint32 cmd, uint32 data);
|
void handleCommand(CommandSender *sender, uint32 cmd, uint32 data);
|
||||||
|
|
||||||
virtual void handleScreenChanged();
|
virtual void reflowLayout();
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
kOKCmd = 'ok '
|
kOKCmd = 'ok '
|
||||||
|
|
|
@ -128,7 +128,7 @@ public:
|
||||||
virtual bool handleKeyUp(uint16 ascii, int keycode, int modifiers) { return false; } // Return true if the event was handled
|
virtual bool handleKeyUp(uint16 ascii, int keycode, int modifiers) { return false; } // Return true if the event was handled
|
||||||
virtual void handleTickle() {}
|
virtual void handleTickle() {}
|
||||||
|
|
||||||
virtual void handleScreenChanged() { GuiObject::handleScreenChanged(); }
|
virtual void reflowLayout() { GuiObject::reflowLayout(); }
|
||||||
|
|
||||||
void draw();
|
void draw();
|
||||||
void receivedFocus() { _hasFocus = true; receivedFocusWidget(); }
|
void receivedFocus() { _hasFocus = true; receivedFocusWidget(); }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue