]> git.saurik.com Git - wxWidgets.git/commitdiff
wxRadioBox fixed on mac
authorStefan Csomor <csomor@advancedconcepts.ch>
Tue, 8 May 2001 19:13:45 +0000 (19:13 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Tue, 8 May 2001 19:13:45 +0000 (19:13 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10062 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/mac/radiobox.h
src/mac/carbon/radiobox.cpp
src/mac/carbon/radiobut.cpp
src/mac/radiobox.cpp
src/mac/radiobut.cpp

index 73119114f04980c1b30b077212c70696bf9ac492..f46628180e3b7df67ea601855943259f32973e17 100644 (file)
@@ -71,6 +71,7 @@ public:
        inline int GetNumberOfRowsOrCols() const { return m_noRowsOrCols; }
        inline void SetNumberOfRowsOrCols(int n) { m_noRowsOrCols = n; }
 
+       void OnRadioButton( wxCommandEvent& event ) ;
 protected:
        wxRadioButton           *m_radioButtonCycle;
        
@@ -85,6 +86,7 @@ protected:
        int GetNumHor() const;
        int GetNumVer() const;
 
+    DECLARE_EVENT_TABLE()
 };
 
 #endif
index 3f3279dd0457e83bb823ad93903eaa761924623d..b18f098d3c4197e811a6c974acbddbda93a67f81 100644 (file)
@@ -32,6 +32,19 @@ IMPLEMENT_DYNAMIC_CLASS(wxRadioBox, wxControl)
 //             ¥ wxRadioBox()
 //-------------------------------------------------------------------------------------
 // Default constructor
+BEGIN_EVENT_TABLE(wxRadioBox, wxControl)
+EVT_RADIOBUTTON( -1 , wxRadioBox::OnRadioButton )
+END_EVENT_TABLE()
+
+void wxRadioBox::OnRadioButton( wxCommandEvent &outer )
+{
+    wxCommandEvent event(wxEVT_COMMAND_RADIOBOX_SELECTED, m_windowId);
+    int i = GetSelection() ;
+    event.SetInt( i );
+    event.SetString( GetString( i ) );
+    event.SetEventObject( this );
+    ProcessCommand(event);
+}
 
 wxRadioBox::wxRadioBox()
 {
index aff004469bfd5ab440f824930cf0816763a80ecc..94aad1efaf75c1494d065b1b5230b3cb9c23e108 100644 (file)
@@ -96,6 +96,7 @@ void wxRadioButton::MacHandleControlClick( ControlHandle control , SInt16 contro
        SetValue(true) ;
     wxCommandEvent event(wxEVT_COMMAND_RADIOBUTTON_SELECTED, m_windowId );
     event.SetEventObject(this);
+    event.SetInt( GetValue() );
     ProcessCommand(event);
 }
 
index 3f3279dd0457e83bb823ad93903eaa761924623d..b18f098d3c4197e811a6c974acbddbda93a67f81 100644 (file)
@@ -32,6 +32,19 @@ IMPLEMENT_DYNAMIC_CLASS(wxRadioBox, wxControl)
 //             ¥ wxRadioBox()
 //-------------------------------------------------------------------------------------
 // Default constructor
+BEGIN_EVENT_TABLE(wxRadioBox, wxControl)
+EVT_RADIOBUTTON( -1 , wxRadioBox::OnRadioButton )
+END_EVENT_TABLE()
+
+void wxRadioBox::OnRadioButton( wxCommandEvent &outer )
+{
+    wxCommandEvent event(wxEVT_COMMAND_RADIOBOX_SELECTED, m_windowId);
+    int i = GetSelection() ;
+    event.SetInt( i );
+    event.SetString( GetString( i ) );
+    event.SetEventObject( this );
+    ProcessCommand(event);
+}
 
 wxRadioBox::wxRadioBox()
 {
index aff004469bfd5ab440f824930cf0816763a80ecc..94aad1efaf75c1494d065b1b5230b3cb9c23e108 100644 (file)
@@ -96,6 +96,7 @@ void wxRadioButton::MacHandleControlClick( ControlHandle control , SInt16 contro
        SetValue(true) ;
     wxCommandEvent event(wxEVT_COMMAND_RADIOBUTTON_SELECTED, m_windowId );
     event.SetEventObject(this);
+    event.SetInt( GetValue() );
     ProcessCommand(event);
 }