MySQL Workbench  6.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
label.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 
20 #ifndef _MFORMS_LABEL_H_
21 #define _MFORMS_LABEL_H_
22 
23 #include <mforms/base.h>
24 #include <mforms/view.h>
25 
26 
27 namespace mforms {
28  class Label;
29 
31  {
32  // normal text in normal system font
34  // same as above, but bold
36  // bold text, slightly smaller
38  // large text
40  // same as above, but bold
42  // smaller than normal text
44  // As small as possible but still readable, for titles under widgets etc.
46 
47  // style for showing some information, can be same as normal or a bit smaller
50  // wizard heading, in windows its blue, black elsewhere.. also bold and a bigger than normal
52  // description/help text to show for options, smaller than normal for fitting longer descriptions
54 
55  VeryBigStyle // 18pt
56  };
57 
58 #ifndef DOXYGEN_SHOULD_SKIP_THIS
59 #ifndef SWIG
60  struct LabelImplPtrs
61  {
62  bool (*create)(Label *self);
63  void (*set_style)(Label *self, LabelStyle style);
64  void (*set_text)(Label *self, const std::string &text);
65  void (*set_text_align)(Label *self, Alignment align);
66  void (*set_color)(Label *self, const std::string &color);
67  void (*set_wrap_text)(Label *self, bool flag);
68  };
69 #endif
70 #endif
71 
73  class MFORMS_EXPORT Label : public View
74  {
75  public:
76  Label(const std::string &text, bool right_align = false);
77 #ifndef DOXYGEN_SHOULD_SKIP_THIS
78 #ifndef SWIG
79  Label();
80 #endif
81 #endif
82 
86  void set_wrap_text(bool flag);
87 
89  void set_text_align(Alignment align);
90 
92  void set_text(const std::string &text);
93 
95  void set_style(LabelStyle style);
96 
98  void set_color(const std::string &color);
99  protected:
100  LabelImplPtrs *_label_impl;
101  };
102 
103 };
104 
105 #endif
LabelStyle
Definition: label.h:30
A control with some static text.
Definition: label.h:73
#define MFORMS_EXPORT
Definition: base.h:33
Alignment
Definition: view.h:40
LabelImplPtrs * _label_impl
Definition: label.h:100
MySQL Workbench 6.1 documentation