예제 #1
0
DWORD cEditBox::ActionEvent(CMouse * mouseInfo)
{
	DWORD we = WE_NULL;
	if( !m_bActive ) return we;
	we = cWindow::ActionEvent(mouseInfo);

	if( m_bDisable ) return we;

	if( mouseInfo->LButtonDown() )
	{
		if( PtInWindow(mouseInfo->GetMouseEventX(), mouseInfo->GetMouseEventY()) && ( we & WE_LBTNCLICK ) )
		{
			SetFocusEdit(TRUE);
			if(cbWindowFunc)
				(*cbWindowFunc)(m_ID, m_pParent, WE_SETFOCUSON);

			we |= WE_SETFOCUSON;
		}
		else
		{
			SetFocusEdit(FALSE);
		}
	}

	if(m_bTextChanged)
	{
		if(cbWindowFunc)
			(*cbWindowFunc)(m_ID, m_pParent, WE_CHANGETEXT);//pjslocal 이게 월까?
		we |= WE_CHANGETEXT;

	}

	return we;
}
예제 #2
0
//--------------------------------------------------------------------------
//	功能:得到处于指定坐标位置的最上层窗口,传入的坐标为绝对坐标
//--------------------------------------------------------------------------
KWndWindow* KWndWindow::TopChildFromPoint(int x, int y)
{
	KWndWindow* pLastMatch = NULL;
	if (PtInWindow(x, y))
	{
		pLastMatch = this;
		KWndWindow*	pWnd = m_pFirstChild;
		while(pWnd)
		{
			//一系列同级的兄弟窗口,要从最上面(链表最末端的)开始判断
			while(pWnd->m_pNextWnd)
				pWnd = pWnd->m_pNextWnd;
			while(pWnd)
			{
				if (pWnd->PtInWindow(x, y) && !pWnd->IsDisable())
				{
					pLastMatch = pWnd;
					pWnd = pLastMatch->m_pFirstChild;
					break;
				}
				pWnd = pWnd->m_pPreviousWnd;
			}
		}
	}	
	return pLastMatch;
}
예제 #3
0
DWORD cPushupButton::ActionEvent(CMouse * mouseInfo)
{
	if( !m_bActive ) return WE_NULL;

	DWORD we = cWindow::ActionEvent(mouseInfo);

	if( m_bDisable ) return we;

	long x2 = mouseInfo->GetMouseEventX();
	long y2 = mouseInfo->GetMouseEventY();	

	if(m_fPassive)
	{
		if( we & ( WE_LBTNCLICK | WE_LBTNDBLCLICK ) )
		{
			if(PtInWindow(x2, y2))
			{
				(m_fPushed?we |= WE_PUSHUP:we |= WE_PUSHDOWN);
				cbWindowFunc(m_ID, m_pParent, (m_fPushed?WE_PUSHUP:WE_PUSHDOWN));
			}
		}		
	}
	else
	{
		if( we & ( WE_LBTNCLICK | WE_LBTNDBLCLICK ) )
		{
			if(PtInWindow(x2, y2))
			{
				m_fPushed ^= TRUE;
				SetPush(m_fPushed);
				if(cbWindowFunc)
				{
					(m_fPushed?we |= WE_PUSHDOWN:we |= WE_PUSHUP);
					(*cbWindowFunc)(m_ID, m_pParent, (m_fPushed?WE_PUSHDOWN:WE_PUSHUP));
				}
			}
		}
	}

	return we;
}
예제 #4
0
void cSkillBase::Render()
{
	cIcon::Render();
	if(!m_pHighLayerImage.IsNull())
		m_pHighLayerImage.RenderSprite( NULL, NULL, 0, &m_absPos, RGBA_MERGE(m_dwImageRGB, m_alpha * m_dwOptionAlpha / 100));

	if(mSkillInfo->GetCoolTime() > gCurTime)
	{
		const float ratio = float(mSkillInfo->GetCoolTime() - gCurTime) / mSkillInfo->GetSkillInfo()->CoolTime;
		VECTOR2 scale = {
			1.0f,
			m_height * ratio};
		VECTOR2 position = {
			m_absPos.x,
			m_absPos.y + m_height * (1 - ratio)};

		m_DelayImage.RenderSprite(
			&scale,
			0,
			0,
			&position,
			0xff000000);
	}

	if(m_SkillBaseInfo.Level > 0)
	{
		RECT rect = {
			LONG(m_absPos.x + 1),
				LONG(m_absPos.y + 22),
				1,
				1};
			TCHAR nums[MAX_PATH] = {0};
			_stprintf(
				nums,
				_T("%d"),
				mSkillInfo->GetLevel());
			CFONT_OBJ->RenderFontShadow(
				0,
				1,
				nums,
				_tcslen(nums),
				&rect,
				RGBA_MERGE(m_dwImageRGB, m_alpha * m_dwOptionAlpha / 100 ));
	}

	if(WINDOWMGR->IsMouseOverUsed() &&
		PtInWindow(g_UserInput.GetMouse()->GetMouseX(), g_UserInput.GetMouse()->GetMouseY()))
	{
		SKILLTREEMGR->SetToolTipIcon(
			this,
			GetSkillIdx());
	}
}