X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8aa04e8bf1638ed4d9355e560c8d718c8be4667a..3c67202dee33f95fa48b176dec8994340c70eaa2:/src/motif/textctrl.cpp diff --git a/src/motif/textctrl.cpp b/src/motif/textctrl.cpp index b28bdf9ef5..b9f564264c 100644 --- a/src/motif/textctrl.cpp +++ b/src/motif/textctrl.cpp @@ -80,7 +80,8 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id, m_modified = FALSE; m_processedDefault = FALSE; m_fileName = ""; - m_backgroundColour = parent->GetBackgroundColour(); + // m_backgroundColour = parent->GetBackgroundColour(); + m_backgroundColour = * wxWHITE; m_foregroundColour = parent->GetForegroundColour(); SetName(name); @@ -488,7 +489,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; } @@ -649,46 +650,51 @@ void wxTextCtrl::ChangeBackgroundColour() { wxWindow::ChangeBackgroundColour(); - Widget parent = XtParent ((Widget) m_mainWidget); - Widget hsb, vsb; + /* TODO: should scrollbars be affected? Should probably have separate + * function to change them (by default, taken from wxSystemSettings) + */ + if (m_windowStyle & wxTE_MULTILINE) + { + Widget parent = XtParent ((Widget) m_mainWidget); + Widget hsb, vsb; - XtVaGetValues (parent, + XtVaGetValues (parent, XmNhorizontalScrollBar, &hsb, XmNverticalScrollBar, &vsb, NULL); + wxColour backgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE); + if (hsb) + DoChangeBackgroundColour((WXWidget) hsb, backgroundColour, TRUE); + if (vsb) + DoChangeBackgroundColour((WXWidget) vsb, backgroundColour, TRUE); - /* 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); + DoChangeBackgroundColour((WXWidget) parent, m_backgroundColour, TRUE); + } } void wxTextCtrl::ChangeForegroundColour() { wxWindow::ChangeForegroundColour(); + if (m_windowStyle & wxTE_MULTILINE) + { + Widget parent = XtParent ((Widget) m_mainWidget); + Widget hsb, vsb; - Widget parent = XtParent ((Widget) m_mainWidget); - Widget hsb, vsb; - - XtVaGetValues (parent, + 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); + /* 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)