]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/radiobox.cpp
changed Mac Mouse Moved Hysteresis (area in which mouse movements do NOT generate...
[wxWidgets.git] / src / mac / carbon / radiobox.cpp
index 1f74fae6d21774cfdc4b900d3f616e3b0862b39f..b18f098d3c4197e811a6c974acbddbda93a67f81 100644 (file)
@@ -18,7 +18,8 @@
 #endif
 
 #include "wx/radiobox.h"
-#include <wx/mac/uma.h>
+#include "wx/radiobut.h"
+#include "wx/mac/uma.h"
 
 #if !USE_SHARED_LIBRARY
 IMPLEMENT_DYNAMIC_CLASS(wxRadioBox, wxControl)
@@ -31,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()
 {
@@ -104,8 +118,11 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& label,
 
     for (i = 0; i < n; i++)
     {
-        wxRadioButton *radBtn = new wxRadioButton(this, NewControlId(),choices[i],wxPoint(5,20*i+10));
-        m_radioButtonCycle=radBtn->AddInCycle(m_radioButtonCycle);
+        wxRadioButton *radBtn = new wxRadioButton(this, NewControlId(),choices[i],wxPoint(5,20*i+10),
+          wxDefaultSize , i == 0 ? wxRB_GROUP : 0 ) ;
+        if ( i == 0 )
+          m_radioButtonCycle = radBtn ;
+//        m_radioButtonCycle=radBtn->AddInCycle(m_radioButtonCycle);
     }
 
        SetSelection(0);