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

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

Issue 2555253002: Split CFWL_Widget::GetWidgetRect into two parts (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 | « no previous file | xfa/fwl/core/cfwl_combobox.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 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_checkbox.h" 7 #include "xfa/fwl/core/cfwl_checkbox.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 return; 63 return;
64 64
65 CFX_SizeF sz = CalcTextSize( 65 CFX_SizeF sz = CalcTextSize(
66 L"Check box", m_pProperties->m_pThemeProvider, 66 L"Check box", m_pProperties->m_pThemeProvider,
67 !!(m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CKB_MultiLine)); 67 !!(m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CKB_MultiLine));
68 rect.Set(0, 0, sz.x, sz.y); 68 rect.Set(0, 0, sz.x, sz.y);
69 rect.Inflate(kCaptionMargin, kCaptionMargin); 69 rect.Inflate(kCaptionMargin, kCaptionMargin);
70 70
71 rect.width += m_fBoxHeight; 71 rect.width += m_fBoxHeight;
72 rect.height = std::max(rect.height, m_fBoxHeight); 72 rect.height = std::max(rect.height, m_fBoxHeight);
73 CFWL_Widget::GetWidgetRect(rect, true); 73 InflateWidgetRect(rect);
74 } 74 }
75 75
76 void CFWL_CheckBox::Update() { 76 void CFWL_CheckBox::Update() {
77 if (IsLocked()) 77 if (IsLocked())
78 return; 78 return;
79 if (!m_pProperties->m_pThemeProvider) 79 if (!m_pProperties->m_pThemeProvider)
80 m_pProperties->m_pThemeProvider = GetAvailableTheme(); 80 m_pProperties->m_pThemeProvider = GetAvailableTheme();
81 81
82 UpdateTextOutStyles(); 82 UpdateTextOutStyles();
83 Layout(); 83 Layout();
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 } 473 }
474 474
475 void CFWL_CheckBox::OnKeyDown(CFWL_MsgKey* pMsg) { 475 void CFWL_CheckBox::OnKeyDown(CFWL_MsgKey* pMsg) {
476 if (pMsg->m_dwKeyCode == FWL_VKEY_Tab) 476 if (pMsg->m_dwKeyCode == FWL_VKEY_Tab)
477 return; 477 return;
478 if (pMsg->m_dwKeyCode == FWL_VKEY_Return || 478 if (pMsg->m_dwKeyCode == FWL_VKEY_Return ||
479 pMsg->m_dwKeyCode == FWL_VKEY_Space) { 479 pMsg->m_dwKeyCode == FWL_VKEY_Space) {
480 NextStates(); 480 NextStates();
481 } 481 }
482 } 482 }
OLDNEW
« no previous file with comments | « no previous file | xfa/fwl/core/cfwl_combobox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698