bWidgets
Core widget toolkit designed for Blender
bwEvent.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
bwDistance.h
"
4
#include "
bwPoint.h
"
5
6
namespace
bWidgets
{
7
8
class
bwEvent
{
9
public
:
10
bwEvent
(
bwPoint
_location);
11
virtual
~bwEvent
() =
default
;
12
13
void
swallow
();
14
void
unswallow
();
15
auto
isSwallowed
() const ->
bool
;
16
18
const
bwPoint
location
;
19
20
private:
21
bool
is_swallowed{
false
};
22
};
23
24
class
bwMouseButtonEvent
:
public
bwEvent
{
25
public
:
26
enum class
Button
{
27
LEFT
,
28
RIGHT
,
29
WHEEL,
30
31
UNKNOWN
32
};
33
34
bwMouseButtonEvent
(
Button
_button,
bwPoint
_location);
35
36
const
Button
button
;
37
};
38
39
class
bwMouseButtonDragEvent
:
public
bwMouseButtonEvent
{
40
public
:
41
enum
DragState
{
42
DRAGGING_BELOW_THRESHOLD
,
43
DRAGGING
,
44
};
45
46
bwMouseButtonDragEvent
(
Button
_button,
bwPoint
_location);
47
48
void
addMouseMovement
(
bwPoint
new_location);
49
50
const
static
short
DRAG_THRESHOLD
= 3;
51
52
bwDistance
drag_distance
;
53
DragState
drag_state
;
54
};
55
56
class
bwMouseWheelEvent
:
public
bwMouseButtonEvent
{
57
public
:
58
enum class
Direction
{
UP
,
DOWN
};
59
60
bwMouseWheelEvent
(
Direction
_direction,
bwPoint
_location);
61
62
auto
getDirection
() const ->
Direction
;
63
64
private:
65
Direction
direction;
66
};
67
68
}
// namespace bWidgets
bwDistance.h
bwPoint.h
bWidgets::bwEvent
Definition:
bwEvent.h:8
bWidgets::bwEvent::swallow
void swallow()
Definition:
bwEvent.cc:9
bWidgets::bwEvent::bwEvent
bwEvent(bwPoint _location)
Definition:
bwEvent.cc:5
bWidgets::bwEvent::isSwallowed
auto isSwallowed() const -> bool
Definition:
bwEvent.cc:19
bWidgets::bwEvent::unswallow
void unswallow()
Definition:
bwEvent.cc:14
bWidgets::bwEvent::~bwEvent
virtual ~bwEvent()=default
bWidgets::bwEvent::location
const bwPoint location
Definition:
bwEvent.h:18
bWidgets::bwMouseButtonDragEvent
Definition:
bwEvent.h:39
bWidgets::bwMouseButtonDragEvent::drag_state
DragState drag_state
Definition:
bwEvent.h:53
bWidgets::bwMouseButtonDragEvent::bwMouseButtonDragEvent
bwMouseButtonDragEvent(Button _button, bwPoint _location)
Definition:
bwEvent.cc:29
bWidgets::bwMouseButtonDragEvent::DRAG_THRESHOLD
static const short DRAG_THRESHOLD
Definition:
bwEvent.h:50
bWidgets::bwMouseButtonDragEvent::addMouseMovement
void addMouseMovement(bwPoint new_location)
Definition:
bwEvent.cc:34
bWidgets::bwMouseButtonDragEvent::drag_distance
bwDistance drag_distance
Definition:
bwEvent.h:52
bWidgets::bwMouseButtonDragEvent::DragState
DragState
Definition:
bwEvent.h:41
bWidgets::bwMouseButtonDragEvent::DRAGGING_BELOW_THRESHOLD
@ DRAGGING_BELOW_THRESHOLD
Definition:
bwEvent.h:42
bWidgets::bwMouseButtonDragEvent::DRAGGING
@ DRAGGING
Definition:
bwEvent.h:43
bWidgets::bwMouseButtonEvent
Definition:
bwEvent.h:24
bWidgets::bwMouseButtonEvent::Button
Button
Definition:
bwEvent.h:26
bWidgets::bwMouseButtonEvent::bwMouseButtonEvent
bwMouseButtonEvent(Button _button, bwPoint _location)
Definition:
bwEvent.cc:24
bWidgets::bwMouseButtonEvent::button
const Button button
Definition:
bwEvent.h:36
bWidgets::bwMouseWheelEvent
Definition:
bwEvent.h:56
bWidgets::bwMouseWheelEvent::Direction
Direction
Definition:
bwEvent.h:58
bWidgets::bwMouseWheelEvent::getDirection
auto getDirection() const -> Direction
Definition:
bwEvent.cc:49
bWidgets::bwMouseWheelEvent::bwMouseWheelEvent
bwMouseWheelEvent(Direction _direction, bwPoint _location)
Definition:
bwEvent.cc:44
bWidgets::bwPoint
Definition:
bwPoint.h:7
bWidgets
Definition:
bwContext.h:3
bWidgets::Direction
Direction
Definition:
bwPainter.h:33
bWidgets::Direction::DOWN
@ DOWN
bWidgets::Direction::UP
@ UP
bWidgets::TextAlignment::RIGHT
@ RIGHT
bWidgets::TextAlignment::LEFT
@ LEFT
bwidgets
bwEvent.h
Generated by
1.9.3