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_cblistbox.cpp
Go to the documentation of this file.
1
// Copyright 2020 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_cblistbox.h"
8
9
#
include
<
utility
>
10
11
#
include
"core/fxcrt/notreached.h"
12
#
include
"fpdfsdk/pwl/cpwl_combo_box.h"
13
#
include
"fpdfsdk/pwl/cpwl_list_ctrl.h"
14
#
include
"public/fpdf_fwlevent.h"
15
16
CPWL_CBListBox::
CPWL_CBListBox
(
17
const
CreateParams
& cp,
18
std::unique_ptr<IPWL_FillerNotify::PerWindowData> pAttachedData)
19
:
CPWL_ListBox
(cp,
std
::move(pAttachedData)) {}
20
21
CPWL_CBListBox::~
CPWL_CBListBox
() =
default
;
22
23
bool
CPWL_CBListBox::
OnLButtonUp
(
Mask
<FWL_EVENTFLAG> nFlag,
24
const
CFX_PointF
& point) {
25
CPWL_Wnd
::
OnLButtonUp
(
nFlag
,
point
)
;
26
27
if
(!m_bMouseDown)
28
return
true
;
29
30
ReleaseCapture
();
31
m_bMouseDown =
false
;
32
33
if
(!
ClientHitTest
(point))
34
return
true
;
35
if
(
CPWL_Wnd
* pParent =
GetParentWindow
())
36
pParent
->
NotifyLButtonUp
(
this
, point);
37
38
return
!
OnNotifySelectionChanged
(
false
,
nFlag
)
;
39
}
40
41
bool
CPWL_CBListBox::
IsMovementKey
(FWL_VKEYCODE nKeyCode)
const
{
42
switch
(nKeyCode) {
43
case
FWL_VKEY_Up
:
44
case
FWL_VKEY_Down
:
45
case
FWL_VKEY_Home
:
46
case
FWL_VKEY_Left
:
47
case
FWL_VKEY_End
:
48
case
FWL_VKEY_Right
:
49
return
true
;
50
default
:
51
return
false
;
52
}
53
}
54
55
bool
CPWL_CBListBox::
OnMovementKeyDown
(FWL_VKEYCODE nKeyCode,
56
Mask
<FWL_EVENTFLAG> nFlag) {
57
switch
(nKeyCode) {
58
case
FWL_VKEY_Up:
59
m_pListCtrl->OnVK_UP(IsSHIFTKeyDown(nFlag), IsCTRLKeyDown(nFlag));
60
break
;
61
case
FWL_VKEY_Down:
62
m_pListCtrl->OnVK_DOWN(IsSHIFTKeyDown(nFlag), IsCTRLKeyDown(nFlag));
63
break
;
64
case
FWL_VKEY_Home:
65
m_pListCtrl->OnVK_HOME(IsSHIFTKeyDown(nFlag), IsCTRLKeyDown(nFlag));
66
break
;
67
case
FWL_VKEY_Left:
68
m_pListCtrl->OnVK_LEFT(IsSHIFTKeyDown(nFlag), IsCTRLKeyDown(nFlag));
69
break
;
70
case
FWL_VKEY_End:
71
m_pListCtrl->OnVK_END(IsSHIFTKeyDown(nFlag), IsCTRLKeyDown(nFlag));
72
break
;
73
case
FWL_VKEY_Right:
74
m_pListCtrl->OnVK_RIGHT(IsSHIFTKeyDown(nFlag), IsCTRLKeyDown(nFlag));
75
break
;
76
default
:
77
NOTREACHED_NORETURN
();
78
}
79
return
OnNotifySelectionChanged
(
true
,
nFlag
)
;
80
}
81
82
bool
CPWL_CBListBox::
IsChar
(uint16_t nChar,
Mask
<FWL_EVENTFLAG> nFlag)
const
{
83
return
m_pListCtrl->OnChar(nChar, IsSHIFTKeyDown(nFlag),
84
IsCTRLKeyDown(nFlag));
85
}
86
87
bool
CPWL_CBListBox::
OnCharNotify
(uint16_t nChar,
Mask
<FWL_EVENTFLAG> nFlag) {
88
if
(
auto
* pComboBox =
static_cast
<CPWL_ComboBox*>(GetParentWindow()))
89
pComboBox->SetSelectText();
90
91
return
OnNotifySelectionChanged
(
true
,
nFlag
)
;
92
}
CPWL_CBListBox::OnCharNotify
bool OnCharNotify(uint16_t nChar, Mask< FWL_EVENTFLAG > nFlag)
Definition
cpwl_cblistbox.cpp:87
CPWL_CBListBox::CPWL_CBListBox
CPWL_CBListBox(const CreateParams &cp, std::unique_ptr< IPWL_FillerNotify::PerWindowData > pAttachedData)
Definition
cpwl_cblistbox.cpp:16
CPWL_CBListBox::OnMovementKeyDown
bool OnMovementKeyDown(FWL_VKEYCODE nKeyCode, Mask< FWL_EVENTFLAG > nFlag)
Definition
cpwl_cblistbox.cpp:55
CPWL_CBListBox::IsChar
bool IsChar(uint16_t nChar, Mask< FWL_EVENTFLAG > nFlag) const
Definition
cpwl_cblistbox.cpp:82
CPWL_CBListBox::IsMovementKey
bool IsMovementKey(FWL_VKEYCODE nKeyCode) const
Definition
cpwl_cblistbox.cpp:41
CPWL_CBListBox::~CPWL_CBListBox
~CPWL_CBListBox() override
CPWL_CBListBox::OnLButtonUp
bool OnLButtonUp(Mask< FWL_EVENTFLAG > nFlag, const CFX_PointF &point) override
Definition
cpwl_cblistbox.cpp:23
CPWL_ListBox
Definition
cpwl_list_box.h:18
CPWL_ListBox::OnNotifySelectionChanged
bool OnNotifySelectionChanged(bool bKeyDown, Mask< FWL_EVENTFLAG > nFlag)
Definition
cpwl_list_box.cpp:206
CPWL_Wnd::CreateParams
Definition
cpwl_wnd.h:96
CPWL_Wnd
Definition
cpwl_wnd.h:77
CPWL_Wnd::ClientHitTest
bool ClientHitTest(const CFX_PointF &point) const
Definition
cpwl_wnd.cpp:572
CPWL_Wnd::ReleaseCapture
void ReleaseCapture()
Definition
cpwl_wnd.cpp:525
CPWL_Wnd::GetParentWindow
CPWL_Wnd * GetParentWindow() const
Definition
cpwl_wnd.h:249
CPWL_Wnd::OnLButtonUp
virtual bool OnLButtonUp(Mask< FWL_EVENTFLAG > nFlag, const CFX_PointF &point)
CPWL_Wnd::NotifyLButtonUp
virtual void NotifyLButtonUp(CPWL_Wnd *child, const CFX_PointF &pos)
Definition
cpwl_wnd.cpp:437
fxcrt::Mask
Definition
mask.h:15
FWL_VKEY_End
@ FWL_VKEY_End
Definition
fpdf_fwlevent.h:56
FWL_VKEY_Right
@ FWL_VKEY_Right
Definition
fpdf_fwlevent.h:60
FWL_VKEY_Up
@ FWL_VKEY_Up
Definition
fpdf_fwlevent.h:59
FWL_VKEY_Home
@ FWL_VKEY_Home
Definition
fpdf_fwlevent.h:57
FWL_VKEY_Down
@ FWL_VKEY_Down
Definition
fpdf_fwlevent.h:61
FWL_VKEY_Left
@ FWL_VKEY_Left
Definition
fpdf_fwlevent.h:58
CFX_PointF
CFX_PTemplate< float > CFX_PointF
Definition
fx_coordinates.h:51
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
NOTREACHED_NORETURN
#define NOTREACHED_NORETURN()
Definition
notreached.h:22
qtwebengine
src
3rdparty
chromium
third_party
pdfium
fpdfsdk
pwl
cpwl_cblistbox.cpp
Generated on
for Qt by
1.18.0