Ejemplo n.º 1
0
void aui_Tab::MouseLDropInside( aui_MouseEvent *mouseData )
{
	if ( IsDisabled() ) return;
	if ( !GetWhichSeesMouse() || GetWhichSeesMouse() == this )
	{
		SetWhichSeesMouse( this );

		
		if ( GetMouseOwnership() != NULL )
		{
			PlaySound( AUI_SOUNDBASE_SOUND_ACTIVATE );

			
			if ( m_mouseCode == AUI_ERRCODE_UNHANDLED )
				m_mouseCode = AUI_ERRCODE_HANDLED;

			
			m_attributes |= k_CONTROL_ATTRIBUTE_ACTIVE;
			m_draw |= m_drawMask & k_AUI_REGION_DRAWFLAG_MOUSELDROPINSIDE;

			if ( m_ActionFunc )
				m_ActionFunc( this, AUI_SWITCH_ACTION_NULL, 0, m_cookie );
			else if ( m_action )
				m_action->Execute( this, AUI_SWITCH_ACTION_NULL, 0 );
		}
	}
	else
		MouseLDropOutside( mouseData );
}
Ejemplo n.º 2
0
void aui_Button::MouseLDropInside( aui_MouseEvent *mouseData )
{
	if (IsDisabled()) {
		g_soundManager->AddGameSound(GAMESOUNDS_DISABLED);
		return;
	}
	if ( !GetWhichSeesMouse() || GetWhichSeesMouse() == this )
	{
		SetWhichSeesMouse( this );

		if ( GetMouseOwnership() == this )
		{

			ReleaseMouseOwnership();

			PlaySound( AUI_SOUNDBASE_SOUND_EXECUTE );

			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_MOUSELDROPINSIDE;

			m_isRepeating = FALSE;

			if(GetAttracting()) {
				SetAttract(false, 0);
			}

			if ( !HandleGameSpecificLeftClick( this ) )
			if ( m_ActionFunc )
				m_ActionFunc( this, AUI_BUTTON_ACTION_EXECUTE, 0, m_cookie );
			else if ( m_action )
				m_action->Execute( this, AUI_BUTTON_ACTION_EXECUTE, 0 );
		}
		else
		{
			PlaySound( AUI_SOUNDBASE_SOUND_ACTIVATE );

			if ( m_mouseCode == AUI_ERRCODE_UNHANDLED )
				m_mouseCode = AUI_ERRCODE_HANDLED;

			m_attributes |= k_CONTROL_ATTRIBUTE_ACTIVE;
			m_draw |= m_drawMask & k_AUI_REGION_DRAWFLAG_MOUSELDROPINSIDE;
		}
	}
	else
		MouseLDropOutside( mouseData );
}
Ejemplo n.º 3
0
void ctp2_HyperTextBox::MouseLDropInside( aui_MouseEvent *mouseData )
{
	if (IsDisabled()) return;

	if ( !GetWhichSeesMouse() || GetWhichSeesMouse() == this )
	{
		SetWhichSeesMouse( this );

		
		if ( GetMouseOwnership() == this )
		{
			
			ReleaseMouseOwnership();

			PlaySound( AUI_SOUNDBASE_SOUND_EXECUTE );

			
			m_mouseCode = AUI_ERRCODE_HANDLEDEXCLUSIVE;

			


			
			
			
			m_attributes &= ~k_CONTROL_ATTRIBUTE_ACTIVE;

			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;
					m_selectedHyperLink = hl;
				}
				else {
					hl->m_frame = FALSE;
					hl->m_static->SetTextColor( hl->m_oldColor );
				}
			}

			if ( m_selectedHyperLink ) {

				
				m_draw |= m_drawMask & k_AUI_REGION_DRAWFLAG_MOUSELDROPINSIDE;

				

				if ( !HandleGameSpecificLeftClick( this ) )
				if ( m_ActionFunc )
					m_ActionFunc( this, CTP2_HYPERLINK_ACTION_EXECUTE, 0, m_cookie );
				else if ( m_action )
					m_action->Execute( this, CTP2_HYPERLINK_ACTION_EXECUTE, 0 );
				else {
					
					open_GreatLibrary();
					if(g_greatLibrary) {
						g_greatLibrary->SetLibrary(m_selectedHyperLink->m_index, (DATABASE)m_selectedHyperLink->m_db);
					}
				}
			}
			else {
				m_draw |= m_drawMask & k_AUI_REGION_DRAWFLAG_UPDATE;
			}
		}
		else
		{
			PlaySound( AUI_SOUNDBASE_SOUND_ACTIVATE );

			
			if ( m_mouseCode == AUI_ERRCODE_UNHANDLED )
				m_mouseCode = AUI_ERRCODE_HANDLED;

			
			m_attributes |= k_CONTROL_ATTRIBUTE_ACTIVE;
			m_draw |= m_drawMask & k_AUI_REGION_DRAWFLAG_MOUSELDROPINSIDE;
		}
	}
	else
		MouseLDropOutside( mouseData );
}