]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/panel.h
Implement next/previous navigation in Panel
[libs/gltk.git] / source / panel.h
index 79e8bd455a3b36cbd76f9f113641cb81baa79731..756108a5cafce149f688906dcb196dcd4c5e5ef4 100644 (file)
@@ -23,10 +23,13 @@ public:
        protected:
                WidgetMap &wdg_map;
                Widget *last_widget;
-       
+
        public:
                Loader(Panel &, WidgetMap &);
+
        private:
+               template<typename T>
+               void add_child_type(const std::string &);
                Layout &get_layout();
                Widget &get_last_widget();
                template<typename T>
@@ -35,10 +38,12 @@ public:
                void child(const std::string &);
                void constraint(Layout::ConstraintType, const std::string &);
                void expand(bool, bool);
+               void ghost(bool);
                void gravity(int, int);
                void grid(unsigned);
                void layout();
-               void panel(const std::string &);
+               template<typename T>
+               void unnamed_child();
        };
 
 private:
@@ -53,6 +58,7 @@ private:
        };
 
 protected:
+       std::vector<Widget *> nav_order;
        Layout *layout;
 
        Panel(const Panel &);
@@ -64,11 +70,18 @@ public:
        virtual const char *get_class() const { return "panel"; }
 
        void set_layout(Layout *);
-       virtual void autosize();
+       Layout *get_layout() { return layout; }
 
 protected:
+       virtual void autosize_special(const Part &, Geometry &) const;
        virtual void render_special(const Part &, GL::Renderer &) const;
 
+public:
+       virtual bool navigate(Navigation);
+protected:
+       Widget *find_next_child(int, int, int, int, int) const;
+       static int compute_delta(int, int, int, int, int);
+
        virtual void on_geometry_change();
        virtual void on_child_added(Widget &);
        virtual void on_child_removed(Widget &);