diff options
author | Stijn Buys <ingar@osirion.org> | 2010-09-20 16:30:45 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2010-09-20 16:30:45 +0000 |
commit | e40f70a3af1142e6c0c89c6ea2ee47b996495661 (patch) | |
tree | ba70a909b5066ad0e07e2f4eb8bc98684e4598e6 /src/ui/widget.h | |
parent | e8f7c4a06fce9e41fb23ffc42a566501a78210cb (diff) |
corrected trading inconsistencies, improved trade window, initial slider widget
Diffstat (limited to 'src/ui/widget.h')
-rw-r--r-- | src/ui/widget.h | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/src/ui/widget.h b/src/ui/widget.h index 3ae75d2..8b61bc1 100644 --- a/src/ui/widget.h +++ b/src/ui/widget.h @@ -28,7 +28,7 @@ class Widget public: /// types of custom events a widget can emit - enum Event {EventNone = 0, EventButtonClicked, EventListItemClicked}; + enum Event {EventNone = 0, EventButtonClicked, EventListItemClicked, EventListViewChanged, EventSliderChanged}; /// create a new widget Widget(Widget *parent = 0); @@ -128,6 +128,16 @@ public: return !widget_visible; } + /// true if the widget is enabled + inline bool enabled() const { + return widget_enabled; + } + + /// true if the widget is disabled + inline bool disabled() const { + return !widget_enabled; + } + /// the palette used to draw this widget const Palette *palette() const; @@ -156,9 +166,18 @@ public: /// hide the widget virtual void hide(); - + /// set visibility - void set_visible(bool visible = true); + void set_visible(const bool visible = true); + + /// disable the widget + virtual void disable(); + + /// enable the widget + virtual void enable(); + + ///set enabled or disabled state + void set_enabled(const bool enabled = true); /// set input focus void set_focus(); @@ -194,16 +213,16 @@ public: void set_font(const Font *font); /// set the widgets label - void set_label(std::string const &label); + void set_label(const std::string &label); /// set the widgets label void set_label(const char *label); /// enable or disable widget border - void set_border(bool border = true); + void set_border(const bool border = true); /// enable or disable widget background - void set_background(bool background = true); + void set_background(const bool background = true); /* -- event distributors --------------------------------------- */ @@ -354,6 +373,7 @@ private: bool widget_background; bool widget_border; bool widget_focus; + bool widget_enabled; math::Vector2f widget_location; math::Vector2f widget_size; |