void aui_Tab::MouseLGrabInside( aui_MouseEvent *mouseData ) { if ( IsDisabled() ) return; if ( !GetWhichSeesMouse() || GetWhichSeesMouse() == this ) { SetWhichSeesMouse( this ); PlaySound( AUI_SOUNDBASE_SOUND_EXECUTE ); HideTipWindow(); SetMouseOwnership(); ReleaseMouseOwnership(); SetKeyboardFocus(); m_mouseCode = AUI_ERRCODE_HANDLEDEXCLUSIVE; if ( !HandleGameSpecificLeftClick( this ) ) if ( 0 < m_state && m_state < m_numStates - 1 ) SetState( Mod(m_state+1,m_numStates) ); else SetState( 1 ); m_attributes |= k_CONTROL_ATTRIBUTE_ACTIVE; m_draw |= m_drawMask & k_AUI_REGION_DRAWFLAG_MOUSELGRABINSIDE; } else MouseLGrabOutside( mouseData ); }
void aui_Button::MouseLGrabInside( aui_MouseEvent *mouseData ) { if (IsDisabled()) { if (g_soundManager) { g_soundManager->AddSound(SOUNDTYPE_SFX, 0, gamesounds_GetGameSoundID(GAMESOUNDS_GENERALFAIL), 0, 0); } return; } if ( !GetWhichSeesMouse() || GetWhichSeesMouse() == this ) { SetWhichSeesMouse( this ); PlaySound( AUI_SOUNDBASE_SOUND_ENGAGE ); HideTipWindow(); SetMouseOwnership(); SetKeyboardFocus(); m_mouseCode = AUI_ERRCODE_HANDLEDEXCLUSIVE; m_attributes |= k_CONTROL_ATTRIBUTE_DOWN; m_attributes |= k_CONTROL_ATTRIBUTE_ACTIVE; m_draw |= m_drawMask & k_AUI_REGION_DRAWFLAG_MOUSELGRABINSIDE; m_isRepeating = TRUE; m_repeatCount = 0; m_startWaitTime = mouseData->time; if ( m_ActionFunc ) m_ActionFunc( this, AUI_BUTTON_ACTION_PRESS, 0, m_cookie ); else if ( m_action ) m_action->Execute( this, AUI_BUTTON_ACTION_PRESS, 0 ); } else MouseLGrabOutside( mouseData ); }
void ctp2_HyperTextBox::MouseLGrabInside( aui_MouseEvent *mouseData ) { if (IsDisabled()) return; if ( !GetWhichSeesMouse() || GetWhichSeesMouse() == this ) { SetWhichSeesMouse( this ); PlaySound( AUI_SOUNDBASE_SOUND_ENGAGE ); HideTipWindow(); SetMouseOwnership(); SetKeyboardFocus(); m_mouseCode = AUI_ERRCODE_HANDLEDEXCLUSIVE; m_attributes |= k_CONTROL_ATTRIBUTE_DOWN; m_attributes |= k_CONTROL_ATTRIBUTE_ACTIVE; m_draw |= m_drawMask & k_AUI_REGION_DRAWFLAG_MOUSELGRABINSIDE; POINT pos; pos.x = mouseData->position.x - m_x; pos.y = mouseData->position.y - m_y; pos.y += m_ranger->GetValueY(); m_selectedHyperLink = NULL; ListPos lp = m_hyperLinkList->GetHeadPosition(); for ( uint32 i = 0;i < m_hyperLinkList->L();i++ ) { ctp2_HyperLink *hl = m_hyperLinkList->GetNext( lp ); RECT rect; rect.left = hl->m_static->X(); rect.top = hl->m_static->Y(); rect.right = rect.left + hl->m_static->Width(); rect.bottom = rect.top + hl->m_static->Height(); if ( PtInRect(&rect, pos) ) { hl->m_frame = TRUE; hl->m_static->SetTextColor( hl->m_selectColor ); m_selectedHyperLink = hl; } else { hl->m_frame = FALSE; hl->m_static->SetTextColor( hl->m_oldColor ); } } } else MouseLGrabOutside( mouseData ); }