]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/wince/choicece.cpp
added semicolons after wxCHECK()s (part of patch 1450705)
[wxWidgets.git] / src / msw / wince / choicece.cpp
index 397ba4ec1403ec0f87cffbb3c4ef63451a23a97d..fba1e4d019e3a86039b6f07ffc0eba1a9d8d49c4 100644 (file)
@@ -9,7 +9,6 @@
 // License:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
-
 // ============================================================================
 // declarations
 // ============================================================================
 // headers
 // ----------------------------------------------------------------------------
 
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-    #pragma implementation "choicece.h"
-#endif
-
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
     #pragma hdrstop
 #endif
 
+#if wxUSE_CHOICE && defined(__SMARTPHONE__) && defined(__WXWINCE__)
+
 #ifndef WX_PRECOMP
     #include "wx/choice.h"
+    #include <commctrl.h>
+    #include "wx/msw/missing.h"
+    #include "wx/msw/winundef.h"
 #endif
 
 #include "wx/spinbutt.h" // for wxSpinnerBestSize
 
-#include <commctrl.h>
-#include "wx/msw/missing.h"
-#include "wx/msw/winundef.h"
-
-#if wxUSE_CHOICE && defined(__SMARTPHONE__) && defined(__WXWINCE__)
-
 #if wxUSE_EXTENDED_RTTI
 // TODO
 #else
@@ -228,7 +222,7 @@ bool wxChoice::CreateAndInit(wxWindow *parent,
     if ( style & wxSP_WRAP )
         spiner_style |= UDS_WRAP;
 
-    if ( !MSWCreateControl(UPDOWN_CLASS, spiner_style, posBtn, sizeBtn, _T(""), 0) )
+    if ( !MSWCreateControl(UPDOWN_CLASS, spiner_style, posBtn, sizeBtn, wxEmptyString, 0) )
         return false;
 
     // subclass the text ctrl to be able to intercept some events
@@ -354,7 +348,7 @@ int wxChoice::DoAppend(const wxString& item)
 int wxChoice::DoInsert(const wxString& item, int pos)
 {
     wxCHECK_MSG(!(GetWindowStyle() & wxCB_SORT), -1, wxT("can't insert into choice"));
-    wxCHECK_MSG((pos>=0) && (pos<=GetCount()), -1, wxT("invalid index"));
+    wxCHECK_MSG(IsValidInsert(pos), -1, wxT("invalid index"));
 
     int n = (int)::SendMessage(GetBuddyHwnd(), LB_INSERTSTRING, pos, (LPARAM)item.c_str());
     if ( n == LB_ERR )
@@ -367,7 +361,7 @@ int wxChoice::DoInsert(const wxString& item, int pos)
 
 void wxChoice::Delete(int n)
 {
-    wxCHECK_RET( n < GetCount(), wxT("invalid item index in wxChoice::Delete") );
+    wxCHECK_RET( IsValid(n), wxT("invalid item index in wxChoice::Delete") );
 
     if ( HasClientObjectData() )
     {
@@ -414,13 +408,17 @@ void wxChoice::SetSelection(int n)
 // string list functions
 // ----------------------------------------------------------------------------
 
-int wxChoice::GetCount() const
+size_t wxChoice::GetCount() const
 {
-    return (int)::SendMessage(GetBuddyHwnd(), LB_GETCOUNT, 0, 0);
+    return (size_t)::SendMessage(GetBuddyHwnd(), LB_GETCOUNT, 0, 0);
 }
 
-int wxChoice::FindString(const wxString& s) const
+int wxChoice::FindString(const wxString& s, bool bCase) const
 {
+    // back to base class search for not native search type
+    if (bCase)
+       return wxItemContainerImmutable::FindString( s, bCase );
+
     int pos = (int)::SendMessage(GetBuddyHwnd(), LB_FINDSTRINGEXACT,
                                (WPARAM)-1, (LPARAM)s.c_str());
 
@@ -429,7 +427,7 @@ int wxChoice::FindString(const wxString& s) const
 
 void wxChoice::SetString(int n, const wxString& s)
 {
-    wxCHECK_RET( n >= 0 && n < GetCount(),
+    wxCHECK_RET( IsValid(n),
                  wxT("invalid item index in wxChoice::SetString") );
 
     // we have to delete and add back the string as there is no way to change a