X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4b5f3fe655deeb91d5d3abe8fad30c4a1cae63dc..44c4a3348693414bace13852e50d926c1aa9f08b:/src/motif/textctrl.cpp diff --git a/src/motif/textctrl.cpp b/src/motif/textctrl.cpp index ba5066934a..3c7dc810ea 100644 --- a/src/motif/textctrl.cpp +++ b/src/motif/textctrl.cpp @@ -181,7 +181,9 @@ wxString wxTextCtrl::GetValue() const 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); @@ -486,7 +488,7 @@ int wxTextCtrl::overflow(int c) // Verify that there are no characters in get area if ( gptr() && gptr() < egptr() ) { - wxError("Who's trespassing my get area?","Internal error"); + wxError("wxTextCtrl::overflow: Who's trespassing my get area?","Internal error"); return EOF; } @@ -646,11 +648,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)