Made choice convenient dialog more, well, convenient: fixed lack of vertical
expansion and increased list size for larger screens. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@44620 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -40,6 +40,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/statline.h"
|
#include "wx/statline.h"
|
||||||
|
#include "wx/settings.h"
|
||||||
#include "wx/generic/choicdgg.h"
|
#include "wx/generic/choicdgg.h"
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -263,7 +264,7 @@ bool wxAnyChoiceDialog::Create(wxWindow *parent,
|
|||||||
m_listbox->SetSelection(0);
|
m_listbox->SetSelection(0);
|
||||||
|
|
||||||
topsizer->
|
topsizer->
|
||||||
Add(m_listbox, wxSizerFlags().Expand().TripleBorder(wxLEFT | wxRIGHT));
|
Add(m_listbox, wxSizerFlags().Expand().Proportion(1).TripleBorder(wxLEFT | wxRIGHT));
|
||||||
|
|
||||||
// 3) buttons if any
|
// 3) buttons if any
|
||||||
wxSizer *
|
wxSizer *
|
||||||
@@ -301,8 +302,11 @@ bool wxAnyChoiceDialog::Create(wxWindow *parent,
|
|||||||
|
|
||||||
wxListBoxBase *wxAnyChoiceDialog::CreateList(int n, const wxString *choices, long styleLbox)
|
wxListBoxBase *wxAnyChoiceDialog::CreateList(int n, const wxString *choices, long styleLbox)
|
||||||
{
|
{
|
||||||
|
wxSize size = wxDefaultSize;
|
||||||
|
if (wxSystemSettings::GetScreenType() > wxSYS_SCREEN_PDA)
|
||||||
|
size = wxSize(300, 200);
|
||||||
return new wxListBox( this, wxID_LISTBOX,
|
return new wxListBox( this, wxID_LISTBOX,
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, size,
|
||||||
n, choices,
|
n, choices,
|
||||||
styleLbox );
|
styleLbox );
|
||||||
}
|
}
|
||||||
@@ -441,7 +445,7 @@ bool wxMultiChoiceDialog::Create( wxWindow *parent,
|
|||||||
#else
|
#else
|
||||||
styleLbox = wxLB_ALWAYS_SB | wxLB_EXTENDED;
|
styleLbox = wxLB_ALWAYS_SB | wxLB_EXTENDED;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ( !wxAnyChoiceDialog::Create(parent, message, caption,
|
if ( !wxAnyChoiceDialog::Create(parent, message, caption,
|
||||||
n, choices,
|
n, choices,
|
||||||
style, pos,
|
style, pos,
|
||||||
@@ -484,11 +488,11 @@ void wxMultiChoiceDialog::SetSelections(const wxArrayInt& selections)
|
|||||||
{
|
{
|
||||||
checkListBox->Check(selections[n]);
|
checkListBox->Check(selections[n]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// first clear all currently selected items
|
// first clear all currently selected items
|
||||||
size_t n,
|
size_t n,
|
||||||
count = m_listbox->GetCount();
|
count = m_listbox->GetCount();
|
||||||
@@ -537,8 +541,12 @@ bool wxMultiChoiceDialog::TransferDataFromWindow()
|
|||||||
|
|
||||||
wxListBoxBase *wxMultiChoiceDialog::CreateList(int n, const wxString *choices, long styleLbox)
|
wxListBoxBase *wxMultiChoiceDialog::CreateList(int n, const wxString *choices, long styleLbox)
|
||||||
{
|
{
|
||||||
|
wxSize size = wxDefaultSize;
|
||||||
|
if (wxSystemSettings::GetScreenType() > wxSYS_SCREEN_PDA)
|
||||||
|
size = wxSize(300, 200);
|
||||||
|
|
||||||
return new wxCheckListBox( this, wxID_LISTBOX,
|
return new wxCheckListBox( this, wxID_LISTBOX,
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, size,
|
||||||
n, choices,
|
n, choices,
|
||||||
styleLbox );
|
styleLbox );
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user