Refactor repetitions into wxFileDialogBase::UpdateExtraControlUI()
No real changes, just prepare for the next commit before repeating more code.
This commit is contained in:
@@ -181,6 +181,9 @@ protected:
|
||||
{ return m_extraControlCreator != NULL; }
|
||||
// get the size of the extra control by creating and deleting it
|
||||
wxSize GetExtraControlSize();
|
||||
// Helper function for native file dialog usage where no wx events
|
||||
// are processed.
|
||||
void UpdateExtraControlUI();
|
||||
|
||||
private:
|
||||
ExtraControlCreatorFunction m_extraControlCreator;
|
||||
|
@@ -192,6 +192,12 @@ wxSize wxFileDialogBase::GetExtraControlSize()
|
||||
return (*m_extraControlCreator)(&dlg)->GetSize();
|
||||
}
|
||||
|
||||
void wxFileDialogBase::UpdateExtraControlUI()
|
||||
{
|
||||
if ( m_extraControl )
|
||||
m_extraControl->UpdateWindowUI(wxUPDATE_UI_RECURSE);
|
||||
}
|
||||
|
||||
void wxFileDialogBase::SetPath(const wxString& path)
|
||||
{
|
||||
wxString ext;
|
||||
|
@@ -496,8 +496,7 @@ void wxFileDialog::GTKSelectionChanged(const wxString& filename)
|
||||
{
|
||||
m_currentlySelectedFilename = filename;
|
||||
|
||||
if (m_extraControl)
|
||||
m_extraControl->UpdateWindowUI(wxUPDATE_UI_RECURSE);
|
||||
UpdateExtraControlUI();
|
||||
}
|
||||
|
||||
#endif // wxUSE_FILEDLG
|
||||
|
@@ -353,8 +353,7 @@ void wxFileDialog::MSWOnSelChange(WXHWND hDlg)
|
||||
else
|
||||
m_currentlySelectedFilename.clear();
|
||||
|
||||
if ( m_extraControl )
|
||||
m_extraControl->UpdateWindowUI(wxUPDATE_UI_RECURSE);
|
||||
UpdateExtraControlUI();
|
||||
}
|
||||
|
||||
void wxFileDialog::MSWOnTypeChange(WXHWND WXUNUSED(hDlg), int nFilterIndex)
|
||||
@@ -364,8 +363,7 @@ void wxFileDialog::MSWOnTypeChange(WXHWND WXUNUSED(hDlg), int nFilterIndex)
|
||||
// circumstances, so take care before decrementing it.
|
||||
m_currentlySelectedFilterIndex = nFilterIndex ? nFilterIndex - 1 : 0;
|
||||
|
||||
if ( m_extraControl )
|
||||
m_extraControl->UpdateWindowUI(wxUPDATE_UI_RECURSE);
|
||||
UpdateExtraControlUI();
|
||||
}
|
||||
|
||||
// helper used below in ShowCommFileDialog(): style is used to determine
|
||||
|
Reference in New Issue
Block a user