Reset displayed wxDirCtrl in Widgets sample after pressing Reset button
This commit is contained in:
@@ -118,7 +118,7 @@ protected:
|
|||||||
void Reset();
|
void Reset();
|
||||||
|
|
||||||
// (re)create the m_dirCtrl
|
// (re)create the m_dirCtrl
|
||||||
void CreateDirCtrl();
|
void CreateDirCtrl(bool defaultPath = false);
|
||||||
|
|
||||||
// the controls
|
// the controls
|
||||||
// ------------
|
// ------------
|
||||||
@@ -231,18 +231,32 @@ void DirCtrlWidgetsPage::CreateContent()
|
|||||||
sizerTop->Add(m_radioStdPath, 0, wxGROW | wxALL , 10);
|
sizerTop->Add(m_radioStdPath, 0, wxGROW | wxALL , 10);
|
||||||
sizerTop->Add(m_dirCtrl, 1, wxGROW | (wxALL & ~wxRIGHT), 10);
|
sizerTop->Add(m_dirCtrl, 1, wxGROW | (wxALL & ~wxRIGHT), 10);
|
||||||
|
|
||||||
|
SetSizer(sizerTop);
|
||||||
|
|
||||||
// final initializations
|
// final initializations
|
||||||
Reset();
|
Reset();
|
||||||
|
|
||||||
SetSizer(sizerTop);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DirCtrlWidgetsPage::Reset()
|
void DirCtrlWidgetsPage::Reset()
|
||||||
{
|
{
|
||||||
m_path->SetValue(m_dirCtrl->GetPath());
|
m_path->Clear();
|
||||||
|
|
||||||
|
m_chkDirOnly->SetValue(false);
|
||||||
|
m_chk3D->SetValue(false);
|
||||||
|
m_chkFirst->SetValue(false);
|
||||||
|
m_chkFilters->SetValue(false);
|
||||||
|
m_chkLabels->SetValue(false);
|
||||||
|
m_chkMulti->SetValue(false);
|
||||||
|
|
||||||
|
m_radioStdPath->SetSelection(0);
|
||||||
|
|
||||||
|
for ( size_t i = 0; i < WXSIZEOF(m_fltr); ++i )
|
||||||
|
m_fltr[i]->SetValue(false);
|
||||||
|
|
||||||
|
CreateDirCtrl(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DirCtrlWidgetsPage::CreateDirCtrl()
|
void DirCtrlWidgetsPage::CreateDirCtrl(bool defaultPath)
|
||||||
{
|
{
|
||||||
wxWindowUpdateLocker noUpdates(this);
|
wxWindowUpdateLocker noUpdates(this);
|
||||||
|
|
||||||
@@ -260,10 +274,11 @@ void DirCtrlWidgetsPage::CreateDirCtrl()
|
|||||||
if ( m_chkMulti->IsChecked() )
|
if ( m_chkMulti->IsChecked() )
|
||||||
style |= wxDIRCTRL_MULTIPLE;
|
style |= wxDIRCTRL_MULTIPLE;
|
||||||
|
|
||||||
|
|
||||||
wxGenericDirCtrl *dirCtrl = new wxGenericDirCtrl(
|
wxGenericDirCtrl *dirCtrl = new wxGenericDirCtrl(
|
||||||
this,
|
this,
|
||||||
DirCtrlPage_Ctrl,
|
DirCtrlPage_Ctrl,
|
||||||
m_dirCtrl->GetPath(),
|
defaultPath ? wxDirDialogDefaultFolderStr : m_dirCtrl->GetPath(),
|
||||||
wxDefaultPosition,
|
wxDefaultPosition,
|
||||||
wxDefaultSize,
|
wxDefaultSize,
|
||||||
style
|
style
|
||||||
|
Reference in New Issue
Block a user