Damn broken pipes.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4720 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
aed8ac3f89
commit
57a1fd7304
@ -16,10 +16,11 @@
|
|||||||
#if wxUSE_SLIDER
|
#if wxUSE_SLIDER
|
||||||
|
|
||||||
#include "wx/utils.h"
|
#include "wx/utils.h"
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#include "gdk/gdk.h"
|
#include <gdk/gdk.h>
|
||||||
#include "gtk/gtk.h"
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// idle system
|
// idle system
|
||||||
@ -34,6 +35,8 @@ extern bool g_isIdle;
|
|||||||
|
|
||||||
extern bool g_blockEventsOnDrag;
|
extern bool g_blockEventsOnDrag;
|
||||||
|
|
||||||
|
static const float sensitivity = 0.02;
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// "value_changed"
|
// "value_changed"
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -46,7 +49,7 @@ static void gtk_slider_callback( GtkAdjustment *adjust, wxSlider *win )
|
|||||||
if (g_blockEventsOnDrag) return;
|
if (g_blockEventsOnDrag) return;
|
||||||
|
|
||||||
float diff = adjust->value - win->m_oldPos;
|
float diff = adjust->value - win->m_oldPos;
|
||||||
if (fabs(diff) < 0.2) return;
|
if (fabs(diff) < sensitivity) return;
|
||||||
|
|
||||||
win->m_oldPos = adjust->value;
|
win->m_oldPos = adjust->value;
|
||||||
|
|
||||||
@ -79,14 +82,6 @@ static void gtk_slider_callback( GtkAdjustment *adjust, wxSlider *win )
|
|||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxSlider,wxControl)
|
IMPLEMENT_DYNAMIC_CLASS(wxSlider,wxControl)
|
||||||
|
|
||||||
wxSlider::wxSlider(void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
wxSlider::~wxSlider(void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
bool wxSlider::Create(wxWindow *parent, wxWindowID id,
|
bool wxSlider::Create(wxWindow *parent, wxWindowID id,
|
||||||
int value, int minValue, int maxValue,
|
int value, int minValue, int maxValue,
|
||||||
const wxPoint& pos, const wxSize& size,
|
const wxPoint& pos, const wxSize& size,
|
||||||
|
@ -16,10 +16,11 @@
|
|||||||
#if wxUSE_SLIDER
|
#if wxUSE_SLIDER
|
||||||
|
|
||||||
#include "wx/utils.h"
|
#include "wx/utils.h"
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#include "gdk/gdk.h"
|
#include <gdk/gdk.h>
|
||||||
#include "gtk/gtk.h"
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// idle system
|
// idle system
|
||||||
@ -34,6 +35,8 @@ extern bool g_isIdle;
|
|||||||
|
|
||||||
extern bool g_blockEventsOnDrag;
|
extern bool g_blockEventsOnDrag;
|
||||||
|
|
||||||
|
static const float sensitivity = 0.02;
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// "value_changed"
|
// "value_changed"
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -46,7 +49,7 @@ static void gtk_slider_callback( GtkAdjustment *adjust, wxSlider *win )
|
|||||||
if (g_blockEventsOnDrag) return;
|
if (g_blockEventsOnDrag) return;
|
||||||
|
|
||||||
float diff = adjust->value - win->m_oldPos;
|
float diff = adjust->value - win->m_oldPos;
|
||||||
if (fabs(diff) < 0.2) return;
|
if (fabs(diff) < sensitivity) return;
|
||||||
|
|
||||||
win->m_oldPos = adjust->value;
|
win->m_oldPos = adjust->value;
|
||||||
|
|
||||||
@ -79,14 +82,6 @@ static void gtk_slider_callback( GtkAdjustment *adjust, wxSlider *win )
|
|||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxSlider,wxControl)
|
IMPLEMENT_DYNAMIC_CLASS(wxSlider,wxControl)
|
||||||
|
|
||||||
wxSlider::wxSlider(void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
wxSlider::~wxSlider(void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
bool wxSlider::Create(wxWindow *parent, wxWindowID id,
|
bool wxSlider::Create(wxWindow *parent, wxWindowID id,
|
||||||
int value, int minValue, int maxValue,
|
int value, int minValue, int maxValue,
|
||||||
const wxPoint& pos, const wxSize& size,
|
const wxPoint& pos, const wxSize& size,
|
||||||
|
Loading…
Reference in New Issue
Block a user