Ejemplo n.º 1
0
BOOL CXTPPopupControl::Show(CWnd* pParent)
{
	//create popup wnd
	if (!Create(pParent))
		return FALSE;

	//check popup state - return if popup state is wrong
	if (m_popupState != xtpPopupStateClosed)
		return FALSE;


	//set expanding
	OnExpanding(TRUE);

	return TRUE;
}
Ejemplo n.º 2
0
BOOL CPropertiesCtrl::OnChildNotify(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pLResult) 
{
	SECTreeCtrl::OnChildNotify(message, wParam, lParam, pLResult);

	if( message == WM_NOTIFY )
	{
		NMHDR * pNMHDR = (NMHDR*)lParam;

		if( pNMHDR && pNMHDR->code == TVN_ITEMEXPANDING )
		{
			NMTREEVIEW * pExpandInfo = (LPNMTREEVIEW)pNMHDR;

			OnExpanding( pExpandInfo->itemNew.hItem, pExpandInfo->action );
			return TRUE;
		}
	}

	return FALSE;
}
Ejemplo n.º 3
0
void CXTPPopupControl::OnMouseMove(UINT nFlags, CPoint point)
{
	if (!m_bSplashScreenMode)
	{
		CXTPClientRect rc(this);

		//test client rect if no-pressed
		BOOL bInRect = rc.PtInRect(point) || m_pPressed != NULL;

		//if test successfull and already not capture
		if (bInRect && !m_bCapture)
		{
			//set capture
			m_bCapture = TRUE;

			//opaque window
			SetLayeredWindowAttributes(255);

			//capture mouse leave event
			TRACKMOUSEEVENT tme =
			{
				sizeof(TRACKMOUSEEVENT), TME_LEAVE, m_hWnd, 0
			};
			_TrackMouseEvent(&tme);
		}
		//else if test fail and there is pressed and selected control
		if (!bInRect && m_bCapture && m_pPressed == NULL)
		{
			//free capture
			m_bCapture = FALSE;
			//set current transparent
			SetLayeredWindowAttributes(m_nTransparency);
		}

		//if collapsing state - expand popup window
		if (m_popupState == xtpPopupStateCollapsing)
		{
			//kill collapsing timer
			KillTimer(TID_COLLAPSING);

			if (m_popupAnimation == xtpPopupAnimationFade)
			{
				OnShow();
			}
			else
			{
				OnExpanding(FALSE);
			}
		}
	}

	//test point to controled items
	CXTPPopupItem* pSelected = HitTest(point);

	//if detect new selected item ore lose selection (NULL)
	if (pSelected != m_pSelected)
	{
		//select new item ore set NULL
		m_pSelected = (m_pPressed == 0 || m_pPressed == pSelected || pSelected == NULL) ? pSelected : NULL;

		//redraw all items
		RedrawControl();
	}

	CWnd::OnMouseMove(nFlags, point);
}