]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/wincmn.cpp
mimetype.cpp/.h split into unix,mac,msw
[wxWidgets.git] / src / common / wincmn.cpp
index dd3822251dc7f176f2fa8020166cb9909fb237dd..f0970096304840a22b2196a8988b147224219728 100644 (file)
@@ -118,8 +118,10 @@ void wxWindowBase::InitBase()
     wxSystemSettings settings;
 
     m_backgroundColour = settings.GetSystemColour(wxSYS_COLOUR_BTNFACE);
-    m_foregroundColour = *wxBLACK;  // TODO take this from sys settings too?
-#ifndef __WXMAC__
+    // m_foregroundColour = *wxBLACK;  // TODO take this from sys settings too?
+    m_foregroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOWTEXT);
+
+#if !defined(__WXMAC__) && !defined(__WXGTK__)
     m_font = *wxSWISS_FONT;         //      and this?
 #else
        m_font = settings.GetSystemFont(wxSYS_DEFAULT_GUI_FONT);
@@ -158,9 +160,7 @@ bool wxWindowBase::CreateBase(wxWindowBase *parent,
                               const wxPoint& WXUNUSED(pos),
                               const wxSize& WXUNUSED(size),
                               long style,
-#if wxUSE_VALIDATORS
                               const wxValidator& validator,
-#endif
                               const wxString& name)
 {
     // m_isWindow is set to TRUE in wxWindowBase::Init() as well as many other
@@ -174,7 +174,10 @@ bool wxWindowBase::CreateBase(wxWindowBase *parent,
     SetName(name);
     SetWindowStyleFlag(style);
     SetParent(parent);
+
+#if wxUSE_VALIDATORS
     SetValidator(validator);
+#endif // wxUSE_VALIDATORS
 
     return TRUE;
 }
@@ -1216,14 +1219,14 @@ void wxWindowBase::UpdateWindowUI()
         }
 #endif // wxUSE_CHECKBOX
 
-#if wxUSE_RADIOBUTTON
+#if wxUSE_RADIOBTN
         wxRadioButton *radiobtn = wxDynamicCast(this, wxRadioButton);
         if ( radiobtn )
         {
             if ( event.GetSetChecked() )
                 radiobtn->SetValue(event.GetChecked());
         }
-#endif // wxUSE_RADIOBUTTON
+#endif // wxUSE_RADIOBTN
     }
 }
 
@@ -1275,7 +1278,9 @@ void wxWindowBase::DoSetClientObject( wxClientData *data )
 
 wxClientData *wxWindowBase::DoGetClientObject() const
 {
-    wxASSERT_MSG( m_clientDataType == ClientData_Object,
+    // it's not an error to call GetClientObject() on a window which doesn't
+    // have client data at all - NULL will be returned
+    wxASSERT_MSG( m_clientDataType != ClientData_Void,
                   wxT("this window doesn't have object client data") );
 
     return m_clientObject;
@@ -1292,7 +1297,9 @@ void wxWindowBase::DoSetClientData( void *data )
 
 void *wxWindowBase::DoGetClientData() const
 {
-    wxASSERT_MSG( m_clientDataType == ClientData_Void,
+    // it's not an error to call GetClientData() on a window which doesn't have
+    // client data at all - NULL will be returned
+    wxASSERT_MSG( m_clientDataType != ClientData_Object,
                   wxT("this window doesn't have void client data") );
 
     return m_clientData;