libt3widget
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups
widgetgroup.h
1 /* Copyright (C) 2012-2013 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_WIDGETGROUP_H
15 #define T3_WIDGET_WIDGETGROUP_H
16 
17 #include <t3widget/widgets/widget.h>
18 
19 namespace t3_widget {
20 
26 class T3_WIDGET_API widget_group_t : public widget_t, public container_t, public focus_widget_t {
27  private:
28  struct T3_WIDGET_LOCAL implementation_t {
29  widgets_t children;
30  int current_child;
31  bool has_focus;
32  implementation_t(void) : current_child(-1), has_focus(false) {}
33  };
34  pimpl_ptr<implementation_t>::t impl;
35 
36  bool focus_next_int(void);
37  bool focus_previous_int(void);
38  public:
39  widget_group_t(void);
40  ~widget_group_t(void);
41 
42  virtual bool process_key(key_t key);
43  virtual void update_contents(void);
44  virtual void set_focus(focus_t _focus);
45  virtual bool set_size(optint height, optint width);
46  virtual bool accepts_focus(void);
47  virtual void force_redraw(void);
48  virtual void set_child_focus(window_component_t *target);
49  virtual bool is_child(window_component_t *component);
50  virtual bool is_hotkey(key_t key);
51 
53  virtual void add_child(widget_t *child);
54 
55  void focus_next(void);
56  void focus_previous(void);
57 };
58 
59 }; // namespace
60 #endif