Esempio n. 1
0
void aui_Control::MouseRDragAway( aui_MouseEvent *mouseData )
{
	if(IsDisabled())
		return;

	if(GetMouseOwnership() == this)
		Highlight(false);

	if(!GetMouseOwnership())
		MouseMoveAway(mouseData);
}
Esempio n. 2
0
void aui_Button::MouseLDragOver( aui_MouseEvent *mouseData )
{

	aui_Control::MouseLDragOver(mouseData);

	if (IsDisabled()) return;

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

		if ( GetMouseOwnership() == this )
		{
			PlaySound( AUI_SOUNDBASE_SOUND_ENGAGE );

			if ( m_mouseCode == AUI_ERRCODE_UNHANDLED )
				m_mouseCode = AUI_ERRCODE_HANDLED;

			m_attributes |= k_CONTROL_ATTRIBUTE_DOWN;
			m_attributes |= k_CONTROL_ATTRIBUTE_ACTIVE;
			m_draw |= m_drawMask & k_AUI_REGION_DRAWFLAG_MOUSELDRAGOVER;

			m_isRepeating = TRUE;
		}
	}
	else
		MouseLDragOutside( mouseData );
}
Esempio n. 3
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 );
}
Esempio n. 4
0
void aui_Button::MouseLDragAway( aui_MouseEvent *mouseData )
{

	aui_Control::MouseLDragAway(mouseData);

	if (IsDisabled()) return;

	if ( GetMouseOwnership() == this )
	{
		PlaySound( AUI_SOUNDBASE_SOUND_DISENGAGE );

		if ( m_mouseCode == AUI_ERRCODE_UNHANDLED )
			m_mouseCode = AUI_ERRCODE_HANDLED;

		m_attributes &= ~k_CONTROL_ATTRIBUTE_DOWN;
		m_attributes &= ~k_CONTROL_ATTRIBUTE_ACTIVE;
		m_draw |= m_drawMask & k_AUI_REGION_DRAWFLAG_MOUSELDRAGAWAY;

		m_isRepeating = FALSE;
		if ( m_ActionFunc )
			m_ActionFunc( this, AUI_BUTTON_ACTION_RELEASE, 0, m_cookie );
		else if ( m_action )
			m_action->Execute( this, AUI_BUTTON_ACTION_RELEASE, 0 );
	}
}
Esempio n. 5
0
AUI_ERRCODE aui_Control::ReleaseMouseOwnership( void )
{
	if (GetMouseOwnership() != this)
	    return AUI_ERRCODE_NOCONTROL;

	s_whichOwnsMouse = NULL;
    return AUI_ERRCODE_OK;
}
Esempio n. 6
0
AUI_ERRCODE aui_Control::ResetThis( void )
{
	if ( GetMouseOwnership() == this ) ReleaseMouseOwnership();
	if ( GetKeyboardFocus() == this ) ReleaseKeyboardFocus();

	ResetCurrentRenderFlags();

	return aui_Region::ResetThis();
}
Esempio n. 7
0
void ctp2_Button::MouseLDragAway(aui_MouseEvent *mouseData)
{

	if(GetMouseOwnership() == this) {

		RenderDown(false);
	}

	aui_Button::MouseLDragAway(mouseData);
}
Esempio n. 8
0
void ctp2_Button::MouseLDragOver(aui_MouseEvent *mouseData)
{

	if(GetMouseOwnership() == this) {

		RenderDown();
	}

	aui_Button::MouseLDragOver(mouseData);
}
Esempio n. 9
0
aui_Control *aui_Control::SetMouseOwnership( void )
{
	aui_Control *prevOwner = GetMouseOwnership();
	if ( prevOwner ) prevOwner->ReleaseMouseOwnership();
	s_whichOwnsMouse = this;

#if FALSE

#ifdef _DEBUG

#define STATUS_BAR_MOUSE_OVER_LDL_DEBUG_INFORMATION
#ifdef STATUS_BAR_MOUSE_OVER_LDL_DEBUG_INFORMATION
		StatusBar::SetText(aui_Ldl::GetBlock(GetMouseOwnership()));
#endif
#endif
#endif

	return prevOwner;
}
Esempio n. 10
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 );
}
Esempio n. 11
0
void aui_Button::KeyboardCallback( aui_KeyboardEvent *keyboardData )
{







	if ( !GetMouseOwnership() && ( keyboardData->key == AUI_KEYBOARD_KEY_RETURN)) {

		if ( keyboardData->down && !m_keyboardEvent.down )
		{
			PlaySound( AUI_SOUNDBASE_SOUND_ENGAGE );

			HideTipWindow();

			m_attributes |= k_CONTROL_ATTRIBUTE_DOWN;
			m_attributes |= k_CONTROL_ATTRIBUTE_ACTIVE;
			m_draw |= m_drawMask & k_AUI_REGION_DRAWFLAG_KEYSTATECHANGE;

			m_isRepeating = TRUE;
			m_repeatCount = 0;
			m_startWaitTime = keyboardData->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 if ( !keyboardData->down && m_keyboardEvent.down )
		{
			PlaySound( AUI_SOUNDBASE_SOUND_EXECUTE );

			m_attributes &= ~k_CONTROL_ATTRIBUTE_DOWN;
			m_attributes &= ~k_CONTROL_ATTRIBUTE_ACTIVE;

			m_draw |= m_drawMask & k_AUI_REGION_DRAWFLAG_KEYSTATECHANGE;

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

			m_isRepeating = FALSE;
			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 );
		}
	}
}
Esempio n. 12
0
void aui_Button::MouseLDropOutside( aui_MouseEvent *mouseData )
{
	if (IsDisabled()) return;

	if ( GetMouseOwnership() == this )
	{

		ReleaseMouseOwnership();

		if ( m_mouseCode == AUI_ERRCODE_UNHANDLED )
			m_mouseCode = AUI_ERRCODE_HANDLED;

		m_draw |= m_drawMask & k_AUI_REGION_DRAWFLAG_MOUSELDROPOUTSIDE;
	}
}
Esempio n. 13
0
void aui_Tab::MouseLDragAway( aui_MouseEvent *mouseData )
{
	if ( IsDisabled() ) return;
	
	if ( GetMouseOwnership() == NULL )
	{
		PlaySound( AUI_SOUNDBASE_SOUND_DEACTIVATE );

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

		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 );
	}
}
Esempio n. 14
0
void ctp2_MenuButton::MouseLDragAway( aui_MouseEvent *mouseData )
{
	if (IsDisabled()) return;

	if ( GetMouseOwnership() == this)
	{
		PlaySound( AUI_SOUNDBASE_SOUND_DISENGAGE );

		if ( m_mouseCode == AUI_ERRCODE_UNHANDLED )
			m_mouseCode = AUI_ERRCODE_HANDLED;

		m_attributes &= ~k_CONTROL_ATTRIBUTE_DOWN;
		m_attributes &= ~k_CONTROL_ATTRIBUTE_ACTIVE;
		m_draw |= m_drawMask & k_AUI_REGION_DRAWFLAG_MOUSELDRAGAWAY;

		m_isRepeating = FALSE;
		if ( m_ActionFunc )
			m_ActionFunc( this, AUI_BUTTON_ACTION_RELEASE, 0, m_cookie );
		else if ( m_action )
			m_action->Execute( this, AUI_BUTTON_ACTION_RELEASE, 0 );

		if(mouseData->position.y >= Y() + Height()) {
			SetWhichSeesMouse(NULL);
			mouseData->position.y -= Height();
			m_menu->ActivateMenu(mouseData);
		} else if(mouseData->position.x >= X() + Width()) {
			if(m_rightNeighbor) {
				m_rightNeighbor->MouseLGrabInside(mouseData);
			}
			m_menu->Close();
		} else if(mouseData->position.x < X()) {
			if(m_leftNeighbor) {
				m_leftNeighbor->MouseLGrabInside(mouseData);
			}
			m_menu->Close();
		}
	}
}
Esempio n. 15
0
void ctp2_Button::SetToggleState(bool state)
{
	m_toggleState = state;
	RenderDown(GetMouseOwnership() == this);
}
Esempio n. 16
0
void aui_Control::MouseLDragAway( aui_MouseEvent *mouseData )
{
	if(GetMouseOwnership() == this)
		Highlight(false);
}
Esempio n. 17
0
void aui_Control::MouseLDragOver( aui_MouseEvent *mouseData )
{
	if(GetMouseOwnership() == this)
		Highlight();
}
Esempio n. 18
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 );
}