Use "pair of ints" type for wxGridBagSizer size and position in XRC

Introduce a new type for XRC values imaginatively called just "pair of
integers" which can be used for values not expressed in pixels and hence for
which it doesn't make sense to use dialog units nor to scale them by the DPI.

Use this new type for wxGridBagSizer position and span elements to prevent
them from being changed when using higher than normal DPI.

Closes #17592.
This commit is contained in:
Vadim Zeitlin
2016-07-06 18:44:07 +02:00
parent c4d2ba1335
commit f68c67aa85
6 changed files with 54 additions and 12 deletions

View File

@@ -544,6 +544,9 @@ public:
wxCoord GetDimension(const wxString& param, wxCoord defaultv = 0,
wxWindow *windowToUse = NULL) wxOVERRIDE;
// Gets a size which is not expressed in pixels, so not in dialog units.
wxSize GetPairInts(const wxString& param) wxOVERRIDE;
// Gets a direction, complains if the value is invalid.
wxDirection GetDirection(const wxString& param, wxDirection dirDefault = wxLEFT) wxOVERRIDE;

View File

@@ -74,6 +74,7 @@ public:
virtual wxPoint GetPosition(const wxString& param = wxT("pos")) = 0;
virtual wxCoord GetDimension(const wxString& param, wxCoord defaultv = 0,
wxWindow *windowToUse = NULL) = 0;
virtual wxSize GetPairInts(const wxString& param) = 0;
virtual wxDirection GetDirection(const wxString& param, wxDirection dir = wxLEFT) = 0;
virtual wxBitmap GetBitmap(const wxString& param = wxT("bitmap"),
const wxArtClient& defaultArtClient = wxART_OTHER,
@@ -296,6 +297,10 @@ protected:
{
return GetImpl()->GetDimension(param, defaultv, windowToUse);
}
wxSize GetPairInts(const wxString& param)
{
return GetImpl()->GetPairInts(param);
}
wxDirection GetDirection(const wxString& param, wxDirection dir = wxLEFT)
{
return GetImpl()->GetDirection(param, dir);