~hikiko/nux/arb-srgba-shader

« back to all changes in this revision

Viewing changes to Nux/RadioButton.h

  • Committer: Neil Jagdish Patel
  • Date: 2010-09-02 03:28:11 UTC
  • Revision ID: neil.patel@canonical.com-20100902032811-i2m18tfb6pkasnvt
Remove Win EOL chars

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 */
21
21
 
22
22
 
23
 
#ifndef RADIOBUTTON_H
24
 
#define RADIOBUTTON_H
25
 
 
26
 
#include "AbstractButton.h"
27
 
 
28
 
NAMESPACE_BEGIN_GUI
29
 
 
30
 
class RadioButton;
31
 
class RadioButtonGroup;
32
 
class HLayout;
33
 
 
34
 
class RadioButton: public AbstractButton
35
 
{
36
 
public:
37
 
    RadioButton(const TCHAR* Caption = 0, bool state = false);
38
 
 
39
 
    ~RadioButton();
40
 
    virtual long ProcessEvent(IEvent &ievent, long TraverseInfo, long ProcessEventInfo);
41
 
 
42
 
    virtual void Draw(GraphicsContext& GfxContext, bool force_draw);
43
 
    virtual void DrawContent(GraphicsContext& GfxContext, bool force_draw);
44
 
    virtual void PostDraw(GraphicsContext& GfxContext, bool force_draw);
45
 
 
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);
49
 
    /*
50
 
        Signal emitted if a click happen. The state change and the check box need to redraw itself.
51
 
    */
52
 
    void RecvClick(int x, int y, unsigned long button_flags, unsigned long key_flags);
53
 
    /*
54
 
        Signal emitted if the mouse is released. Whether a click happened or not, 
55
 
        the check box need to redraw itself.
56
 
    */
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);
59
 
 
60
 
    sigc::signal<void, const weaksmptr(RadioButton)> sigStateToggled;
61
 
    sigc::signal<void> sigToggled;
62
 
    sigc::signal<void, bool> sigStateChanged;
63
 
 
64
 
    void EmitStateChangedSignal();
65
 
 
66
 
    //+++ Inherited from AbstractButton
67
 
    virtual bool IsCheckable() const {return true;}
68
 
 
69
 
    virtual void SetCaption(const TCHAR* Caption);
70
 
    virtual const NString& GetCaption() const;
71
 
 
72
 
    virtual void SetState(bool State);
73
 
    virtual void SetState(bool State, bool EmitSignal);
74
 
    virtual bool GetState() const;
75
 
    //---
76
 
 
77
 
protected:
78
 
    void InitializeWidgets();
79
 
    void InitializeLayout();
80
 
    void DestroyLayout();
81
 
 
82
 
private:
83
 
    //! Intended for RadioButtonGroup only.
84
 
    void SetStatePrivate(bool State);
85
 
    //! Intended for RadioButtonGroup only.
86
 
    void SetStatePrivate(bool State, bool EmitSignal);
87
 
 
88
 
 
89
 
    smptr(HLayout) m_hlayout;
90
 
    smptr(CoreArea) m_TextArea;
91
 
    smptr(CoreArea) m_CheckArea;
92
 
    bool m_State;
93
 
 
94
 
    RadioButtonGroup* m_Group;
95
 
    int m_GroupId;
96
 
 
97
 
public:
98
 
    friend class RadioButtonGroup;
99
 
};
100
 
 
101
 
NAMESPACE_END_GUI
102
 
 
103
 
#endif // RADIOBUTTON_H
 
23
#ifndef RADIOBUTTON_H
 
24
#define RADIOBUTTON_H
 
25
 
 
26
#include "AbstractButton.h"
 
27
 
 
28
NAMESPACE_BEGIN_GUI
 
29
 
 
30
class RadioButton;
 
31
class RadioButtonGroup;
 
32
class HLayout;
 
33
 
 
34
class RadioButton: public AbstractButton
 
35
{
 
36
public:
 
37
    RadioButton(const TCHAR* Caption = 0, bool state = false);
 
38
 
 
39
    ~RadioButton();
 
40
    virtual long ProcessEvent(IEvent &ievent, long TraverseInfo, long ProcessEventInfo);
 
41
 
 
42
    virtual void Draw(GraphicsContext& GfxContext, bool force_draw);
 
43
    virtual void DrawContent(GraphicsContext& GfxContext, bool force_draw);
 
44
    virtual void PostDraw(GraphicsContext& GfxContext, bool force_draw);
 
45
 
 
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);
 
49
    /*
 
50
        Signal emitted if a click happen. The state change and the check box need to redraw itself.
 
51
    */
 
52
    void RecvClick(int x, int y, unsigned long button_flags, unsigned long key_flags);
 
53
    /*
 
54
        Signal emitted if the mouse is released. Whether a click happened or not, 
 
55
        the check box need to redraw itself.
 
56
    */
 
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);
 
59
 
 
60
    sigc::signal<void, const weaksmptr(RadioButton)> sigStateToggled;
 
61
    sigc::signal<void> sigToggled;
 
62
    sigc::signal<void, bool> sigStateChanged;
 
63
 
 
64
    void EmitStateChangedSignal();
 
65
 
 
66
    //+++ Inherited from AbstractButton
 
67
    virtual bool IsCheckable() const {return true;}
 
68
 
 
69
    virtual void SetCaption(const TCHAR* Caption);
 
70
    virtual const NString& GetCaption() const;
 
71
 
 
72
    virtual void SetState(bool State);
 
73
    virtual void SetState(bool State, bool EmitSignal);
 
74
    virtual bool GetState() const;
 
75
    //---
 
76
 
 
77
protected:
 
78
    void InitializeWidgets();
 
79
    void InitializeLayout();
 
80
    void DestroyLayout();
 
81
 
 
82
private:
 
83
    //! Intended for RadioButtonGroup only.
 
84
    void SetStatePrivate(bool State);
 
85
    //! Intended for RadioButtonGroup only.
 
86
    void SetStatePrivate(bool State, bool EmitSignal);
 
87
 
 
88
 
 
89
    smptr(HLayout) m_hlayout;
 
90
    smptr(CoreArea) m_TextArea;
 
91
    smptr(CoreArea) m_CheckArea;
 
92
    bool m_State;
 
93
 
 
94
    RadioButtonGroup* m_Group;
 
95
    int m_GroupId;
 
96
 
 
97
public:
 
98
    friend class RadioButtonGroup;
 
99
};
 
100
 
 
101
NAMESPACE_END_GUI
 
102
 
 
103
#endif // RADIOBUTTON_H