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

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

Issue 2533623002: Cleanup default FWL params part I (Closed)
Patch Set: Rebase to master Created 4 years 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
« no previous file with comments | « xfa/fwl/core/cfwl_combobox.cpp ('k') | xfa/fwl/core/cfwl_combolist.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 PDFium Authors. All rights reserved. 1 // Copyright 2016 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/cfwl_comboboxproxy.h" 7 #include "xfa/fwl/core/cfwl_comboboxproxy.h"
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 } 64 }
65 65
66 void CFWL_ComboBoxProxy::OnLButtonDown(CFWL_Message* pMessage) { 66 void CFWL_ComboBoxProxy::OnLButtonDown(CFWL_Message* pMessage) {
67 const CFWL_App* pApp = GetOwnerApp(); 67 const CFWL_App* pApp = GetOwnerApp();
68 if (!pApp) 68 if (!pApp)
69 return; 69 return;
70 70
71 CFWL_NoteDriver* pDriver = 71 CFWL_NoteDriver* pDriver =
72 static_cast<CFWL_NoteDriver*>(pApp->GetNoteDriver()); 72 static_cast<CFWL_NoteDriver*>(pApp->GetNoteDriver());
73 CFX_RectF rtWidget; 73 CFX_RectF rtWidget;
74 GetWidgetRect(rtWidget); 74 GetWidgetRect(rtWidget, false);
75 rtWidget.left = rtWidget.top = 0; 75 rtWidget.left = rtWidget.top = 0;
76 76
77 CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage); 77 CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage);
78 if (rtWidget.Contains(pMsg->m_fx, pMsg->m_fy)) { 78 if (rtWidget.Contains(pMsg->m_fx, pMsg->m_fy)) {
79 m_bLButtonDown = true; 79 m_bLButtonDown = true;
80 pDriver->SetGrab(this, true); 80 pDriver->SetGrab(this, true);
81 } else { 81 } else {
82 m_bLButtonDown = false; 82 m_bLButtonDown = false;
83 pDriver->SetGrab(this, false); 83 pDriver->SetGrab(this, false);
84 m_pComboBox->ShowDropList(false); 84 m_pComboBox->ShowDropList(false);
85 } 85 }
86 } 86 }
87 87
88 void CFWL_ComboBoxProxy::OnLButtonUp(CFWL_Message* pMessage) { 88 void CFWL_ComboBoxProxy::OnLButtonUp(CFWL_Message* pMessage) {
89 m_bLButtonDown = false; 89 m_bLButtonDown = false;
90 const CFWL_App* pApp = GetOwnerApp(); 90 const CFWL_App* pApp = GetOwnerApp();
91 if (!pApp) 91 if (!pApp)
92 return; 92 return;
93 93
94 CFWL_NoteDriver* pDriver = 94 CFWL_NoteDriver* pDriver =
95 static_cast<CFWL_NoteDriver*>(pApp->GetNoteDriver()); 95 static_cast<CFWL_NoteDriver*>(pApp->GetNoteDriver());
96 pDriver->SetGrab(this, false); 96 pDriver->SetGrab(this, false);
97 if (!m_bLButtonUpSelf) { 97 if (!m_bLButtonUpSelf) {
98 m_bLButtonUpSelf = true; 98 m_bLButtonUpSelf = true;
99 return; 99 return;
100 } 100 }
101 101
102 CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage); 102 CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage);
103 CFX_RectF rect; 103 CFX_RectF rect;
104 GetWidgetRect(rect); 104 GetWidgetRect(rect, false);
105 rect.left = rect.top = 0; 105 rect.left = rect.top = 0;
106 if (!rect.Contains(pMsg->m_fx, pMsg->m_fy) && 106 if (!rect.Contains(pMsg->m_fx, pMsg->m_fy) &&
107 m_pComboBox->IsDropListVisible()) { 107 m_pComboBox->IsDropListVisible()) {
108 m_pComboBox->ShowDropList(false); 108 m_pComboBox->ShowDropList(false);
109 } 109 }
110 } 110 }
111 111
112 void CFWL_ComboBoxProxy::OnFocusChanged(CFWL_Message* pMessage, bool bSet) { 112 void CFWL_ComboBoxProxy::OnFocusChanged(CFWL_Message* pMessage, bool bSet) {
113 if (bSet) 113 if (bSet)
114 return; 114 return;
115 115
116 CFWL_MsgKillFocus* pMsg = static_cast<CFWL_MsgKillFocus*>(pMessage); 116 CFWL_MsgKillFocus* pMsg = static_cast<CFWL_MsgKillFocus*>(pMessage);
117 if (!pMsg->m_pSetFocus) 117 if (!pMsg->m_pSetFocus)
118 m_pComboBox->ShowDropList(false); 118 m_pComboBox->ShowDropList(false);
119 } 119 }
OLDNEW
« no previous file with comments | « xfa/fwl/core/cfwl_combobox.cpp ('k') | xfa/fwl/core/cfwl_combolist.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698