Simplify DIALOG_SHIM::SetSizeInDU()
I missed in the wx documentation that ConvertDialogToPixels() has a wxSize overload.
This commit is contained in:
parent
13bc706518
commit
4d3b16bbd9
|
@ -117,23 +117,21 @@ void DIALOG_SHIM::FinishDialogSettings()
|
||||||
|
|
||||||
void DIALOG_SHIM::SetSizeInDU( int x, int y )
|
void DIALOG_SHIM::SetSizeInDU( int x, int y )
|
||||||
{
|
{
|
||||||
wxPoint sz( x, y );
|
wxSize sz( x, y );
|
||||||
auto pixels_as_point = ConvertDialogToPixels( sz );
|
SetSize( ConvertDialogToPixels( sz ) );
|
||||||
wxSize pixels_as_size( pixels_as_point.x, pixels_as_point.y );
|
|
||||||
SetSize( pixels_as_size );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int DIALOG_SHIM::HorizPixelsFromDU( int x )
|
int DIALOG_SHIM::HorizPixelsFromDU( int x )
|
||||||
{
|
{
|
||||||
wxPoint sz( x, 0 );
|
wxSize sz( x, 0 );
|
||||||
return ConvertDialogToPixels( sz ).x;
|
return ConvertDialogToPixels( sz ).x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int DIALOG_SHIM::VertPixelsFromDU( int y )
|
int DIALOG_SHIM::VertPixelsFromDU( int y )
|
||||||
{
|
{
|
||||||
wxPoint sz( 0, y );
|
wxSize sz( 0, y );
|
||||||
return ConvertDialogToPixels( sz ).y;
|
return ConvertDialogToPixels( sz ).y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue