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 );
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" );
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 );
static gint gtk_scrollbar_button_press_callback( GtkRange *widget, GdkEventButton *gdk_event, wxWindow *win )
{
if (gdk_event->window != widget->slider) return FALSE;
-
+
win->m_isScrolling = TRUE;
return FALSE;
gtk_signal_connect( GTK_OBJECT(s_window->vscrollbar), "button_press_event",
(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",
(GtkSignalFunc)gtk_scrollbar_button_release_callback, (gpointer) this );
m_hAdjust->upper = frange;
m_hAdjust->value = fpos;
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;
}
else
m_vAdjust->upper = frange;
m_vAdjust->value = fpos;
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;
}
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 );
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" );
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 );
static gint gtk_scrollbar_button_press_callback( GtkRange *widget, GdkEventButton *gdk_event, wxWindow *win )
{
if (gdk_event->window != widget->slider) return FALSE;
-
+
win->m_isScrolling = TRUE;
return FALSE;
gtk_signal_connect( GTK_OBJECT(s_window->vscrollbar), "button_press_event",
(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",
(GtkSignalFunc)gtk_scrollbar_button_release_callback, (gpointer) this );
m_hAdjust->upper = frange;
m_hAdjust->value = fpos;
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;
}
else
m_vAdjust->upper = frange;
m_vAdjust->value = fpos;
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;
}