wxMultiChoiceDialog uses now wxCheckListBox if possible, wxListBox if not

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36055 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2005-11-01 22:35:50 +00:00
parent 4b8f856e6f
commit 60104cbafa
3 changed files with 34 additions and 5 deletions

View File

@@ -24,6 +24,7 @@ All (GUI):
wxLB_TOP, wxNB_TOP, wxCHB_TOP, wxTBK_TOP. wxLB_TOP, wxNB_TOP, wxCHB_TOP, wxTBK_TOP.
- Added parent window parameter to wxHelpController constructor - Added parent window parameter to wxHelpController constructor
and added SetParentWindow/GetParentWindow. and added SetParentWindow/GetParentWindow.
- wxMultiChoiceDialog uses now wxCheckListBox if possible, wxListBox if not.
wxMSW: wxMSW:

View File

@@ -80,7 +80,11 @@ public:
long styleLbox = wxLB_ALWAYS_SB); long styleLbox = wxLB_ALWAYS_SB);
protected: protected:
wxListBox *m_listbox; wxListBoxBase *m_listbox;
virtual wxListBoxBase *CreateList(int n,
const wxString *choices,
long styleLbox);
DECLARE_NO_COPY_CLASS(wxAnyChoiceDialog) DECLARE_NO_COPY_CLASS(wxAnyChoiceDialog)
}; };
@@ -206,6 +210,12 @@ public:
virtual bool TransferDataFromWindow(); virtual bool TransferDataFromWindow();
protected: protected:
#if wxUSE_CHECKLISTBOX
virtual wxListBoxBase *CreateList(int n,
const wxString *choices,
long styleLbox);
#endif // wxUSE_CHECKLISTBOX
wxArrayInt m_selections; wxArrayInt m_selections;
private: private:

View File

@@ -272,10 +272,8 @@ bool wxAnyChoiceDialog::Create(wxWindow *parent,
topsizer->Add( CreateTextSizer( message ), 0, wxALL, wxLARGESMALL(10,0) ); topsizer->Add( CreateTextSizer( message ), 0, wxALL, wxLARGESMALL(10,0) );
// 2) list box // 2) list box
m_listbox = new wxListBox( this, wxID_LISTBOX, m_listbox = CreateList(n,choices,styleLbox);
wxDefaultPosition, wxDefaultSize,
n, choices,
styleLbox );
if ( n > 0 ) if ( n > 0 )
m_listbox->SetSelection(0); m_listbox->SetSelection(0);
@@ -326,6 +324,14 @@ bool wxAnyChoiceDialog::Create(wxWindow *parent,
styleDlg, pos, styleLbox); styleDlg, pos, styleLbox);
} }
wxListBoxBase *wxAnyChoiceDialog::CreateList(int n, const wxString *choices, long styleLbox)
{
return new wxListBox( this, wxID_LISTBOX,
wxDefaultPosition, wxDefaultSize,
n, choices,
styleLbox );
}
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxSingleChoiceDialog // wxSingleChoiceDialog
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -506,4 +512,16 @@ bool wxMultiChoiceDialog::TransferDataFromWindow()
return true; return true;
} }
#if wxUSE_CHECKLISTBOX
wxListBoxBase *wxMultiChoiceDialog::CreateList(int n, const wxString *choices, long styleLbox)
{
return new wxCheckListBox( this, wxID_LISTBOX,
wxDefaultPosition, wxDefaultSize,
n, choices,
styleLbox );
}
#endif // wxUSE_CHECKLISTBOX
#endif // wxUSE_CHOICEDLG #endif // wxUSE_CHOICEDLG