MySQL Workbench  6.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
radiobutton.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_RADIOBUTTON_H_
20 #define _MFORMS_RADIOBUTTON_H_
21 
22 #include <mforms/base.h>
23 #include <mforms/button.h>
24 
25 namespace mforms {
26 
27  class RadioButton;
28 
29 #ifndef DOXYGEN_SHOULD_SKIP_THIS
30 #ifndef SWIG
31  struct RadioButtonImplPtrs
32  {
33  bool (*create)(RadioButton *self, int group_id);
34  void (*set_active)(RadioButton *self, bool flag);
35  bool (*get_active)(RadioButton *self);
36  };
37 #endif
38 #endif
39 
42  {
43  protected:
44  RadioButtonImplPtrs *_radio_impl;
45 
46  boost::signals2::signal<void ()> _signal_toggled;
47 
48  int _group_id;
49 
50  void radio_activated(int group_id);
51 
52  public:
54  static int new_id();
55 
66  RadioButton(int group_id);
67 
69  int group_id() const { return _group_id; }
70 
72  void set_active(bool flag);
73 
75  bool get_active();
76 
77 #ifndef SWIG
78 
81  boost::signals2::signal<void ()>* signal_toggled() { return &_signal_toggled; }
82 #ifndef DOXYGEN_SHOULD_SKIP_THIS
83  virtual void callback();
84 #endif
85 #endif
86  };
87 };
88 
89 #endif
RadioButtonImplPtrs * _radio_impl
Definition: radiobutton.h:44
boost::signals2::signal< void()> _signal_toggled
Definition: radiobutton.h:46
A radio button that will unselect other buttons in the same group when selected.
Definition: radiobutton.h:41
#define MFORMS_EXPORT
Definition: base.h:33
int group_id() const
Returns group_id of this radio button.
Definition: radiobutton.h:69
A clickable button control.
Definition: button.h:51
boost::signals2::signal< void()> * signal_toggled()
Signal emited when the radio button is toggled.
Definition: radiobutton.h:81
MySQL Workbench 6.1 documentation