]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/window.cpp
changed ppc to ptpc as ppc is a preprocessor constant for PowerPC on Mac
[wxWidgets.git] / src / gtk1 / window.cpp
index be6e24913ea1e24b10df5c6caf29cf0a339c1a38..859efed9c5329ed73e4d36e1bcff61f16d19484e 100644 (file)
@@ -2798,21 +2798,6 @@ bool wxWindowGTK::PreCreation( wxWindowGTK *parent, const wxPoint &pos,  const w
     m_x = (int)pos.x;
     m_y = (int)pos.y;
 
-    // some reasonable defaults
-    if (!parent)
-    {
-        if (m_x == -1)
-        {
-            m_x = (gdk_screen_width () - m_width) / 2;
-            if (m_x < 10) m_x = 10;
-        }
-        if (m_y == -1)
-        {
-            m_y = (gdk_screen_height () - m_height) / 2;
-            if (m_y < 10) m_y = 10;
-        }
-    }
-
     return TRUE;
 }
 
@@ -3009,13 +2994,13 @@ void wxWindowGTK::DoSetSize( int x, int y, int width, int height, int sizeFlags
         }
 
         // calculate the best size if we should auto size the window
-        if ( (sizeFlags & wxSIZE_AUTO_WIDTH) ||
-                (sizeFlags & wxSIZE_AUTO_HEIGHT) )
+        if ( ((sizeFlags & wxSIZE_AUTO_WIDTH) && width == -1) ||
+                ((sizeFlags & wxSIZE_AUTO_HEIGHT) && height == -1) )
         {
             const wxSize sizeBest = GetBestSize();
-            if ( sizeFlags & wxSIZE_AUTO_WIDTH )
+            if ( (sizeFlags & wxSIZE_AUTO_WIDTH) && width == -1 )
                 width = sizeBest.x;
-            if ( sizeFlags & wxSIZE_AUTO_HEIGHT )
+            if ( (sizeFlags & wxSIZE_AUTO_HEIGHT) && height == -1 )
                 height = sizeBest.y;
         }
 
@@ -3904,7 +3889,7 @@ void wxWindowGTK::GtkSendPaintEvents()
                 g_eraseGC = gdk_gc_new( pizza->bin_window );
                 gdk_gc_set_fill( g_eraseGC, GDK_SOLID );
             }
-            gdk_gc_set_foreground( g_eraseGC, m_backgroundColour.GetColor() );
+            gdk_gc_set_foreground( g_eraseGC, GetBackgroundColour().GetColor() );
 
             wxRegionIterator upd( m_clearRegion );
             while (upd)
@@ -4206,7 +4191,7 @@ void wxWindowGTK::SetWidgetStyle()
         }
     }
 
-    if ( m_hasBgCol )
+    if ( m_hasBgCol && m_backgroundColour.Ok() )
     {
         m_backgroundColour.CalcPixel( gtk_widget_get_colormap( m_widget ) );
         if (m_backgroundColour != wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE))