void CQueView::OnMouseMove(const UINT nFlags, CPoint point) { CScrollView::OnMouseMove(nFlags, point); ClientToDoc(&point); if (moving && selected_add) { RepaintRect(&selected_add->m_position); CRect screen; GetClientRect(&screen); ClientToDoc(&screen); if (point.x < screen.left || point.x > screen.right || point.y > screen.top || point.y < screen.bottom) { // out of view mouse movement ReleaseCapture(); theApp.unQueing = TRUE; moving = false; selected_add->m_position = vPos; Invalidate(FALSE); } else selected_add->m_position += CPoint(point.x - vPoint.x, point.y - vPoint.y); RepaintRect(&selected_add->m_position); vPoint = point; return; } if (theApp.unQueing && selected_add) { RepaintRect(&selected_add->m_position); theApp.unQueing = FALSE; } CDrawObj* pObj = GetDocument()->ObjectAtQue(point); ((CMainFrame *)AfxGetMainWnd())->SetStatusBarInfo(pObj ? pObj->info : ""); }
void CQueView::OnLButtonUp(const UINT nFlags, const CPoint point) { if (moving) { if (selected_add && selected_add->m_position != vPos) { CRect rect = selected_add->m_position; selected_add->m_position = vPos; RepaintRect(&rect); RepaintRect(&selected_add->m_position); } moving = false; theApp.unQueing = FALSE; } ReleaseCapture(); CScrollView::OnLButtonUp(nFlags, point); }
void CFWL_PushButton::OnMouseMove(CFWL_MessageMouse* pMsg) { bool bRepaint = false; if (m_bBtnDown) { if (m_rtClient.Contains(pMsg->m_pos)) { if ((m_pProperties->m_dwStates & FWL_STATE_PSB_Pressed) == 0) { m_pProperties->m_dwStates |= FWL_STATE_PSB_Pressed; bRepaint = true; } if (m_pProperties->m_dwStates & FWL_STATE_PSB_Hovered) { m_pProperties->m_dwStates &= ~FWL_STATE_PSB_Hovered; bRepaint = true; } } else { if (m_pProperties->m_dwStates & FWL_STATE_PSB_Pressed) { m_pProperties->m_dwStates &= ~FWL_STATE_PSB_Pressed; bRepaint = true; } if ((m_pProperties->m_dwStates & FWL_STATE_PSB_Hovered) == 0) { m_pProperties->m_dwStates |= FWL_STATE_PSB_Hovered; bRepaint = true; } } } else { if (!m_rtClient.Contains(pMsg->m_pos)) return; if ((m_pProperties->m_dwStates & FWL_STATE_PSB_Hovered) == 0) { m_pProperties->m_dwStates |= FWL_STATE_PSB_Hovered; bRepaint = true; } } if (bRepaint) RepaintRect(m_rtClient); }
void CFWL_Form::SetWorkAreaRect() { m_rtRestore = m_pProperties->m_rtWidget; CFWL_WidgetMgr* pWidgetMgr = GetOwnerApp()->GetWidgetMgr(); if (!pWidgetMgr) return; RepaintRect(m_rtRelative); }
void CFWL_PushButton::OnFocusChanged(CFWL_Message* pMsg, bool bSet) { if (bSet) m_pProperties->m_dwStates |= FWL_WGTSTATE_Focused; else m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Focused; RepaintRect(m_rtClient); }
void CFWL_PushButton::OnLButtonDown(CFWL_MessageMouse* pMsg) { if ((m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) == 0) SetFocus(true); m_bBtnDown = true; m_pProperties->m_dwStates |= FWL_STATE_PSB_Hovered; m_pProperties->m_dwStates |= FWL_STATE_PSB_Pressed; RepaintRect(m_rtClient); }
void CQueView::OnLButtonDown(const UINT nFlags, CPoint point) { ClientToDoc(&point); CDrawAdd* pObj = GetDocument()->ObjectAtQue(point); if (!pObj) { if (selected_add) { CRect rect = selected_add->m_position; selected_add = nullptr; RepaintRect(&rect); } return; } if (selected_add) vPos = selected_add->m_position; selected_add = pObj; RepaintRect(&vPos); vPoint = point; vPos = selected_add->m_position; moving = true; RepaintRect(&vPos); SetCapture(); CScrollView::OnLButtonDown(nFlags, point); }
void CFWL_PushButton::OnLButtonUp(CFWL_MessageMouse* pMsg) { m_bBtnDown = false; if (m_rtClient.Contains(pMsg->m_pos)) { m_pProperties->m_dwStates &= ~FWL_STATE_PSB_Pressed; m_pProperties->m_dwStates |= FWL_STATE_PSB_Hovered; } else { m_pProperties->m_dwStates &= ~FWL_STATE_PSB_Hovered; m_pProperties->m_dwStates &= ~FWL_STATE_PSB_Pressed; } if (m_rtClient.Contains(pMsg->m_pos)) { CFWL_Event wmClick(CFWL_Event::Type::Click, this); DispatchEvent(&wmClick); } RepaintRect(m_rtClient); }
void CFWL_ComboList::ChangeSelected(int32_t iSel) { CFWL_ListItem* hItem = GetItem(this, iSel); CFWL_ListItem* hOld = GetSelItem(0); int32_t iOld = GetItemIndex(this, hOld); if (iOld == iSel) return; CFX_RectF rtInvalidate; if (iOld > -1) { if (CFWL_ListItem* hOldItem = GetItem(this, iOld)) rtInvalidate = hOldItem->GetRect(); SetSelItem(hOld, false); } if (hItem) { if (CFWL_ListItem* hOldItem = GetItem(this, iSel)) rtInvalidate.Union(hOldItem->GetRect()); CFWL_ListItem* hSel = GetItem(this, iSel); SetSelItem(hSel, true); } if (!rtInvalidate.IsEmpty()) RepaintRect(rtInvalidate); }
void CFWL_ComboList::OnDropListKeyDown(CFWL_MessageKey* pKey) { uint32_t dwKeyCode = pKey->m_dwKeyCode; switch (dwKeyCode) { case FWL_VKEY_Up: case FWL_VKEY_Down: case FWL_VKEY_Home: case FWL_VKEY_End: { CFWL_ComboBox* pOuter = static_cast<CFWL_ComboBox*>(m_pOuter); CFWL_ListItem* hItem = GetItem(this, pOuter->GetCurrentSelection()); hItem = GetListItem(hItem, dwKeyCode); if (!hItem) break; SetSelection(hItem, hItem, true); ScrollToVisible(hItem); CFX_RectF rtInvalidate(0, 0, m_pProperties->m_rtWidget.width, m_pProperties->m_rtWidget.height); RepaintRect(rtInvalidate); break; } default: break; } }
void CFWL_PushButton::OnMouseLeave(CFWL_MessageMouse* pMsg) { m_bBtnDown = false; m_pProperties->m_dwStates &= ~FWL_STATE_PSB_Hovered; m_pProperties->m_dwStates &= ~FWL_STATE_PSB_Pressed; RepaintRect(m_rtClient); }