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

Side by Side Diff: xfa/fwl/core/cfwl_pushbutton.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
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/cfwl_pushbutton.h" 7 #include "xfa/fwl/core/cfwl_pushbutton.h"
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 rect.Set(0, 0, 0, 0); 44 rect.Set(0, 0, 0, 0);
45 if (!m_pProperties->m_pThemeProvider) 45 if (!m_pProperties->m_pThemeProvider)
46 m_pProperties->m_pThemeProvider = GetAvailableTheme(); 46 m_pProperties->m_pThemeProvider = GetAvailableTheme();
47 47
48 FX_FLOAT* fcaption = 48 FX_FLOAT* fcaption =
49 static_cast<FX_FLOAT*>(GetThemeCapacity(CFWL_WidgetCapacity::Margin)); 49 static_cast<FX_FLOAT*>(GetThemeCapacity(CFWL_WidgetCapacity::Margin));
50 rect.Inflate(*fcaption, *fcaption); 50 rect.Inflate(*fcaption, *fcaption);
51 CFWL_Widget::GetWidgetRect(rect, true); 51 CFWL_Widget::GetWidgetRect(rect, true);
52 } 52 }
53 53
54 void CFWL_PushButton::SetStates(uint32_t dwStates, bool bSet) { 54 void CFWL_PushButton::SetStates(uint32_t dwStates) {
Tom Sepez 2016/12/06 22:38:26 sure this never got called as false?
dsinclair 2016/12/07 15:03:27 That call would have been changed to a RemoveState
55 if ((dwStates & FWL_WGTSTATE_Disabled) && bSet) { 55 if (dwStates & FWL_WGTSTATE_Disabled) {
56 m_pProperties->m_dwStates = FWL_WGTSTATE_Disabled; 56 m_pProperties->m_dwStates = FWL_WGTSTATE_Disabled;
57 return; 57 return;
58 } 58 }
59 CFWL_Widget::SetStates(dwStates, bSet); 59 CFWL_Widget::SetStates(dwStates);
60 } 60 }
61 61
62 void CFWL_PushButton::Update() { 62 void CFWL_PushButton::Update() {
63 if (IsLocked()) 63 if (IsLocked())
64 return; 64 return;
65 if (!m_pProperties->m_pThemeProvider) 65 if (!m_pProperties->m_pThemeProvider)
66 m_pProperties->m_pThemeProvider = GetAvailableTheme(); 66 m_pProperties->m_pThemeProvider = GetAvailableTheme();
67 67
68 UpdateTextOutStyles(); 68 UpdateTextOutStyles();
69 GetClientRect(m_rtClient); 69 GetClientRect(m_rtClient);
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 return; 301 return;
302 302
303 CFWL_EvtMouse wmMouse; 303 CFWL_EvtMouse wmMouse;
304 wmMouse.m_pSrcTarget = this; 304 wmMouse.m_pSrcTarget = this;
305 wmMouse.m_dwCmd = FWL_MouseCommand::LeftButtonUp; 305 wmMouse.m_dwCmd = FWL_MouseCommand::LeftButtonUp;
306 DispatchEvent(&wmMouse); 306 DispatchEvent(&wmMouse);
307 CFWL_Event wmClick(CFWL_EventType::Click); 307 CFWL_Event wmClick(CFWL_EventType::Click);
308 wmClick.m_pSrcTarget = this; 308 wmClick.m_pSrcTarget = this;
309 DispatchEvent(&wmClick); 309 DispatchEvent(&wmClick);
310 } 310 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698