MySQL Workbench  6.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
panel.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License as
6  * published by the Free Software Foundation; version 2 of the
7  * License.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
17  * 02110-1301 USA
18  */
19 #ifndef _MFORMS_PANEL_H_
20 #define _MFORMS_PANEL_H_
21 
22 #include <mforms/container.h>
23 
24 namespace mforms {
25  enum PanelType {
26  // TODO: re-arrange names so that the all begin with Panel.., as this sorts much better
27  // in lists etc.
28  TransparentPanel, // just a container with no background
29  FilledPanel, // just a container with color filled background
30  BorderedPanel, // container with native border
31  LineBorderPanel, // container with a solid line border
32  TitledBoxPanel, // native grouping box with a title with border
33  TitledGroupPanel, // native grouping container with a title (may have no border)
34  FilledHeaderPanel, // Just like a filled panel but additionally has a header bar with a title.
35  StyledHeaderPanel // Panel which has top round corners for win, rect + gradient fill for osx, plain filled rect for linux
36  };
37 
38  class Panel;
39 
40 #ifndef DOXYGEN_SHOULD_SKIP_THIS
41 #ifndef SWIG
42  struct MFORMS_EXPORT PanelImplPtrs
43  {
44  bool (*create)(Panel*, PanelType type);
45  void (*set_back_color)(Panel*, const std::string &);
46  void (*set_title)(Panel*, const std::string&);
47 
48  void (*set_active)(Panel*, bool);
49  bool (*get_active)(Panel*);
50 
51  void (*add)(Panel *self,View*);
52  void (*remove)(Panel *self,View*);
53  };
54 #endif
55 #endif
56 
58  class MFORMS_EXPORT Panel : public Container
59  {
60  public:
71  Panel(PanelType type);
72 
74  void set_title(const std::string &title);
76  virtual void set_back_color(const std::string &color);
77 
79  void set_active(bool);
81  bool get_active();
82 
84  void add(View *subview);
86  virtual void remove(View *subview);
87 
88  protected:
89  PanelImplPtrs *_panel_impl;
90  };
91 };
92 
93 #endif
PanelImplPtrs * _panel_impl
Definition: panel.h:89
A generic single item container with optional border.
Definition: panel.h:58
PanelType
Definition: panel.h:25
#define MFORMS_EXPORT
Definition: base.h:33
Intermediate class used to collectively check for containers and later maybe implement special contai...
Definition: container.h:31
MySQL Workbench 6.1 documentation