-// ----------------------------------------------------------------------------
-// scrollbar management
-// ----------------------------------------------------------------------------
-
-// Helper function
-void wxWindowX11::CreateScrollbar(wxOrientation orientation)
-{
- // TODO
-#if 0
- wxCHECK_RET( m_drawingArea, "this window can't have scrollbars" );
-
- XtVaSetValues((Widget) m_scrolledWindow, XmNresizePolicy, XmRESIZE_NONE, NULL);
-
- // Add scrollbars if required
- if (orientation == wxHORIZONTAL)
- {
- Widget hScrollBar = XtVaCreateManagedWidget ("hsb",
- xmScrollBarWidgetClass, (Widget) m_scrolledWindow,
- XmNorientation, XmHORIZONTAL,
- NULL);
- XtAddCallback (hScrollBar, XmNvalueChangedCallback, (XtCallbackProc) wxScrollBarCallback, (XtPointer) XmHORIZONTAL);
- XtAddCallback (hScrollBar, XmNdragCallback, (XtCallbackProc) wxScrollBarCallback, (XtPointer) XmHORIZONTAL);
- XtAddCallback (hScrollBar, XmNincrementCallback, (XtCallbackProc) wxScrollBarCallback, (XtPointer) XmHORIZONTAL);
- XtAddCallback (hScrollBar, XmNdecrementCallback, (XtCallbackProc) wxScrollBarCallback, (XtPointer) XmHORIZONTAL);
- XtAddCallback (hScrollBar, XmNpageIncrementCallback, (XtCallbackProc) wxScrollBarCallback, (XtPointer) XmHORIZONTAL);
- XtAddCallback (hScrollBar, XmNpageDecrementCallback, (XtCallbackProc) wxScrollBarCallback, (XtPointer) XmHORIZONTAL);
- XtAddCallback (hScrollBar, XmNtoTopCallback, (XtCallbackProc) wxScrollBarCallback, (XtPointer) XmHORIZONTAL);
- XtAddCallback (hScrollBar, XmNtoBottomCallback, (XtCallbackProc) wxScrollBarCallback, (XtPointer) XmHORIZONTAL);
-
- XtVaSetValues (hScrollBar,
- XmNincrement, 1,
- XmNvalue, 0,
- NULL);
-
- m_hScrollBar = (WXWidget) hScrollBar;
-
- wxColour backgroundColour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
- DoChangeBackgroundColour(m_hScrollBar, backgroundColour, TRUE);
-
- XtRealizeWidget(hScrollBar);
-
- XtVaSetValues((Widget) m_scrolledWindow,
- XmNhorizontalScrollBar, (Widget) m_hScrollBar,
- NULL);
-
- m_hScroll = TRUE;
-
- wxAddWindowToTable( hScrollBar, this );
- }
-
- if (orientation == wxVERTICAL)
- {
- Widget vScrollBar = XtVaCreateManagedWidget ("vsb",
- xmScrollBarWidgetClass, (Widget) m_scrolledWindow,
- XmNorientation, XmVERTICAL,
- NULL);
- XtAddCallback (vScrollBar, XmNvalueChangedCallback, (XtCallbackProc) wxScrollBarCallback, (XtPointer) XmVERTICAL);
- XtAddCallback (vScrollBar, XmNdragCallback, (XtCallbackProc) wxScrollBarCallback, (XtPointer) XmVERTICAL);
- XtAddCallback (vScrollBar, XmNincrementCallback, (XtCallbackProc) wxScrollBarCallback, (XtPointer) XmVERTICAL);
- XtAddCallback (vScrollBar, XmNdecrementCallback, (XtCallbackProc) wxScrollBarCallback, (XtPointer) XmVERTICAL);
- XtAddCallback (vScrollBar, XmNpageIncrementCallback, (XtCallbackProc) wxScrollBarCallback, (XtPointer) XmVERTICAL);
- XtAddCallback (vScrollBar, XmNpageDecrementCallback, (XtCallbackProc) wxScrollBarCallback, (XtPointer) XmVERTICAL);
- XtAddCallback (vScrollBar, XmNtoTopCallback, (XtCallbackProc) wxScrollBarCallback, (XtPointer) XmVERTICAL);
- XtAddCallback (vScrollBar, XmNtoBottomCallback, (XtCallbackProc) wxScrollBarCallback, (XtPointer) XmVERTICAL);
-
- XtVaSetValues (vScrollBar,
- XmNincrement, 1,
- XmNvalue, 0,
- NULL);
-
- m_vScrollBar = (WXWidget) vScrollBar;
- wxColour backgroundColour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
- DoChangeBackgroundColour(m_vScrollBar, backgroundColour, TRUE);
-
- XtRealizeWidget(vScrollBar);
-
- XtVaSetValues((Widget) m_scrolledWindow,
- XmNverticalScrollBar, (Widget) m_vScrollBar,
- NULL);
-
- m_vScroll = TRUE;
-
- wxAddWindowToTable( vScrollBar, this );
- }
-
- XtVaSetValues((Widget) m_scrolledWindow, XmNresizePolicy, XmRESIZE_ANY, NULL);
-#endif
-}
-
-void wxWindowX11::DestroyScrollbar(wxOrientation orientation)
-{
- // TODO
-#if 0
- wxCHECK_RET( m_drawingArea, "this window can't have scrollbars" );
-
- XtVaSetValues((Widget) m_scrolledWindow, XmNresizePolicy, XmRESIZE_NONE, NULL);
- // Add scrollbars if required
- if (orientation == wxHORIZONTAL)
- {
- if (m_hScrollBar)
- {
- wxDeleteWindowFromTable((Widget)m_hScrollBar);
- XtDestroyWidget((Widget) m_hScrollBar);
- }
- m_hScrollBar = (WXWidget) 0;
- m_hScroll = FALSE;
-
- XtVaSetValues((Widget) m_scrolledWindow,
- XmNhorizontalScrollBar, (Widget) 0,
- NULL);
-
- }
-
- if (orientation == wxVERTICAL)
- {
- if (m_vScrollBar)
- {
- wxDeleteWindowFromTable((Widget)m_vScrollBar);
- XtDestroyWidget((Widget) m_vScrollBar);
- }
- m_vScrollBar = (WXWidget) 0;
- m_vScroll = FALSE;
-
- XtVaSetValues((Widget) m_scrolledWindow,
- XmNverticalScrollBar, (Widget) 0,
- NULL);
-
- }
- XtVaSetValues((Widget) m_scrolledWindow, XmNresizePolicy, XmRESIZE_ANY, NULL);
-#endif
-}
-