MySQL Workbench  6.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
table.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008, 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_TABLE_H_
20 #define _MFORMS_TABLE_H_
21 
22 #include <mforms/base.h>
23 #include <mforms/container.h>
24 
25 
26 namespace mforms {
27 
28  class Table;
29 
31  {
33  VExpandFlag = (1 << 0),
34  HExpandFlag = (1 << 1),
35  VFillFlag = (1 << 2),
36  HFillFlag = (1 << 3),
37 
39  };
40 
42  {
43  return (TableItemFlags)((int)a|(int)b);
44  }
45 
46 #ifndef DOXYGEN_SHOULD_SKIP_THIS
47 #ifndef SWIG
48  struct MFORMS_EXPORT TableImplPtrs
49  {
50  bool (*create)(Table*);
51 
52  void (*set_row_count)(Table *self, int);
53  void (*set_column_count)(Table *self, int);
54 
55  void (*add)(Table *self,View*, int, int, int, int, int);
56  void (*remove)(Table *self, View*);
57 
58  void (*set_row_spacing)(Table *self, int);
59  void (*set_column_spacing)(Table *self, int);
60 
61  void (*set_homogeneous)(Table *self, bool);
62  };
63 #endif
64 #endif
65 
68  class MFORMS_EXPORT Table : public Container
69  {
70  public:
71  Table();
72 
74  void set_row_count(int c);
76  void set_column_count(int c);
77 
79  void set_row_spacing(int s);
81  void set_column_spacing(int s);
82 
84  void set_homogeneous(bool value);
85 
94  void add(View *subview, int left, int right, int top, int bottom, int flags= HExpandFlag | VExpandFlag | HFillFlag | VFillFlag);
95 
97  virtual void remove(View *sv);
98 
99  protected:
100  TableImplPtrs *_table_impl;
101  };
102 };
103 
104 
105 #endif /* _MFORMS_TABLE_H_ */
LineMarkup operator|(LineMarkup a, LineMarkup b)
Definition: code_editor.h:73
Neither expand nor fill.
Definition: table.h:32
Container to layout child items in a grid of rows and columns.
Definition: table.h:68
same for horizontal filling
Definition: table.h:36
#define MFORMS_EXPORT
Definition: base.h:33
whether item should try using vertical space leftover from table
Definition: table.h:33
same for horizontal expansion
Definition: table.h:34
TableImplPtrs * _table_impl
Definition: table.h:100
Intermediate class used to collectively check for containers and later maybe implement special contai...
Definition: container.h:31
TableItemFlags
Definition: table.h:30
whether all allocated vertical space should be filled, or just centered in it
Definition: table.h:35
MySQL Workbench 6.1 documentation