void IFWL_ComboList::OnDropListMouseMove(CFWL_MsgMouse* pMsg) { if (GetRTClient().Contains(pMsg->m_fx, pMsg->m_fy)) { if (m_bNotifyOwner) m_bNotifyOwner = false; IFWL_ScrollBar* vertSB = GetVertScrollBar(); if (IsShowScrollBar(true) && vertSB) { CFX_RectF rect; vertSB->GetWidgetRect(rect); if (rect.Contains(pMsg->m_fx, pMsg->m_fy)) return; } CFWL_ListItem* hItem = GetItemAtPoint(pMsg->m_fx, pMsg->m_fy); if (!hItem) return; if (!m_pProperties->m_pDataProvider) return; IFWL_ListBoxDP* pData = static_cast<IFWL_ListBoxDP*>(m_pProperties->m_pDataProvider); ChangeSelected(pData->GetItemIndex(this, hItem)); } else if (m_bNotifyOwner) { ClientToOuter(pMsg->m_fx, pMsg->m_fy); IFWL_ComboBox* pOuter = static_cast<IFWL_ComboBox*>(m_pOuter); pOuter->GetDelegate()->OnProcessMessage(pMsg); } }
void COXTabViewContainer::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) { // TODO: Add your message handler code here and/or call default ASSERT(pScrollBar==GetVertScrollBar()); CWnd* pWnd=GetActivePage(); ASSERT(pWnd!=NULL); if(pWnd!=NULL) { ASSERT(::IsWindow(pWnd->m_hWnd)); pWnd->SendMessage(WM_VSCROLL,MAKEWPARAM(nSBCode,nPos), (LPARAM)pScrollBar->m_hWnd); } }
void IFWL_ComboList::OnProcessMessage(CFWL_Message* pMessage) { if (!pMessage) return; CFWL_MessageType dwHashCode = pMessage->GetClassID(); bool backDefault = true; if (dwHashCode == CFWL_MessageType::SetFocus || dwHashCode == CFWL_MessageType::KillFocus) { OnDropListFocusChanged(pMessage, dwHashCode == CFWL_MessageType::SetFocus); } else if (dwHashCode == CFWL_MessageType::Mouse) { CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage); IFWL_ScrollBar* vertSB = GetVertScrollBar(); if (IsShowScrollBar(true) && vertSB) { CFX_RectF rect; vertSB->GetWidgetRect(rect); if (rect.Contains(pMsg->m_fx, pMsg->m_fy)) { pMsg->m_fx -= rect.left; pMsg->m_fy -= rect.top; vertSB->GetDelegate()->OnProcessMessage(pMsg); return; } } switch (pMsg->m_dwCmd) { case FWL_MouseCommand::Move: { backDefault = false; OnDropListMouseMove(pMsg); break; } case FWL_MouseCommand::LeftButtonDown: { backDefault = false; OnDropListLButtonDown(pMsg); break; } case FWL_MouseCommand::LeftButtonUp: { backDefault = false; OnDropListLButtonUp(pMsg); break; } default: break; } } else if (dwHashCode == CFWL_MessageType::Key) { backDefault = !OnDropListKey(static_cast<CFWL_MsgKey*>(pMessage)); } if (backDefault) IFWL_ListBox::OnProcessMessage(pMessage); }
void CFWL_ComboList::OnProcessMessage(CFWL_Message* pMessage) { if (!pMessage) return; CFWL_Message::Type type = pMessage->GetType(); bool backDefault = true; if (type == CFWL_Message::Type::SetFocus || type == CFWL_Message::Type::KillFocus) { OnDropListFocusChanged(pMessage, type == CFWL_Message::Type::SetFocus); } else if (type == CFWL_Message::Type::Mouse) { CFWL_MessageMouse* pMsg = static_cast<CFWL_MessageMouse*>(pMessage); CFWL_ScrollBar* vertSB = GetVertScrollBar(); if (IsShowScrollBar(true) && vertSB) { CFX_RectF rect = vertSB->GetWidgetRect(); if (rect.Contains(pMsg->m_pos)) { pMsg->m_pos -= rect.TopLeft(); vertSB->GetDelegate()->OnProcessMessage(pMsg); return; } } switch (pMsg->m_dwCmd) { case FWL_MouseCommand::Move: { backDefault = false; OnDropListMouseMove(pMsg); break; } case FWL_MouseCommand::LeftButtonDown: { backDefault = false; OnDropListLButtonDown(pMsg); break; } case FWL_MouseCommand::LeftButtonUp: { backDefault = false; OnDropListLButtonUp(pMsg); break; } default: break; } } else if (type == CFWL_Message::Type::Key) { backDefault = !OnDropListKey(static_cast<CFWL_MessageKey*>(pMessage)); } if (backDefault) CFWL_ListBox::OnProcessMessage(pMessage); }
void CFWL_ComboList::OnDropListLButtonUp(CFWL_MessageMouse* pMsg) { CFWL_ComboBox* pOuter = static_cast<CFWL_ComboBox*>(m_pOuter); if (m_bNotifyOwner) { pMsg->m_pos = ClientToOuter(pMsg->m_pos); pOuter->GetDelegate()->OnProcessMessage(pMsg); return; } CFWL_ScrollBar* vertSB = GetVertScrollBar(); if (IsShowScrollBar(true) && vertSB) { CFX_RectF rect = vertSB->GetWidgetRect(); if (rect.Contains(pMsg->m_pos)) return; } pOuter->ShowDropList(false); CFWL_ListItem* hItem = GetItemAtPoint(pMsg->m_pos); if (hItem) pOuter->ProcessSelChanged(true); }
void CFWL_ComboList::OnDropListMouseMove(CFWL_MessageMouse* pMsg) { if (GetRTClient().Contains(pMsg->m_pos)) { if (m_bNotifyOwner) m_bNotifyOwner = false; CFWL_ScrollBar* vertSB = GetVertScrollBar(); if (IsShowScrollBar(true) && vertSB) { CFX_RectF rect = vertSB->GetWidgetRect(); if (rect.Contains(pMsg->m_pos)) return; } CFWL_ListItem* hItem = GetItemAtPoint(pMsg->m_pos); if (!hItem) return; ChangeSelected(GetItemIndex(this, hItem)); } else if (m_bNotifyOwner) { pMsg->m_pos = ClientToOuter(pMsg->m_pos); CFWL_ComboBox* pOuter = static_cast<CFWL_ComboBox*>(m_pOuter); pOuter->GetDelegate()->OnProcessMessage(pMsg); } }