mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-24 21:21:05 +00:00
Cleanup. We no longer need these widget size parameters.
svn-id: r22798
This commit is contained in:
parent
acb3ff742b
commit
8975ba8963
@ -27,8 +27,8 @@
|
||||
|
||||
namespace GUI {
|
||||
|
||||
EditTextWidget::EditTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text, WidgetSize ws)
|
||||
: EditableWidget(boss, x, y - 1, w, h + 2, ws) {
|
||||
EditTextWidget::EditTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text)
|
||||
: EditableWidget(boss, x, y - 1, w, h + 2) {
|
||||
_flags = WIDGET_ENABLED | WIDGET_CLEARBG | WIDGET_RETAIN_FOCUS | WIDGET_WANT_TICKLE;
|
||||
_type = kEditTextWidget;
|
||||
|
||||
|
@ -38,7 +38,7 @@ protected:
|
||||
int _rightPadding;
|
||||
|
||||
public:
|
||||
EditTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text, WidgetSize ws = kNormalWidgetSize);
|
||||
EditTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text);
|
||||
EditTextWidget(GuiObject *boss, String name, const String &text);
|
||||
|
||||
void setEditString(const String &str);
|
||||
|
@ -32,8 +32,6 @@ namespace GUI {
|
||||
ListWidget::ListWidget(GuiObject *boss, String name)
|
||||
: EditableWidget(boss, name), CommandSender(boss) {
|
||||
|
||||
WidgetSize ws = g_gui.getWidgetSize();
|
||||
|
||||
_leftPadding = g_gui.evaluator()->getVar("ListWidget.leftPadding", 0);
|
||||
_rightPadding = g_gui.evaluator()->getVar("ListWidget.rightPadding", 0);
|
||||
_topPadding = g_gui.evaluator()->getVar("ListWidget.topPadding", 0);
|
||||
@ -41,7 +39,7 @@ ListWidget::ListWidget(GuiObject *boss, String name)
|
||||
_hlLeftPadding = g_gui.evaluator()->getVar("ListWidget.hlLeftPadding", 0);
|
||||
_hlRightPadding = g_gui.evaluator()->getVar("ListWidget.hlRightPadding", 0);
|
||||
|
||||
if (ws == kBigWidgetSize) {
|
||||
if (g_gui.getWidgetSize() == kBigWidgetSize) {
|
||||
_scrollBarWidth = kBigScrollBarWidth;
|
||||
} else {
|
||||
_scrollBarWidth = kNormalScrollBarWidth;
|
||||
|
@ -47,7 +47,7 @@ protected:
|
||||
int _rightPadding;
|
||||
|
||||
public:
|
||||
PopUpDialog(PopUpWidget *boss, int clickX, int clickY, WidgetSize ws = kDefaultWidgetSize);
|
||||
PopUpDialog(PopUpWidget *boss, int clickX, int clickY);
|
||||
|
||||
void drawDialog();
|
||||
|
||||
@ -67,7 +67,7 @@ protected:
|
||||
void moveDown();
|
||||
};
|
||||
|
||||
PopUpDialog::PopUpDialog(PopUpWidget *boss, int clickX, int clickY, WidgetSize ws)
|
||||
PopUpDialog::PopUpDialog(PopUpWidget *boss, int clickX, int clickY)
|
||||
: Dialog(0, 0, 16, 16, false),
|
||||
_popUpBoss(boss) {
|
||||
|
||||
@ -359,7 +359,7 @@ PopUpWidget::PopUpWidget(GuiObject *boss, String name, const String &label, uint
|
||||
void PopUpWidget::handleMouseDown(int x, int y, int button, int clickCount) {
|
||||
|
||||
if (isEnabled()) {
|
||||
PopUpDialog popupDialog(this, x + getAbsX(), y + getAbsY(), _ws);
|
||||
PopUpDialog popupDialog(this, x + getAbsX(), y + getAbsY());
|
||||
int newSel = popupDialog.runModal();
|
||||
if (newSel != -1 && _selectedItem != newSel) {
|
||||
_selectedItem = newSel;
|
||||
@ -370,8 +370,6 @@ void PopUpWidget::handleMouseDown(int x, int y, int button, int clickCount) {
|
||||
}
|
||||
|
||||
void PopUpWidget::handleScreenChanged() {
|
||||
_ws = g_gui.getWidgetSize();
|
||||
|
||||
_leftPadding = g_gui.evaluator()->getVar("PopUpWidget.leftPadding", 0);
|
||||
_rightPadding = g_gui.evaluator()->getVar("PopUpWidget.rightPadding", 0);
|
||||
_labelSpacing = g_gui.evaluator()->getVar("PopUpWidget.labelSpacing", 0);
|
||||
|
@ -49,7 +49,6 @@ class PopUpWidget : public Widget, public CommandSender {
|
||||
};
|
||||
typedef Common::Array<Entry> EntryList;
|
||||
protected:
|
||||
WidgetSize _ws;
|
||||
EntryList _entries;
|
||||
int _selectedItem;
|
||||
|
||||
|
@ -36,14 +36,13 @@ enum {
|
||||
kTabPadding = 3
|
||||
};
|
||||
|
||||
TabWidget::TabWidget(GuiObject *boss, int x, int y, int w, int h, WidgetSize ws)
|
||||
: Widget(boss, x, y, w, h), _ws(ws) {
|
||||
TabWidget::TabWidget(GuiObject *boss, int x, int y, int w, int h)
|
||||
: Widget(boss, x, y, w, h) {
|
||||
init();
|
||||
}
|
||||
|
||||
TabWidget::TabWidget(GuiObject *boss, String name)
|
||||
: Widget(boss, name) {
|
||||
_ws = g_gui.getWidgetSize();
|
||||
init();
|
||||
}
|
||||
|
||||
@ -54,7 +53,7 @@ void TabWidget::init() {
|
||||
|
||||
_tabWidth = 40;
|
||||
|
||||
if (_ws == kBigWidgetSize) {
|
||||
if (g_gui.getWidgetSize() == kBigWidgetSize) {
|
||||
_tabHeight = kBigTabHeight;
|
||||
} else {
|
||||
_tabHeight = kTabHeight;
|
||||
@ -145,13 +144,12 @@ void TabWidget::handleScreenChanged() {
|
||||
w = w->next();
|
||||
}
|
||||
}
|
||||
Widget::handleScreenChanged();
|
||||
_ws = g_gui.getWidgetSize();
|
||||
if (_ws == kBigWidgetSize) {
|
||||
if (g_gui.getWidgetSize() == kBigWidgetSize) {
|
||||
_tabHeight = kBigTabHeight;
|
||||
} else {
|
||||
_tabHeight = kTabHeight;
|
||||
}
|
||||
Widget::handleScreenChanged();
|
||||
}
|
||||
|
||||
void TabWidget::drawWidget(bool hilite) {
|
||||
|
@ -40,10 +40,9 @@ protected:
|
||||
TabList _tabs;
|
||||
int _tabWidth;
|
||||
int _tabHeight;
|
||||
WidgetSize _ws;
|
||||
|
||||
public:
|
||||
TabWidget(GuiObject *boss, int x, int y, int w, int h, WidgetSize ws = kDefaultWidgetSize);
|
||||
TabWidget(GuiObject *boss, int x, int y, int w, int h);
|
||||
TabWidget(GuiObject *boss, String name);
|
||||
~TabWidget();
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
namespace GUI {
|
||||
|
||||
EditableWidget::EditableWidget(GuiObject *boss, int x, int y, int w, int h, WidgetSize ws)
|
||||
EditableWidget::EditableWidget(GuiObject *boss, int x, int y, int w, int h)
|
||||
: Widget(boss, x, y, w, h) {
|
||||
init();
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ protected:
|
||||
Theme::kFontStyle _font;
|
||||
|
||||
public:
|
||||
EditableWidget(GuiObject *boss, int x, int y, int w, int h, WidgetSize ws = kNormalWidgetSize);
|
||||
EditableWidget(GuiObject *boss, int x, int y, int w, int h);
|
||||
EditableWidget(GuiObject *boss, String name);
|
||||
virtual ~EditableWidget();
|
||||
|
||||
|
@ -143,7 +143,6 @@ bool Widget::isVisible() const {
|
||||
|
||||
StaticTextWidget::StaticTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text, TextAlignment align)
|
||||
: Widget(boss, x, y, w, h), _align(align) {
|
||||
_ws = g_gui.getWidgetSize();
|
||||
_flags = WIDGET_ENABLED;
|
||||
_type = kStaticTextWidget;
|
||||
_label = text;
|
||||
@ -151,7 +150,6 @@ StaticTextWidget::StaticTextWidget(GuiObject *boss, int x, int y, int w, int h,
|
||||
|
||||
StaticTextWidget::StaticTextWidget(GuiObject *boss, String name, const String &text)
|
||||
: Widget(boss, name) {
|
||||
_ws = g_gui.getWidgetSize();
|
||||
_flags = WIDGET_ENABLED;
|
||||
_type = kStaticTextWidget;
|
||||
_label = text;
|
||||
@ -190,11 +188,6 @@ void StaticTextWidget::drawWidget(bool hilite) {
|
||||
g_gui.theme()->convertAligment(_align));
|
||||
}
|
||||
|
||||
void StaticTextWidget::handleScreenChanged() {
|
||||
Widget::handleScreenChanged();
|
||||
_ws = g_gui.getWidgetSize();
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
||||
ButtonWidget::ButtonWidget(GuiObject *boss, int x, int y, int w, int h, const String &label, uint32 cmd, uint8 hotkey, WidgetSize ws)
|
||||
|
@ -169,7 +169,6 @@ protected:
|
||||
|
||||
String _label;
|
||||
TextAlignment _align;
|
||||
WidgetSize _ws;
|
||||
public:
|
||||
StaticTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text, TextAlignment align);
|
||||
StaticTextWidget(GuiObject *boss, String name, const String &text);
|
||||
@ -179,8 +178,6 @@ public:
|
||||
void setAlign(TextAlignment align);
|
||||
TextAlignment getAlign() const { return _align; }
|
||||
|
||||
virtual void handleScreenChanged();
|
||||
|
||||
protected:
|
||||
void drawWidget(bool hilite);
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user