#if wxUSE_SLIDER
#include "wx/utils.h"
+
#include <math.h>
-#include "gdk/gdk.h"
-#include "gtk/gtk.h"
+#include <gdk/gdk.h>
+#include <gtk/gtk.h>
//-----------------------------------------------------------------------------
// idle system
extern bool g_blockEventsOnDrag;
+static const float sensitivity = 0.02;
+
//-----------------------------------------------------------------------------
// "value_changed"
//-----------------------------------------------------------------------------
if (g_blockEventsOnDrag) return;
float diff = adjust->value - win->m_oldPos;
- if (fabs(diff) < 0.2) return;
+ if (fabs(diff) < sensitivity) return;
win->m_oldPos = adjust->value;
IMPLEMENT_DYNAMIC_CLASS(wxSlider,wxControl)
-wxSlider::wxSlider(void)
-{
-}
-
-wxSlider::~wxSlider(void)
-{
-}
-
bool wxSlider::Create(wxWindow *parent, wxWindowID id,
int value, int minValue, int maxValue,
const wxPoint& pos, const wxSize& size,
return TRUE;
}
-int wxSlider::GetValue(void) const
+int wxSlider::GetValue() const
{
return (int)(m_adjust->value+0.5);
}
gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "changed" );
}
-int wxSlider::GetMin(void) const
+int wxSlider::GetMin() const
{
return (int)ceil(m_adjust->lower);
}
-int wxSlider::GetMax(void) const
+int wxSlider::GetMax() const
{
return (int)ceil(m_adjust->upper);
}
gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "changed" );
}
-int wxSlider::GetPageSize(void) const
+int wxSlider::GetPageSize() const
{
return (int)ceil(m_adjust->page_increment);
}
gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "changed" );
}
-int wxSlider::GetThumbLength(void) const
+int wxSlider::GetThumbLength() const
{
return (int)ceil(m_adjust->page_size);
}
{
}
-int wxSlider::GetLineSize(void) const
+int wxSlider::GetLineSize() const
{
return 0;
}
{
}
-int wxSlider::GetTickFreq(void) const
+int wxSlider::GetTickFreq() const
{
return 0;
}
-void wxSlider::ClearTicks(void)
+void wxSlider::ClearTicks()
{
}
{
}
-int wxSlider::GetSelEnd(void) const
+int wxSlider::GetSelEnd() const
{
return 0;
}
-int wxSlider::GetSelStart(void) const
+int wxSlider::GetSelStart() const
{
return 0;
}
-void wxSlider::ClearSel(void)
+void wxSlider::ClearSel()
{
}