Move GetExtraControlSize() hack from wxFileDialogBase to MSW code

The hack with creating a dummy dialog just to get the size of the extra
controls is only used in wxMSW, so move it to MSW-specific file from the
common code.

To allow doing this there, add CreateExtraControlWithParent() helper,
which is still not really used anywhere else than in wxMSW, but at least
doesn't do anything particularly ugly and doesn't really penalize the
common code for wxMSW sins.

No real changes.
This commit is contained in:
Vadim Zeitlin
2022-05-28 19:01:11 +01:00
parent f6a261468e
commit fdcaeb050f
3 changed files with 22 additions and 28 deletions

View File

@@ -194,13 +194,13 @@ protected:
wxWindow* m_extraControl;
// returns true if control is created (if it already exists returns false)
// create and return the extra control using the given parent
wxWindow* CreateExtraControlWithParent(wxWindow* parent) const;
// returns true if control is created, also sets m_extraControl
bool CreateExtraControl();
// return true if SetExtraControlCreator() was called
bool HasExtraControlCreator() const
{ 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();