X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a8680e3e0e5066d35a8f4fd43294ba4bfcaf4ba7..42c37decc53971441199dfe4d8adf7fb842b2336:/src/motif/choice.cpp diff --git a/src/motif/choice.cpp b/src/motif/choice.cpp index d8f2533de4..233a0670e5 100644 --- a/src/motif/choice.cpp +++ b/src/motif/choice.cpp @@ -9,7 +9,7 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "choice.h" #endif @@ -209,12 +209,20 @@ int wxChoice::DoAppend(const wxString& item) return GetCount() - 1; } +int wxChoice::DoInsert(const wxString& item, int pos) +{ + wxCHECK_MSG(FALSE, -1, wxT("insert not implemented")); + +// wxCHECK_MSG((pos>=0) && (pos<=GetCount()), -1, wxT("invalid index")); +// if (pos == GetCount()) return DoAppend(item); +} + void wxChoice::Delete(int n) { Widget w = (Widget)m_widgetArray[n]; XtRemoveCallback(w, XmNactivateCallback, (XtCallbackProc)wxChoiceCallback, (XtPointer)this); - m_stringList.DeleteNode(m_stringList.Item(n)); + m_stringList.Erase(m_stringList.Item(n)); m_widgetArray.RemoveAt(size_t(n)); m_clientDataDict.Delete(n, HasClientObjectData()); @@ -259,7 +267,7 @@ int wxChoice::GetSelection() const if (!s.IsEmpty()) { int i = 0; - for (wxStringListNode* node = m_stringList.GetFirst (); + for (wxStringList::compatibility_iterator node = m_stringList.GetFirst (); node; node = node->GetNext ()) { if (wxStrcmp(node->GetData(), s.c_str()) == 0) @@ -279,7 +287,7 @@ void wxChoice::SetSelection(int n) { m_inSetValue = TRUE; - wxStringListNode *node = m_stringList.Item(n); + wxStringList::compatibility_iterator node = m_stringList.Item(n); if (node) { #if 0 @@ -310,7 +318,7 @@ void wxChoice::SetSelection(int n) int wxChoice::FindString(const wxString& s) const { int i = 0; - for (wxStringListNode* node = m_stringList.GetFirst(); + for (wxStringList::compatibility_iterator node = m_stringList.GetFirst(); node; node = node->GetNext ()) { if (s == node->GetData()) @@ -324,7 +332,7 @@ int wxChoice::FindString(const wxString& s) const wxString wxChoice::GetString(int n) const { - wxStringListNode *node = m_stringList.Item(n); + wxStringList::compatibility_iterator node = m_stringList.Item(n); if (node) return node->GetData(); else @@ -515,7 +523,7 @@ wxSize wxChoice::GetItemsSize() const // get my GetTextExtent( "|", &x, &my ); - wxStringList::Node* curr = m_stringList.GetFirst(); + wxStringList::compatibility_iterator curr = m_stringList.GetFirst(); while( curr ) { GetTextExtent( curr->GetData(), &x, &y );