Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
cpwl_special_button.cpp
Go to the documentation of this file.
1
// Copyright 2014 The PDFium Authors
2
// 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
7
#
include
"fpdfsdk/pwl/cpwl_special_button.h"
8
9
#
include
<
utility
>
10
11
#
include
"fpdfsdk/pwl/cpwl_button.h"
12
#
include
"fpdfsdk/pwl/cpwl_wnd.h"
13
14
CPWL_PushButton::
CPWL_PushButton
(
15
const
CreateParams
& cp,
16
std::unique_ptr<IPWL_FillerNotify::PerWindowData> pAttachedData)
17
:
CPWL_Button
(cp,
std
::move(pAttachedData)) {}
18
19
CPWL_PushButton::~
CPWL_PushButton
() =
default
;
20
21
CFX_FloatRect
CPWL_PushButton::
GetFocusRect
()
const
{
22
return
GetWindowRect
().GetDeflated(
static_cast
<
float
>(
GetBorderWidth
()),
23
static_cast
<
float
>(
GetBorderWidth
()));
24
}
25
26
CPWL_CheckBox::
CPWL_CheckBox
(
27
const
CreateParams
& cp,
28
std::unique_ptr<IPWL_FillerNotify::PerWindowData> pAttachedData)
29
:
CPWL_Button
(cp,
std
::move(pAttachedData)) {}
30
31
CPWL_CheckBox::~
CPWL_CheckBox
() =
default
;
32
33
bool
CPWL_CheckBox::
OnLButtonUp
(
Mask
<FWL_EVENTFLAG> nFlag,
34
const
CFX_PointF
& point) {
35
if
(
IsReadOnly
())
36
return
false
;
37
38
SetCheck
(
!
IsChecked
(
)
)
;
39
return
true
;
40
}
41
42
bool
CPWL_CheckBox::
OnChar
(uint16_t nChar,
Mask
<FWL_EVENTFLAG> nFlag) {
43
if
(
IsReadOnly
())
44
return
false
;
45
46
SetCheck
(
!
IsChecked
(
)
)
;
47
return
true
;
48
}
49
50
CPWL_RadioButton::
CPWL_RadioButton
(
51
const
CreateParams
& cp,
52
std::unique_ptr<IPWL_FillerNotify::PerWindowData> pAttachedData)
53
:
CPWL_Button
(cp,
std
::move(pAttachedData)) {}
54
55
CPWL_RadioButton::~
CPWL_RadioButton
() =
default
;
56
57
bool
CPWL_RadioButton::
OnLButtonUp
(
Mask
<FWL_EVENTFLAG> nFlag,
58
const
CFX_PointF
& point) {
59
if
(
IsReadOnly
())
60
return
false
;
61
62
SetCheck
(
true
)
;
63
return
true
;
64
}
65
66
bool
CPWL_RadioButton::
OnChar
(uint16_t nChar,
Mask
<FWL_EVENTFLAG> nFlag) {
67
if
(
IsReadOnly
())
68
return
false
;
69
70
SetCheck
(
true
)
;
71
return
true
;
72
}
CFX_FloatRect
Definition
fx_coordinates.h:185
CPWL_Button
Definition
cpwl_button.h:15
CPWL_CheckBox::OnChar
bool OnChar(uint16_t nChar, Mask< FWL_EVENTFLAG > nFlag) override
Definition
cpwl_special_button.cpp:42
CPWL_CheckBox::~CPWL_CheckBox
~CPWL_CheckBox() override
CPWL_CheckBox::CPWL_CheckBox
CPWL_CheckBox(const CreateParams &cp, std::unique_ptr< IPWL_FillerNotify::PerWindowData > pAttachedData)
Definition
cpwl_special_button.cpp:26
CPWL_CheckBox::IsChecked
bool IsChecked() const
Definition
cpwl_special_button.h:36
CPWL_CheckBox::SetCheck
void SetCheck(bool bCheck)
Definition
cpwl_special_button.h:37
CPWL_CheckBox::OnLButtonUp
bool OnLButtonUp(Mask< FWL_EVENTFLAG > nFlag, const CFX_PointF &point) override
Definition
cpwl_special_button.cpp:33
CPWL_PushButton::GetFocusRect
CFX_FloatRect GetFocusRect() const override
Definition
cpwl_special_button.cpp:21
CPWL_PushButton::CPWL_PushButton
CPWL_PushButton(const CreateParams &cp, std::unique_ptr< IPWL_FillerNotify::PerWindowData > pAttachedData)
Definition
cpwl_special_button.cpp:14
CPWL_PushButton::~CPWL_PushButton
~CPWL_PushButton() override
CPWL_RadioButton::~CPWL_RadioButton
~CPWL_RadioButton() override
CPWL_RadioButton::SetCheck
void SetCheck(bool bCheck)
Definition
cpwl_special_button.h:55
CPWL_RadioButton::OnChar
bool OnChar(uint16_t nChar, Mask< FWL_EVENTFLAG > nFlag) override
Definition
cpwl_special_button.cpp:66
CPWL_RadioButton::CPWL_RadioButton
CPWL_RadioButton(const CreateParams &cp, std::unique_ptr< IPWL_FillerNotify::PerWindowData > pAttachedData)
Definition
cpwl_special_button.cpp:50
CPWL_RadioButton::OnLButtonUp
bool OnLButtonUp(Mask< FWL_EVENTFLAG > nFlag, const CFX_PointF &point) override
Definition
cpwl_special_button.cpp:57
CPWL_Wnd::CreateParams
Definition
cpwl_wnd.h:96
CPWL_Wnd::GetWindowRect
CFX_FloatRect GetWindowRect() const
Definition
cpwl_wnd.cpp:441
CPWL_Wnd::GetBorderWidth
int32_t GetBorderWidth() const
Definition
cpwl_wnd.cpp:483
CPWL_Wnd::IsReadOnly
bool IsReadOnly() const
Definition
cpwl_wnd.cpp:610
fxcrt::Mask
Definition
mask.h:15
CFX_PointF
CFX_PTemplate< float > CFX_PointF
Definition
fx_coordinates.h:51
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
qtwebengine
src
3rdparty
chromium
third_party
pdfium
fpdfsdk
pwl
cpwl_special_button.cpp
Generated on
for Qt by
1.18.0