X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3a73cc52036fd2a18810c36a5c21766da4b23d0a..404f1d80d8211110151f5e89591805ee5e0dc555:/src/motif/choice.cpp diff --git a/src/motif/choice.cpp b/src/motif/choice.cpp index 3407965764..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 @@ -179,7 +179,7 @@ int wxChoice::DoAppend(const wxString& item) #endif NULL); - DoChangeBackgroundColour((WXWidget) w, m_backgroundColour); + wxDoChangeBackgroundColour((WXWidget) w, m_backgroundColour); if( m_font.Ok() ) wxDoChangeFont( w, m_font ); @@ -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 @@ -459,22 +467,22 @@ void wxChoice::ChangeFont(bool keepOriginalSize) void wxChoice::ChangeBackgroundColour() { - DoChangeBackgroundColour(m_formWidget, m_backgroundColour); - DoChangeBackgroundColour(m_buttonWidget, m_backgroundColour); - DoChangeBackgroundColour(m_menuWidget, m_backgroundColour); + wxDoChangeBackgroundColour(m_formWidget, m_backgroundColour); + wxDoChangeBackgroundColour(m_buttonWidget, m_backgroundColour); + wxDoChangeBackgroundColour(m_menuWidget, m_backgroundColour); size_t i; for (i = 0; i < m_noStrings; i++) - DoChangeBackgroundColour(m_widgetArray[i], m_backgroundColour); + wxDoChangeBackgroundColour(m_widgetArray[i], m_backgroundColour); } void wxChoice::ChangeForegroundColour() { - DoChangeForegroundColour(m_formWidget, m_foregroundColour); - DoChangeForegroundColour(m_buttonWidget, m_foregroundColour); - DoChangeForegroundColour(m_menuWidget, m_foregroundColour); + wxDoChangeForegroundColour(m_formWidget, m_foregroundColour); + wxDoChangeForegroundColour(m_buttonWidget, m_foregroundColour); + wxDoChangeForegroundColour(m_menuWidget, m_foregroundColour); size_t i; for (i = 0; i < m_noStrings; i++) - DoChangeForegroundColour(m_widgetArray[i], m_foregroundColour); + wxDoChangeForegroundColour(m_widgetArray[i], m_foregroundColour); } int wxChoice::GetCount() const @@ -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 );