MySQL Workbench  6.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
splitter.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010, 2013, 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_SPLITTER_H_
20 #define _MFORMS_SPLITTER_H_
21 
22 #include <mforms/container.h>
23 #include <boost/signals2.hpp>
24 #include <map>
25 
26 namespace mforms {
27 
28  class Splitter;
29 
30 #ifndef DOXYGEN_SHOULD_SKIP_THIS
31 #ifndef SWIG
32  struct SplitterImplPtrs
33  {
34 #ifdef __APPLE__
35  bool (*create)(Splitter *self, bool horizontal, bool thin);
36 #else
37  bool (*create)(Splitter *self, bool horizontal);
38 #endif
39  void (*add)(Splitter *self, View *child, int minsize, bool fixed);
40  void (*remove)(Splitter *self, View *child);
41  void (*set_position)(Splitter *self, int);
42  int (*get_position)(Splitter *self);
43  void (*set_expanded)(Splitter *self, bool first, bool expand);
44  };
45 #endif
46 #endif
47 
50  {
51  public:
55  Splitter(bool horiz, bool thin = false);
56 
61  void add(View *subview, int minsize=0, bool fixed=false);
62 
64  virtual void remove(View *subview);
65 
67  void set_position(int position);
68  int get_position();
69 
71  void set_expanded(bool first, bool expand);
72 
73 #ifndef SWIG
74  boost::signals2::signal<void ()> *signal_position_changed() { return &_position_changed_signal; }
75 #endif
76 
77  public:
78  void position_changed();
79 
80  protected:
81  SplitterImplPtrs *_splitter_impl;
82 
83  boost::signals2::signal<void ()> _position_changed_signal;
84  };
85 
86 };
87 
88 #endif /* _MFORMS_SPLITTER_H_ */
A splitter/split view/paned view to accommodate 2 child views with a draggable divider.
Definition: splitter.h:49
#define MFORMS_EXPORT
Definition: base.h:33
SplitterImplPtrs * _splitter_impl
Definition: splitter.h:81
boost::signals2::signal< void()> _position_changed_signal
Definition: splitter.h:83
boost::signals2::signal< void()> * signal_position_changed()
Definition: splitter.h:74
Intermediate class used to collectively check for containers and later maybe implement special contai...
Definition: container.h:31
MySQL Workbench 6.1 documentation