blob: 6e864db92b2d4db13510b0bd686ae5610b722539 [file] [log] [blame]
K. Moon832a6942022-10-31 20:11:31 +00001// Copyright 2014 The PDFium Authors
Tom Sepez99ffdb02016-01-26 14:51:21 -08002// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
dsinclair447b1f32016-12-08 10:06:32 -08007#include "xfa/fwl/cfwl_picturebox.h"
Dan Sinclaire73c5ce2016-02-25 13:38:37 -05008
Tom Sepez0a9d9742020-09-01 21:40:52 +00009CFWL_PictureBox::CFWL_PictureBox(CFWL_App* app)
Tom Sepez5f4456e2020-08-14 20:22:02 +000010 : CFWL_Widget(app, CFWL_Widget::Properties(), nullptr) {}
weili4ce94e12016-06-18 06:21:57 -070011
Lei Zhang0e744a22020-06-02 00:44:28 +000012CFWL_PictureBox::~CFWL_PictureBox() = default;
dsinclaireb3f68c2016-11-07 10:28:47 -080013
dsinclair2c489cc2016-11-23 16:17:20 -080014FWL_Type CFWL_PictureBox::GetClassID() const {
15 return FWL_Type::PictureBox;
dsinclaireb3f68c2016-11-07 10:28:47 -080016}
17
dsinclair2c489cc2016-11-23 16:17:20 -080018void CFWL_PictureBox::Update() {
19 if (IsLocked())
20 return;
dsinclair2c489cc2016-11-23 16:17:20 -080021
Tom Sepezc43d5f22020-05-06 22:47:51 +000022 m_ClientRect = GetClientRect();
dsinclair2c489cc2016-11-23 16:17:20 -080023}
24
Tom Sepez45eae7b2020-10-13 22:50:53 +000025void CFWL_PictureBox::DrawWidget(CFGAS_GEGraphics* pGraphics,
Lei Zhang4b472142017-08-17 14:30:08 -070026 const CFX_Matrix& matrix) {
dsinclair2c489cc2016-11-23 16:17:20 -080027 if (!pGraphics)
28 return;
dsinclair2c489cc2016-11-23 16:17:20 -080029
dsinclair2c489cc2016-11-23 16:17:20 -080030 if (HasBorder())
Lei Zhang58842d12021-06-05 01:38:48 +000031 DrawBorder(pGraphics, CFWL_ThemePart::Part::kBorder, matrix);
dsinclair2c489cc2016-11-23 16:17:20 -080032}
33
Tom Sepez45eae7b2020-10-13 22:50:53 +000034void CFWL_PictureBox::OnDrawWidget(CFGAS_GEGraphics* pGraphics,
Lei Zhang4b472142017-08-17 14:30:08 -070035 const CFX_Matrix& matrix) {
36 DrawWidget(pGraphics, matrix);
dsinclair2c489cc2016-11-23 16:17:20 -080037}