+void wxScrollHelper::DoScroll( int x_pos, int y_pos )
+{
+ wxCHECK_RET( m_targetWindow != 0, wxT("No target window") );
+
+ DoScrollOneDir(wxHORIZONTAL, x_pos, m_xScrollPixelsPerLine, &m_xScrollPosition);
+ DoScrollOneDir(wxVERTICAL, y_pos, m_yScrollPixelsPerLine, &m_yScrollPosition);
+}
+
+// ----------------------------------------------------------------------------
+// scrollbars visibility
+// ----------------------------------------------------------------------------
+
+namespace
+{
+
+GtkPolicyType GtkPolicyFromWX(wxScrollbarVisibility visibility)
+{
+ GtkPolicyType policy;
+ switch ( visibility )
+ {
+ case wxSHOW_SB_NEVER:
+ policy = GTK_POLICY_NEVER;
+ break;
+
+ case wxSHOW_SB_DEFAULT:
+ policy = GTK_POLICY_AUTOMATIC;
+ break;
+
+ default:
+ wxFAIL_MSG( wxS("unknown scrollbar visibility") );
+ // fall through
+
+ case wxSHOW_SB_ALWAYS:
+ policy = GTK_POLICY_ALWAYS;
+ break;
+ }
+
+ return policy;
+}
+
+} // anonymous namespace
+
+bool wxScrollHelper::IsScrollbarShown(int orient) const
+{
+ GtkScrolledWindow * const scrolled = GTK_SCROLLED_WINDOW(m_win->m_widget);
+ if ( !scrolled )
+ {
+ // By default, all windows are scrollable.
+ return true;
+ }
+
+ GtkPolicyType hpolicy, vpolicy;
+ gtk_scrolled_window_get_policy(scrolled, &hpolicy, &vpolicy);
+
+ GtkPolicyType policy = orient == wxHORIZONTAL ? hpolicy : vpolicy;
+
+ return policy != GTK_POLICY_NEVER;
+}
+
+void wxScrollHelper::DoShowScrollbars(wxScrollbarVisibility horz,
+ wxScrollbarVisibility vert)