Use dedicated function to check if the mouse button is pressed
This commit is contained in:
@@ -142,7 +142,6 @@ class wxPGSpinButton : public wxSpinButton
|
|||||||
public:
|
public:
|
||||||
wxPGSpinButton() : wxSpinButton()
|
wxPGSpinButton() : wxSpinButton()
|
||||||
{
|
{
|
||||||
m_bLeftDown = false;
|
|
||||||
m_hasCapture = false;
|
m_hasCapture = false;
|
||||||
m_spins = 1;
|
m_spins = 1;
|
||||||
|
|
||||||
@@ -167,8 +166,6 @@ private:
|
|||||||
// isn't anything there that can be reliably reused.
|
// isn't anything there that can be reliably reused.
|
||||||
int m_spins;
|
int m_spins;
|
||||||
|
|
||||||
bool m_bLeftDown;
|
|
||||||
|
|
||||||
// SpinButton seems to be a special for mouse capture, so we may need track
|
// SpinButton seems to be a special for mouse capture, so we may need track
|
||||||
// privately whether mouse is actually captured.
|
// privately whether mouse is actually captured.
|
||||||
bool m_hasCapture;
|
bool m_hasCapture;
|
||||||
@@ -185,8 +182,6 @@ private:
|
|||||||
}
|
}
|
||||||
void Release()
|
void Release()
|
||||||
{
|
{
|
||||||
m_bLeftDown = false;
|
|
||||||
|
|
||||||
if ( m_hasCapture )
|
if ( m_hasCapture )
|
||||||
{
|
{
|
||||||
ReleaseMouse();
|
ReleaseMouse();
|
||||||
@@ -202,7 +197,6 @@ private:
|
|||||||
|
|
||||||
void OnMouseLeftDown(wxMouseEvent& evt)
|
void OnMouseLeftDown(wxMouseEvent& evt)
|
||||||
{
|
{
|
||||||
m_bLeftDown = true;
|
|
||||||
m_ptPosition = evt.GetPosition();
|
m_ptPosition = evt.GetPosition();
|
||||||
evt.Skip();
|
evt.Skip();
|
||||||
}
|
}
|
||||||
@@ -210,13 +204,12 @@ private:
|
|||||||
void OnMouseLeftUp(wxMouseEvent& evt)
|
void OnMouseLeftUp(wxMouseEvent& evt)
|
||||||
{
|
{
|
||||||
Release();
|
Release();
|
||||||
m_bLeftDown = false;
|
|
||||||
evt.Skip();
|
evt.Skip();
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnMouseMove(wxMouseEvent& evt)
|
void OnMouseMove(wxMouseEvent& evt)
|
||||||
{
|
{
|
||||||
if ( m_bLeftDown )
|
if ( evt.LeftIsDown() )
|
||||||
{
|
{
|
||||||
int dy = m_ptPosition.y - evt.GetPosition().y;
|
int dy = m_ptPosition.y - evt.GetPosition().y;
|
||||||
if ( dy )
|
if ( dy )
|
||||||
|
Reference in New Issue
Block a user