wxChoice derives from wxChoiceBase; renamed Append to DoAppend

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16730 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart 2002-08-24 10:54:15 +00:00
parent 3f2b72b240
commit c33c81c30f
2 changed files with 7 additions and 5 deletions

View File

@ -16,12 +16,10 @@
#pragma interface "choice.h" #pragma interface "choice.h"
#endif #endif
#include "wx/ctrlsub.h"
WXDLLEXPORT_DATA(extern const char*) wxChoiceNameStr; WXDLLEXPORT_DATA(extern const char*) wxChoiceNameStr;
// Choice item // Choice item
class WXDLLEXPORT wxChoice: public wxControlWithItems class WXDLLEXPORT wxChoice: public wxChoiceBase
{ {
DECLARE_DYNAMIC_CLASS(wxChoice) DECLARE_DYNAMIC_CLASS(wxChoice)
@ -63,7 +61,7 @@ public:
virtual void SetString(int n, const wxString& s); virtual void SetString(int n, const wxString& s);
// Original API // Original API
virtual void Append(const wxString& item); // virtual void Append(const wxString& item);
virtual void Delete(int n); virtual void Delete(int n);
virtual void Clear(); virtual void Clear();
virtual int GetSelection() const ; virtual int GetSelection() const ;

View File

@ -172,7 +172,7 @@ wxChoice::~wxChoice()
} }
} }
void wxChoice::Append(const wxString& item) int wxChoice::DoAppend(const wxString& item)
{ {
Widget w = XtVaCreateManagedWidget (wxStripMenuCodes(item), Widget w = XtVaCreateManagedWidget (wxStripMenuCodes(item),
#if USE_GADGETS #if USE_GADGETS
@ -226,6 +226,8 @@ void wxChoice::Append(const wxString& item)
m_clientList.Insert( m_clientList.Item(m_noStrings-1), m_clientList.Insert( m_clientList.Item(m_noStrings-1),
(wxObject*) NULL ); (wxObject*) NULL );
m_noStrings ++; m_noStrings ++;
return Number() - 1;
} }
void wxChoice::Delete(int WXUNUSED(n)) void wxChoice::Delete(int WXUNUSED(n))
@ -517,11 +519,13 @@ int wxChoice::GetCount() const
return Number(); return Number();
} }
/*
int wxChoice::DoAppend(const wxString& item) int wxChoice::DoAppend(const wxString& item)
{ {
Append(item); Append(item);
return GetCount() - 1; return GetCount() - 1;
} }
*/
// Just appends, doesn't yet insert // Just appends, doesn't yet insert
void wxChoice::DoInsertItems(const wxArrayString& items, int WXUNUSED(pos)) void wxChoice::DoInsertItems(const wxArrayString& items, int WXUNUSED(pos))