Lay out various wxPG dialogs based on the current system screen design.

Currently, customizing some dialogs for small screen environment is done statically on the build stage by setting wxPG_SMALL_SCREEN to 1 (what is done for WXWINCE only).
Instead, we can do this for all platforms in a dynamic manner, based on the classification provided by wxSystemSettings::GetScreenType() function.
In order to do so there is introduced a static helper function wxPropertyGrid::IsSmallScreen() which is used to select right parameters (size, position) for several dialogs in order to display them correctly on the small screen.
This commit is contained in:
Artur Wieczorek
2015-06-08 21:46:03 +02:00
parent 8367c3c0ca
commit cb6efbd3c3
4 changed files with 45 additions and 45 deletions

View File

@@ -1696,10 +1696,12 @@ void wxPropertyGrid::SetCurControlBoldFont()
wxPoint wxPropertyGrid::GetGoodEditorDialogPosition( wxPGProperty* p,
const wxSize& sz )
{
#if wxPG_SMALL_SCREEN
// On small-screen devices, always show dialogs with default position and size.
return wxDefaultPosition;
#else
if ( IsSmallScreen() )
{
// On small-screen devices, always show dialogs with default position and size.
return wxDefaultPosition;
}
int splitterX = GetSplitterPosition();
int x = splitterX;
int y = p->GetY();
@@ -1729,7 +1731,6 @@ wxPoint wxPropertyGrid::GetGoodEditorDialogPosition( wxPGProperty* p,
new_y = y + m_lineHeight;
return wxPoint(new_x,new_y);
#endif
}
// -----------------------------------------------------------------------