remove m_blockScrollEvent from wxWindowGTK
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48669 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -7,8 +7,8 @@
|
|||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifndef __GTKSLIDERH__
|
#ifndef _WX_GTK_SLIDER_H_
|
||||||
#define __GTKSLIDERH__
|
#define _WX_GTK_SLIDER_H_
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// wxSlider
|
// wxSlider
|
||||||
@@ -63,12 +63,12 @@ public:
|
|||||||
double m_pos;
|
double m_pos;
|
||||||
int m_scrollEventType;
|
int m_scrollEventType;
|
||||||
bool m_needThumbRelease;
|
bool m_needThumbRelease;
|
||||||
|
bool m_blockScrollEvent;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const;
|
virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const;
|
||||||
|
|
||||||
private:
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxSlider)
|
DECLARE_DYNAMIC_CLASS(wxSlider)
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __GTKSLIDERH__
|
#endif // _WX_GTK_SLIDER_H_
|
||||||
|
@@ -239,9 +239,6 @@ public:
|
|||||||
// Common scroll event handling code for wxWindow and wxScrollBar
|
// Common scroll event handling code for wxWindow and wxScrollBar
|
||||||
wxEventType GetScrollEventType(GtkRange* range);
|
wxEventType GetScrollEventType(GtkRange* range);
|
||||||
|
|
||||||
void BlockScrollEvent();
|
|
||||||
void UnblockScrollEvent();
|
|
||||||
|
|
||||||
// position and size of the window
|
// position and size of the window
|
||||||
int m_x, m_y;
|
int m_x, m_y;
|
||||||
int m_width, m_height;
|
int m_width, m_height;
|
||||||
@@ -301,7 +298,6 @@ public:
|
|||||||
bool m_needsStyleChange:1; // May not be able to change
|
bool m_needsStyleChange:1; // May not be able to change
|
||||||
// background style until OnIdle
|
// background style until OnIdle
|
||||||
bool m_mouseButtonDown:1;
|
bool m_mouseButtonDown:1;
|
||||||
bool m_blockScrollEvent:1;
|
|
||||||
|
|
||||||
bool m_showOnIdle:1; // postpone showing the window until idle
|
bool m_showOnIdle:1; // postpone showing the window until idle
|
||||||
|
|
||||||
|
@@ -231,9 +231,9 @@ gtk_event_after(GtkRange* range, GdkEvent* event, wxSlider* win)
|
|||||||
ProcessScrollEvent(win, wxEVT_SCROLL_THUMBRELEASE);
|
ProcessScrollEvent(win, wxEVT_SCROLL_THUMBRELEASE);
|
||||||
}
|
}
|
||||||
// Keep slider at an integral position
|
// Keep slider at an integral position
|
||||||
win->BlockScrollEvent();
|
win->m_blockScrollEvent = true;
|
||||||
gtk_range_set_value(GTK_RANGE (win->m_widget), win->GetValue());
|
gtk_range_set_value(GTK_RANGE (win->m_widget), win->GetValue());
|
||||||
win->UnblockScrollEvent();
|
win->m_blockScrollEvent = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -279,6 +279,7 @@ wxSlider::wxSlider()
|
|||||||
m_pos = 0;
|
m_pos = 0;
|
||||||
m_scrollEventType = 0;
|
m_scrollEventType = 0;
|
||||||
m_needThumbRelease = false;
|
m_needThumbRelease = false;
|
||||||
|
m_blockScrollEvent = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxSlider::Create(wxWindow *parent,
|
bool wxSlider::Create(wxWindow *parent,
|
||||||
@@ -299,10 +300,6 @@ bool wxSlider::Create(wxWindow *parent,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_pos = 0;
|
|
||||||
m_scrollEventType = 0;
|
|
||||||
m_needThumbRelease = false;
|
|
||||||
|
|
||||||
if (style & wxSL_VERTICAL)
|
if (style & wxSL_VERTICAL)
|
||||||
m_widget = gtk_vscale_new( (GtkAdjustment *) NULL );
|
m_widget = gtk_vscale_new( (GtkAdjustment *) NULL );
|
||||||
else
|
else
|
||||||
@@ -344,18 +341,18 @@ void wxSlider::SetValue( int value )
|
|||||||
{
|
{
|
||||||
if (GetValue() != value)
|
if (GetValue() != value)
|
||||||
{
|
{
|
||||||
BlockScrollEvent();
|
m_blockScrollEvent = true;
|
||||||
gtk_range_set_value(GTK_RANGE (m_widget), value);
|
gtk_range_set_value(GTK_RANGE (m_widget), value);
|
||||||
UnblockScrollEvent();
|
m_blockScrollEvent = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxSlider::SetRange( int minValue, int maxValue )
|
void wxSlider::SetRange( int minValue, int maxValue )
|
||||||
{
|
{
|
||||||
BlockScrollEvent();
|
m_blockScrollEvent = true;
|
||||||
gtk_range_set_range(GTK_RANGE (m_widget), minValue, maxValue);
|
gtk_range_set_range(GTK_RANGE (m_widget), minValue, maxValue);
|
||||||
gtk_range_set_increments(GTK_RANGE (m_widget), 1, (maxValue - minValue + 9) / 10);
|
gtk_range_set_increments(GTK_RANGE (m_widget), 1, (maxValue - minValue + 9) / 10);
|
||||||
UnblockScrollEvent();
|
m_blockScrollEvent = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxSlider::GetMin() const
|
int wxSlider::GetMin() const
|
||||||
@@ -370,9 +367,9 @@ int wxSlider::GetMax() const
|
|||||||
|
|
||||||
void wxSlider::SetPageSize( int pageSize )
|
void wxSlider::SetPageSize( int pageSize )
|
||||||
{
|
{
|
||||||
BlockScrollEvent();
|
m_blockScrollEvent = true;
|
||||||
gtk_range_set_increments(GTK_RANGE (m_widget), GetLineSize(), pageSize);
|
gtk_range_set_increments(GTK_RANGE (m_widget), GetLineSize(), pageSize);
|
||||||
UnblockScrollEvent();
|
m_blockScrollEvent = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxSlider::GetPageSize() const
|
int wxSlider::GetPageSize() const
|
||||||
@@ -392,9 +389,9 @@ int wxSlider::GetThumbLength() const
|
|||||||
|
|
||||||
void wxSlider::SetLineSize( int lineSize )
|
void wxSlider::SetLineSize( int lineSize )
|
||||||
{
|
{
|
||||||
BlockScrollEvent();
|
m_blockScrollEvent = true;
|
||||||
gtk_range_set_increments(GTK_RANGE (m_widget), lineSize, GetPageSize());
|
gtk_range_set_increments(GTK_RANGE (m_widget), lineSize, GetPageSize());
|
||||||
UnblockScrollEvent();
|
m_blockScrollEvent = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxSlider::GetLineSize() const
|
int wxSlider::GetLineSize() const
|
||||||
|
@@ -2237,7 +2237,6 @@ void wxWindowGTK::Init()
|
|||||||
m_hasScrolling = false;
|
m_hasScrolling = false;
|
||||||
m_isScrolling = false;
|
m_isScrolling = false;
|
||||||
m_mouseButtonDown = false;
|
m_mouseButtonDown = false;
|
||||||
m_blockScrollEvent = false;
|
|
||||||
|
|
||||||
// initialize scrolling stuff
|
// initialize scrolling stuff
|
||||||
for ( int dir = 0; dir < ScrollDir_Max; dir++ )
|
for ( int dir = 0; dir < ScrollDir_Max; dir++ )
|
||||||
@@ -4126,18 +4125,6 @@ bool wxWindowGTK::IsRetained() const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowGTK::BlockScrollEvent()
|
|
||||||
{
|
|
||||||
wxASSERT(!m_blockScrollEvent);
|
|
||||||
m_blockScrollEvent = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void wxWindowGTK::UnblockScrollEvent()
|
|
||||||
{
|
|
||||||
wxASSERT(m_blockScrollEvent);
|
|
||||||
m_blockScrollEvent = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void wxWindowGTK::SetScrollbar(int orient,
|
void wxWindowGTK::SetScrollbar(int orient,
|
||||||
int pos,
|
int pos,
|
||||||
int thumbVisible,
|
int thumbVisible,
|
||||||
|
Reference in New Issue
Block a user