Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
cfwl_comboedit.cpp
Go to the documentation of this file.
1
// Copyright 2016 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
"xfa/fwl/cfwl_comboedit.h"
8
9
#
include
"xfa/fde/cfde_texteditengine.h"
10
#
include
"xfa/fwl/cfwl_combobox.h"
11
#
include
"xfa/fwl/cfwl_messagemouse.h"
12
13
CFWL_ComboEdit::CFWL_ComboEdit(CFWL_App* app,
14
const
Properties
& properties,
15
CFWL_Widget
* pOuter)
16
:
CFWL_Edit
(
app
,
properties
,
pOuter
)
{}
17
18
CFWL_ComboEdit::~
CFWL_ComboEdit
() =
default
;
19
20
void
CFWL_ComboEdit::
ClearSelected
() {
21
ClearSelection
();
22
RepaintRect
(
GetRTClient
()
)
;
23
}
24
25
void
CFWL_ComboEdit::
SetSelected
() {
26
m_Properties
.
m_dwStates
|=
FWL_STATE_WGT_Focused
;
27
SelectAll
();
28
}
29
30
void
CFWL_ComboEdit::
OnProcessMessage
(
CFWL_Message
* pMessage) {
31
bool
backDefault =
true
;
32
switch
(pMessage
->
GetType
(
)
) {
33
case
CFWL_Message
::
Type
::
kSetFocus
: {
34
m_Properties
.
m_dwStates
|=
FWL_STATE_WGT_Focused
;
35
backDefault =
false
;
36
break
;
37
}
38
case
CFWL_Message
::
Type
::
kKillFocus
: {
39
m_Properties
.
m_dwStates
&= ~
FWL_STATE_WGT_Focused
;
40
backDefault =
false
;
41
break
;
42
}
43
case
CFWL_Message
::
Type
::
kMouse
: {
44
CFWL_MessageMouse* pMsg =
static_cast
<CFWL_MessageMouse*>(pMessage);
45
if
((pMsg
->
m_dwCmd
== CFWL_MessageMouse
::
MouseCommand
::
kLeftButtonDown
) &&
46
((
m_Properties
.
m_dwStates
&
FWL_STATE_WGT_Focused
) == 0)) {
47
SetSelected
(
)
;
48
}
49
break
;
50
}
51
default
:
52
break
;
53
}
54
if
(backDefault)
55
CFWL_Edit
::
OnProcessMessage
(pMessage);
56
}
FWL_STATE_WGT_Focused
#define FWL_STATE_WGT_Focused
Definition
cfwl_widget.h:42
CFWL_ComboEdit::ClearSelected
void ClearSelected()
Definition
cfwl_comboedit.cpp:20
CFWL_ComboEdit::SetSelected
void SetSelected()
Definition
cfwl_comboedit.cpp:25
CFWL_ComboEdit::OnProcessMessage
void OnProcessMessage(CFWL_Message *pMessage) override
Definition
cfwl_comboedit.cpp:30
CFWL_ComboEdit::~CFWL_ComboEdit
~CFWL_ComboEdit() override
CFWL_Edit
Definition
cfwl_edit.h:46
CFWL_Edit::GetRTClient
const CFX_RectF & GetRTClient() const
Definition
cfwl_edit.h:105
CFWL_Edit::OnProcessMessage
void OnProcessMessage(CFWL_Message *pMessage) override
Definition
cfwl_edit.cpp:785
CFWL_Edit::ClearSelection
void ClearSelection()
Definition
cfwl_edit.cpp:184
CFWL_Edit::CFWL_Edit
CFWL_Edit(CFWL_App *app, const Properties &properties, CFWL_Widget *pOuter)
Definition
cfwl_edit.cpp:50
CFWL_Edit::SelectAll
void SelectAll()
Definition
cfwl_edit.cpp:172
CFWL_MessageMouse::m_dwCmd
const MouseCommand m_dwCmd
Definition
cfwl_messagemouse.h:36
CFWL_MessageMouse::MouseCommand
MouseCommand
Definition
cfwl_messagemouse.h:17
CFWL_MessageMouse::MouseCommand::kLeftButtonDown
@ kLeftButtonDown
CFWL_Message
Definition
cfwl_message.h:16
CFWL_Message::Type
Type
Definition
cfwl_message.h:20
CFWL_Message::Type::kKillFocus
@ kKillFocus
CFWL_Message::Type::kSetFocus
@ kSetFocus
CFWL_Message::Type::kMouse
@ kMouse
CFWL_Message::GetType
Type GetType() const
Definition
cfwl_message.h:24
CFWL_Widget::Properties
Definition
cfwl_widget.h:80
CFWL_Widget::Properties::m_dwStates
uint32_t m_dwStates
Definition
cfwl_widget.h:84
CFWL_Widget
Definition
cfwl_widget.h:68
CFWL_Widget::m_Properties
Properties m_Properties
Definition
cfwl_widget.h:179
CFWL_Widget::RepaintRect
void RepaintRect(const CFX_RectF &pRect)
Definition
cfwl_widget.cpp:275
qtwebengine
src
3rdparty
chromium
third_party
pdfium
xfa
fwl
cfwl_comboedit.cpp
Generated on Thu Nov 14 2024 01:04:19 for Qt by
1.12.0