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

@@ -2172,6 +2172,28 @@ wxCoord wxXmlResourceHandlerImpl::GetDimension(const wxString& param,
return ParseValueInPixels(this, param, defaultv, windowToUse);
}
wxSize wxXmlResourceHandlerImpl::GetPairInts(const wxString& param)
{
const wxString s = GetParamValue(param);
if ( s.empty() )
return wxDefaultSize;
wxSize sz;
if ( !XRCConvertFromAbsValue(s, sz) )
{
ReportParamError
(
param,
wxString::Format("cannot parse \"%s\" as pair of integers", s)
);
return wxDefaultSize;
}
return sz;
}
wxDirection
wxXmlResourceHandlerImpl::GetDirection(const wxString& param, wxDirection dirDefault)
{