From cf1a9b45c7b70f217d3cc282ab77df8feaadcdeb Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Tue, 8 May 2001 19:13:45 +0000 Subject: [PATCH] wxRadioBox fixed on mac git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10062 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/mac/radiobox.h | 2 ++ src/mac/carbon/radiobox.cpp | 13 +++++++++++++ src/mac/carbon/radiobut.cpp | 1 + src/mac/radiobox.cpp | 13 +++++++++++++ src/mac/radiobut.cpp | 1 + 5 files changed, 30 insertions(+) diff --git a/include/wx/mac/radiobox.h b/include/wx/mac/radiobox.h index 73119114f0..f46628180e 100644 --- a/include/wx/mac/radiobox.h +++ b/include/wx/mac/radiobox.h @@ -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 diff --git a/src/mac/carbon/radiobox.cpp b/src/mac/carbon/radiobox.cpp index 3f3279dd04..b18f098d3c 100644 --- a/src/mac/carbon/radiobox.cpp +++ b/src/mac/carbon/radiobox.cpp @@ -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() { diff --git a/src/mac/carbon/radiobut.cpp b/src/mac/carbon/radiobut.cpp index aff004469b..94aad1efaf 100644 --- a/src/mac/carbon/radiobut.cpp +++ b/src/mac/carbon/radiobut.cpp @@ -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); } diff --git a/src/mac/radiobox.cpp b/src/mac/radiobox.cpp index 3f3279dd04..b18f098d3c 100644 --- a/src/mac/radiobox.cpp +++ b/src/mac/radiobox.cpp @@ -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() { diff --git a/src/mac/radiobut.cpp b/src/mac/radiobut.cpp index aff004469b..94aad1efaf 100644 --- a/src/mac/radiobut.cpp +++ b/src/mac/radiobut.cpp @@ -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); } -- 2.47.2