Added wxFLP_SMALL and wxDIRP_SMALL styles for wx{File,Dir}PickerCtrl.
These styles allow to use a smaller browse button as the standard one takes too much space, often leaving too little of it for the more important text control part. Notice that both styles are, in fact, equal to wxPB_SMALL but only file and directory pickers currently use it as it doesn't make sense for the colour and font pickers. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68921 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -111,7 +111,8 @@ protected:
|
||||
wxCheckBox *m_chkFileTextCtrl,
|
||||
*m_chkFileOverwritePrompt,
|
||||
*m_chkFileMustExist,
|
||||
*m_chkFileChangeDir;
|
||||
*m_chkFileChangeDir,
|
||||
*m_chkSmall;
|
||||
wxRadioBox *m_radioFilePickerMode;
|
||||
|
||||
wxBoxSizer *m_sizer;
|
||||
@@ -169,6 +170,8 @@ void FilePickerWidgetsPage::CreateContent()
|
||||
m_chkFileOverwritePrompt = CreateCheckBoxAndAddToSizer(filebox, wxT("Overwrite prompt"), false);
|
||||
m_chkFileMustExist = CreateCheckBoxAndAddToSizer(filebox, wxT("File must exist"), false);
|
||||
m_chkFileChangeDir = CreateCheckBoxAndAddToSizer(filebox, wxT("Change working dir"), false);
|
||||
m_chkSmall = CreateCheckBoxAndAddToSizer(filebox, "&Small version", false);
|
||||
|
||||
boxleft->Add(filebox, 0, wxALL|wxGROW, 5);
|
||||
|
||||
boxleft->Add(new wxButton(this, PickerPage_Reset, wxT("&Reset")),
|
||||
@@ -222,6 +225,9 @@ long FilePickerWidgetsPage::GetPickerStyle()
|
||||
if ( m_chkFileChangeDir->GetValue() )
|
||||
style |= wxFLP_CHANGE_DIR;
|
||||
|
||||
if ( m_chkSmall->GetValue() )
|
||||
style |= wxFLP_SMALL;
|
||||
|
||||
if (m_radioFilePickerMode->GetSelection() == FilePickerMode_Open)
|
||||
style |= wxFLP_OPEN;
|
||||
else
|
||||
@@ -247,6 +253,7 @@ void FilePickerWidgetsPage::Reset()
|
||||
m_chkFileOverwritePrompt->SetValue((wxFLP_DEFAULT_STYLE & wxFLP_OVERWRITE_PROMPT) != 0);
|
||||
m_chkFileMustExist->SetValue((wxFLP_DEFAULT_STYLE & wxFLP_FILE_MUST_EXIST) != 0);
|
||||
m_chkFileChangeDir->SetValue((wxFLP_DEFAULT_STYLE & wxFLP_CHANGE_DIR) != 0);
|
||||
m_chkSmall->SetValue((wxFLP_DEFAULT_STYLE & wxFLP_SMALL) != 0);
|
||||
|
||||
UpdateFilePickerMode();
|
||||
}
|
||||
@@ -291,7 +298,8 @@ void FilePickerWidgetsPage::OnCheckBox(wxCommandEvent &event)
|
||||
if (event.GetEventObject() == m_chkFileTextCtrl ||
|
||||
event.GetEventObject() == m_chkFileOverwritePrompt ||
|
||||
event.GetEventObject() == m_chkFileMustExist ||
|
||||
event.GetEventObject() == m_chkFileChangeDir)
|
||||
event.GetEventObject() == m_chkFileChangeDir ||
|
||||
event.GetEventObject() == m_chkSmall)
|
||||
RecreatePicker();
|
||||
|
||||
if (event.GetEventObject() == m_radioFilePickerMode)
|
||||
|
Reference in New Issue
Block a user