Renamed handleScreenChanged() -> reflowLayout() in the GUI code

svn-id: r23662
This commit is contained in:
Max Horn 2006-08-04 13:55:53 +00:00
parent ca7880df6c
commit 1a10cacfb9
23 changed files with 60 additions and 60 deletions

View file

@ -262,7 +262,7 @@ SaveLoadChooser::SaveLoadChooser(const String &title, const String &buttonLabel,
_chooseButton = new GUI::ButtonWidget(this, "scummsaveload_choose", buttonLabel, kChooseCmd, 0);
_chooseButton->setEnabled(false);
handleScreenChanged();
reflowLayout();
}
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) {
int thumbX = g_gui.evaluator()->getVar("scummsaveload_thumbnail.x");
int thumbY = g_gui.evaluator()->getVar("scummsaveload_thumbnail.y");
@ -365,7 +365,7 @@ void SaveLoadChooser::handleScreenChanged() {
_playtime->setFlags(GUI::WIDGET_INVISIBLE);
}
Dialog::handleScreenChanged();
Dialog::reflowLayout();
}
void SaveLoadChooser::updateInfos() {
@ -512,17 +512,17 @@ void MainMenuDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
}
}
void MainMenuDialog::handleScreenChanged() {
ScummDialog::handleScreenChanged();
void MainMenuDialog::reflowLayout() {
ScummDialog::reflowLayout();
_optionsDialog->handleScreenChanged();
_aboutDialog->handleScreenChanged();
_optionsDialog->reflowLayout();
_aboutDialog->reflowLayout();
_saveDialog->handleScreenChanged();
_loadDialog->handleScreenChanged();
_saveDialog->reflowLayout();
_loadDialog->reflowLayout();
#ifndef DISABLE_HELP
_helpDialog->handleScreenChanged();
_helpDialog->reflowLayout();
#endif
}
@ -556,7 +556,7 @@ void MainMenuDialog::load() {
}
void MainMenuDialog::open() {
handleScreenChanged();
reflowLayout();
Dialog::open();
}
@ -686,8 +686,8 @@ HelpDialog::HelpDialog(const GameSettings &game)
}
void HelpDialog::handleScreenChanged() {
ScummDialog::handleScreenChanged();
void HelpDialog::reflowLayout() {
ScummDialog::reflowLayout();
_drawingHints &= ~GUI::THEME_HINT_SPECIAL_COLOR;
@ -781,10 +781,10 @@ void InfoDialog::setInfoText(const String& message) {
// Width and height are dummy
_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 screenH = g_system->getOverlayHeight();

View file

@ -76,7 +76,7 @@ public:
void setList(const StringList& list);
int runModal();
void handleScreenChanged();
void reflowLayout();
};
@ -85,7 +85,7 @@ public:
MainMenuDialog(ScummEngine *scumm);
~MainMenuDialog();
virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data);
virtual void handleScreenChanged();
virtual void reflowLayout();
protected:
ScummEngine *_vm;
@ -110,7 +110,7 @@ public:
HelpDialog(const GameSettings &game);
virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data);
virtual void handleScreenChanged();
virtual void reflowLayout();
protected:
typedef Common::String String;
@ -174,7 +174,7 @@ public:
close();
}
virtual void handleScreenChanged();
virtual void reflowLayout();
protected:
void setInfoText (const String& message);

View file

@ -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;
_type = kEditTextWidget;
handleScreenChanged();
reflowLayout();
setEditString(text);
}
@ -42,7 +42,7 @@ EditTextWidget::EditTextWidget(GuiObject *boss, const String &name, const String
_type = kEditTextWidget;
_hints |= THEME_HINT_USE_SHADOW;
handleScreenChanged();
reflowLayout();
setEditString(text);
}
@ -51,8 +51,8 @@ void EditTextWidget::setEditString(const String &str) {
_backupString = str;
}
void EditTextWidget::handleScreenChanged() {
EditableWidget::handleScreenChanged();
void EditTextWidget::reflowLayout() {
EditableWidget::reflowLayout();
_leftPadding = g_gui.evaluator()->getVar("EditTextWidget.leftPadding", 0);
_rightPadding = g_gui.evaluator()->getVar("EditTextWidget.rightPadding", 0);

View file

@ -47,7 +47,7 @@ public:
virtual bool wantsFocus() { return true; }
virtual void handleScreenChanged();
virtual void reflowLayout();
protected:
void drawWidget(bool hilite);

View file

@ -446,8 +446,8 @@ void ListWidget::abortEditMode() {
g_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, false);
}
void ListWidget::handleScreenChanged() {
Widget::handleScreenChanged();
void ListWidget::reflowLayout() {
Widget::reflowLayout();
_leftPadding = g_gui.evaluator()->getVar("ListWidget.leftPadding", 0);
_rightPadding = g_gui.evaluator()->getVar("ListWidget.rightPadding", 0);

View file

@ -93,7 +93,7 @@ public:
virtual bool handleKeyUp(uint16 ascii, int keycode, int modifiers);
virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data);
virtual void handleScreenChanged();
virtual void reflowLayout();
virtual bool wantsFocus() { return true; }

View file

@ -344,7 +344,7 @@ void PopUpDialog::drawMenuEntry(int entry, bool hilite) {
PopUpWidget::PopUpWidget(GuiObject *boss, const String &name, const String &label, uint labelWidth)
: Widget(boss, name), CommandSender(boss), _label(label), _labelWidth(labelWidth) {
handleScreenChanged();
reflowLayout();
_flags = WIDGET_ENABLED | WIDGET_CLEARBG | WIDGET_RETAIN_FOCUS;
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);
_rightPadding = g_gui.evaluator()->getVar("PopUpWidget.rightPadding", 0);
_labelSpacing = g_gui.evaluator()->getVar("PopUpWidget.labelSpacing", 0);
Widget::handleScreenChanged();
Widget::reflowLayout();
}
void PopUpWidget::appendEntry(const String &entry, uint32 tag) {

View file

@ -82,7 +82,7 @@ public:
void handleMouseEntered(int button) { setFlags(WIDGET_HILITED); draw(); }
void handleMouseLeft(int button) { clearFlags(WIDGET_HILITED); draw(); }
virtual void handleScreenChanged();
virtual void reflowLayout();
protected:
void drawWidget(bool hilite);
};

View file

@ -169,13 +169,13 @@ bool TabWidget::handleKeyDown(uint16 ascii, int keycode, int modifiers) {
return Widget::handleKeyDown(ascii, keycode, modifiers);
}
void TabWidget::handleScreenChanged() {
Widget::handleScreenChanged();
void TabWidget::reflowLayout() {
Widget::reflowLayout();
for (uint i = 0; i < _tabs.size(); ++i) {
Widget *w = _tabs[i].firstWidget;
while (w) {
w->handleScreenChanged();
w->reflowLayout();
w = w->next();
}
}

View file

@ -80,7 +80,7 @@ public:
virtual bool handleKeyDown(uint16 ascii, int keycode, int modifiers);
virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data);
virtual void handleScreenChanged();
virtual void reflowLayout();
virtual void draw();

View file

@ -308,8 +308,8 @@ void AboutDialog::handleKeyUp(uint16 ascii, int keycode, int modifiers) {
close();
}
void AboutDialog::handleScreenChanged() {
Dialog::handleScreenChanged();
void AboutDialog::reflowLayout() {
Dialog::reflowLayout();
const int screenW = g_system->getOverlayWidth();
const int screenH = g_system->getOverlayHeight();

View file

@ -53,7 +53,7 @@ public:
void handleKeyDown(uint16 ascii, int keycode, int modifiers);
void handleKeyUp(uint16 ascii, int keycode, int modifiers);
void handleScreenChanged();
void reflowLayout();
};
} // End of namespace GUI

View file

@ -162,7 +162,7 @@ void ConsoleDialog::open() {
// the console, or even outright crashes. This means _scrollLine is not
// preserved, but that's a tiny sacrifice.
handleScreenChanged();
reflowLayout();
Dialog::open();
if (_promptStartPos == -1) {
@ -214,7 +214,7 @@ void ConsoleDialog::drawLine(int line, bool restoreBg) {
}
}
void ConsoleDialog::handleScreenChanged() {
void ConsoleDialog::reflowLayout() {
init();
_scrollLine = _promptEndPos / kLineWidth;
@ -222,7 +222,7 @@ void ConsoleDialog::handleScreenChanged() {
_scrollLine = _linesPerPage - 1;
updateScrollBuffer();
Dialog::handleScreenChanged();
Dialog::reflowLayout();
draw();
}

View file

@ -105,7 +105,7 @@ public:
void drawDialog();
void handleTickle();
void handleScreenChanged();
void reflowLayout();
void handleMouseWheel(int x, int y, int direction);
void handleKeyDown(uint16 ascii, int keycode, int modifiers);
void handleCommand(CommandSender *sender, uint32 cmd, uint32 data);

View file

@ -98,7 +98,7 @@ void Dialog::close() {
releaseFocus();
}
void Dialog::handleScreenChanged() {
void Dialog::reflowLayout() {
// The screen has changed. That means the screen visual may also have
// changed, so any cached image may be invalid. The subsequent redraw
// should be treated as the very first draw.
@ -106,12 +106,12 @@ void Dialog::handleScreenChanged() {
_drawingHints |= THEME_HINT_FIRST_DRAW;
Widget *w = _firstWidget;
while (w) {
w->handleScreenChanged();
w->reflowLayout();
w->setHints(THEME_HINT_FIRST_DRAW);
w = w->_next;
}
GuiObject::handleScreenChanged();
GuiObject::reflowLayout();
}
void Dialog::releaseFocus() {

View file

@ -62,7 +62,7 @@ public:
void releaseFocus();
virtual void handleScreenChanged();
virtual void reflowLayout();
protected:
virtual void open();

View file

@ -116,7 +116,7 @@ class EditGameDialog : public OptionsDialog {
public:
EditGameDialog(const String &domain, const String &desc);
virtual void handleScreenChanged();
virtual void reflowLayout();
void open();
void close();
@ -267,8 +267,8 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc)
new ButtonWidget(this, "gameoptions_ok", "OK", kOKCmd, 0);
}
void EditGameDialog::handleScreenChanged() {
OptionsDialog::handleScreenChanged();
void EditGameDialog::reflowLayout() {
OptionsDialog::reflowLayout();
int labelWidth = g_gui.evaluator()->getVar("gameOptionsLabelWidth");
@ -805,7 +805,7 @@ void LauncherDialog::updateButtons() {
}
}
void LauncherDialog::handleScreenChanged() {
void LauncherDialog::reflowLayout() {
#ifndef DISABLE_FANCY_THEMES
if (g_gui.evaluator()->getVar("launcher_logo.visible") == 1) {
StaticTextWidget *ver = (StaticTextWidget*)findWidget("launcher_version");
@ -839,7 +839,7 @@ void LauncherDialog::handleScreenChanged() {
_w = g_system->getOverlayWidth();
_h = g_system->getOverlayHeight();
Dialog::handleScreenChanged();
Dialog::reflowLayout();
}
} // End of namespace GUI

View file

@ -51,7 +51,7 @@ protected:
StringList _domains;
BrowserDialog *_browser;
virtual void handleScreenChanged();
virtual void reflowLayout();
void updateListing();
void updateButtons();

View file

@ -56,10 +56,10 @@ enum {
// HACK. FIXME. This doesn't belong here. But otherwise it creates compilation problems
GuiObject::GuiObject(const Common::String &name) : _firstWidget(0) {
_name = name;
handleScreenChanged();
reflowLayout();
}
void GuiObject::handleScreenChanged() {
void GuiObject::reflowLayout() {
if (!_name.empty()) {
if ((_x = g_gui.evaluator()->getVar(_name + ".x")) == EVAL_UNDEF_VAR)
error("Undefined variable %s.x", _name.c_str());
@ -262,7 +262,7 @@ void NewGui::runLoop() {
_theme->refresh();
// refresh all dialogs
for (int i = 0; i < _dialogStack.size(); ++i) {
_dialogStack[i]->handleScreenChanged();
_dialogStack[i]->reflowLayout();
}
// We need to redraw immediately. Otherwise
// some other event may cause a widget to be

View file

@ -78,7 +78,7 @@ public:
virtual void draw() = 0;
virtual void handleScreenChanged();
virtual void reflowLayout();
protected:
virtual void releaseFocus() = 0;

View file

@ -606,8 +606,8 @@ int OptionsDialog::getSubtitleMode(bool subtitles, bool speech_mute) {
return 2;
}
void OptionsDialog::handleScreenChanged() {
Dialog::handleScreenChanged();
void OptionsDialog::reflowLayout() {
Dialog::reflowLayout();
int labelWidth = g_gui.evaluator()->getVar("tabPopupsLabelW");

View file

@ -49,7 +49,7 @@ public:
void close();
void handleCommand(CommandSender *sender, uint32 cmd, uint32 data);
virtual void handleScreenChanged();
virtual void reflowLayout();
enum {
kOKCmd = 'ok '

View file

@ -128,7 +128,7 @@ public:
virtual bool handleKeyUp(uint16 ascii, int keycode, int modifiers) { return false; } // Return true if the event was handled
virtual void handleTickle() {}
virtual void handleScreenChanged() { GuiObject::handleScreenChanged(); }
virtual void reflowLayout() { GuiObject::reflowLayout(); }
void draw();
void receivedFocus() { _hasFocus = true; receivedFocusWidget(); }