resize fun

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1705 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
1999-02-17 10:13:12 +00:00
parent dbdb39b2d0
commit f5eafd0e55
4 changed files with 16 additions and 22 deletions

View File

@@ -385,13 +385,13 @@ void wxDialog::SetSize( int width, int height )
void wxDialog::Centre( int direction )
{
wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
wxASSERT_MSG( (m_widget != NULL), "invalid dialog" );
int x = 0;
int y = 0;
if (direction & wxHORIZONTAL == wxHORIZONTAL) x = (gdk_screen_width () - m_width) / 2;
if (direction & wxVERTICAL == wxVERTICAL) y = (gdk_screen_height () - m_height) / 2;
if ((direction & wxHORIZONTAL) == wxHORIZONTAL) x = (gdk_screen_width () - m_width) / 2;
if ((direction & wxVERTICAL) == wxVERTICAL) y = (gdk_screen_height () - m_height) / 2;
Move( x, y );
}