XtAddCallback((Widget) m_mainWidget, XmNlosingFocusCallback, (XtCallbackProc)wxTextWindowLoseFocusProc, (XtPointer)this);
+ m_windowFont = parent->GetFont();
+ ChangeFont(FALSE);
+
SetCanAddEventHandler(TRUE);
AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, size.x, size.y);
- SetFont(* parent->GetFont());
ChangeBackgroundColour();
return TRUE;
void wxTextCtrl::SetValue(const wxString& value)
{
- wxASSERT_MSG( (!value.IsNull()), "Must not pass a null string to wxTextCtrl::SetValue." ) ;
+ // This assert is wrong -- means that you can't set an empty
+ // string (IsNull == IsEmpty).
+ // wxASSERT_MSG( (!value.IsNull()), "Must not pass a null string to wxTextCtrl::SetValue." ) ;
m_inSetValue = TRUE;
XmTextSetString ((Widget) m_mainWidget, (char*) (const char*) value);
}
}
-void wxTextCtrl::ChangeFont()
+void wxTextCtrl::ChangeFont(bool keepOriginalSize)
{
- wxWindow::ChangeFont();
+ wxWindow::ChangeFont(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)