]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/choiccmn.cpp
Have wxComboCtrl honour any custom foreground and background colour.
[wxWidgets.git] / src / common / choiccmn.cpp
index 57ec42af309c15b6fd71bd8b184530aa2e2c6b11..64f8a92347e01da7d80b107e513fdde002f4ec48 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        common/choiccmn.cpp
+// Name:        src/common/choiccmn.cpp
 // Purpose:     common (to all ports) wxChoice functions
 // Author:      Vadim Zeitlin
 // Modified by:
 // headers
 // ----------------------------------------------------------------------------
 
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-    #pragma implementation "choicebase.h"
-#endif
-
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
 
 #if wxUSE_CHOICE
 
+#include "wx/choice.h"
+
 #ifndef WX_PRECOMP
-    #include "wx/choice.h"
 #endif
 
+const char wxChoiceNameStr[] = "choice";
+
 // ============================================================================
 // implementation
 // ============================================================================
 
-// ----------------------------------------------------------------------------
-// selection
-// ----------------------------------------------------------------------------
-
-bool wxChoiceBase::SetStringSelection(const wxString& s)
+wxChoiceBase::~wxChoiceBase()
 {
-    int sel = FindString(s);
-    wxCHECK_MSG( sel != -1, false,
-                 wxT("invalid string in wxChoice::SetStringSelection") );
-
-    Select(sel);
-
-    return true;
+    // this destructor is required for Darwin
 }
 
 // ----------------------------------------------------------------------------
@@ -59,9 +48,8 @@ bool wxChoiceBase::SetStringSelection(const wxString& s)
 
 void wxChoiceBase::Command(wxCommandEvent& event)
 {
-    SetSelection(event.m_commandInt);
-    (void)ProcessEvent(event);
+    SetSelection(event.GetInt());
+    (void)GetEventHandler()->ProcessEvent(event);
 }
 
 #endif // wxUSE_CHOICE
-