X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fwidget.h;h=4550648aebd3adbfaaebc09b5f60669b05ade595;hb=cc433448b71025256bdd44a569c353d98e0935f1;hp=dfef4ba7128be3b1a3e099addc5b7720a943ad8e;hpb=e6a6b3fbd760e487c5df1a6d70ed0700d151710b;p=libs%2Fgltk.git diff --git a/source/widget.h b/source/widget.h index dfef4ba..4550648 100644 --- a/source/widget.h +++ b/source/widget.h @@ -17,8 +17,7 @@ class Resources; class Style; /** -Base class for all widgets. Derived classes should call update_style in -constructor, because it can't be done correctly in the Widget constructor. +Base class for all widgets. */ class Widget { @@ -53,6 +52,9 @@ protected: PartCache part_cache; Widget(); +private: + Widget(const Widget &); + Widget &operator=(const Widget &); public: virtual ~Widget(); @@ -62,8 +64,9 @@ public: void set_position(int, int); void set_size(unsigned, unsigned); void autosize(); + void autosize(Geometry &) const; protected: - virtual void autosize_special(const Part &, Geometry &) { } + virtual void autosize_special(const Part &, Geometry &) const { }; public: void set_geometry(const Geometry &); const Geometry &get_geometry() const { return geom; } @@ -107,12 +110,17 @@ public: void set_focusable(bool); bool is_focusable() const { return focusable; } void set_focus(); + void set_enabled(bool); + bool is_enabled() const { return !(state&DISABLED); } protected: void set_state(State s) { set_state(s, s); } void clear_state(State s) { set_state(s, NORMAL); } void set_state(State, State); +public: + State get_state() const { return state; } +protected: void rebuild(); virtual void rebuild_special(const Part &);