//*************************************************************************************** BOOL CBCGPRadialMenuObject::OnMouseDown(int nButton, const CBCGPPoint& pt) { if (nButton != 0) { return FALSE; } m_bIsFirstClick = FALSE; m_nPressed = HitTestShape(pt); if (IsItemDisabled(m_nPressed)) { m_nPressed = -1; } if (m_nPressed >= 0) { Redraw(); if (m_nAutoRepeatTimeDelay > 0) { m_nAutoRepeatTimerID = (UINT) ::SetTimer (NULL, 0, m_nAutoRepeatTimeDelay, AutoRepeatTimerProc); g_cs.Lock (); m_mapAutorepeat.SetAt (m_nAutoRepeatTimerID, this); g_cs.Unlock (); } return TRUE; } return FALSE; }
bool CTreeWnd::NotifyRButtonUp(UINT nFlags,CPoint point) { // We selected a node on rbuttondown. If we're // now over a different node, select that one instead. // If we're not over a node at all, clear the selection. CShape* pShape = HitTestShape(point); if (pShape) { CTreeNode* pNode = NodeFromShape(pShape); if (pNode && pNode != m_selection.lastSelected()) { // Over a different node now. Select it. m_selection.NotifyItemClicked(pNode); ForceLayout(); } } else { // Haven't hit a node. Still want the context menu though... // m_selection.InvalidateAll(); m_selection.Clear(); ForceLayout(); } m_prevSelectedNode = NULL; return true; }
//*************************************************************************************** BOOL CBCGPRadialMenuObject::OnGetToolTip(const CBCGPPoint& pt, CString& strToolTip, CString& strDescr) { int nHit = HitTestShape(pt); if (nHit < 0 || nHit >= m_arItems.GetSize()) { return FALSE; } strToolTip = m_arItems[nHit]->m_strToolTip; strDescr = m_arItems[nHit]->m_strDescription; return TRUE; }
void CTreeWnd::NotifyRButtonDown(UINT nFlags,CPoint point) { CShape* pShape = HitTestShape(point); if (pShape) { m_prevSelectedNode = m_selection.lastSelected(); InvalidateNode(m_selection.lastSelected()); CTreeNode* pNode = NodeFromShape(pShape); if (pNode) { m_selection.NotifyItemClicked(pNode); ForceLayout(); } } }
void CTreeWnd::NotifyLButtonDblClick(UINT nFlags,CPoint point) { CShape* pShape = HitTestShape(point); if (pShape) { CTreeNode* pNode = NodeFromShape(pShape); if (pNode) { if (OnNodeDoubleClicked(pNode)) { pNode->ToggleExpanded(); ForceLayout(); Invalidate(); } } } }
//*************************************************************************************** void CBCGPRadialMenuObject::OnMouseMove(const CBCGPPoint& pt) { int nHighlightedOld = m_nHighlighted; m_nHighlighted = HitTestShape(pt); if (IsItemDisabled(m_nHighlighted)) { m_nHighlighted = -1; } else if (m_nPressed >= 0 && m_nHighlighted != m_nPressed) { m_nHighlighted = -1; } if (nHighlightedOld != m_nHighlighted) { Redraw(); } }
void CTreeWnd::NotifyLButtonDown(UINT nFlags,CPoint point) { // TRACE("lbuttondown %d,%d\n",point.x,point.y); //TRACE("%x CTreeWnd::NotifyLButtonDown - %d\n",this,m_shapes.size()); // test expand box hit first. CTreeNode* pExpandNode = HitTestExpandBox(point); if (pExpandNode) { if (pExpandNode->IsExpanded() == false && (m_style & MTS_EXPANDRECURSIVE)) { pExpandNode->Expand(true);//>ToggleExpanded(); } else pExpandNode->ToggleExpanded(); ForceLayout(); Invalidate(TRUE); return; } CShape* pShape = HitTestShape(point); if (pShape) { //TRACE("CTreeWnd::NotifyLButtonDown HIT SHAPE\n"); InvalidateNode(m_selection.lastSelected()); CTreeNode* pNode = NodeFromShape(pShape); if (pNode) { if (m_selection.NotifyItemClicked(pNode)) OnNodeSelected(pNode); ForceLayout(); } } }