]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/widget.h
Style and comment fixes
[libs/gltk.git] / source / widget.h
index dfef4ba7128be3b1a3e099addc5b7720a943ad8e..4550648aebd3adbfaaebc09b5f60669b05ade595 100644 (file)
@@ -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 &);