Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Side by Side Diff: xfa/fwl/core/ifwl_listbox.cpp

Issue 2509283003: Unify the three CFWL_EventType::SelectChange classes. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/core/ifwl_listbox.h" 7 #include "xfa/fwl/core/ifwl_listbox.h"
8 8
9 #include "third_party/base/ptr_util.h" 9 #include "third_party/base/ptr_util.h"
10 #include "xfa/fde/tto/fde_textout.h" 10 #include "xfa/fde/tto/fde_textout.h"
(...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 bool IFWL_ListBox::IsShowScrollBar(bool bVert) { 836 bool IFWL_ListBox::IsShowScrollBar(bool bVert) {
837 IFWL_ScrollBar* pScrollbar = 837 IFWL_ScrollBar* pScrollbar =
838 bVert ? m_pVertScrollBar.get() : m_pHorzScrollBar.get(); 838 bVert ? m_pVertScrollBar.get() : m_pHorzScrollBar.get();
839 if (!pScrollbar || (pScrollbar->GetStates() & FWL_WGTSTATE_Invisible)) 839 if (!pScrollbar || (pScrollbar->GetStates() & FWL_WGTSTATE_Invisible))
840 return false; 840 return false;
841 return !(m_pProperties->m_dwStyleExes & 841 return !(m_pProperties->m_dwStyleExes &
842 FWL_STYLEEXT_LTB_ShowScrollBarFocus) || 842 FWL_STYLEEXT_LTB_ShowScrollBarFocus) ||
843 (m_pProperties->m_dwStates & FWL_WGTSTATE_Focused); 843 (m_pProperties->m_dwStates & FWL_WGTSTATE_Focused);
844 } 844 }
845 845
846 void IFWL_ListBox::ProcessSelChanged() { 846 void IFWL_ListBox::ProcessSelChanged() {}
npm 2016/11/17 18:07:02 Can we delete this method altogether?
dsinclair 2016/11/17 18:13:19 Done.
847 CFWL_EvtLtbSelChanged selEvent;
848 selEvent.m_pSrcTarget = this;
849 CFX_Int32Array arrSels;
850 int32_t iCount = CountSelItems();
851 for (int32_t i = 0; i < iCount; i++) {
852 CFWL_ListItem* item = GetSelItem(i);
853 if (!item)
854 continue;
855 selEvent.iarraySels.Add(i);
856 }
857 DispatchEvent(&selEvent);
858 }
859 847
860 void IFWL_ListBox::OnProcessMessage(CFWL_Message* pMessage) { 848 void IFWL_ListBox::OnProcessMessage(CFWL_Message* pMessage) {
861 if (!pMessage) 849 if (!pMessage)
862 return; 850 return;
863 if (!IsEnabled()) 851 if (!IsEnabled())
864 return; 852 return;
865 853
866 CFWL_MessageType dwMsgCode = pMessage->GetClassID(); 854 CFWL_MessageType dwMsgCode = pMessage->GetClassID();
867 switch (dwMsgCode) { 855 switch (dwMsgCode) {
868 case CFWL_MessageType::SetFocus: 856 case CFWL_MessageType::SetFocus:
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
1091 return false; 1079 return false;
1092 } 1080 }
1093 if (iCurPos != fPos) { 1081 if (iCurPos != fPos) {
1094 pScrollBar->SetPos(fPos); 1082 pScrollBar->SetPos(fPos);
1095 pScrollBar->SetTrackPos(fPos); 1083 pScrollBar->SetTrackPos(fPos);
1096 Repaint(&m_rtClient); 1084 Repaint(&m_rtClient);
1097 } 1085 }
1098 return true; 1086 return true;
1099 } 1087 }
1100 1088
1101 void IFWL_ListBox::DispatchSelChangedEv() { 1089 void IFWL_ListBox::DispatchSelChangedEv() {}
npm 2016/11/17 18:07:02 Ditto
dsinclair 2016/11/17 18:13:19 Done.
1102 CFWL_EvtLtbSelChanged ev;
1103 ev.m_pSrcTarget = this;
1104 DispatchEvent(&ev);
1105 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698