Next try at removing the dancing sliders

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@733 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling 1998-09-12 20:38:55 +00:00
parent cfb88c5569
commit 84efdbf195
6 changed files with 26 additions and 14 deletions

View File

@ -48,7 +48,7 @@ static void gtk_scrollbar_callback( GtkWidget *WXUNUSED(widget), wxScrollBar *wi
int value = (int)(win->m_adjust->value+0.5); int value = (int)(win->m_adjust->value+0.5);
int orient = wxHORIZONTAL; 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 ); wxScrollEvent event( command, win->GetId(), value, orient );
event.SetEventObject( win ); event.SetEventObject( win );
@ -187,7 +187,7 @@ void wxScrollBar::SetScrollbar( int position, int thumbSize, int range, int page
m_adjust->upper = frange; m_adjust->upper = frange;
m_adjust->value = fpos; m_adjust->value = fpos;
m_adjust->step_increment = 1.0; 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; m_adjust->page_size = fthumb;
gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "changed" ); gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "changed" );

View File

@ -48,7 +48,7 @@ static void gtk_slider_callback( GtkWidget *WXUNUSED(widget), wxSlider *win )
int value = (int)(win->m_adjust->value+0.5); int value = (int)(win->m_adjust->value+0.5);
int orient = wxHORIZONTAL; 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 ); wxScrollEvent event( command, win->GetId(), value, orient );
event.SetEventObject( win ); event.SetEventObject( win );

View File

@ -930,6 +930,12 @@ bool wxWindow::Create( wxWindow *parent, wxWindowID id,
gtk_signal_connect( GTK_OBJECT(s_window->vscrollbar), "button_press_event", gtk_signal_connect( GTK_OBJECT(s_window->vscrollbar), "button_press_event",
(GtkSignalFunc)gtk_scrollbar_button_press_callback, (gpointer) this ); (GtkSignalFunc)gtk_scrollbar_button_press_callback, (gpointer) this );
gtk_signal_connect( GTK_OBJECT(s_window->hscrollbar), "button_press_event",
(GtkSignalFunc)gtk_scrollbar_button_press_callback, (gpointer) this );
gtk_signal_connect( GTK_OBJECT(s_window->vscrollbar), "button_release_event",
(GtkSignalFunc)gtk_scrollbar_button_release_callback, (gpointer) this );
gtk_signal_connect( GTK_OBJECT(s_window->hscrollbar), "button_release_event", gtk_signal_connect( GTK_OBJECT(s_window->hscrollbar), "button_release_event",
(GtkSignalFunc)gtk_scrollbar_button_release_callback, (gpointer) this ); (GtkSignalFunc)gtk_scrollbar_button_release_callback, (gpointer) this );
@ -2264,7 +2270,7 @@ void wxWindow::SetScrollbar( int orient, int pos, int thumbVisible,
m_hAdjust->upper = frange; m_hAdjust->upper = frange;
m_hAdjust->value = fpos; m_hAdjust->value = fpos;
m_hAdjust->step_increment = 1.0; m_hAdjust->step_increment = 1.0;
m_hAdjust->page_increment = (float)(wxMax(fthumb-2,0)); m_hAdjust->page_increment = (float)(wxMax(fthumb,0));
m_hAdjust->page_size = fthumb; m_hAdjust->page_size = fthumb;
} }
else else
@ -2286,7 +2292,7 @@ void wxWindow::SetScrollbar( int orient, int pos, int thumbVisible,
m_vAdjust->upper = frange; m_vAdjust->upper = frange;
m_vAdjust->value = fpos; m_vAdjust->value = fpos;
m_vAdjust->step_increment = 1.0; m_vAdjust->step_increment = 1.0;
m_vAdjust->page_increment = (float)(wxMax(fthumb-2,0)); m_vAdjust->page_increment = (float)(wxMax(fthumb,0));
m_vAdjust->page_size = fthumb; m_vAdjust->page_size = fthumb;
} }

View File

@ -48,7 +48,7 @@ static void gtk_scrollbar_callback( GtkWidget *WXUNUSED(widget), wxScrollBar *wi
int value = (int)(win->m_adjust->value+0.5); int value = (int)(win->m_adjust->value+0.5);
int orient = wxHORIZONTAL; 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 ); wxScrollEvent event( command, win->GetId(), value, orient );
event.SetEventObject( win ); event.SetEventObject( win );
@ -187,7 +187,7 @@ void wxScrollBar::SetScrollbar( int position, int thumbSize, int range, int page
m_adjust->upper = frange; m_adjust->upper = frange;
m_adjust->value = fpos; m_adjust->value = fpos;
m_adjust->step_increment = 1.0; 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; m_adjust->page_size = fthumb;
gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "changed" ); gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "changed" );

View File

@ -48,7 +48,7 @@ static void gtk_slider_callback( GtkWidget *WXUNUSED(widget), wxSlider *win )
int value = (int)(win->m_adjust->value+0.5); int value = (int)(win->m_adjust->value+0.5);
int orient = wxHORIZONTAL; 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 ); wxScrollEvent event( command, win->GetId(), value, orient );
event.SetEventObject( win ); event.SetEventObject( win );

View File

@ -930,6 +930,12 @@ bool wxWindow::Create( wxWindow *parent, wxWindowID id,
gtk_signal_connect( GTK_OBJECT(s_window->vscrollbar), "button_press_event", gtk_signal_connect( GTK_OBJECT(s_window->vscrollbar), "button_press_event",
(GtkSignalFunc)gtk_scrollbar_button_press_callback, (gpointer) this ); (GtkSignalFunc)gtk_scrollbar_button_press_callback, (gpointer) this );
gtk_signal_connect( GTK_OBJECT(s_window->hscrollbar), "button_press_event",
(GtkSignalFunc)gtk_scrollbar_button_press_callback, (gpointer) this );
gtk_signal_connect( GTK_OBJECT(s_window->vscrollbar), "button_release_event",
(GtkSignalFunc)gtk_scrollbar_button_release_callback, (gpointer) this );
gtk_signal_connect( GTK_OBJECT(s_window->hscrollbar), "button_release_event", gtk_signal_connect( GTK_OBJECT(s_window->hscrollbar), "button_release_event",
(GtkSignalFunc)gtk_scrollbar_button_release_callback, (gpointer) this ); (GtkSignalFunc)gtk_scrollbar_button_release_callback, (gpointer) this );
@ -2264,7 +2270,7 @@ void wxWindow::SetScrollbar( int orient, int pos, int thumbVisible,
m_hAdjust->upper = frange; m_hAdjust->upper = frange;
m_hAdjust->value = fpos; m_hAdjust->value = fpos;
m_hAdjust->step_increment = 1.0; m_hAdjust->step_increment = 1.0;
m_hAdjust->page_increment = (float)(wxMax(fthumb-2,0)); m_hAdjust->page_increment = (float)(wxMax(fthumb,0));
m_hAdjust->page_size = fthumb; m_hAdjust->page_size = fthumb;
} }
else else
@ -2286,7 +2292,7 @@ void wxWindow::SetScrollbar( int orient, int pos, int thumbVisible,
m_vAdjust->upper = frange; m_vAdjust->upper = frange;
m_vAdjust->value = fpos; m_vAdjust->value = fpos;
m_vAdjust->step_increment = 1.0; m_vAdjust->step_increment = 1.0;
m_vAdjust->page_increment = (float)(wxMax(fthumb-2,0)); m_vAdjust->page_increment = (float)(wxMax(fthumb,0));
m_vAdjust->page_size = fthumb; m_vAdjust->page_size = fthumb;
} }