libt3widget
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Modules
dialogbase.h
1 /* Copyright (C) 2011-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 
15 #ifndef T3_DIALOG_BASE_H
16 #define T3_DIALOG_BASE_H
17 
18 #include <list>
19 #include <t3widget/interfaces.h>
20 #include <t3widget/widgets/widget.h>
21 #include <t3widget/widgets/dummywidget.h>
22 
23 namespace t3_widget {
24 
25 class dialog_base_t;
26 typedef std::list<dialog_base_t *> dialog_base_list_t;
27 class dialog_t;
28 
29 class T3_WIDGET_API dialog_base_t : public virtual window_component_t, public container_t {
30  private:
31  friend class dialog_t;
32 
33  static dialog_base_list_t dialog_base_list;
34  static dummy_widget_t *dummy;
36  static void init(bool _init);
37  static sigc::connection init_connected;
40  dialog_base_t(void);
41 
42  protected:
43  widgets_t widgets;
44  widgets_t::iterator current_widget;
45  bool redraw;
46  cleanup_t3_window_ptr shadow_window;
49  dialog_base_t(int height, int width, bool has_shadow);
51  void focus_next(void);
53  void focus_previous(void);
57  void push_back(widget_t *widget);
58 
59  virtual bool is_child(window_component_t *widget);
60  virtual void set_child_focus(window_component_t *target);
61 
62  public:
66  virtual ~dialog_base_t();
67  virtual void set_position(optint top, optint left);
68  virtual bool set_size(optint height, optint width);
69  virtual void update_contents(void);
70  virtual void set_focus(focus_t focus);
71  virtual void show(void);
72  virtual void hide(void);
73  virtual void force_redraw(void);
75  virtual void center_over(window_component_t *center);
76 
78  static void force_redraw_all(void);
79 
80 };
81 
82 } // namespace
83 
84 #endif // T3_DIALOG_BASE_H
A widget that does not actually show anything on screen.
Definition: dummywidget.h:26
The t3_widget namespace is contains all classes, functions and global variables in the libt3widget li...
Definition: autocompleter.cc:18
bool redraw
Boolean indicating whether redrawing is necessary.
Definition: dialogbase.h:45
Abstract base class for all items displayed on screen.
Definition: interfaces.h:28
Definition: dialogbase.h:29
Base class for widgets.
Definition: widget.h:24
widgets_t::iterator current_widget
Iterator indicating the widget that has the input focus.
Definition: dialogbase.h:44
Base class for window_component_t's that are the parents of other window_component_t's.
Definition: interfaces.h:86
Class defining values with a separate validity check.
Definition: util.h:29
complex_error_t init(const init_parameters_t *params)
Initialize the libt3widget library.
Definition: main.cc:254
cleanup_t3_window_ptr shadow_window
t3_window_t used to draw the shadow under a dialog.
Definition: dialogbase.h:46
Base class for dialogs.
Definition: dialog.h:27
widgets_t widgets
List of widgets on this dialog.
Definition: dialogbase.h:43