]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/wincmn.cpp
VTK wrapper of vtkRenderWindow for wxPython. Tested on MSW so far.
[wxWidgets.git] / src / common / wincmn.cpp
index 5f7b55bbebbb53ca322d7515c18dc5750f764c5a..18e1821bfc1ae89d2c64a2f2a48d245c432d5cda 100644 (file)
@@ -37,6 +37,7 @@
     #include "wx/window.h"
     #include "wx/checkbox.h"
     #include "wx/radiobut.h"
+    #include "wx/textctrl.h"
     #include "wx/settings.h"
     #include "wx/dialog.h"
 #endif //WX_PRECOMP
@@ -118,8 +119,11 @@ void wxWindowBase::InitBase()
 
     m_backgroundColour = settings.GetSystemColour(wxSYS_COLOUR_BTNFACE);
     m_foregroundColour = *wxBLACK;  // TODO take this from sys settings too?
+#ifndef __WXMAC__
     m_font = *wxSWISS_FONT;         //      and this?
-
+#else
+       m_font = settings.GetSystemFont(wxSYS_DEFAULT_GUI_FONT);
+#endif
     // no style bits
     m_windowStyle = 0;
 
@@ -350,6 +354,7 @@ void wxWindowBase::Centre(int direction)
         yNew += posParent.y;
     }
 
+    // move the centre of this window to this position
     Move(xNew, yNew);
 }
 
@@ -1179,42 +1184,44 @@ void wxWindowBase::GetPositionConstraint(int *x, int *y) const
 // of control classes.
 void wxWindowBase::UpdateWindowUI()
 {
-    wxWindowID id = GetId();
-    if ( id > 0 )
+    wxUpdateUIEvent event(GetId());
+    event.m_eventObject = this;
+
+    if ( GetEventHandler()->ProcessEvent(event) )
     {
-        wxUpdateUIEvent event(id);
-        event.m_eventObject = this;
+        if ( event.GetSetEnabled() )
+            Enable(event.GetEnabled());
 
-        if ( GetEventHandler()->ProcessEvent(event) )
+        if ( event.GetSetText() )
         {
-            if ( event.GetSetEnabled() )
-                Enable(event.GetEnabled());
-
-            if ( event.GetSetText() )
+            wxControl *control = wxDynamicCast(this, wxControl);
+            if ( control )
             {
-                wxControl *control = wxDynamicCast(this, wxControl);
-                if ( control )
+                wxTextCtrl *text = wxDynamicCast(control, wxTextCtrl);
+                if ( text )
+                    text->SetValue(event.GetText());
+                else
                     control->SetLabel(event.GetText());
             }
+        }
 
 #if wxUSE_CHECKBOX
-            wxCheckBox *checkbox = wxDynamicCast(this, wxCheckBox);
-            if ( checkbox )
-            {
-                if ( event.GetSetChecked() )
-                    checkbox->SetValue(event.GetChecked());
-            }
+        wxCheckBox *checkbox = wxDynamicCast(this, wxCheckBox);
+        if ( checkbox )
+        {
+            if ( event.GetSetChecked() )
+                checkbox->SetValue(event.GetChecked());
+        }
 #endif // wxUSE_CHECKBOX
 
 #if wxUSE_RADIOBUTTON
-            wxRadioButton *radiobtn = wxDynamicCast(this, wxRadioButton);
-            if ( radiobtn )
-            {
-                if ( event.GetSetChecked() )
-                    radiobtn->SetValue(event.GetChecked());
-            }
-#endif // wxUSE_RADIOBUTTON
+        wxRadioButton *radiobtn = wxDynamicCast(this, wxRadioButton);
+        if ( radiobtn )
+        {
+            if ( event.GetSetChecked() )
+                radiobtn->SetValue(event.GetChecked());
         }
+#endif // wxUSE_RADIOBUTTON
     }
 }