OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "xfa/fwl/basewidget/fwl_comboboximp.h" | 7 #include "xfa/fwl/basewidget/fwl_comboboximp.h" |
8 | 8 |
9 #include "xfa/fde/cfde_txtedtengine.h" | 9 #include "xfa/fde/cfde_txtedtengine.h" |
10 #include "xfa/fde/tto/fde_textout.h" | 10 #include "xfa/fde/tto/fde_textout.h" |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Focused; | 192 m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Focused; |
193 ShowCaret(FALSE); | 193 ShowCaret(FALSE); |
194 } | 194 } |
195 } | 195 } |
196 void CFWL_ComboEditImp::SetComboBoxFocus(FX_BOOL bSet) { | 196 void CFWL_ComboEditImp::SetComboBoxFocus(FX_BOOL bSet) { |
197 m_pOuter->SetFocus(bSet); | 197 m_pOuter->SetFocus(bSet); |
198 } | 198 } |
199 CFWL_ComboListImp::CFWL_ComboListImp(const CFWL_WidgetImpProperties& properties, | 199 CFWL_ComboListImp::CFWL_ComboListImp(const CFWL_WidgetImpProperties& properties, |
200 IFWL_Widget* pOuter) | 200 IFWL_Widget* pOuter) |
201 : CFWL_ListBoxImp(properties, pOuter), m_bNotifyOwner(TRUE) { | 201 : CFWL_ListBoxImp(properties, pOuter), m_bNotifyOwner(TRUE) { |
202 ASSERT(pOuter != NULL); | 202 ASSERT(pOuter); |
203 } | 203 } |
204 FWL_Error CFWL_ComboListImp::Initialize() { | 204 FWL_Error CFWL_ComboListImp::Initialize() { |
205 if (CFWL_ListBoxImp::Initialize() != FWL_Error::Succeeded) | 205 if (CFWL_ListBoxImp::Initialize() != FWL_Error::Succeeded) |
206 return FWL_Error::Indefinite; | 206 return FWL_Error::Indefinite; |
207 delete m_pDelegate; | 207 delete m_pDelegate; |
208 m_pDelegate = new CFWL_ComboListImpDelegate(this); | 208 m_pDelegate = new CFWL_ComboListImpDelegate(this); |
209 return FWL_Error::Succeeded; | 209 return FWL_Error::Succeeded; |
210 } | 210 } |
211 FWL_Error CFWL_ComboListImp::Finalize() { | 211 FWL_Error CFWL_ComboListImp::Finalize() { |
212 delete m_pDelegate; | 212 delete m_pDelegate; |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 OnDropListFocusChanged(pMessage, dwHashCode == CFWL_MessageType::SetFocus); | 296 OnDropListFocusChanged(pMessage, dwHashCode == CFWL_MessageType::SetFocus); |
297 } else if (dwHashCode == CFWL_MessageType::Mouse) { | 297 } else if (dwHashCode == CFWL_MessageType::Mouse) { |
298 CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage); | 298 CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage); |
299 if (m_pOwner->IsShowScrollBar(TRUE) && m_pOwner->m_pVertScrollBar) { | 299 if (m_pOwner->IsShowScrollBar(TRUE) && m_pOwner->m_pVertScrollBar) { |
300 CFX_RectF rect; | 300 CFX_RectF rect; |
301 m_pOwner->m_pVertScrollBar->GetWidgetRect(rect); | 301 m_pOwner->m_pVertScrollBar->GetWidgetRect(rect); |
302 if (rect.Contains(pMsg->m_fx, pMsg->m_fy)) { | 302 if (rect.Contains(pMsg->m_fx, pMsg->m_fy)) { |
303 pMsg->m_fx -= rect.left; | 303 pMsg->m_fx -= rect.left; |
304 pMsg->m_fy -= rect.top; | 304 pMsg->m_fy -= rect.top; |
305 IFWL_WidgetDelegate* pDelegate = | 305 IFWL_WidgetDelegate* pDelegate = |
306 m_pOwner->m_pVertScrollBar->SetDelegate(NULL); | 306 m_pOwner->m_pVertScrollBar->SetDelegate(nullptr); |
307 pDelegate->OnProcessMessage(pMsg); | 307 pDelegate->OnProcessMessage(pMsg); |
308 return; | 308 return; |
309 } | 309 } |
310 } | 310 } |
311 switch (pMsg->m_dwCmd) { | 311 switch (pMsg->m_dwCmd) { |
312 case FWL_MouseCommand::Move: { | 312 case FWL_MouseCommand::Move: { |
313 backDefault = FALSE; | 313 backDefault = FALSE; |
314 OnDropListMouseMove(pMsg); | 314 OnDropListMouseMove(pMsg); |
315 break; | 315 break; |
316 } | 316 } |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 m_pOwner->m_pProperties->m_rtWidget.height); | 465 m_pOwner->m_pProperties->m_rtWidget.height); |
466 m_pOwner->Repaint(&rtInvalidate); | 466 m_pOwner->Repaint(&rtInvalidate); |
467 break; | 467 break; |
468 } | 468 } |
469 default: {} | 469 default: {} |
470 } | 470 } |
471 } | 471 } |
472 CFWL_ComboBoxImp::CFWL_ComboBoxImp(const CFWL_WidgetImpProperties& properties, | 472 CFWL_ComboBoxImp::CFWL_ComboBoxImp(const CFWL_WidgetImpProperties& properties, |
473 IFWL_Widget* pOuter) | 473 IFWL_Widget* pOuter) |
474 : CFWL_WidgetImp(properties, pOuter), | 474 : CFWL_WidgetImp(properties, pOuter), |
475 m_pForm(NULL), | 475 m_pForm(nullptr), |
476 m_bLButtonDown(FALSE), | 476 m_bLButtonDown(FALSE), |
477 m_iCurSel(-1), | 477 m_iCurSel(-1), |
478 m_iBtnState(CFWL_PartState_Normal), | 478 m_iBtnState(CFWL_PartState_Normal), |
479 m_fComboFormHandler(0), | 479 m_fComboFormHandler(0), |
480 m_bNeedShowList(FALSE) { | 480 m_bNeedShowList(FALSE) { |
481 m_rtClient.Reset(); | 481 m_rtClient.Reset(); |
482 m_rtBtn.Reset(); | 482 m_rtBtn.Reset(); |
483 m_rtHandler.Reset(); | 483 m_rtHandler.Reset(); |
484 } | 484 } |
485 | 485 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 return DisForm_Update(); | 580 return DisForm_Update(); |
581 } | 581 } |
582 if (IsLocked()) { | 582 if (IsLocked()) { |
583 return FWL_Error::Indefinite; | 583 return FWL_Error::Indefinite; |
584 } | 584 } |
585 ReSetTheme(); | 585 ReSetTheme(); |
586 FX_BOOL bDropDown = IsDropDownStyle(); | 586 FX_BOOL bDropDown = IsDropDownStyle(); |
587 if (bDropDown && m_pEdit) { | 587 if (bDropDown && m_pEdit) { |
588 ReSetEditAlignment(); | 588 ReSetEditAlignment(); |
589 } | 589 } |
590 if (m_pProperties->m_pThemeProvider == NULL) { | 590 if (!m_pProperties->m_pThemeProvider) |
591 m_pProperties->m_pThemeProvider = GetAvailableTheme(); | 591 m_pProperties->m_pThemeProvider = GetAvailableTheme(); |
592 } | 592 |
593 Layout(); | 593 Layout(); |
594 CFWL_ThemePart part; | 594 CFWL_ThemePart part; |
595 part.m_pWidget = m_pInterface; | 595 part.m_pWidget = m_pInterface; |
596 m_fComboFormHandler = | 596 m_fComboFormHandler = |
597 *static_cast<FX_FLOAT*>(m_pProperties->m_pThemeProvider->GetCapacity( | 597 *static_cast<FX_FLOAT*>(m_pProperties->m_pThemeProvider->GetCapacity( |
598 &part, CFWL_WidgetCapacity::ComboFormHandler)); | 598 &part, CFWL_WidgetCapacity::ComboFormHandler)); |
599 return FWL_Error::Succeeded; | 599 return FWL_Error::Succeeded; |
600 } | 600 } |
601 FWL_WidgetHit CFWL_ComboBoxImp::HitTest(FX_FLOAT fx, FX_FLOAT fy) { | 601 FWL_WidgetHit CFWL_ComboBoxImp::HitTest(FX_FLOAT fx, FX_FLOAT fy) { |
602 if (m_pWidgetMgr->IsFormDisabled()) { | 602 if (m_pWidgetMgr->IsFormDisabled()) { |
(...skipping 28 matching lines...) Expand all Loading... |
631 if (pMatrix) { | 631 if (pMatrix) { |
632 param.m_matrix.Concat(*pMatrix); | 632 param.m_matrix.Concat(*pMatrix); |
633 } | 633 } |
634 param.m_rtPart = rtTextBk; | 634 param.m_rtPart = rtTextBk; |
635 if (m_iCurSel >= 0) { | 635 if (m_iCurSel >= 0) { |
636 IFWL_ListBoxDP* pData = static_cast<IFWL_ListBoxDP*>( | 636 IFWL_ListBoxDP* pData = static_cast<IFWL_ListBoxDP*>( |
637 static_cast<CFWL_ComboListImp*>(m_pListBox->GetImpl()) | 637 static_cast<CFWL_ComboListImp*>(m_pListBox->GetImpl()) |
638 ->m_pProperties->m_pDataProvider); | 638 ->m_pProperties->m_pDataProvider); |
639 void* p = pData->GetItemData(m_pListBox.get(), | 639 void* p = pData->GetItemData(m_pListBox.get(), |
640 pData->GetItem(m_pListBox.get(), m_iCurSel)); | 640 pData->GetItem(m_pListBox.get(), m_iCurSel)); |
641 if (p != NULL) { | 641 if (p) |
642 param.m_pData = p; | 642 param.m_pData = p; |
643 } | |
644 } | 643 } |
645 if (m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled) { | 644 if (m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled) { |
646 param.m_dwStates = CFWL_PartState_Disabled; | 645 param.m_dwStates = CFWL_PartState_Disabled; |
647 } else if ((m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) && | 646 } else if ((m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) && |
648 (m_iCurSel >= 0)) { | 647 (m_iCurSel >= 0)) { |
649 param.m_dwStates = CFWL_PartState_Selected; | 648 param.m_dwStates = CFWL_PartState_Selected; |
650 } else { | 649 } else { |
651 param.m_dwStates = CFWL_PartState_Normal; | 650 param.m_dwStates = CFWL_PartState_Normal; |
652 } | 651 } |
653 pTheme->DrawBackground(¶m); | 652 pTheme->DrawBackground(¶m); |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
866 if (m_pListBox && IsDropListShowed()) { | 865 if (m_pListBox && IsDropListShowed()) { |
867 CFX_RectF rtList; | 866 CFX_RectF rtList; |
868 m_pListBox->GetWidgetRect(rtList); | 867 m_pListBox->GetWidgetRect(rtList); |
869 rtList.Offset(rect.left, rect.top); | 868 rtList.Offset(rect.left, rect.top); |
870 rect.Union(rtList); | 869 rect.Union(rtList); |
871 } | 870 } |
872 return FWL_Error::Succeeded; | 871 return FWL_Error::Succeeded; |
873 } | 872 } |
874 FWL_Error CFWL_ComboBoxImp::EditModifyStylesEx(uint32_t dwStylesExAdded, | 873 FWL_Error CFWL_ComboBoxImp::EditModifyStylesEx(uint32_t dwStylesExAdded, |
875 uint32_t dwStylesExRemoved) { | 874 uint32_t dwStylesExRemoved) { |
876 if (m_pEdit != NULL) { | 875 if (m_pEdit) |
877 return m_pEdit->ModifyStylesEx(dwStylesExAdded, dwStylesExRemoved); | 876 return m_pEdit->ModifyStylesEx(dwStylesExAdded, dwStylesExRemoved); |
878 } else { | 877 return FWL_Error::ParameterInvalid; |
879 return FWL_Error::ParameterInvalid; | |
880 } | |
881 } | 878 } |
882 FX_FLOAT CFWL_ComboBoxImp::GetListHeight() { | 879 FX_FLOAT CFWL_ComboBoxImp::GetListHeight() { |
883 return static_cast<IFWL_ComboBoxDP*>(m_pProperties->m_pDataProvider) | 880 return static_cast<IFWL_ComboBoxDP*>(m_pProperties->m_pDataProvider) |
884 ->GetListHeight(m_pInterface); | 881 ->GetListHeight(m_pInterface); |
885 } | 882 } |
886 void CFWL_ComboBoxImp::DrawStretchHandler(CFX_Graphics* pGraphics, | 883 void CFWL_ComboBoxImp::DrawStretchHandler(CFX_Graphics* pGraphics, |
887 const CFX_Matrix* pMatrix) { | 884 const CFX_Matrix* pMatrix) { |
888 CFWL_ThemeBackground param; | 885 CFWL_ThemeBackground param; |
889 param.m_pGraphics = pGraphics; | 886 param.m_pGraphics = pGraphics; |
890 param.m_iPart = CFWL_Part::StretchHandler; | 887 param.m_iPart = CFWL_Part::StretchHandler; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
931 m_rtList.width = m_rtClient.width; | 928 m_rtList.width = m_rtClient.width; |
932 } | 929 } |
933 m_rtProxy = m_rtList; | 930 m_rtProxy = m_rtList; |
934 if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CMB_ListDrag) { | 931 if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CMB_ListDrag) { |
935 m_rtProxy.height += m_fComboFormHandler; | 932 m_rtProxy.height += m_fComboFormHandler; |
936 } | 933 } |
937 GetPopupPos(fMinHeight, m_rtProxy.height, rtAnchor, m_rtProxy); | 934 GetPopupPos(fMinHeight, m_rtProxy.height, rtAnchor, m_rtProxy); |
938 if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CMB_ListDrag) { | 935 if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CMB_ListDrag) { |
939 FX_FLOAT fx = 0; | 936 FX_FLOAT fx = 0; |
940 FX_FLOAT fy = m_rtClient.top + m_rtClient.height / 2; | 937 FX_FLOAT fy = m_rtClient.top + m_rtClient.height / 2; |
941 TransformTo(NULL, fx, fy); | 938 TransformTo(nullptr, fx, fy); |
942 m_bUpFormHandler = fy > m_rtProxy.top; | 939 m_bUpFormHandler = fy > m_rtProxy.top; |
943 if (m_bUpFormHandler) { | 940 if (m_bUpFormHandler) { |
944 m_rtHandler.Set(0, 0, m_rtList.width, m_fComboFormHandler); | 941 m_rtHandler.Set(0, 0, m_rtList.width, m_fComboFormHandler); |
945 m_rtList.top = m_fComboFormHandler; | 942 m_rtList.top = m_fComboFormHandler; |
946 } else { | 943 } else { |
947 m_rtHandler.Set(0, m_rtList.height, m_rtList.width, | 944 m_rtHandler.Set(0, m_rtList.height, m_rtList.width, |
948 m_fComboFormHandler); | 945 m_fComboFormHandler); |
949 } | 946 } |
950 } | 947 } |
951 m_pForm->SetWidgetRect(m_rtProxy); | 948 m_pForm->SetWidgetRect(m_rtProxy); |
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1591 m_pOwner->m_iCurSel = iCurSel; | 1588 m_pOwner->m_iCurSel = iCurSel; |
1592 if (bDropDown && m_pOwner->m_pEdit) { | 1589 if (bDropDown && m_pOwner->m_pEdit) { |
1593 m_pOwner->SynchrEditText(m_pOwner->m_iCurSel); | 1590 m_pOwner->SynchrEditText(m_pOwner->m_iCurSel); |
1594 } else { | 1591 } else { |
1595 m_pOwner->Repaint(&m_pOwner->m_rtClient); | 1592 m_pOwner->Repaint(&m_pOwner->m_rtClient); |
1596 } | 1593 } |
1597 return; | 1594 return; |
1598 } | 1595 } |
1599 FX_BOOL bDropDown = m_pOwner->IsDropDownStyle(); | 1596 FX_BOOL bDropDown = m_pOwner->IsDropDownStyle(); |
1600 if (bDropDown) { | 1597 if (bDropDown) { |
1601 IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pEdit->SetDelegate(NULL); | 1598 IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pEdit->SetDelegate(nullptr); |
1602 pDelegate->OnProcessMessage(pMsg); | 1599 pDelegate->OnProcessMessage(pMsg); |
1603 } | 1600 } |
1604 } | 1601 } |
1605 void CFWL_ComboBoxImpDelegate::DisForm_OnProcessMessage( | 1602 void CFWL_ComboBoxImpDelegate::DisForm_OnProcessMessage( |
1606 CFWL_Message* pMessage) { | 1603 CFWL_Message* pMessage) { |
1607 if (!pMessage) | 1604 if (!pMessage) |
1608 return; | 1605 return; |
1609 | 1606 |
1610 FX_BOOL backDefault = TRUE; | 1607 FX_BOOL backDefault = TRUE; |
1611 switch (pMessage->GetClassID()) { | 1608 switch (pMessage->GetClassID()) { |
(...skipping 30 matching lines...) Expand all Loading... |
1642 if (pKey->m_dwCmd == FWL_KeyCommand::KeyUp) | 1639 if (pKey->m_dwCmd == FWL_KeyCommand::KeyUp) |
1643 break; | 1640 break; |
1644 if (m_pOwner->DisForm_IsDropListShowed() && | 1641 if (m_pOwner->DisForm_IsDropListShowed() && |
1645 pKey->m_dwCmd == FWL_KeyCommand::KeyDown) { | 1642 pKey->m_dwCmd == FWL_KeyCommand::KeyDown) { |
1646 FX_BOOL bListKey = pKey->m_dwKeyCode == FWL_VKEY_Up || | 1643 FX_BOOL bListKey = pKey->m_dwKeyCode == FWL_VKEY_Up || |
1647 pKey->m_dwKeyCode == FWL_VKEY_Down || | 1644 pKey->m_dwKeyCode == FWL_VKEY_Down || |
1648 pKey->m_dwKeyCode == FWL_VKEY_Return || | 1645 pKey->m_dwKeyCode == FWL_VKEY_Return || |
1649 pKey->m_dwKeyCode == FWL_VKEY_Escape; | 1646 pKey->m_dwKeyCode == FWL_VKEY_Escape; |
1650 if (bListKey) { | 1647 if (bListKey) { |
1651 IFWL_WidgetDelegate* pDelegate = | 1648 IFWL_WidgetDelegate* pDelegate = |
1652 m_pOwner->m_pListBox->SetDelegate(NULL); | 1649 m_pOwner->m_pListBox->SetDelegate(nullptr); |
1653 pDelegate->OnProcessMessage(pMessage); | 1650 pDelegate->OnProcessMessage(pMessage); |
1654 break; | 1651 break; |
1655 } | 1652 } |
1656 } | 1653 } |
1657 DisForm_OnKey(pKey); | 1654 DisForm_OnKey(pKey); |
1658 break; | 1655 break; |
1659 } | 1656 } |
1660 default: | 1657 default: |
1661 break; | 1658 break; |
1662 } | 1659 } |
(...skipping 18 matching lines...) Expand all Loading... |
1681 } | 1678 } |
1682 } | 1679 } |
1683 } | 1680 } |
1684 void CFWL_ComboBoxImpDelegate::DisForm_OnFocusChanged(CFWL_Message* pMsg, | 1681 void CFWL_ComboBoxImpDelegate::DisForm_OnFocusChanged(CFWL_Message* pMsg, |
1685 FX_BOOL bSet) { | 1682 FX_BOOL bSet) { |
1686 if (bSet) { | 1683 if (bSet) { |
1687 m_pOwner->m_pProperties->m_dwStates |= FWL_WGTSTATE_Focused; | 1684 m_pOwner->m_pProperties->m_dwStates |= FWL_WGTSTATE_Focused; |
1688 if ((m_pOwner->m_pEdit->GetStates() & FWL_WGTSTATE_Focused) == 0) { | 1685 if ((m_pOwner->m_pEdit->GetStates() & FWL_WGTSTATE_Focused) == 0) { |
1689 CFWL_MsgSetFocus msg; | 1686 CFWL_MsgSetFocus msg; |
1690 msg.m_pDstTarget = m_pOwner->m_pEdit.get(); | 1687 msg.m_pDstTarget = m_pOwner->m_pEdit.get(); |
1691 msg.m_pSrcTarget = NULL; | 1688 msg.m_pSrcTarget = nullptr; |
1692 IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pEdit->SetDelegate(NULL); | 1689 IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pEdit->SetDelegate(nullptr); |
1693 pDelegate->OnProcessMessage(&msg); | 1690 pDelegate->OnProcessMessage(&msg); |
1694 } | 1691 } |
1695 } else { | 1692 } else { |
1696 m_pOwner->m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Focused; | 1693 m_pOwner->m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Focused; |
1697 m_pOwner->DisForm_ShowDropList(FALSE); | 1694 m_pOwner->DisForm_ShowDropList(FALSE); |
1698 CFWL_MsgKillFocus msg; | 1695 CFWL_MsgKillFocus msg; |
1699 msg.m_pDstTarget = NULL; | 1696 msg.m_pDstTarget = nullptr; |
1700 msg.m_pSrcTarget = m_pOwner->m_pEdit.get(); | 1697 msg.m_pSrcTarget = m_pOwner->m_pEdit.get(); |
1701 IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pEdit->SetDelegate(NULL); | 1698 IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pEdit->SetDelegate(nullptr); |
1702 pDelegate->OnProcessMessage(&msg); | 1699 pDelegate->OnProcessMessage(&msg); |
1703 } | 1700 } |
1704 } | 1701 } |
1705 void CFWL_ComboBoxImpDelegate::DisForm_OnKey(CFWL_MsgKey* pMsg) { | 1702 void CFWL_ComboBoxImpDelegate::DisForm_OnKey(CFWL_MsgKey* pMsg) { |
1706 uint32_t dwKeyCode = pMsg->m_dwKeyCode; | 1703 uint32_t dwKeyCode = pMsg->m_dwKeyCode; |
1707 const bool bUp = dwKeyCode == FWL_VKEY_Up; | 1704 const bool bUp = dwKeyCode == FWL_VKEY_Up; |
1708 const bool bDown = dwKeyCode == FWL_VKEY_Down; | 1705 const bool bDown = dwKeyCode == FWL_VKEY_Down; |
1709 if (bUp || bDown) { | 1706 if (bUp || bDown) { |
1710 CFWL_ComboListImp* pComboList = | 1707 CFWL_ComboListImp* pComboList = |
1711 static_cast<CFWL_ComboListImp*>(m_pOwner->m_pListBox->GetImpl()); | 1708 static_cast<CFWL_ComboListImp*>(m_pOwner->m_pListBox->GetImpl()); |
(...skipping 24 matching lines...) Expand all Loading... |
1736 iCurSel--; | 1733 iCurSel--; |
1737 } else { | 1734 } else { |
1738 iCurSel++; | 1735 iCurSel++; |
1739 } | 1736 } |
1740 } | 1737 } |
1741 m_pOwner->m_iCurSel = iCurSel; | 1738 m_pOwner->m_iCurSel = iCurSel; |
1742 m_pOwner->SynchrEditText(m_pOwner->m_iCurSel); | 1739 m_pOwner->SynchrEditText(m_pOwner->m_iCurSel); |
1743 return; | 1740 return; |
1744 } | 1741 } |
1745 if (m_pOwner->m_pEdit) { | 1742 if (m_pOwner->m_pEdit) { |
1746 IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pEdit->SetDelegate(NULL); | 1743 IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pEdit->SetDelegate(nullptr); |
1747 pDelegate->OnProcessMessage(pMsg); | 1744 pDelegate->OnProcessMessage(pMsg); |
1748 } | 1745 } |
1749 } | 1746 } |
1750 | 1747 |
1751 CFWL_ComboProxyImpDelegate::CFWL_ComboProxyImpDelegate( | 1748 CFWL_ComboProxyImpDelegate::CFWL_ComboProxyImpDelegate( |
1752 IFWL_Form* pForm, | 1749 IFWL_Form* pForm, |
1753 CFWL_ComboBoxImp* pComboBox) | 1750 CFWL_ComboBoxImp* pComboBox) |
1754 : m_bLButtonDown(FALSE), | 1751 : m_bLButtonDown(FALSE), |
1755 m_bLButtonUpSelf(FALSE), | 1752 m_bLButtonUpSelf(FALSE), |
1756 m_fStartPos(0), | 1753 m_fStartPos(0), |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1844 } else { | 1841 } else { |
1845 m_bLButtonUpSelf = TRUE; | 1842 m_bLButtonUpSelf = TRUE; |
1846 } | 1843 } |
1847 } | 1844 } |
1848 void CFWL_ComboProxyImpDelegate::OnMouseMove(CFWL_MsgMouse* pMsg) {} | 1845 void CFWL_ComboProxyImpDelegate::OnMouseMove(CFWL_MsgMouse* pMsg) {} |
1849 void CFWL_ComboProxyImpDelegate::OnDeactive(CFWL_MsgDeactivate* pMsg) { | 1846 void CFWL_ComboProxyImpDelegate::OnDeactive(CFWL_MsgDeactivate* pMsg) { |
1850 m_pComboBox->ShowDropList(FALSE); | 1847 m_pComboBox->ShowDropList(FALSE); |
1851 } | 1848 } |
1852 void CFWL_ComboProxyImpDelegate::OnFocusChanged(CFWL_MsgKillFocus* pMsg, | 1849 void CFWL_ComboProxyImpDelegate::OnFocusChanged(CFWL_MsgKillFocus* pMsg, |
1853 FX_BOOL bSet) { | 1850 FX_BOOL bSet) { |
1854 if (!bSet) { | 1851 if (bSet) |
1855 if (pMsg->m_pSetFocus == NULL) { | 1852 return; |
1856 m_pComboBox->ShowDropList(FALSE); | 1853 if (!pMsg->m_pSetFocus) |
1857 } | 1854 m_pComboBox->ShowDropList(FALSE); |
1858 } | |
1859 } | 1855 } |
OLD | NEW |