Added some missing STL-like wxArray/wxArrayString constructors.

Added helper class wxCArrayString, better replacement for
wxArrayString::GetStringArray.
  Added overloaded constructors and Create() methods taking
a wxArrayString for wxCheckListBox, wxChoice, wxComboBox,
wxListBox, wxRadioBox, wxSingleChoiceDialog, wxMultipleChoiceDialog.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25440 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Mattia Barbon 2004-01-31 18:21:45 +00:00
parent 55945915c9
commit 584ad2a32f
95 changed files with 1707 additions and 28 deletions

View File

@ -51,7 +51,8 @@ versions, please update your code to not use them.
- wxTheFontMapper: use wxFontMapper::Get() instead
- wxStringHashTable: use wxHashMap instead
- wxHashTableLong: use wxHashMap instead
- wxArrayString::GetStringArray: no replacement
- wxArrayString::GetStringArray: use wxCArrayString or alternative wxWindows
methods taking wxArrayString
- wxArrayString::Remove(index, count): use RemoveAt instead
- wxTreeItemId conversion to long is deprecated and shouldn't be used
- [MSW only] wxWindow::GetUseCtl3D(), GetTransparentBackground() and
@ -91,6 +92,9 @@ All:
wxSize (Wlodzimierz Skiba)
- intermediate wxIPaddress class added to prepare for
wxIPV6address (Ray Gilbert)
- added overloaded constructors and Create() methods taking wxArrayString
for wxChoice, wxComboBox, wxListBox, wxRadioBox, wxCheckListBox,
wxSingleChoiceDialog, wxMultipleChoiceDialog
All (GUI):

View File

@ -92,10 +92,8 @@ public:
// constructors and destructor
// default ctor
wxArrayString()
: m_nSize(0), m_nCount(0), m_pItems(NULL), m_autoSort(FALSE)
{ Init(FALSE); }
// if autoSort is TRUE, the array is always sorted (in alphabetical order)
wxArrayString() { Init(false); }
// if autoSort is true, the array is always sorted (in alphabetical order)
//
// NB: the reason for using int and not bool is that like this we can avoid
// using this ctor for implicit conversions from "const char *" (which
@ -103,9 +101,7 @@ public:
//
// of course, using explicit would be even better - if all compilers
// supported it...
wxArrayString(int autoSort)
: m_nSize(0), m_nCount(0), m_pItems(NULL), m_autoSort(FALSE)
{ Init(autoSort != 0); }
wxArrayString(int autoSort) { Init(autoSort != 0); }
// copy ctor
wxArrayString(const wxArrayString& array);
// assignment operator
@ -155,14 +151,16 @@ public:
// take one in their ctor. You must delete[] it yourself
// once you are done with it. Will return NULL if the
// ArrayString was empty.
#if WXWIN_COMPATIBILITY_2_4
wxString* GetStringArray() const;
#endif
// item management
// Search the element in the array, starting from the beginning if
// bFromEnd is FALSE or from end otherwise. If bCase, comparison is case
// bFromEnd is false or from end otherwise. If bCase, comparison is case
// sensitive (default). Returns index of the first item matched or
// wxNOT_FOUND
int Index (const wxChar *sz, bool bCase = TRUE, bool bFromEnd = FALSE) const;
int Index (const wxChar *sz, bool bCase = true, bool bFromEnd = false) const;
// add new element at the end (if the array is not sorted), return its
// index
size_t Add(const wxString& str, size_t nInsert = 1);
@ -180,8 +178,8 @@ public:
// sorting
// sort array elements in alphabetical order (or reversed alphabetical
// order if reverseOrder parameter is TRUE)
void Sort(bool reverseOrder = FALSE);
// order if reverseOrder parameter is true)
void Sort(bool reverseOrder = false);
// sort array elements using specified comparaison function
void Sort(CompareFunction compareFunction);
void Sort(CompareFunction2 compareFunction);
@ -257,6 +255,9 @@ public:
bool operator !=(const itor& it) { return m_ptr != it.m_ptr; }
};
wxArrayString(const_iterator first, const_iterator last)
{ Init(false); assign(first, last); }
wxArrayString(size_type n, const_reference v) { Init(false); assign(n, v); }
void assign(const_iterator first, const_iterator last);
void assign(size_type n, const_reference v)
{ clear(); Add(v, n); }
@ -309,18 +310,43 @@ private:
wxChar **m_pItems; // pointer to data
bool m_autoSort; // if TRUE, keep the array always sorted
bool m_autoSort; // if true, keep the array always sorted
};
class WXDLLIMPEXP_BASE wxSortedArrayString : public wxArrayString
{
public:
wxSortedArrayString() : wxArrayString(TRUE)
wxSortedArrayString() : wxArrayString(true)
{ }
wxSortedArrayString(const wxArrayString& array) : wxArrayString(TRUE)
wxSortedArrayString(const wxArrayString& array) : wxArrayString(true)
{ Copy(array); }
};
#endif // !wxUSE_STL
// this class provides a temporary wxString* from a
// wxArrayString
class WXDLLIMPEXP_BASE wxCArrayString
{
public:
wxCArrayString( const wxArrayString& array )
: m_array( array ), m_strings( NULL )
{ }
~wxCArrayString() { delete[] m_strings; }
size_t GetCount() const { return m_array.GetCount(); }
wxString* GetStrings()
{
if( m_strings ) return m_strings;
size_t count = m_array.GetCount();
m_strings = new wxString[count];
for( size_t i = 0; i < count; ++i )
m_strings[i] = m_array[i];
return m_strings;
}
private:
const wxArrayString& m_array;
wxString* m_strings;
};
#endif

View File

@ -37,6 +37,16 @@ public:
{
Create(parent, winid, pos, size, n, choices, style, validator, name);
}
wxCheckListBox(wxWindow *parent, wxWindowID winid,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr)
{
Create(parent, winid, pos, size, choices, style, validator, name);
}
bool Create(wxWindow *parent, wxWindowID winid,
const wxPoint& pos = wxDefaultPosition,
@ -45,6 +55,13 @@ public:
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
bool Create(wxWindow *parent, wxWindowID winid,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
virtual ~wxCheckListBox();
// ------------------------------------------------------------------------

View File

@ -15,6 +15,8 @@
//#include "wx/cocoa/NSPopUpButton.h"
#include "wx/cocoa/NSMenu.h"
class WXDLLIMPEXP_BASE wxSortedArrayString;
// ========================================================================
// wxChoice
// ========================================================================
@ -39,6 +41,17 @@ public:
Init();
Create(parent, winid, pos, size, n, choices, style, validator, name);
}
wxChoice(wxWindow *parent, wxWindowID winid,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr)
{
Init();
Create(parent, winid, pos, size, choices, style, validator, name);
}
bool Create(wxWindow *parent, wxWindowID winid,
const wxPoint& pos = wxDefaultPosition,
@ -47,6 +60,13 @@ public:
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr);
bool Create(wxWindow *parent, wxWindowID winid,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr);
virtual ~wxChoice();
protected:
void Init();

View File

@ -40,6 +40,18 @@ public:
{
Create(parent, winid, value, pos, size, n, choices, style, validator, name);
}
wxComboBox(wxWindow *parent, wxWindowID winid,
const wxString& value,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr)
{
Create(parent, winid, value, pos, size, choices, style,
validator, name);
}
bool Create(wxWindow *parent, wxWindowID winid,
const wxString& value = wxEmptyString,
@ -49,6 +61,14 @@ public:
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr);
bool Create(wxWindow *parent, wxWindowID winid,
const wxString& value,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr);
virtual ~wxComboBox();
// ------------------------------------------------------------------------

View File

@ -39,6 +39,16 @@ public:
{
Create(parent, winid, pos, size, n, choices, style, validator, name);
}
wxListBox(wxWindow *parent, wxWindowID winid,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr)
{
Create(parent, winid, pos, size, choices, style, validator, name);
}
bool Create(wxWindow *parent, wxWindowID winid,
const wxPoint& pos = wxDefaultPosition,
@ -47,6 +57,13 @@ public:
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
bool Create(wxWindow *parent, wxWindowID winid,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
virtual ~wxListBox();
// ------------------------------------------------------------------------

View File

@ -38,6 +38,17 @@ public:
{
Create(parent, winid, title, pos, size, n, choices, majorDim, style, validator, name);
}
wxRadioBox(wxWindow *parent, wxWindowID winid,
const wxString& title,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
int majorDim = 0,
long style = 0, const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxRadioBoxNameStr)
{
Create(parent, winid, title, pos, size, choices, majorDim, style, validator, name);
}
bool Create(wxWindow *parent, wxWindowID winid,
const wxString& title,
@ -48,6 +59,15 @@ public:
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxRadioBoxNameStr);
bool Create(wxWindow *parent, wxWindowID winid,
const wxString& title,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
int majorDim = 0,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxRadioBoxNameStr);
virtual ~wxRadioBox();
// ------------------------------------------------------------------------

View File

@ -442,6 +442,9 @@ public: \
bool operator !=(const itor& it) { return m_ptr != it.m_ptr; } \
}; \
\
name(size_type n, const_reference v) { assign(n, v); } \
name(const_iterator first, const_iterator last) \
{ assign(first, last); } \
void assign(const_iterator first, const_iterator last) \
{ base::assign((bconst_iterator)first, (bconst_iterator)last); } \
void assign(size_type n, const_reference v) \

View File

@ -51,6 +51,17 @@ public:
(void)Create(parent, message, caption, n, choices,
styleDlg, pos, styleLbox);
}
wxAnyChoiceDialog(wxWindow *parent,
const wxString& message,
const wxString& caption,
const wxArrayString& choices,
long styleDlg = wxCHOICEDLG_STYLE,
const wxPoint& pos = wxDefaultPosition,
long styleLbox = wxLB_ALWAYS_SB)
{
(void)Create(parent, message, caption, choices,
styleDlg, pos, styleLbox);
}
bool Create(wxWindow *parent,
const wxString& message,
@ -59,6 +70,13 @@ public:
long styleDlg = wxCHOICEDLG_STYLE,
const wxPoint& pos = wxDefaultPosition,
long styleLbox = wxLB_ALWAYS_SB);
bool Create(wxWindow *parent,
const wxString& message,
const wxString& caption,
const wxArrayString& choices,
long styleDlg = wxCHOICEDLG_STYLE,
const wxPoint& pos = wxDefaultPosition,
long styleLbox = wxLB_ALWAYS_SB);
protected:
wxListBox *m_listbox;
@ -86,6 +104,13 @@ public:
char **clientData = (char **)NULL,
long style = wxCHOICEDLG_STYLE,
const wxPoint& pos = wxDefaultPosition);
wxSingleChoiceDialog(wxWindow *parent,
const wxString& message,
const wxString& caption,
const wxArrayString& choices,
char **clientData = (char **)NULL,
long style = wxCHOICEDLG_STYLE,
const wxPoint& pos = wxDefaultPosition);
bool Create(wxWindow *parent,
const wxString& message,
@ -95,6 +120,13 @@ public:
char **clientData = (char **)NULL,
long style = wxCHOICEDLG_STYLE,
const wxPoint& pos = wxDefaultPosition);
bool Create(wxWindow *parent,
const wxString& message,
const wxString& caption,
const wxArrayString& choices,
char **clientData = (char **)NULL,
long style = wxCHOICEDLG_STYLE,
const wxPoint& pos = wxDefaultPosition);
void SetSelection(int sel);
int GetSelection() const { return m_selection; }
@ -135,6 +167,15 @@ public:
{
(void)Create(parent, message, caption, n, choices, style, pos);
}
wxMultiChoiceDialog(wxWindow *parent,
const wxString& message,
const wxString& caption,
const wxArrayString& choices,
long style = wxCHOICEDLG_STYLE,
const wxPoint& pos = wxDefaultPosition)
{
(void)Create(parent, message, caption, choices, style, pos);
}
bool Create(wxWindow *parent,
const wxString& message,
@ -143,6 +184,12 @@ public:
const wxString *choices,
long style = wxCHOICEDLG_STYLE,
const wxPoint& pos = wxDefaultPosition);
bool Create(wxWindow *parent,
const wxString& message,
const wxString& caption,
const wxArrayString& choices,
long style = wxCHOICEDLG_STYLE,
const wxPoint& pos = wxDefaultPosition);
void SetSelections(const wxArrayInt& selections);
wxArrayInt GetSelections() const { return m_selections; }

View File

@ -44,6 +44,13 @@ public:
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
wxCheckListBox(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
bool IsChecked( int index ) const;
void Check( int index, bool check = TRUE );

View File

@ -15,6 +15,7 @@
#endif
class WXDLLIMPEXP_BASE wxSortedArrayString;
class WXDLLIMPEXP_BASE wxArrayString;
//-----------------------------------------------------------------------------
// wxChoice
@ -36,6 +37,18 @@ public:
Create(parent, id, pos, size, n, choices, style, validator, name);
}
wxChoice( wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr )
{
m_strings = (wxSortedArrayString *)NULL;
Create(parent, id, pos, size, choices, style, validator, name);
}
~wxChoice();
bool Create( wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
@ -44,6 +57,13 @@ public:
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr );
bool Create( wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr );
// implement base class pure virtuals
void Delete(int n);

View File

@ -54,6 +54,17 @@ public:
{
Create(parent, id, value, pos, size, n, choices, style, validator, name);
}
inline wxComboBox(wxWindow *parent, wxWindowID id,
const wxString& value,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr)
{
Create(parent, id, value, pos, size, choices, style, validator, name);
}
~wxComboBox();
@ -65,6 +76,14 @@ public:
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr);
bool Create(wxWindow *parent, wxWindowID id,
const wxString& value,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr);
void Clear();
void Delete( int n );

View File

@ -41,6 +41,19 @@ public:
#endif // wxUSE_CHECKLISTBOX
Create(parent, id, pos, size, n, choices, style, validator, name);
}
wxListBox( wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr )
{
#if wxUSE_CHECKLISTBOX
m_hasCheckBoxes = FALSE;
#endif // wxUSE_CHECKLISTBOX
Create(parent, id, pos, size, choices, style, validator, name);
}
virtual ~wxListBox();
bool Create(wxWindow *parent, wxWindowID id,
@ -50,6 +63,13 @@ public:
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
// implement base class pure virtuals
virtual void Clear();

View File

@ -41,6 +41,21 @@ public:
Create( parent, id, title, pos, size, n, choices, majorDim, style, val, name );
}
wxRadioBox(wxWindow *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
int majorDim = 1,
long style = wxRA_HORIZONTAL,
const wxValidator& val = wxDefaultValidator,
const wxString& name = wxRadioBoxNameStr)
{
Init();
Create( parent, id, title, pos, size, choices, majorDim, style, val, name );
}
virtual ~wxRadioBox();
bool Create(wxWindow *parent,
@ -54,6 +69,16 @@ public:
long style = wxRA_HORIZONTAL,
const wxValidator& val = wxDefaultValidator,
const wxString& name = wxRadioBoxNameStr);
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
int majorDim = 0,
long style = wxRA_HORIZONTAL,
const wxValidator& val = wxDefaultValidator,
const wxString& name = wxRadioBoxNameStr);
int FindString( const wxString& s) const;
void SetSelection( int n );

View File

@ -44,6 +44,13 @@ public:
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
wxCheckListBox(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
bool IsChecked( int index ) const;
void Check( int index, bool check = TRUE );

View File

@ -15,6 +15,7 @@
#endif
class WXDLLIMPEXP_BASE wxSortedArrayString;
class WXDLLIMPEXP_BASE wxArrayString;
//-----------------------------------------------------------------------------
// wxChoice
@ -36,6 +37,18 @@ public:
Create(parent, id, pos, size, n, choices, style, validator, name);
}
wxChoice( wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr )
{
m_strings = (wxSortedArrayString *)NULL;
Create(parent, id, pos, size, choices, style, validator, name);
}
~wxChoice();
bool Create( wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
@ -44,6 +57,13 @@ public:
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr );
bool Create( wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr );
// implement base class pure virtuals
void Delete(int n);

View File

@ -54,6 +54,17 @@ public:
{
Create(parent, id, value, pos, size, n, choices, style, validator, name);
}
inline wxComboBox(wxWindow *parent, wxWindowID id,
const wxString& value,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr)
{
Create(parent, id, value, pos, size, choices, style, validator, name);
}
~wxComboBox();
@ -65,6 +76,14 @@ public:
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr);
bool Create(wxWindow *parent, wxWindowID id,
const wxString& value,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr);
void Clear();
void Delete( int n );

View File

@ -41,6 +41,19 @@ public:
#endif // wxUSE_CHECKLISTBOX
Create(parent, id, pos, size, n, choices, style, validator, name);
}
wxListBox( wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr )
{
#if wxUSE_CHECKLISTBOX
m_hasCheckBoxes = FALSE;
#endif // wxUSE_CHECKLISTBOX
Create(parent, id, pos, size, choices, style, validator, name);
}
virtual ~wxListBox();
bool Create(wxWindow *parent, wxWindowID id,
@ -50,6 +63,13 @@ public:
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
// implement base class pure virtuals
virtual void Clear();

View File

@ -41,6 +41,21 @@ public:
Create( parent, id, title, pos, size, n, choices, majorDim, style, val, name );
}
wxRadioBox(wxWindow *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
int majorDim = 1,
long style = wxRA_HORIZONTAL,
const wxValidator& val = wxDefaultValidator,
const wxString& name = wxRadioBoxNameStr)
{
Init();
Create( parent, id, title, pos, size, choices, majorDim, style, val, name );
}
virtual ~wxRadioBox();
bool Create(wxWindow *parent,
@ -54,6 +69,16 @@ public:
long style = wxRA_HORIZONTAL,
const wxValidator& val = wxDefaultValidator,
const wxString& name = wxRadioBoxNameStr);
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
int majorDim = 0,
long style = wxRA_HORIZONTAL,
const wxValidator& val = wxDefaultValidator,
const wxString& name = wxRadioBoxNameStr);
int FindString( const wxString& s) const;
void SetSelection( int n );

View File

@ -41,6 +41,19 @@ public:
Create(parent, id, pos, size, nStrings, choices, style, validator, name);
}
wxCheckListBox(wxWindow *parent,
wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr)
{
Init();
Create(parent, id, pos, size, choices, style, validator, name);
}
bool Create(wxWindow *parent,
wxWindowID id,
@ -51,6 +64,14 @@ public:
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
bool Create(wxWindow *parent,
wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
// items may be checked
bool IsChecked(size_t uiIndex) const;

View File

@ -18,7 +18,8 @@
#include "wx/control.h"
#include "wx/dynarray.h"
#include "wx/dynarray.h"
#include "wx/arrstr.h"
WXDLLEXPORT_DATA(extern const wxChar*) wxChoiceNameStr;
@ -46,6 +47,16 @@ public:
{
Create(parent, id, pos, size, n, choices, style, validator, name);
}
wxChoice(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr)
{
Create(parent, id, pos, size, choices, style, validator, name);
}
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
@ -54,6 +65,13 @@ public:
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr);
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr);
// implement base class pure virtuals
virtual int DoAppend(const wxString& item);

View File

@ -53,6 +53,17 @@ class WXDLLEXPORT wxComboBox : public wxControl, public wxComboBoxBase
{
Create(parent, id, value, pos, size, n, choices, style, validator, name);
}
inline wxComboBox(wxWindow *parent, wxWindowID id,
const wxString& value,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr)
{
Create(parent, id, value, pos, size, choices, style, validator, name);
}
bool Create(wxWindow *parent, wxWindowID id,
const wxString& value = wxEmptyString,
@ -62,6 +73,14 @@ class WXDLLEXPORT wxComboBox : public wxControl, public wxComboBoxBase
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr);
bool Create(wxWindow *parent, wxWindowID id,
const wxString& value,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr);
// List functions
virtual void Delete(int n);

View File

@ -21,7 +21,7 @@
// simple types
// ----------------------------------------------------------------------------
#include "wx/dynarray.h"
#include "wx/arrstr.h"
#if wxUSE_OWNER_DRAWN
class WXDLLEXPORT wxOwnerDrawn;
@ -58,6 +58,16 @@ public:
{
Create(parent, id, pos, size, n, choices, style, validator, name);
}
wxListBox(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr)
{
Create(parent, id, pos, size, choices, style, validator, name);
}
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
@ -66,6 +76,13 @@ public:
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
virtual ~wxListBox();
virtual void Refresh(bool eraseBack = TRUE, const wxRect *rect = NULL);

View File

@ -18,6 +18,8 @@
class WXDLLEXPORT wxFrame;
#include "wx/arrstr.h"
// ----------------------------------------------------------------------------
// Menu
// ----------------------------------------------------------------------------

View File

@ -35,12 +35,28 @@ public:
{
Create(parent, id, title, pos, size, n, choices, majorDim, style, val, name);
}
inline wxRadioBox(wxWindow *parent, wxWindowID id, const wxString& title,
const wxPoint& pos, const wxSize& size,
const wxArrayString& choices,
int majorDim = 0, long style = wxRA_HORIZONTAL,
const wxValidator& val = wxDefaultValidator,
const wxString& name = wxRadioBoxNameStr)
{
Create(parent, id, title, pos, size, choices,
majorDim, style, val, name);
}
~wxRadioBox();
bool Create(wxWindow *parent, wxWindowID id, const wxString& title,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
int n = 0, const wxString choices[] = NULL,
int majorDim = 0, long style = wxRA_HORIZONTAL,
const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr);
bool Create(wxWindow *parent, wxWindowID id, const wxString& title,
const wxPoint& pos, const wxSize& size,
const wxArrayString& choices,
int majorDim = 0, long style = wxRA_HORIZONTAL,
const wxValidator& val = wxDefaultValidator,
const wxString& name = wxRadioBoxNameStr);
// Specific functions (in wxWindows2 reference)
virtual void SetSelection(int item);

View File

@ -35,6 +35,14 @@ public:
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
wxCheckListBox(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
@ -43,6 +51,14 @@ public:
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
// items may be checked
bool IsChecked(size_t uiIndex) const;
void Check(size_t uiIndex, bool bCheck = TRUE);

View File

@ -46,6 +46,18 @@ public:
Create(parent, id, pos, size, n, choices, style, validator, name);
}
wxChoice(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr)
{
Init();
Create(parent, id, pos, size, choices, style, validator, name);
}
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
@ -54,6 +66,14 @@ public:
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr);
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr);
// implementation of wxControlWithItems
virtual int GetCount() const;
virtual int DoAppend(const wxString& item);

View File

@ -41,6 +41,20 @@ public:
style, validator, name);
}
inline wxComboBox(wxWindow *parent, wxWindowID id,
const wxString& value,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr)
{
m_inSetSelection = false;
Create(parent, id, value, pos, size, choices,
style, validator, name);
}
bool Create(wxWindow *parent, wxWindowID id,
const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
@ -50,6 +64,15 @@ public:
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr);
bool Create(wxWindow *parent, wxWindowID id,
const wxString& value,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr);
// implementation of wxControlWithItems
virtual int DoAppend(const wxString& item);
virtual int DoInsert(const wxString& item, int pos);

View File

@ -40,6 +40,17 @@ public:
Create(parent, id, pos, size, n, choices, style, validator, name);
}
wxListBox(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr)
{
Create(parent, id, pos, size, choices, style, validator, name);
}
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
@ -48,6 +59,14 @@ public:
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
~wxListBox();
// implementation of wxControlWithItems

View File

@ -118,6 +118,7 @@ public:
wxMenuBar() { Init(); }
wxMenuBar(long WXUNUSED(style)) { Init(); }
wxMenuBar(int n, wxMenu *menus[], const wxString titles[]);
wxMenuBar(int n, wxMenu *menus[], const wxArrayString& titles);
virtual ~wxMenuBar();
// implement base class (pure) virtuals

View File

@ -46,6 +46,20 @@ public:
majorDim, style, val, name);
}
wxRadioBox(wxWindow *parent, wxWindowID id, const wxString& title,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
int majorDim = 0, long style = wxRA_HORIZONTAL,
const wxValidator& val = wxDefaultValidator,
const wxString& name = wxRadioBoxNameStr)
{
Init();
Create(parent, id, title, pos, size, choices,
majorDim, style, val, name);
}
~wxRadioBox();
bool Create(wxWindow *parent, wxWindowID id, const wxString& title,
@ -56,6 +70,14 @@ public:
const wxValidator& val = wxDefaultValidator,
const wxString& name = wxRadioBoxNameStr);
bool Create(wxWindow *parent, wxWindowID id, const wxString& title,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
int majorDim = 0, long style = wxRA_HORIZONTAL,
const wxValidator& val = wxDefaultValidator,
const wxString& name = wxRadioBoxNameStr);
int FindString(const wxString& s) const;
void SetSelection(int N);
int GetSelection() const;

View File

@ -36,6 +36,13 @@ public:
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
wxCheckListBox(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
@ -44,6 +51,13 @@ public:
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
// override base class virtuals
virtual void Delete(int n);

View File

@ -38,6 +38,17 @@ public:
{
Create(parent, id, pos, size, n, choices, style, validator, name);
}
wxChoice(wxWindow *parent,
wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr)
{
Create(parent, id, pos, size, choices, style, validator, name);
}
bool Create(wxWindow *parent,
wxWindowID id,
@ -47,6 +58,14 @@ public:
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr);
bool Create(wxWindow *parent,
wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr);
// implement base class pure virtuals
virtual int DoAppend(const wxString& item);

View File

@ -40,6 +40,17 @@ public:
{
Create(parent, id, value, pos, size, n, choices, style, validator, name);
}
wxComboBox(wxWindow *parent, wxWindowID id,
const wxString& value,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr)
{
Create(parent, id, value, pos, size, choices, style, validator, name);
}
bool Create(wxWindow *parent,
wxWindowID id,
@ -51,6 +62,15 @@ public:
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr);
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& value,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr);
// List functions: see wxChoice

View File

@ -53,6 +53,16 @@ public:
{
Create(parent, id, pos, size, n, choices, style, validator, name);
}
wxListBox(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr)
{
Create(parent, id, pos, size, choices, style, validator, name);
}
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
@ -61,6 +71,13 @@ public:
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
virtual ~wxListBox();

View File

@ -41,6 +41,20 @@ public:
(void)Create(parent, id, title, pos, size, n, choices, majorDim,
style, val, name);
}
wxRadioBox(wxWindow *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
int majorDim = 0,
long style = wxRA_HORIZONTAL,
const wxValidator& val = wxDefaultValidator,
const wxString& name = wxRadioBoxNameStr)
{
(void)Create(parent, id, title, pos, size, choices, majorDim,
style, val, name);
}
~wxRadioBox();
@ -54,6 +68,16 @@ public:
long style = wxRA_HORIZONTAL,
const wxValidator& val = wxDefaultValidator,
const wxString& name = wxRadioBoxNameStr);
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
int majorDim = 0,
long style = wxRA_HORIZONTAL,
const wxValidator& val = wxDefaultValidator,
const wxString& name = wxRadioBoxNameStr);
// implement the radiobox interface
virtual void SetSelection(int n);

View File

@ -38,6 +38,15 @@ public:
,const wxValidator& rValidator = wxDefaultValidator
,const wxString& rsName = wxListBoxNameStr
);
wxCheckListBox( wxWindow* pParent
,wxWindowID vId
,const wxPoint& rPos
,const wxSize& vSize
,const wxArrayString& asChoices
,long lStyle = 0
,const wxValidator& rValidator = wxDefaultValidator
,const wxString& rsName = wxListBoxNameStr
);
//
// Override base class virtuals

View File

@ -44,6 +44,27 @@ public:
);
}
inline wxChoice( wxWindow* pParent
,wxWindowID vId
,const wxPoint& rPos
,const wxSize& rSize
,const wxArrayString& asChoices
,long lStyle = 0
,const wxValidator& rValidator = wxDefaultValidator
,const wxString& rsName = wxChoiceNameStr
)
{
Create( pParent
,vId
,rPos
,rSize
,asChoices
,lStyle
,rValidator
,rsName
);
}
bool Create( wxWindow* pParent
,wxWindowID vId
,const wxPoint& rPos = wxDefaultPosition
@ -55,6 +76,16 @@ public:
,const wxString& rsName = wxChoiceNameStr
);
bool Create( wxWindow* pParent
,wxWindowID vId
,const wxPoint& rPos
,const wxSize& rSize
,const wxArrayString& asChoices
,long lStyle = 0
,const wxValidator& rValidator = wxDefaultValidator
,const wxString& rsName = wxChoiceNameStr
);
//
// Implement base class virtuals
//

View File

@ -48,6 +48,29 @@ class WXDLLEXPORT wxComboBox : public wxChoice
);
}
inline wxComboBox( wxWindow* pParent
,wxWindowID vId
,const wxString& rsValue
,const wxPoint& rPos
,const wxSize& rSize
,const wxArrayString& asChoices
,long lStyle = 0
,const wxValidator& rValidator = wxDefaultValidator
,const wxString& rsName = wxComboBoxNameStr
)
{
Create( pParent
,vId
,rsValue
,rPos
,rSize
,asChoices
,lStyle
,rValidator
,rsName
);
}
bool Create( wxWindow* pParent
,wxWindowID vId
,const wxString& rsValue = wxEmptyString
@ -60,6 +83,17 @@ class WXDLLEXPORT wxComboBox : public wxChoice
,const wxString& rsName = wxComboBoxNameStr
);
bool Create( wxWindow* pParent
,wxWindowID vId
,const wxString& rsValue
,const wxPoint& rPos
,const wxSize& rSize
,const wxArrayString& asChoices
,long lStyle = 0
,const wxValidator& rValidator = wxDefaultValidator
,const wxString& rsName = wxComboBoxNameStr
);
//
// List functions: see wxChoice
//

View File

@ -58,6 +58,25 @@ public:
,rsName
);
}
wxListBox( wxWindow* pParent
,wxWindowID vId
,const wxPoint& rPos
,const wxSize& rSize
,const wxArrayString& asChoices
,long lStyle = 0
,const wxValidator& rValidator = wxDefaultValidator
,const wxString& rsName = wxListBoxNameStr)
{
Create( pParent
,vId
,rPos
,rSize
,asChoices
,lStyle
,rValidator
,rsName
);
}
bool Create( wxWindow* pParent
,wxWindowID vId
@ -69,6 +88,15 @@ public:
,const wxValidator& rValidator = wxDefaultValidator
,const wxString& rsName = wxListBoxNameStr
);
bool Create( wxWindow* pParent
,wxWindowID vId
,const wxPoint& rPos
,const wxSize& rSize
,const wxArrayString& asChoices
,long lStyle = 0
,const wxValidator& rValidator = wxDefaultValidator
,const wxString& rsName = wxListBoxNameStr
);
virtual ~wxListBox();

View File

@ -47,6 +47,31 @@ public:
);
}
inline wxRadioBox( wxWindow* pParent
,wxWindowID vId
,const wxString& rsTitle
,const wxPoint& rPos
,const wxSize& rSize
,const wxArrayString& asChoices
,int nMajorDim = 0
,long lStyle = wxRA_HORIZONTAL
,const wxValidator& rVal = wxDefaultValidator
,const wxString& rsName = wxRadioBoxNameStr
)
{
Create( pParent
,vId
,rsTitle
,rPos
,rSize
,asChoices
,nMajorDim
,lStyle
,rVal
,rsName
);
}
~wxRadioBox();
bool Create( wxWindow* pParent
@ -62,6 +87,18 @@ public:
,const wxString& rsName = wxRadioBoxNameStr
);
bool Create( wxWindow* pParent
,wxWindowID vId
,const wxString& rsTitle
,const wxPoint& rPos
,const wxSize& rSize
,const wxArrayString& asChoices
,int nMajorDim = 0
,long lStyle = wxRA_HORIZONTAL
,const wxValidator& rVal = wxDefaultValidator
,const wxString& rsName = wxRadioBoxNameStr
);
void Command(wxCommandEvent& rEvent);
bool ContainsHWND(WXHWND hWnd) const;
virtual bool Enable(bool bEnable = TRUE);

View File

@ -46,6 +46,14 @@ public:
Create(parent, id, pos, size, nStrings, choices, style, validator, name);
}
wxCheckListBox(wxWindow *parent,
wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
bool Create(wxWindow *parent,
wxWindowID id,
@ -56,6 +64,14 @@ public:
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
bool Create(wxWindow *parent,
wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
// implement check list box methods
virtual bool IsChecked(size_t item) const;

View File

@ -34,6 +34,13 @@ public:
{
Create(parent, id, pos, size, n, choices, style, validator, name);
}
wxChoice(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr);
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
@ -42,6 +49,13 @@ public:
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr);
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr);
private:
void OnComboBox(wxCommandEvent &event);

View File

@ -231,6 +231,15 @@ public:
(void)Create(parent, id, value, pos, size, n, choices,
style, validator, name);
}
wxComboBox(wxWindow *parent,
wxWindowID id,
const wxString& value,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr);
bool Create(wxWindow *parent,
wxWindowID id,
@ -242,7 +251,15 @@ public:
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr);
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& value,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr);
virtual ~wxComboBox();

View File

@ -70,6 +70,14 @@ public:
Create(parent, id, pos, size, n, choices, style, validator, name);
}
wxListBox(wxWindow *parent,
wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr );
virtual ~wxListBox();
@ -81,6 +89,14 @@ public:
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
bool Create(wxWindow *parent,
wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
// implement the listbox interface defined by wxListBoxBase
virtual void Clear();

View File

@ -50,6 +50,16 @@ public:
(void)Create(parent, id, title, pos, size, n, choices,
majorDim, style, val, name);
}
wxRadioBox(wxWindow *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
int majorDim = 0,
long style = wxRA_SPECIFY_COLS,
const wxValidator& val = wxDefaultValidator,
const wxString& name = wxRadioBoxNameStr);
bool Create(wxWindow *parent,
wxWindowID id,
@ -61,6 +71,16 @@ public:
long style = wxRA_SPECIFY_COLS,
const wxValidator& val = wxDefaultValidator,
const wxString& name = wxRadioBoxNameStr);
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
int majorDim = 0,
long style = wxRA_SPECIFY_COLS,
const wxValidator& val = wxDefaultValidator,
const wxString& name = wxRadioBoxNameStr);
virtual ~wxRadioBox();

View File

@ -21,6 +21,20 @@ BEGIN_EVENT_TABLE(wxCheckListBox, wxCheckListBoxBase)
END_EVENT_TABLE()
// WX_IMPLEMENT_COCOA_OWNER(wxCheckListBox,NSButton,NSControl,NSView)
bool wxCheckListBox::Create(wxWindow *parent, wxWindowID winid,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style,
const wxValidator& validator,
const wxString& name)
{
wxCArrayString chs(choices);
return Create(parent, winid, pos, size, chs.GetCount(), chs.GetStrings(),
style, validator, name);
}
bool wxCheckListBox::Create(wxWindow *parent, wxWindowID winid,
const wxPoint& pos,
const wxSize& size,

View File

@ -14,6 +14,7 @@
#include "wx/log.h"
#include "wx/app.h"
#include "wx/choice.h"
#include "wx/arrstr.h"
#endif //WX_PRECOMP
#include "wx/cocoa/string.h"
@ -33,6 +34,20 @@ void wxChoice::Init()
m_sortedStrings = NULL;
}
bool wxChoice::Create(wxWindow *parent, wxWindowID winid,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style,
const wxValidator& validator,
const wxString& name)
{
wxCArrayString chs(choices);
return Create(parent, winid, pos, size, chs.GetCount(), chs.GetStrings(),
style, validator, name);
}
bool wxChoice::Create(wxWindow *parent, wxWindowID winid,
const wxPoint& pos,
const wxSize& size,

View File

@ -27,6 +27,21 @@ BEGIN_EVENT_TABLE(wxComboBox, wxTextCtrl)
END_EVENT_TABLE()
// WX_IMPLEMENT_COCOA_OWNER(wxComboBox,NSComboBox,NSTextField,NSView)
bool wxComboBox::Create(wxWindow *parent, wxWindowID winid,
const wxString& value,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style,
const wxValidator& validator,
const wxString& name)
{
wxCArrayString chs(choices);
return Create(parent, winid, value, pos, size, chs.GetCount(),
chs.GetStrings(), style, validator, name);
}
bool wxComboBox::Create(wxWindow *parent, wxWindowID winid,
const wxString& value,
const wxPoint& pos,

View File

@ -30,6 +30,20 @@ BEGIN_EVENT_TABLE(wxListBox, wxListBoxBase)
END_EVENT_TABLE()
WX_IMPLEMENT_COCOA_OWNER(wxListBox,NSTableView,NSControl,NSView)
bool wxListBox::Create(wxWindow *parent, wxWindowID winid,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style,
const wxValidator& validator,
const wxString& name)
{
wxCArrayString chs(choices);
return Create(parent, winid, pos, size, chs.GetCount(), chs.GetStrings(),
style, validator, name);
}
bool wxListBox::Create(wxWindow *parent, wxWindowID winid,
const wxPoint& pos,
const wxSize& size,

View File

@ -13,6 +13,7 @@
#ifndef WX_PRECOMP
#include "wx/app.h"
#include "wx/radiobox.h"
#include "wx/arrstr.h"
#endif //WX_PRECOMP
#import <AppKit/NSView.h>
@ -22,6 +23,21 @@ BEGIN_EVENT_TABLE(wxRadioBox, wxControl)
END_EVENT_TABLE()
// WX_IMPLEMENT_COCOA_OWNER(wxRadioBox,NSTextField,NSControl,NSView)
bool wxRadioBox::Create(wxWindow *parent, wxWindowID winid,
const wxString& title,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
int majorDim,
long style, const wxValidator& validator,
const wxString& name)
{
wxCArrayString chs(choices);
return Create(parent, winid, title, pos, size, chs.GetCount(),
chs.GetStrings(), majorDim, style, validator, name);
}
bool wxRadioBox::Create(wxWindow *parent, wxWindowID winid,
const wxString& title,
const wxPoint& pos,

View File

@ -285,6 +285,19 @@ bool wxAnyChoiceDialog::Create(wxWindow *parent,
return TRUE;
}
bool wxAnyChoiceDialog::Create(wxWindow *parent,
const wxString& message,
const wxString& caption,
const wxArrayString& choices,
long styleDlg,
const wxPoint& pos,
long styleLbox)
{
wxCArrayString chs(choices);
return Create(parent, message, caption, chs.GetCount(), chs.GetStrings(),
styleDlg, pos, styleLbox);
}
// ----------------------------------------------------------------------------
// wxSingleChoiceDialog
// ----------------------------------------------------------------------------
@ -308,6 +321,17 @@ wxSingleChoiceDialog::wxSingleChoiceDialog(wxWindow *parent,
Create(parent, message, caption, n, choices, clientData, style);
}
wxSingleChoiceDialog::wxSingleChoiceDialog(wxWindow *parent,
const wxString& message,
const wxString& caption,
const wxArrayString& choices,
char **clientData,
long style,
const wxPoint& WXUNUSED(pos))
{
Create(parent, message, caption, choices, clientData, style);
}
bool wxSingleChoiceDialog::Create( wxWindow *parent,
const wxString& message,
const wxString& caption,
@ -333,6 +357,19 @@ bool wxSingleChoiceDialog::Create( wxWindow *parent,
return TRUE;
}
bool wxSingleChoiceDialog::Create( wxWindow *parent,
const wxString& message,
const wxString& caption,
const wxArrayString& choices,
char **clientData,
long style,
const wxPoint& pos )
{
wxCArrayString chs(choices);
return Create( parent, message, caption, chs.GetCount(), chs.GetStrings(),
clientData, style, pos );
}
// Set the selection
void wxSingleChoiceDialog::SetSelection(int sel)
{
@ -383,6 +420,18 @@ bool wxMultiChoiceDialog::Create( wxWindow *parent,
return TRUE;
}
bool wxMultiChoiceDialog::Create( wxWindow *parent,
const wxString& message,
const wxString& caption,
const wxArrayString& choices,
long style,
const wxPoint& pos )
{
wxCArrayString chs(choices);
return Create( parent, message, caption, chs.GetCount(),
chs.GetStrings(), style, pos );
}
void wxMultiChoiceDialog::SetSelections(const wxArrayInt& selections)
{
size_t count = selections.GetCount();

View File

@ -1398,20 +1398,11 @@ void wxGridCellChoiceEditor::Create(wxWindow* parent,
wxWindowID id,
wxEvtHandler* evtHandler)
{
size_t count = m_choices.GetCount();
wxString *choices = new wxString[count];
for ( size_t n = 0; n < count; n++ )
{
choices[n] = m_choices[n];
}
m_control = new wxComboBox(parent, id, wxEmptyString,
wxDefaultPosition, wxDefaultSize,
count, choices,
m_choices,
m_allowOthers ? 0 : wxCB_READONLY);
delete [] choices;
wxGridCellEditor::Create(parent, id, evtHandler);
}

View File

@ -48,6 +48,19 @@ wxCheckListBox::wxCheckListBox(wxWindow *parent, wxWindowID id,
wxListBox::Create( parent, id, pos, size, nStrings, choices, style, validator, name );
}
wxCheckListBox::wxCheckListBox(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style,
const wxValidator& validator,
const wxString& name )
{
m_hasCheckBoxes = TRUE;
wxListBox::Create( parent, id, pos, size, choices,
style, validator, name );
}
bool wxCheckListBox::IsChecked( int index ) const
{
wxCHECK_MSG( m_list != NULL, FALSE, wxT("invalid checklistbox") );

View File

@ -73,6 +73,18 @@ wxChoice::wxChoice()
m_strings = (wxSortedArrayString *)NULL;
}
bool wxChoice::Create( wxWindow *parent, wxWindowID id,
const wxPoint &pos, const wxSize &size,
const wxArrayString& choices,
long style, const wxValidator& validator,
const wxString &name )
{
wxCArrayString chs(choices);
return Create( parent, id, pos, size, chs.GetCount(), chs.GetStrings(),
style, validator, name );
}
bool wxChoice::Create( wxWindow *parent, wxWindowID id,
const wxPoint &pos, const wxSize &size,
int n, const wxString choices[],

View File

@ -19,6 +19,7 @@
#if wxUSE_COMBOBOX
#include "wx/settings.h"
#include "wx/arrstr.h"
#include "wx/intl.h"
#include "wx/textctrl.h" // for wxEVT_COMMAND_TEXT_UPDATED
@ -102,6 +103,19 @@ BEGIN_EVENT_TABLE(wxComboBox, wxControl)
EVT_CHAR(wxComboBox::OnChar)
END_EVENT_TABLE()
bool wxComboBox::Create( wxWindow *parent, wxWindowID id,
const wxString& value,
const wxPoint& pos, const wxSize& size,
const wxArrayString& choices,
long style, const wxValidator& validator,
const wxString& name )
{
wxCArrayString chs(choices);
return Create( parent, id, value, pos, size, chs.GetCount(),
chs.GetStrings(), style, validator, name );
}
bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value,
const wxPoint& pos, const wxSize& size,
int n, const wxString choices[],

View File

@ -316,6 +316,18 @@ wxListBox::wxListBox()
#endif // wxUSE_CHECKLISTBOX
}
bool wxListBox::Create( wxWindow *parent, wxWindowID id,
const wxPoint &pos, const wxSize &size,
const wxArrayString& choices,
long style, const wxValidator& validator,
const wxString &name )
{
wxCArrayString chs(choices);
return Create( parent, id, pos, size, chs.GetCount(), chs.GetStrings(),
style, validator, name );
}
bool wxListBox::Create( wxWindow *parent, wxWindowID id,
const wxPoint &pos, const wxSize &size,
int n, const wxString choices[],

View File

@ -168,6 +168,19 @@ void wxRadioBox::Init()
m_lostFocus = FALSE;
}
bool wxRadioBox::Create( wxWindow *parent, wxWindowID id,
const wxString& title,
const wxPoint &pos, const wxSize &size,
const wxArrayString& choices, int majorDim,
long style, const wxValidator& validator,
const wxString &name )
{
wxCArrayString chs(choices);
return Create( parent, id, title, pos, size, chs.GetCount(),
chs.GetStrings(), majorDim, style, validator, name );
}
bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
const wxPoint &pos, const wxSize &size,
int n, const wxString choices[], int majorDim,

View File

@ -48,6 +48,19 @@ wxCheckListBox::wxCheckListBox(wxWindow *parent, wxWindowID id,
wxListBox::Create( parent, id, pos, size, nStrings, choices, style, validator, name );
}
wxCheckListBox::wxCheckListBox(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style,
const wxValidator& validator,
const wxString& name )
{
m_hasCheckBoxes = TRUE;
wxListBox::Create( parent, id, pos, size, choices,
style, validator, name );
}
bool wxCheckListBox::IsChecked( int index ) const
{
wxCHECK_MSG( m_list != NULL, FALSE, wxT("invalid checklistbox") );

View File

@ -73,6 +73,18 @@ wxChoice::wxChoice()
m_strings = (wxSortedArrayString *)NULL;
}
bool wxChoice::Create( wxWindow *parent, wxWindowID id,
const wxPoint &pos, const wxSize &size,
const wxArrayString& choices,
long style, const wxValidator& validator,
const wxString &name )
{
wxCArrayString chs(choices);
return Create( parent, id, pos, size, chs.GetCount(), chs.GetStrings(),
style, validator, name );
}
bool wxChoice::Create( wxWindow *parent, wxWindowID id,
const wxPoint &pos, const wxSize &size,
int n, const wxString choices[],

View File

@ -19,6 +19,7 @@
#if wxUSE_COMBOBOX
#include "wx/settings.h"
#include "wx/arrstr.h"
#include "wx/intl.h"
#include "wx/textctrl.h" // for wxEVT_COMMAND_TEXT_UPDATED
@ -102,6 +103,19 @@ BEGIN_EVENT_TABLE(wxComboBox, wxControl)
EVT_CHAR(wxComboBox::OnChar)
END_EVENT_TABLE()
bool wxComboBox::Create( wxWindow *parent, wxWindowID id,
const wxString& value,
const wxPoint& pos, const wxSize& size,
const wxArrayString& choices,
long style, const wxValidator& validator,
const wxString& name )
{
wxCArrayString chs(choices);
return Create( parent, id, value, pos, size, chs.GetCount(),
chs.GetStrings(), style, validator, name );
}
bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value,
const wxPoint& pos, const wxSize& size,
int n, const wxString choices[],

View File

@ -316,6 +316,18 @@ wxListBox::wxListBox()
#endif // wxUSE_CHECKLISTBOX
}
bool wxListBox::Create( wxWindow *parent, wxWindowID id,
const wxPoint &pos, const wxSize &size,
const wxArrayString& choices,
long style, const wxValidator& validator,
const wxString &name )
{
wxCArrayString chs(choices);
return Create( parent, id, pos, size, chs.GetCount(), chs.GetStrings(),
style, validator, name );
}
bool wxListBox::Create( wxWindow *parent, wxWindowID id,
const wxPoint &pos, const wxSize &size,
int n, const wxString choices[],

View File

@ -168,6 +168,19 @@ void wxRadioBox::Init()
m_lostFocus = FALSE;
}
bool wxRadioBox::Create( wxWindow *parent, wxWindowID id,
const wxString& title,
const wxPoint &pos, const wxSize &size,
const wxArrayString& choices, int majorDim,
long style, const wxValidator& validator,
const wxString &name )
{
wxCArrayString chs(choices);
return Create( parent, id, title, pos, size, chs.GetCount(),
chs.GetStrings(), majorDim, style, validator, name );
}
bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
const wxPoint &pos, const wxSize &size,
int n, const wxString choices[], int majorDim,

View File

@ -22,6 +22,7 @@
#if wxUSE_CHECKLISTBOX
#include "wx/checklst.h"
#include "wx/arrstr.h"
#include "wx/mac/uma.h"
#include "Appearance.h"
@ -172,6 +173,21 @@ void wxCheckListBox::Init()
{
}
bool wxCheckListBox::Create(wxWindow *parent,
wxWindowID id,
const wxPoint &pos,
const wxSize &size,
const wxArrayString& choices,
long style,
const wxValidator& validator,
const wxString &name)
{
wxCArrayString chs(choices);
return Create(parent, id, pos, size, chs.GetCount(), chs.GetStrings(),
style, validator, name);
}
bool wxCheckListBox::Create(wxWindow *parent,
wxWindowID id,
const wxPoint &pos,

View File

@ -38,6 +38,20 @@ wxChoice::~wxChoice()
// DisposeMenu( m_macPopUpMenuHandle ) ;
}
bool wxChoice::Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style,
const wxValidator& validator,
const wxString& name)
{
wxCArrayString chs(choices);
return Create(parent, id, pos, size, chs.GetCount(), chs.GetStrings(),
style, validator, name);
}
bool wxChoice::Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,

View File

@ -256,6 +256,22 @@ void wxComboBox::DelegateChoice( const wxString& value )
}
bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
const wxString& value,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style,
const wxValidator& validator,
const wxString& name)
{
wxCArrayString chs( choices );
return Create( parent, id, value, pos, size, chs.GetCount(),
chs.GetStrings(), style, validator, name );
}
bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
const wxString& value,
const wxPoint& pos,

View File

@ -193,6 +193,20 @@ wxListBox::wxListBox()
static ListDefUPP macListDefUPP = NULL ;
bool wxListBox::Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style,
const wxValidator& validator,
const wxString& name)
{
wxCArrayString chs(choices);
return Create(parent, id, pos, size, chs.GetCount(), chs.GetStrings(),
style, validator, name);
}
bool wxListBox::Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,

View File

@ -19,6 +19,7 @@
//-------------------------------------------------------------------------------------
#include "wx/defs.h"
#include "wx/arrstr.h"
#include "wx/radiobox.h"
#include "wx/radiobut.h"
@ -93,6 +94,18 @@ wxRadioBox::~wxRadioBox()
//-------------------------------------------------------------------------------------
// Create the radiobox for two-step construction
bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& label,
const wxPoint& pos, const wxSize& size,
const wxArrayString& choices,
int majorDim, long style,
const wxValidator& val, const wxString& name)
{
wxCArrayString chs(choices);
return Create(parent, id, label, pos, size, chs.GetCount(),
chs.GetStrings(), majorDim, style, val, name);
}
bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& label,
const wxPoint& pos, const wxSize& size,
int n, const wxString choices[],

View File

@ -22,6 +22,7 @@
#if wxUSE_CHECKLISTBOX
#include "wx/checklst.h"
#include "wx/arrstr.h"
#include "wx/mac/uma.h"
#include "Appearance.h"
@ -172,6 +173,21 @@ void wxCheckListBox::Init()
{
}
bool wxCheckListBox::Create(wxWindow *parent,
wxWindowID id,
const wxPoint &pos,
const wxSize &size,
const wxArrayString& choices,
long style,
const wxValidator& validator,
const wxString &name)
{
wxCArrayString chs(choices);
return Create(parent, id, pos, size, chs.GetCount(), chs.GetStrings(),
style, validator, name);
}
bool wxCheckListBox::Create(wxWindow *parent,
wxWindowID id,
const wxPoint &pos,

View File

@ -38,6 +38,20 @@ wxChoice::~wxChoice()
// DisposeMenu( m_macPopUpMenuHandle ) ;
}
bool wxChoice::Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style,
const wxValidator& validator,
const wxString& name)
{
wxCArrayString chs(choices);
return Create(parent, id, pos, size, chs.GetCount(), chs.GetStrings(),
style, validator, name);
}
bool wxChoice::Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,

View File

@ -256,6 +256,22 @@ void wxComboBox::DelegateChoice( const wxString& value )
}
bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
const wxString& value,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style,
const wxValidator& validator,
const wxString& name)
{
wxCArrayString chs( choices );
return Create( parent, id, value, pos, size, chs.GetCount(),
chs.GetStrings(), style, validator, name );
}
bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
const wxString& value,
const wxPoint& pos,

View File

@ -193,6 +193,20 @@ wxListBox::wxListBox()
static ListDefUPP macListDefUPP = NULL ;
bool wxListBox::Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style,
const wxValidator& validator,
const wxString& name)
{
wxCArrayString chs(choices);
return Create(parent, id, pos, size, chs.GetCount(), chs.GetStrings(),
style, validator, name);
}
bool wxListBox::Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,

View File

@ -19,6 +19,7 @@
//-------------------------------------------------------------------------------------
#include "wx/defs.h"
#include "wx/arrstr.h"
#include "wx/radiobox.h"
#include "wx/radiobut.h"
@ -93,6 +94,18 @@ wxRadioBox::~wxRadioBox()
//-------------------------------------------------------------------------------------
// Create the radiobox for two-step construction
bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& label,
const wxPoint& pos, const wxSize& size,
const wxArrayString& choices,
int majorDim, long style,
const wxValidator& val, const wxString& name)
{
wxCArrayString chs(choices);
return Create(parent, id, label, pos, size, chs.GetCount(),
chs.GetStrings(), majorDim, style, val, name);
}
bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& label,
const wxPoint& pos, const wxSize& size,
int n, const wxString choices[],

View File

@ -75,6 +75,17 @@ wxCheckListBox::wxCheckListBox(wxWindow *parent, wxWindowID id,
style, val, name);
}
wxCheckListBox::wxCheckListBox(wxWindow *parent, wxWindowID id,
const wxPoint& pos, const wxSize& size,
const wxArrayString& choices,
long style, const wxValidator& val,
const wxString& name)
: wxCheckListBoxBase()
{
Create(parent, id, pos, size, choices,
style, val, name);
}
bool wxCheckListBox::Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
@ -89,6 +100,20 @@ bool wxCheckListBox::Create(wxWindow *parent, wxWindowID id,
return retVal;
}
bool wxCheckListBox::Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style,
const wxValidator& validator,
const wxString& name)
{
// wxListBox::Create calls set, which adds the prefixes
bool retVal = wxListBox::Create(parent, id, pos, size, choices,
style, validator, name);
return retVal;
}
// check items
// -----------

View File

@ -22,6 +22,7 @@
#include "wx/choice.h"
#include "wx/utils.h"
#include "wx/arrstr.h"
#ifdef __VMS__
#pragma message disable nosimpint
@ -143,6 +144,19 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id,
return TRUE;
}
bool wxChoice::Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style,
const wxValidator& validator,
const wxString& name)
{
wxCArrayString chs(choices);
return Create(parent, id, pos, size, chs.GetCount(), chs.GetStrings(),
style, validator, name);
}
wxChoice::~wxChoice()
{
// For some reason destroying the menuWidget

View File

@ -18,6 +18,7 @@
#if wxUSE_COMBOBOX
#include "wx/combobox.h"
#include "wx/arrstr.h"
#ifdef __VMS__
#pragma message disable nosimpint
@ -93,6 +94,20 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
return TRUE;
}
bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
const wxString& value,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style,
const wxValidator& validator,
const wxString& name)
{
wxCArrayString chs(choices);
return Create(parent, id, value, pos, size, chs.GetCount(),
chs.GetStrings(), style, validator, name);
}
wxComboBox::~wxComboBox()
{
DetachWidget((Widget) m_mainWidget); // Removes event handlers

View File

@ -14,6 +14,7 @@
#if wxUSE_COMBOBOX
#include "wx/combobox.h"
#include "wx/arrstr.h"
#ifdef __VMS__
#pragma message disable nosimpint
@ -122,6 +123,20 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
return true;
}
bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
const wxString& value,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style,
const wxValidator& validator,
const wxString& name)
{
wxCArrayString chs(choices);
return Create(parent, id, value, pos, size, chs.GetCount(),
chs.GetStrings(), style, validator, name);
}
void wxComboBox::AdjustDropDownListSize()
{
int newListCount = -1, itemCount = GetCount();

View File

@ -23,6 +23,7 @@
#include "wx/dynarray.h"
#include "wx/log.h"
#include "wx/utils.h"
#include "wx/arrstr.h"
#ifdef __VMS__
#pragma message disable nosimpint
@ -157,6 +158,19 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id,
return TRUE;
}
bool wxListBox::Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style,
const wxValidator& validator,
const wxString& name)
{
wxCArrayString chs(choices);
return Create(parent, id, pos, size, chs.GetCount(), chs.GetStrings(),
style, validator, name);
}
wxListBox::~wxListBox()
{
if( HasClientObjectData() )

View File

@ -206,6 +206,17 @@ void wxMenuBar::Init()
m_font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
}
wxMenuBar::wxMenuBar(int n, wxMenu *menus[], const wxArrayString& titles)
{
wxASSERT( size_t(n) == titles.GetCount() );
Init();
m_titles = titles;
for ( int i = 0; i < n; i++ )
m_menus.Append(menus[i]);
}
wxMenuBar::wxMenuBar(int n, wxMenu *menus[], const wxString titles[])
{
Init();

View File

@ -21,6 +21,7 @@
#include "wx/radiobox.h"
#include "wx/utils.h"
#include "wx/arrstr.h"
#ifdef __VMS__
#pragma message disable nosimpint
@ -157,6 +158,16 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& title,
return TRUE;
}
bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& title,
const wxPoint& pos, const wxSize& size,
const wxArrayString& choices,
int majorDim, long style,
const wxValidator& val, const wxString& name)
{
wxCArrayString chs(choices);
return Create(parent, id, title, pos, size, chs.GetCount(),
chs.GetStrings(), majorDim, style, val, name);
}
wxRadioBox::~wxRadioBox()
{

View File

@ -345,6 +345,15 @@ wxCheckListBox::wxCheckListBox(wxWindow *parent, wxWindowID id,
Create(parent, id, pos, size, nStrings, choices, style, val, name);
}
wxCheckListBox::wxCheckListBox(wxWindow *parent, wxWindowID id,
const wxPoint& pos, const wxSize& size,
const wxArrayString& choices,
long style, const wxValidator& val,
const wxString& name)
{
Create(parent, id, pos, size, choices, style, val, name);
}
bool wxCheckListBox::Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos, const wxSize& size,
int n, const wxString choices[],
@ -355,6 +364,16 @@ bool wxCheckListBox::Create(wxWindow *parent, wxWindowID id,
style | wxLB_OWNERDRAW, validator, name);
}
bool wxCheckListBox::Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos, const wxSize& size,
const wxArrayString& choices,
long style,
const wxValidator& validator, const wxString& name)
{
return wxListBox::Create(parent, id, pos, size, choices,
style | wxLB_OWNERDRAW, validator, name);
}
// misc overloaded methods
// -----------------------

View File

@ -151,6 +151,20 @@ bool wxChoice::Create(wxWindow *parent,
return TRUE;
}
bool wxChoice::Create(wxWindow *parent,
wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style,
const wxValidator& validator,
const wxString& name)
{
wxCArrayString chs(choices);
return Create(parent, id, pos, size, chs.GetCount(), chs.GetStrings(),
style, validator, name);
}
wxChoice::~wxChoice()
{
Free();

View File

@ -433,6 +433,20 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
return TRUE;
}
bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
const wxString& value,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style,
const wxValidator& validator,
const wxString& name)
{
wxCArrayString chs(choices);
return Create(parent, id, value, pos, size, chs.GetCount(),
chs.GetStrings(), style, validator, name);
}
void wxComboBox::SetValue(const wxString& value)
{
if ( HasFlag(wxCB_READONLY) )

View File

@ -251,6 +251,20 @@ bool wxListBox::Create(wxWindow *parent,
return TRUE;
}
bool wxListBox::Create(wxWindow *parent,
wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style,
const wxValidator& wxVALIDATOR_PARAM(validator),
const wxString& name)
{
wxCArrayString chs(choices);
return Create(parent, id, pos, size, chs.GetCount(), chs.GetStrings(),
style, validator, name);
}
wxListBox::~wxListBox()
{
Free();

View File

@ -352,6 +352,22 @@ bool wxRadioBox::Create(wxWindow *parent,
return TRUE;
}
bool wxRadioBox::Create(wxWindow *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
int majorDim,
long style,
const wxValidator& val,
const wxString& name)
{
wxCArrayString chs(choices);
return Create(parent, id, title, pos, size, chs.GetCount(),
chs.GetStrings(), majorDim, style, val, name);
}
wxRadioBox::~wxRadioBox()
{
m_isBeingDeleted = TRUE;

View File

@ -291,6 +291,31 @@ wxCheckListBox::wxCheckListBox (
);
} // end of wxCheckListBox::wxCheckListBox
wxCheckListBox::wxCheckListBox (
wxWindow* pParent
, wxWindowID vId
, const wxPoint& rPos
, const wxSize& rSize
, const wxArrayString& asChoices
, long lStyle
, const wxValidator& rVal
, const wxString& rsName
)
: wxListBox()
{
wxCArrayString chs(asChoices);
Create( pParent
,vId
,rPos
,rSize
,chs.GetCount()
,chs.GetStrings()
,lStyle | wxLB_OWNERDRAW
,rVal
,rsName
);
} // end of wxCheckListBox::wxCheckListBox
void wxCheckListBox::Delete(
int N
)

View File

@ -23,6 +23,23 @@
IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl)
bool wxChoice::Create(
wxWindow* pParent
, wxWindowID vId
, const wxPoint& rPos
, const wxSize& rSize
, const wxArrayString& asChoices
, long lStyle
, const wxValidator& rValidator
, const wxString& rsName
)
{
wxCArrayString chs(asChoices);
return Create(pParent, vId, rPos, rSize, chs.GetCount(), chs.GetStrings(),
lStyle, rValidator, rsName);
}
bool wxChoice::Create(
wxWindow* pParent
, wxWindowID vId

View File

@ -86,6 +86,24 @@ bool wxComboBox::OS2Command(
return FALSE;
} // end of wxComboBox::OS2Command
bool wxComboBox::Create(
wxWindow* pParent
, wxWindowID vId
, const wxString& rsValue
, const wxPoint& rPos
, const wxSize& rSize
, const wxArrayString& asChoices
, long lStyle
, const wxValidator& rValidator
, const wxString& rsName
)
{
wxCArrayString chs(asChoices);
return Create(pParent, vId, rsValue, rPos, rSize, chs.GetCount(),
chs.GetStrings(), lStyle, rValidator, rsName);
}
bool wxComboBox::Create(
wxWindow* pParent
, wxWindowID vId

View File

@ -85,6 +85,23 @@ wxListBox::wxListBox()
m_nSelected = 0;
} // end of wxListBox::wxListBox
bool wxListBox::Create(
wxWindow* pParent
, wxWindowID vId
, const wxPoint& rPos
, const wxSize& rSize
, const wxArrayString& asChoices
, long lStyle
, const wxValidator& rValidator
, const wxString& rsName
)
{
wxCArrayString chs(asChoices);
return Create(pParent, vId, rPos, rSize, chs.GetCount(), chs.GetStrings(),
lStyle, rValidator, rsName);
}
bool wxListBox::Create(
wxWindow* pParent
, wxWindowID vId

View File

@ -253,6 +253,25 @@ bool wxRadioBox::ContainsHWND(
return FALSE;
} // end of wxRadioBox::ContainsHWND
bool wxRadioBox::Create(
wxWindow* pParent
, wxWindowID vId
, const wxString& rsTitle
, const wxPoint& rPos
, const wxSize& rSize
, const wxArrayString& asChoices
, int nMajorDim
, long lStyle
, const wxValidator& rVal
, const wxString& rsName
)
{
wxCArrayString(asChoices);
return Create(pParent, vId, rsTitle, rPos, rSize, chs.GetCount(),
chs.GetStrings(), nMajorDim, lStyle, rVal, rsName);
}
bool wxRadioBox::Create(
wxWindow* pParent
, wxWindowID vId

View File

@ -55,6 +55,35 @@ void wxCheckListBox::Init()
{
}
wxCheckListBox::wxCheckListBox(wxWindow *parent,
wxWindowID id,
const wxPoint &pos,
const wxSize &size,
const wxArrayString& choices,
long style,
const wxValidator& validator,
const wxString &name)
{
Init();
Create(parent, id, pos, size, choices, style, validator, name);
}
bool wxCheckListBox::Create(wxWindow *parent,
wxWindowID id,
const wxPoint &pos,
const wxSize &size,
const wxArrayString& choices,
long style,
const wxValidator& validator,
const wxString &name)
{
wxCArrayString chs(choices);
return Create(parent, id, pos, size, chs.GetCount(), chs.GetStrings(),
style, validator, name);
}
bool wxCheckListBox::Create(wxWindow *parent,
wxWindowID id,
const wxPoint &pos,

View File

@ -31,6 +31,7 @@
#ifndef WX_PRECOMP
#include "wx/choice.h"
#include "wx/arrstr.h"
#endif
IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl)
@ -39,6 +40,31 @@ BEGIN_EVENT_TABLE(wxChoice, wxComboBox)
EVT_COMBOBOX(-1, wxChoice::OnComboBox)
END_EVENT_TABLE()
wxChoice::wxChoice(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style,
const wxValidator& validator,
const wxString& name)
{
Create(parent, id, pos, size, choices, style, validator, name);
}
bool wxChoice::Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style,
const wxValidator& validator,
const wxString& name)
{
wxCArrayString chs(choices);
return Create(parent, id, pos, size, chs.GetCount(), chs.GetStrings(),
style, validator, name);
}
bool wxChoice::Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,

View File

@ -657,6 +657,37 @@ void wxComboBox::Init()
m_lbox = (wxListBox *)NULL;
}
wxComboBox::wxComboBox(wxWindow *parent,
wxWindowID id,
const wxString& value,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style,
const wxValidator& validator,
const wxString& name)
{
Init();
Create(parent, id, value, pos, size, choices, style, validator, name);
}
bool wxComboBox::Create(wxWindow *parent,
wxWindowID id,
const wxString& value,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style,
const wxValidator& validator,
const wxString& name)
{
wxCArrayString chs(choices);
return Create(parent, id, value, pos, size, chs.GetCount(),
chs.GetStrings(), style, validator, name);
}
bool wxComboBox::Create(wxWindow *parent,
wxWindowID id,
const wxString& value,

View File

@ -80,6 +80,35 @@ void wxListBox::Init()
m_showScrollbarY = FALSE;
}
wxListBox::wxListBox(wxWindow *parent,
wxWindowID id,
const wxPoint &pos,
const wxSize &size,
const wxArrayString& choices,
long style,
const wxValidator& validator,
const wxString &name)
{
Init();
Create(parent, id, pos, size, choices, style, validator, name);
}
bool wxListBox::Create(wxWindow *parent,
wxWindowID id,
const wxPoint &pos,
const wxSize &size,
const wxArrayString& choices,
long style,
const wxValidator& validator,
const wxString &name)
{
wxCArrayString chs(choices);
return Create(parent, id, pos, size, chs.GetCount(), chs.GetStrings(),
style, validator, name);
}
bool wxListBox::Create(wxWindow *parent,
wxWindowID id,
const wxPoint &pos,

View File

@ -34,6 +34,7 @@
#include "wx/radiobox.h"
#include "wx/radiobut.h"
#include "wx/validate.h"
#include "wx/arrstr.h"
#endif
#include "wx/tooltip.h"
@ -101,6 +102,37 @@ void wxRadioBox::Init()
m_majorDim = 0;
}
wxRadioBox::wxRadioBox(wxWindow *parent, wxWindowID id, const wxString& title,
const wxPoint& pos, const wxSize& size,
const wxArrayString& choices,
int majorDim, long style,
const wxValidator& val, const wxString& name)
{
wxCArrayString chs(choices);
Init();
(void)Create(parent, id, title, pos, size, chs.GetCount(),
chs.GetStrings(), majorDim, style, val, name);
}
bool wxRadioBox::Create(wxWindow *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
int majorDim,
long style,
const wxValidator& val,
const wxString& name)
{
wxCArrayString chs(choices);
return Create(parent, id, title, pos, size, chs.GetCount(),
chs.GetStrings(), majorDim, style, val, name);
}
bool wxRadioBox::Create(wxWindow *parent,
wxWindowID id,
const wxString& title,