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 } |
(...skipping 30 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 } | 643 } |
644 } | 644 } |
645 if (m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled) { | 645 if (m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled) { |
646 param.m_dwStates = CFWL_PartState_Disabled; | 646 param.m_dwStates = CFWL_PartState_Disabled; |
647 } else if ((m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) && | 647 } else if ((m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) && |
648 (m_iCurSel >= 0)) { | 648 (m_iCurSel >= 0)) { |
649 param.m_dwStates = CFWL_PartState_Selected; | 649 param.m_dwStates = CFWL_PartState_Selected; |
650 } else { | 650 } else { |
651 param.m_dwStates = CFWL_PartState_Normal; | 651 param.m_dwStates = CFWL_PartState_Normal; |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
864 } | 864 } |
865 rect = m_pProperties->m_rtWidget; | 865 rect = m_pProperties->m_rtWidget; |
866 if (m_pListBox && IsDropListShowed()) { | 866 if (m_pListBox && IsDropListShowed()) { |
867 CFX_RectF rtList; | 867 CFX_RectF rtList; |
868 m_pListBox->GetWidgetRect(rtList); | 868 m_pListBox->GetWidgetRect(rtList); |
869 rtList.Offset(rect.left, rect.top); | 869 rtList.Offset(rect.left, rect.top); |
870 rect.Union(rtList); | 870 rect.Union(rtList); |
871 } | 871 } |
872 return FWL_Error::Succeeded; | 872 return FWL_Error::Succeeded; |
873 } | 873 } |
| 874 |
874 FWL_Error CFWL_ComboBoxImp::EditModifyStylesEx(uint32_t dwStylesExAdded, | 875 FWL_Error CFWL_ComboBoxImp::EditModifyStylesEx(uint32_t dwStylesExAdded, |
875 uint32_t dwStylesExRemoved) { | 876 uint32_t dwStylesExRemoved) { |
876 if (m_pEdit != NULL) { | 877 if (!m_pEdit) |
877 return m_pEdit->ModifyStylesEx(dwStylesExAdded, dwStylesExRemoved); | |
878 } else { | |
879 return FWL_Error::ParameterInvalid; | 878 return FWL_Error::ParameterInvalid; |
880 } | 879 return m_pEdit->ModifyStylesEx(dwStylesExAdded, dwStylesExRemoved); |
881 } | 880 } |
| 881 |
882 FX_FLOAT CFWL_ComboBoxImp::GetListHeight() { | 882 FX_FLOAT CFWL_ComboBoxImp::GetListHeight() { |
883 return static_cast<IFWL_ComboBoxDP*>(m_pProperties->m_pDataProvider) | 883 return static_cast<IFWL_ComboBoxDP*>(m_pProperties->m_pDataProvider) |
884 ->GetListHeight(m_pInterface); | 884 ->GetListHeight(m_pInterface); |
885 } | 885 } |
886 void CFWL_ComboBoxImp::DrawStretchHandler(CFX_Graphics* pGraphics, | 886 void CFWL_ComboBoxImp::DrawStretchHandler(CFX_Graphics* pGraphics, |
887 const CFX_Matrix* pMatrix) { | 887 const CFX_Matrix* pMatrix) { |
888 CFWL_ThemeBackground param; | 888 CFWL_ThemeBackground param; |
889 param.m_pGraphics = pGraphics; | 889 param.m_pGraphics = pGraphics; |
890 param.m_iPart = CFWL_Part::StretchHandler; | 890 param.m_iPart = CFWL_Part::StretchHandler; |
891 param.m_dwStates = CFWL_PartState_Normal; | 891 param.m_dwStates = CFWL_PartState_Normal; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
931 m_rtList.width = m_rtClient.width; | 931 m_rtList.width = m_rtClient.width; |
932 } | 932 } |
933 m_rtProxy = m_rtList; | 933 m_rtProxy = m_rtList; |
934 if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CMB_ListDrag) { | 934 if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CMB_ListDrag) { |
935 m_rtProxy.height += m_fComboFormHandler; | 935 m_rtProxy.height += m_fComboFormHandler; |
936 } | 936 } |
937 GetPopupPos(fMinHeight, m_rtProxy.height, rtAnchor, m_rtProxy); | 937 GetPopupPos(fMinHeight, m_rtProxy.height, rtAnchor, m_rtProxy); |
938 if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CMB_ListDrag) { | 938 if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CMB_ListDrag) { |
939 FX_FLOAT fx = 0; | 939 FX_FLOAT fx = 0; |
940 FX_FLOAT fy = m_rtClient.top + m_rtClient.height / 2; | 940 FX_FLOAT fy = m_rtClient.top + m_rtClient.height / 2; |
941 TransformTo(NULL, fx, fy); | 941 TransformTo(nullptr, fx, fy); |
942 m_bUpFormHandler = fy > m_rtProxy.top; | 942 m_bUpFormHandler = fy > m_rtProxy.top; |
943 if (m_bUpFormHandler) { | 943 if (m_bUpFormHandler) { |
944 m_rtHandler.Set(0, 0, m_rtList.width, m_fComboFormHandler); | 944 m_rtHandler.Set(0, 0, m_rtList.width, m_fComboFormHandler); |
945 m_rtList.top = m_fComboFormHandler; | 945 m_rtList.top = m_fComboFormHandler; |
946 } else { | 946 } else { |
947 m_rtHandler.Set(0, m_rtList.height, m_rtList.width, | 947 m_rtHandler.Set(0, m_rtList.height, m_rtList.width, |
948 m_fComboFormHandler); | 948 m_fComboFormHandler); |
949 } | 949 } |
950 } | 950 } |
951 m_pForm->SetWidgetRect(m_rtProxy); | 951 m_pForm->SetWidgetRect(m_rtProxy); |
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1591 m_pOwner->m_iCurSel = iCurSel; | 1591 m_pOwner->m_iCurSel = iCurSel; |
1592 if (bDropDown && m_pOwner->m_pEdit) { | 1592 if (bDropDown && m_pOwner->m_pEdit) { |
1593 m_pOwner->SynchrEditText(m_pOwner->m_iCurSel); | 1593 m_pOwner->SynchrEditText(m_pOwner->m_iCurSel); |
1594 } else { | 1594 } else { |
1595 m_pOwner->Repaint(&m_pOwner->m_rtClient); | 1595 m_pOwner->Repaint(&m_pOwner->m_rtClient); |
1596 } | 1596 } |
1597 return; | 1597 return; |
1598 } | 1598 } |
1599 FX_BOOL bDropDown = m_pOwner->IsDropDownStyle(); | 1599 FX_BOOL bDropDown = m_pOwner->IsDropDownStyle(); |
1600 if (bDropDown) { | 1600 if (bDropDown) { |
1601 IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pEdit->SetDelegate(NULL); | 1601 IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pEdit->SetDelegate(nullptr); |
1602 pDelegate->OnProcessMessage(pMsg); | 1602 pDelegate->OnProcessMessage(pMsg); |
1603 } | 1603 } |
1604 } | 1604 } |
1605 void CFWL_ComboBoxImpDelegate::DisForm_OnProcessMessage( | 1605 void CFWL_ComboBoxImpDelegate::DisForm_OnProcessMessage( |
1606 CFWL_Message* pMessage) { | 1606 CFWL_Message* pMessage) { |
1607 if (!pMessage) | 1607 if (!pMessage) |
1608 return; | 1608 return; |
1609 | 1609 |
1610 FX_BOOL backDefault = TRUE; | 1610 FX_BOOL backDefault = TRUE; |
1611 switch (pMessage->GetClassID()) { | 1611 switch (pMessage->GetClassID()) { |
(...skipping 30 matching lines...) Expand all Loading... |
1642 if (pKey->m_dwCmd == FWL_KeyCommand::KeyUp) | 1642 if (pKey->m_dwCmd == FWL_KeyCommand::KeyUp) |
1643 break; | 1643 break; |
1644 if (m_pOwner->DisForm_IsDropListShowed() && | 1644 if (m_pOwner->DisForm_IsDropListShowed() && |
1645 pKey->m_dwCmd == FWL_KeyCommand::KeyDown) { | 1645 pKey->m_dwCmd == FWL_KeyCommand::KeyDown) { |
1646 FX_BOOL bListKey = pKey->m_dwKeyCode == FWL_VKEY_Up || | 1646 FX_BOOL bListKey = pKey->m_dwKeyCode == FWL_VKEY_Up || |
1647 pKey->m_dwKeyCode == FWL_VKEY_Down || | 1647 pKey->m_dwKeyCode == FWL_VKEY_Down || |
1648 pKey->m_dwKeyCode == FWL_VKEY_Return || | 1648 pKey->m_dwKeyCode == FWL_VKEY_Return || |
1649 pKey->m_dwKeyCode == FWL_VKEY_Escape; | 1649 pKey->m_dwKeyCode == FWL_VKEY_Escape; |
1650 if (bListKey) { | 1650 if (bListKey) { |
1651 IFWL_WidgetDelegate* pDelegate = | 1651 IFWL_WidgetDelegate* pDelegate = |
1652 m_pOwner->m_pListBox->SetDelegate(NULL); | 1652 m_pOwner->m_pListBox->SetDelegate(nullptr); |
1653 pDelegate->OnProcessMessage(pMessage); | 1653 pDelegate->OnProcessMessage(pMessage); |
1654 break; | 1654 break; |
1655 } | 1655 } |
1656 } | 1656 } |
1657 DisForm_OnKey(pKey); | 1657 DisForm_OnKey(pKey); |
1658 break; | 1658 break; |
1659 } | 1659 } |
1660 default: | 1660 default: |
1661 break; | 1661 break; |
1662 } | 1662 } |
(...skipping 18 matching lines...) Expand all Loading... |
1681 } | 1681 } |
1682 } | 1682 } |
1683 } | 1683 } |
1684 void CFWL_ComboBoxImpDelegate::DisForm_OnFocusChanged(CFWL_Message* pMsg, | 1684 void CFWL_ComboBoxImpDelegate::DisForm_OnFocusChanged(CFWL_Message* pMsg, |
1685 FX_BOOL bSet) { | 1685 FX_BOOL bSet) { |
1686 if (bSet) { | 1686 if (bSet) { |
1687 m_pOwner->m_pProperties->m_dwStates |= FWL_WGTSTATE_Focused; | 1687 m_pOwner->m_pProperties->m_dwStates |= FWL_WGTSTATE_Focused; |
1688 if ((m_pOwner->m_pEdit->GetStates() & FWL_WGTSTATE_Focused) == 0) { | 1688 if ((m_pOwner->m_pEdit->GetStates() & FWL_WGTSTATE_Focused) == 0) { |
1689 CFWL_MsgSetFocus msg; | 1689 CFWL_MsgSetFocus msg; |
1690 msg.m_pDstTarget = m_pOwner->m_pEdit.get(); | 1690 msg.m_pDstTarget = m_pOwner->m_pEdit.get(); |
1691 msg.m_pSrcTarget = NULL; | 1691 msg.m_pSrcTarget = nullptr; |
1692 IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pEdit->SetDelegate(NULL); | 1692 IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pEdit->SetDelegate(nullptr); |
1693 pDelegate->OnProcessMessage(&msg); | 1693 pDelegate->OnProcessMessage(&msg); |
1694 } | 1694 } |
1695 } else { | 1695 } else { |
1696 m_pOwner->m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Focused; | 1696 m_pOwner->m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Focused; |
1697 m_pOwner->DisForm_ShowDropList(FALSE); | 1697 m_pOwner->DisForm_ShowDropList(FALSE); |
1698 CFWL_MsgKillFocus msg; | 1698 CFWL_MsgKillFocus msg; |
1699 msg.m_pDstTarget = NULL; | 1699 msg.m_pDstTarget = nullptr; |
1700 msg.m_pSrcTarget = m_pOwner->m_pEdit.get(); | 1700 msg.m_pSrcTarget = m_pOwner->m_pEdit.get(); |
1701 IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pEdit->SetDelegate(NULL); | 1701 IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pEdit->SetDelegate(nullptr); |
1702 pDelegate->OnProcessMessage(&msg); | 1702 pDelegate->OnProcessMessage(&msg); |
1703 } | 1703 } |
1704 } | 1704 } |
1705 void CFWL_ComboBoxImpDelegate::DisForm_OnKey(CFWL_MsgKey* pMsg) { | 1705 void CFWL_ComboBoxImpDelegate::DisForm_OnKey(CFWL_MsgKey* pMsg) { |
1706 uint32_t dwKeyCode = pMsg->m_dwKeyCode; | 1706 uint32_t dwKeyCode = pMsg->m_dwKeyCode; |
1707 const bool bUp = dwKeyCode == FWL_VKEY_Up; | 1707 const bool bUp = dwKeyCode == FWL_VKEY_Up; |
1708 const bool bDown = dwKeyCode == FWL_VKEY_Down; | 1708 const bool bDown = dwKeyCode == FWL_VKEY_Down; |
1709 if (bUp || bDown) { | 1709 if (bUp || bDown) { |
1710 CFWL_ComboListImp* pComboList = | 1710 CFWL_ComboListImp* pComboList = |
1711 static_cast<CFWL_ComboListImp*>(m_pOwner->m_pListBox->GetImpl()); | 1711 static_cast<CFWL_ComboListImp*>(m_pOwner->m_pListBox->GetImpl()); |
(...skipping 24 matching lines...) Expand all Loading... |
1736 iCurSel--; | 1736 iCurSel--; |
1737 } else { | 1737 } else { |
1738 iCurSel++; | 1738 iCurSel++; |
1739 } | 1739 } |
1740 } | 1740 } |
1741 m_pOwner->m_iCurSel = iCurSel; | 1741 m_pOwner->m_iCurSel = iCurSel; |
1742 m_pOwner->SynchrEditText(m_pOwner->m_iCurSel); | 1742 m_pOwner->SynchrEditText(m_pOwner->m_iCurSel); |
1743 return; | 1743 return; |
1744 } | 1744 } |
1745 if (m_pOwner->m_pEdit) { | 1745 if (m_pOwner->m_pEdit) { |
1746 IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pEdit->SetDelegate(NULL); | 1746 IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pEdit->SetDelegate(nullptr); |
1747 pDelegate->OnProcessMessage(pMsg); | 1747 pDelegate->OnProcessMessage(pMsg); |
1748 } | 1748 } |
1749 } | 1749 } |
1750 | 1750 |
1751 CFWL_ComboProxyImpDelegate::CFWL_ComboProxyImpDelegate( | 1751 CFWL_ComboProxyImpDelegate::CFWL_ComboProxyImpDelegate( |
1752 IFWL_Form* pForm, | 1752 IFWL_Form* pForm, |
1753 CFWL_ComboBoxImp* pComboBox) | 1753 CFWL_ComboBoxImp* pComboBox) |
1754 : m_bLButtonDown(FALSE), | 1754 : m_bLButtonDown(FALSE), |
1755 m_bLButtonUpSelf(FALSE), | 1755 m_bLButtonUpSelf(FALSE), |
1756 m_fStartPos(0), | 1756 m_fStartPos(0), |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1845 m_bLButtonUpSelf = TRUE; | 1845 m_bLButtonUpSelf = TRUE; |
1846 } | 1846 } |
1847 } | 1847 } |
1848 void CFWL_ComboProxyImpDelegate::OnMouseMove(CFWL_MsgMouse* pMsg) {} | 1848 void CFWL_ComboProxyImpDelegate::OnMouseMove(CFWL_MsgMouse* pMsg) {} |
1849 void CFWL_ComboProxyImpDelegate::OnDeactive(CFWL_MsgDeactivate* pMsg) { | 1849 void CFWL_ComboProxyImpDelegate::OnDeactive(CFWL_MsgDeactivate* pMsg) { |
1850 m_pComboBox->ShowDropList(FALSE); | 1850 m_pComboBox->ShowDropList(FALSE); |
1851 } | 1851 } |
1852 void CFWL_ComboProxyImpDelegate::OnFocusChanged(CFWL_MsgKillFocus* pMsg, | 1852 void CFWL_ComboProxyImpDelegate::OnFocusChanged(CFWL_MsgKillFocus* pMsg, |
1853 FX_BOOL bSet) { | 1853 FX_BOOL bSet) { |
1854 if (!bSet) { | 1854 if (!bSet) { |
1855 if (pMsg->m_pSetFocus == NULL) { | 1855 if (!pMsg->m_pSetFocus) { |
1856 m_pComboBox->ShowDropList(FALSE); | 1856 m_pComboBox->ShowDropList(FALSE); |
1857 } | 1857 } |
1858 } | 1858 } |
1859 } | 1859 } |
OLD | NEW |