X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/cb43b372fb1567caf7ccfa523aca10c676ceaec4..0133ee9316eb1a446970fd00c1b8ce2fece595e5:/src/gtk/scrolbar.cpp?ds=sidebyside diff --git a/src/gtk/scrolbar.cpp b/src/gtk/scrolbar.cpp index c8bc130f5c..0cd5adbd31 100644 --- a/src/gtk/scrolbar.cpp +++ b/src/gtk/scrolbar.cpp @@ -2,9 +2,8 @@ // Name: scrolbar.cpp // Purpose: // Author: Robert Roebling -// Created: 01/02/97 -// Id: -// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem +// Id: $Id$ +// Copyright: (c) 1998 Robert Roebling // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -48,7 +47,7 @@ static void gtk_scrollbar_callback( GtkWidget *WXUNUSED(widget), wxScrollBar *wi int value = (int)(win->m_adjust->value+0.5); int orient = wxHORIZONTAL; - if (win->GetWindowStyleFlag() & wxSB_VERTICAL == wxSB_VERTICAL) orient = wxHORIZONTAL; + if (win->GetWindowStyleFlag() & wxSB_VERTICAL == wxSB_VERTICAL) orient = wxVERTICAL; wxScrollEvent event( command, win->GetId(), value, orient ); event.SetEventObject( win ); @@ -127,8 +126,14 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id, gtk_signal_connect( GTK_OBJECT(m_widget), "button_release_event", (GtkSignalFunc)gtk_scrollbar_button_release_callback, (gpointer) this ); + m_parent->AddChild( this ); + + (m_parent->m_insertCallback)( m_parent, this ); + PostCreation(); + SetBackgroundColour( parent->GetBackgroundColour() ); + Show( TRUE ); return TRUE; @@ -180,14 +185,14 @@ void wxScrollBar::SetScrollbar( int position, int thumbSize, int range, int page SetPosition( position ); return; } - + m_oldPos = fpos; m_adjust->lower = 0.0; m_adjust->upper = frange; m_adjust->value = fpos; m_adjust->step_increment = 1.0; - m_adjust->page_increment = (float)(wxMax(fpage-2,0)); + m_adjust->page_increment = (float)(wxMax(fpage,0)); m_adjust->page_size = fthumb; gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "changed" ); @@ -260,3 +265,10 @@ bool wxScrollBar::IsOwnGtkWindow( GdkWindow *window ) (window == range->step_forw) || (window == range->step_back) ); } + +void wxScrollBar::ApplyWidgetStyle() +{ + SetWidgetStyle(); + gtk_widget_set_style( m_widget, m_widgetStyle ); +} +