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:
@@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user