X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7d8268a1d64de58aab194e4d8ae800c755990aad..ce7208d49d5ce2ca1dc0b3b83f14f1d04f29c4bf:/src/motif/combobox.cpp diff --git a/src/motif/combobox.cpp b/src/motif/combobox.cpp index 0b6a229487..de2b16e9b1 100644 --- a/src/motif/combobox.cpp +++ b/src/motif/combobox.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: combobox.cpp +// Name: src/motif/combobox.cpp // Purpose: wxComboBox class // Author: Julian Smart // Modified by: @@ -9,19 +9,16 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma implementation "combobox.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#include "wx/setup.h" - #if wxUSE_COMBOBOX #include "wx/combobox.h" -#include "wx/arrstr.h" + +#ifndef WX_PRECOMP + #include "wx/arrstr.h" +#endif #ifdef __VMS__ #pragma message disable nosimpint @@ -120,7 +117,9 @@ wxComboBox::~wxComboBox() m_clientDataDict.DestroyData(); } -void wxComboBox::DoSetSize(int x, int y, int width, int height, int sizeFlags) +void wxComboBox::DoSetSize(int x, int y, + int width, int WXUNUSED(height), + int sizeFlags) { // Necessary so it doesn't call wxChoice::SetSize wxWindow::DoSetSize(x, y, width, DoGetBestSize().y, sizeFlags); @@ -148,7 +147,7 @@ void wxComboBox::SetValue(const wxString& value) m_inSetValue = false; } -void wxComboBox::SetString(int n, const wxString& s) +void wxComboBox::SetString(unsigned int WXUNUSED(n), const wxString& WXUNUSED(s)) { wxFAIL_MSG( wxT("wxComboBox::SetString only implemented for Motif 2.0") ); } @@ -163,10 +162,10 @@ int wxComboBox::DoAppend(const wxString& item) return GetCount() - 1; } -int wxComboBox::DoInsert(const wxString& item, int pos) +int wxComboBox::DoInsert(const wxString& item, unsigned int pos) { wxCHECK_MSG(!(GetWindowStyle() & wxCB_SORT), -1, wxT("can't insert into sorted list")); - wxCHECK_MSG((pos>=0) && (pos<=GetCount()), -1, wxT("invalid index")); + wxCHECK_MSG(IsValidInsert(pos), -1, wxT("invalid index")); if (pos == GetCount()) return DoAppend(item); @@ -180,7 +179,7 @@ int wxComboBox::DoInsert(const wxString& item, int pos) return pos; } -void wxComboBox::Delete(int n) +void wxComboBox::Delete(unsigned int n) { XmComboBoxDeletePos((Widget) m_mainWidget, n+1); wxStringList::Node *node = m_stringList.Item(n); @@ -217,7 +216,7 @@ int wxComboBox::GetSelection (void) const return sel - 1; } -wxString wxComboBox::GetString(int n) const +wxString wxComboBox::GetString(unsigned int n) const { wxStringList::Node *node = m_stringList.Item(n); if (node) @@ -226,8 +225,10 @@ wxString wxComboBox::GetString(int n) const return wxEmptyString; } -int wxComboBox::FindString(const wxString& s) const +int wxComboBox::FindString(const wxString& s, bool WXUNUSED(bCase)) const { + // FIXME: back to base class for not supported value of bCase + int *pos_list = NULL; int count = 0; wxXmString text( s ); @@ -241,7 +242,7 @@ int wxComboBox::FindString(const wxString& s) const return pos; } - return -1; + return wxNOT_FOUND; } // Clipboard operations @@ -324,7 +325,7 @@ void wxComboBoxCallback (Widget WXUNUSED(w), XtPointer clientData, event.SetClientObject( item->GetClientObject(cbs->index - 1) ); else if ( item->HasClientUntypedData() ) event.SetClientData( item->GetClientData(cbs->index - 1) ); - event.SetExtraLong(TRUE); + event.SetExtraLong(true); event.SetEventObject(item); item->ProcessCommand (event); break; @@ -334,7 +335,7 @@ void wxComboBoxCallback (Widget WXUNUSED(w), XtPointer clientData, wxCommandEvent event (wxEVT_COMMAND_TEXT_UPDATED, item->GetId()); event.SetInt(-1); event.SetString( item->GetValue() ); - event.SetExtraLong(TRUE); + event.SetExtraLong(true); event.SetEventObject(item); item->ProcessCommand (event); break;