X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/321db4b6bf15df209942b9c0e6c744c8e7074d1b..184b5d99a5382cd7a19888c85aff11f8a21af2f6:/src/motif/listbox.cpp diff --git a/src/motif/listbox.cpp b/src/motif/listbox.cpp index 246ee2d909..3d864f49d5 100644 --- a/src/motif/listbox.cpp +++ b/src/motif/listbox.cpp @@ -107,11 +107,11 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id, XtAddCallback (listWidget, XmNdefaultActionCallback, (XtCallbackProc) wxListBoxDefaultActionProc, (XtPointer) this); - AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, width, height); + m_windowFont = parent->GetFont(); + ChangeFont(FALSE); - m_backgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOW); + AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, width, height); - SetFont(* parent->GetFont()); ChangeBackgroundColour(); return TRUE; @@ -741,18 +741,49 @@ WXWidget wxListBox::GetTopWidget() const return (WXWidget) XtParent( (Widget) m_mainWidget ); } -void wxListBox::ChangeFont() +void wxListBox::ChangeFont(bool keepOriginalSize) { - wxWindow::ChangeFont(); + wxWindow::ChangeFont(keepOriginalSize); } void wxListBox::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) + DoChangeBackgroundColour((WXWidget) hsb, m_backgroundColour, TRUE); + DoChangeBackgroundColour((WXWidget) vsb, m_backgroundColour, TRUE); + */ + + DoChangeBackgroundColour((WXWidget) parent, m_backgroundColour, TRUE); } void wxListBox::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) + DoChangeForegroundColour((WXWidget) hsb, m_foregroundColour); + DoChangeForegroundColour((WXWidget) vsb, m_foregroundColour); + DoChangeForegroundColour((WXWidget) parent, m_foregroundColour); + */ } +