Use border style consistently in the widgets sample

Use GetAttrs().m_defaultFlags everywhere when creating the widgets, it
was done for some but not all of them before, without any apparent
reason.

This should make setting various border styles work (for the widgets
supporting them).
This commit is contained in:
Vadim Zeitlin
2018-03-17 17:50:56 +01:00
parent 0acb119ccb
commit 7e8fb1e294
13 changed files with 83 additions and 78 deletions

View File

@@ -83,9 +83,6 @@ protected:
// restore the checkboxes state to the initial values
void Reset();
// get the initial style for the picker of the given kind
long GetPickerStyle();
void OnDirChange(wxFileDirPickerEvent &ev);
void OnCheckBox(wxCommandEvent &ev);
@@ -194,15 +191,7 @@ void DirPickerWidgetsPage::CreatePicker()
{
delete m_dirPicker;
m_dirPicker = new wxDirPickerCtrl(this, PickerPage_Dir,
wxGetHomeDir(), wxT("Hello!"),
wxDefaultPosition, wxDefaultSize,
GetPickerStyle());
}
long DirPickerWidgetsPage::GetPickerStyle()
{
long style = 0;
long style = GetAttrs().m_defaultFlags;
if ( m_chkDirTextCtrl->GetValue() )
style |= wxDIRP_USE_TEXTCTRL;
@@ -216,7 +205,10 @@ long DirPickerWidgetsPage::GetPickerStyle()
if ( m_chkSmall->GetValue() )
style |= wxDIRP_SMALL;
return style;
m_dirPicker = new wxDirPickerCtrl(this, PickerPage_Dir,
wxGetHomeDir(), wxT("Hello!"),
wxDefaultPosition, wxDefaultSize,
style);
}
void DirPickerWidgetsPage::RecreatePicker()