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:
@@ -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") );
|
||||
|
@@ -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[],
|
||||
|
@@ -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[],
|
||||
|
@@ -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[],
|
||||
|
@@ -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,
|
||||
|
Reference in New Issue
Block a user