]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/textctrl.cpp
Dialog Editor bug fixes, several other small ones
[wxWidgets.git] / src / motif / textctrl.cpp
index ba5066934a1cd270f076e048b638e905fb664619..3d7c94d2e4f17c380391758d8849c032d7e2863e 100644 (file)
@@ -646,11 +646,47 @@ void wxTextCtrl::ChangeFont(bool keepOriginalSize)
 void wxTextCtrl::ChangeBackgroundColour()
 {
     wxWindow::ChangeBackgroundColour();
+
+    Widget parent = XtParent ((Widget) m_mainWidget);
+    Widget hsb, vsb;
+
+    XtVaGetValues (parent,
+                    XmNhorizontalScrollBar, &hsb,
+                    XmNverticalScrollBar, &vsb,
+                    NULL);
+
+    /* TODO: should scrollbars be affected? Should probably have separate
+     * function to change them (by default, taken from wxSystemSettings)
+    if (hsb)
+        DoChangeBackgroundColour((WXWidget) hsb, m_backgroundColour, TRUE);
+    if (vsb)
+        DoChangeBackgroundColour((WXWidget) vsb, m_backgroundColour, TRUE);
+     */
+
+    DoChangeBackgroundColour((WXWidget) parent, m_backgroundColour, TRUE);
 }
 
 void wxTextCtrl::ChangeForegroundColour()
 {
     wxWindow::ChangeForegroundColour();
+
+
+    Widget parent = XtParent ((Widget) m_mainWidget);
+    Widget hsb, vsb;
+
+    XtVaGetValues (parent,
+                    XmNhorizontalScrollBar, &hsb,
+                    XmNverticalScrollBar, &vsb,
+                    NULL);
+
+    /* TODO: should scrollbars be affected? Should probably have separate
+     * function to change them (by default, taken from wxSystemSettings)
+    if (hsb)
+        DoChangeForegroundColour((WXWidget) hsb, m_foregroundColour);
+    if (vsb)
+        DoChangeForegroundColour((WXWidget) vsb, m_foregroundColour);
+     */
+    DoChangeForegroundColour((WXWidget) parent, m_foregroundColour);
 }
 
 static void wxTextWindowChangedProc (Widget w, XtPointer clientData, XtPointer ptr)