]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/combobox_osx.cpp
Fix link errors under Cygwin with wxUSE_GRAPHICS_CONTEXT==1.
[wxWidgets.git] / src / osx / combobox_osx.cpp
index 214bdbdff4611cb5d23a4247635fc17ca8a1fd0a..bf092f3772fdfacb043e0bbe96e6ae5fc4c3e95e 100644 (file)
@@ -4,7 +4,7 @@
 // Author:      Stefan Csomor
 // Modified by:
 // Created:     1998-01-01
-// RCS-ID:      $Id: combobox_osx.cpp 58318 2009-01-23 08:36:16Z RR $
+// RCS-ID:      $Id$
 // Copyright:   (c) Stefan Csomor
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
@@ -21,8 +21,6 @@
 
 // work in progress
 
-IMPLEMENT_DYNAMIC_CLASS(wxComboBox, wxControl)
-
 wxComboBox::~wxComboBox()
 {
 }
@@ -122,15 +120,11 @@ int wxComboBox::DoInsertItems(const wxArrayStringsAdapter& items,
 // ----------------------------------------------------------------------------
 void wxComboBox::DoSetItemClientData(unsigned int n, void* clientData)
 {
-    wxCHECK_RET( IsValid(n), "invalid index" );
-
     m_datas[n] = (char*)clientData ;
 }
 
 void * wxComboBox::DoGetItemClientData(unsigned int n) const
 {
-    wxCHECK_MSG( IsValid(n), NULL, "invalid index" );
-
     return (void *)m_datas[n];
 }
 
@@ -186,12 +180,15 @@ int wxComboBox::FindString(const wxString& s, bool bCase) const
 
 wxString wxComboBox::GetString(unsigned int n) const
 {
+    wxCHECK_MSG( n < GetCount(), wxString(), "Invalid combobox index" );
+
     return GetComboPeer()->GetStringAtIndex(n);
 }
 
 wxString wxComboBox::GetStringSelection() const
 {
-    return GetString(GetSelection());
+    const int sel = GetSelection();
+    return sel == wxNOT_FOUND ? wxString() : GetString(sel);
 }
 
 void wxComboBox::SetString(unsigned int n, const wxString& s)