]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/wincmn.cpp
using font substitution (allows for fallbacks when unicode chars are not available...
[wxWidgets.git] / src / common / wincmn.cpp
index 5115c3cce6e308a9e05d73b051003aef3c3aa650..4a3b32676e613adc0eb8560c67e0e03a33127a26 100644 (file)
@@ -438,7 +438,8 @@ void wxWindowBase::Centre(int direction)
         //RN:  If we are using wxDisplay we get
         //the dimensions of the monitor the window is on,
         //otherwise we get the dimensions of the primary monitor
-#if wxUSE_DISPLAY
+        //FIXME:  wxDisplay::GetFromWindow only implemented on MSW
+#if wxUSE_DISPLAY && defined(__WXMSW__)
         int nDisplay = wxDisplay::GetFromWindow((wxWindow*)this);
         if(nDisplay != wxNOT_FOUND)
         {
@@ -810,10 +811,17 @@ void wxWindowBase::DoSetVirtualSize( int x, int y )
 
 wxSize wxWindowBase::DoGetVirtualSize() const
 {
-    if (m_virtualSize == wxDefaultSize)
-        return GetClientSize();
+    if ( m_virtualSize.IsFullySpecified() )
+        return m_virtualSize;
+
+    wxSize size = GetClientSize();
+    if ( m_virtualSize.x != wxDefaultCoord )
+        size.x = m_virtualSize.x;
 
-    return m_virtualSize;
+    if ( m_virtualSize.y != wxDefaultCoord )
+        size.y = m_virtualSize.y;
+
+    return size;
 }
 
 // ----------------------------------------------------------------------------
@@ -1036,8 +1044,17 @@ wxWindowBase::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
     wxVisualAttributes attrs;
     attrs.font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
     attrs.colFg = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);
-    attrs.colBg = wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE);
 
+    // On Smartphone/PocketPC, wxSYS_COLOUR_WINDOW is a better reflection of
+    // the usual background colour than wxSYS_COLOUR_BTNFACE.
+    // It's a pity that wxSYS_COLOUR_WINDOW isn't always a suitable background
+    // colour on other platforms.
+
+#if defined(__WXWINCE__) && (defined(__SMARTPHONE__) || defined(__POCKETPC__))
+    attrs.colBg = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW);
+#else
+    attrs.colBg = wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE);
+#endif
     return attrs;
 }