2
* Copyright 2010 Inalogic Inc.
4
* This program is free software: you can redistribute it and/or modify it
5
* under the terms of the GNU Lesser General Public License version 3, as
6
* published by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful, but
9
* WITHOUT ANY WARRANTY; without even the implied warranties of
10
* MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
11
* PURPOSE. See the applicable version of the GNU Lesser General Public
12
* License for more details.
14
* You should have received a copy of both the GNU Lesser General Public
15
* License version 3 along with this program. If not, see
16
* <http://www.gnu.org/licenses/>
18
* Authored by: Jay Taoko <jay.taoko_AT_gmail_DOT_com>
26
#include "AbstractButton.h"
31
class RadioButtonGroup;
34
class RadioButton: public AbstractButton
37
RadioButton (const TCHAR *Caption = 0, bool state = false, NUX_FILE_LINE_PROTO);
40
virtual long ProcessEvent (IEvent &ievent, long TraverseInfo, long ProcessEventInfo);
42
virtual void Draw (GraphicsEngine &GfxContext, bool force_draw);
43
virtual void DrawContent (GraphicsEngine &GfxContext, bool force_draw);
44
virtual void PostDraw (GraphicsEngine &GfxContext, bool force_draw);
46
void RecvMouseMove (int x, int y, int dx, int dy, unsigned long button_flags, unsigned long key_flags);
47
void RecvMouseEnter (int x, int y, unsigned long button_flags, unsigned long key_flags);
48
void RecvMouseLeave (int x, int y, unsigned long button_flags, unsigned long key_flags);
50
Signal emitted if a click happen. The state change and the check box need to redraw itself.
52
void RecvClick (int x, int y, unsigned long button_flags, unsigned long key_flags);
54
Signal emitted if the mouse is released. Whether a click happened or not,
55
the check box need to redraw itself.
57
void RecvMouseUp (int x, int y, unsigned long button_flags, unsigned long key_flags);
58
void RecvMouseDown (int x, int y, unsigned long button_flags, unsigned long key_flags);
60
sigc::signal<void, RadioButton *> sigStateToggled;
61
sigc::signal<void> sigToggled;
62
sigc::signal<void, bool> sigStateChanged;
64
void EmitStateChangedSignal();
66
//+++ Inherited from AbstractButton
67
virtual bool IsCheckable() const
72
virtual void SetCaption (const TCHAR *Caption);
73
virtual const NString &GetCaption() const;
75
virtual void SetState (bool State);
76
virtual void SetState (bool State, bool EmitSignal);
77
virtual bool GetState() const;
81
void InitializeWidgets();
82
void InitializeLayout();
86
void SetRadioGroupSelector (RadioButtonGroup *RadioSelector);
87
//! Intended for RadioButtonGroup only.
88
void SetStatePrivate (bool State);
89
//! Intended for RadioButtonGroup only.
90
void SetStatePrivate (bool State, bool EmitSignal);
95
CoreArea *m_CheckArea;
98
RadioButtonGroup *m_Group;
101
friend class RadioButtonGroup;
105
#endif // RADIOBUTTON_H