aboutsummaryrefslogtreecommitdiff
path: root/gui/widget.h
diff options
context:
space:
mode:
Diffstat (limited to 'gui/widget.h')
-rw-r--r--gui/widget.h17
1 files changed, 7 insertions, 10 deletions
diff --git a/gui/widget.h b/gui/widget.h
index 49362a838c..99cb78c165 100644
--- a/gui/widget.h
+++ b/gui/widget.h
@@ -79,8 +79,7 @@ public:
void setTarget(CommandReceiver *target) { _target = target; }
CommandReceiver *getTarget() const { return _target; }
- virtual void sendCommand(uint32 cmd, uint32 data)
- {
+ virtual void sendCommand(uint32 cmd, uint32 data) {
if (_target && cmd)
_target->handleCommand(this, cmd, data);
}
@@ -120,7 +119,7 @@ public:
void setFlags(int flags) { _flags |= flags; }
void clearFlags(int flags) { _flags &= ~flags; }
int getFlags() const { return _flags; }
-
+
void setEnabled(bool e) { if (e) setFlags(WIDGET_ENABLED); else clearFlags(WIDGET_ENABLED); }
bool isEnabled() const { return _flags & WIDGET_ENABLED; }
bool isVisible() const { return !(_flags & WIDGET_INVISIBLE); }
@@ -132,7 +131,6 @@ protected:
virtual void lostFocusWidget() {}
};
-
/* StaticTextWidget */
class StaticTextWidget : public Widget {
protected:
@@ -143,16 +141,15 @@ protected:
public:
StaticTextWidget(Dialog *boss, int x, int y, int w, int h, const String &text, int align);
void setValue(int value);
- void setLabel(const String &label) { _label = label; }
- const String &getLabel() const { return _label; }
- void setAlign(int align) { _align = align; }
- int getAlign() const { return _align; }
+ void setLabel(const String &label) { _label = label; }
+ const String &getLabel() const { return _label; }
+ void setAlign(int align) { _align = align; }
+ int getAlign() const { return _align; }
protected:
void drawWidget(bool hilite);
};
-
/* ButtonWidget */
class ButtonWidget : public StaticTextWidget, public CommandSender {
friend class Dialog; // Needed for the hotkey handling
@@ -221,7 +218,7 @@ public:
protected:
void drawWidget(bool hilite);
-
+
int valueToPos(int value);
int posToValue(int pos);
};