X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/47bc1060127d86222768789575295254a710f5a6..2e35f56f6d323a15d4e70d4ac0adf9a0a42cce15:/src/motif/scrolbar.cpp diff --git a/src/motif/scrolbar.cpp b/src/motif/scrolbar.cpp index 84fa92fe64..5bd38a4ee5 100644 --- a/src/motif/scrolbar.cpp +++ b/src/motif/scrolbar.cpp @@ -22,7 +22,7 @@ #include -void wxScrollBarCallback(Widget widget, XtPointer clientData, +static void wxScrollBarCallback(Widget widget, XtPointer clientData, XmScaleCallbackStruct *cbs); #if !USE_SHARED_LIBRARY @@ -40,7 +40,9 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id, return FALSE; parent->AddChild(this); SetName(name); - SetValidator(validator); + m_backgroundColour = parent->GetBackgroundColour(); + m_foregroundColour = parent->GetForegroundColour(); + SetValidator(validator); m_windowStyle = style; @@ -91,7 +93,7 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id, SetCanAddEventHandler(TRUE); AttachWidget (parent, m_mainWidget, (WXWidget) NULL, x, y, width, height); - ChangeColour(m_mainWidget); + ChangeBackgroundColour(); return TRUE; } @@ -100,7 +102,7 @@ wxScrollBar::~wxScrollBar() { } -void wxScrollBar::SetPosition(int pos) +void wxScrollBar::SetThumbPosition(int pos) { if (m_mainWidget) { @@ -110,7 +112,7 @@ void wxScrollBar::SetPosition(int pos) } } -int wxScrollBar::GetPosition() const +int wxScrollBar::GetThumbPosition() const { if (m_mainWidget) { @@ -146,11 +148,31 @@ void wxScrollBar::SetScrollbar(int position, int thumbSize, int range, int pageS void wxScrollBar::Command(wxCommandEvent& event) { - SetPosition(event.m_commandInt); + SetThumbPosition(event.m_commandInt); ProcessCommand(event); } -void wxScrollBarCallback(Widget widget, XtPointer clientData, +void wxScrollBar::ChangeFont(bool keepOriginalSize) +{ + // TODO + // Do anything for a scrollbar? A font will never be seen. +} + +void wxScrollBar::ChangeBackgroundColour() +{ + wxWindow::ChangeBackgroundColour(); + + XtVaSetValues ((Widget) GetMainWidget(), + XmNtroughColor, m_backgroundColour.AllocColour(XtDisplay((Widget) GetMainWidget())), + NULL); +} + +void wxScrollBar::ChangeForegroundColour() +{ + wxWindow::ChangeForegroundColour(); +} + +static void wxScrollBarCallback(Widget widget, XtPointer clientData, XmScaleCallbackStruct *cbs) { wxScrollBar *scrollBar = (wxScrollBar *)clientData;