libt3widget
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups
split.h
1 /* Copyright (C) 2011-2012 G.P. Halkes
2  This program is free software: you can redistribute it and/or modify
3  it under the terms of the GNU General Public License version 3, as
4  published by the Free Software Foundation.
5 
6  This program is distributed in the hope that it will be useful,
7  but WITHOUT ANY WARRANTY; without even the implied warranty of
8  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9  GNU General Public License for more details.
10 
11  You should have received a copy of the GNU General Public License
12  along with this program. If not, see <http://www.gnu.org/licenses/>.
13 */
14 #ifndef T3_WIDGET_SPLIT_H
15 #define T3_WIDGET_SPLIT_H
16 
17 #include <t3widget/widgets/widget.h>
18 
19 namespace t3_widget {
20 
29 class T3_WIDGET_API split_t : public widget_t, public container_t {
30  protected:
31  widgets_t widgets;
32  widgets_t::iterator current;
33  bool horizontal,
34  focus;
43  bool next_recurse(void);
47  bool previous_recurse(void);
49  void set_to_begin(void);
51  void set_to_end(void);
59  bool unsplit(widget_t **widget);
60 
61  public:
63  split_t(widget_t *widget);
67  virtual ~split_t(void);
68  virtual bool process_key(key_t key);
69  virtual bool set_size(optint height, optint width);
70  virtual void update_contents(void);
71  virtual void set_focus(focus_t focus);
72  virtual void force_redraw(void);
73  virtual void set_child_focus(window_component_t *target);
74  virtual bool is_child(window_component_t *component);
75 
85  void split(widget_t *widget, bool _horizontal);
89  widget_t *unsplit(void);
91  void next(void);
93  void previous(void);
95  widget_t *get_current(void);
96 };
97 
98 }; // namespace
99 #endif