diff options
Diffstat (limited to 'src/ui/scroll.cpp')
-rw-r--r-- | src/ui/scroll.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/ui/scroll.cpp b/src/ui/scroll.cpp index d3d0ed2..17f210e 100644 --- a/src/ui/scroll.cpp +++ b/src/ui/scroll.cpp @@ -234,21 +234,21 @@ bool CScroll::EventProcess(const Event &event) hButton = m_buttonUp?m_dim.x/0.75f:0.0f; if ( event.type == EVENT_MOUSE_BUTTON_DOWN && - event.mouseButton.button == 1 && + event.mouseButton.button == MOUSE_BUTTON_LEFT && (m_state & STATE_VISIBLE) && (m_state & STATE_ENABLE) ) { - if ( CControl::Detect(event.mouseButton.pos) ) + if ( CControl::Detect(event.mousePos) ) { pos.y = m_pos.y+hButton; dim.y = m_dim.y-hButton*2.0f; pos.y += dim.y*(1.0f-m_visibleRatio)*(1.0f-m_visibleValue); dim.y *= m_visibleRatio; - if ( event.mouseButton.pos.y < pos.y || - event.mouseButton.pos.y > pos.y+dim.y ) // click outside cabin? + if ( event.mousePos.y < pos.y || + event.mousePos.y > pos.y+dim.y ) // click outside cabin? { h = (m_dim.y-hButton*2.0f)*(1.0f-m_visibleRatio); - value = 1.0f-(event.mouseButton.pos.y-(m_pos.y+hButton+dim.y*0.5f))/h; + value = 1.0f-(event.mousePos.y-(m_pos.y+hButton+dim.y*0.5f))/h; if ( value < 0.0f ) value = 0.0f; if ( value > 1.0f ) value = 1.0f; m_visibleValue = value; @@ -259,7 +259,7 @@ bool CScroll::EventProcess(const Event &event) m_event->AddEvent(newEvent); } m_bCapture = true; - m_pressPos = event.mouseButton.pos; + m_pressPos = event.mousePos; m_pressValue = m_visibleValue; } } @@ -269,7 +269,7 @@ bool CScroll::EventProcess(const Event &event) h = (m_dim.y-hButton*2.0f)*(1.0f-m_visibleRatio); if ( h != 0 ) { - value = m_pressValue - (event.mouseMove.pos.y-m_pressPos.y)/h; + value = m_pressValue - (event.mousePos.y-m_pressPos.y)/h; if ( value < 0.0f ) value = 0.0f; if ( value > 1.0f ) value = 1.0f; @@ -286,7 +286,7 @@ bool CScroll::EventProcess(const Event &event) } if ( event.type == EVENT_MOUSE_BUTTON_UP && - event.mouseButton.button == 1 && + event.mouseButton.button == MOUSE_BUTTON_LEFT && m_bCapture ) { m_bCapture = false; @@ -294,7 +294,7 @@ bool CScroll::EventProcess(const Event &event) if (event.type == EVENT_MOUSE_WHEEL && event.mouseWheel.dir == WHEEL_UP && - Detect(event.mouseWheel.pos) && + Detect(event.mousePos) && m_buttonUp != 0) { Event newEvent = event; @@ -303,7 +303,7 @@ bool CScroll::EventProcess(const Event &event) } if (event.type == EVENT_MOUSE_WHEEL && event.mouseWheel.dir == WHEEL_DOWN && - Detect(event.mouseWheel.pos) && + Detect(event.mousePos) && m_buttonDown != 0) { Event newEvent = event; |