MouseEvent.h
1 //##################################################################################################
2 //
3 // Ceetron Desktop Components
4 // Component: Visualization
5 //
6 // --------------------------------------------------------------------------------------------
7 // Copyright (C) 2011, Ceetron AS
8 // This is UNPUBLISHED PROPRIETARY SOURCE CODE of Ceetron AS. The contents of this file may
9 // not be disclosed to third parties, copied or duplicated in any form, in whole or in part,
10 // without the prior written permission of Ceetron AS.
11 //##################################################################################################
12 
13 #pragma once
14 
15 #include "CeeVisualization/Base.h"
16 
17 namespace cee {
18 namespace vis {
19 
20 
22 {
23  NoButton = 0x00000000,
24  LeftButton = 0x00000001,
25  RightButton = 0x00000002,
26  MiddleButton = 0x00000004
27 };
28 
29 typedef int MouseButtons;
30 
31 
33 {
34  NoModifier = 0x00000000,
35  ShiftModifier = 0x00000010,
36  ControlModifier = 0x00000020
37 };
38 
39 typedef int KeyboardModifiers;
40 
41 
42 //==================================================================================================
43 //
44 // Mouse event
45 //
46 //==================================================================================================
47 class CEE_VIS_EXPORT MouseEvent
48 {
49 public:
50  MouseEvent(int x, int y, MouseButtons buttonsDown, KeyboardModifiers modifiersDown);
51  virtual ~MouseEvent();
52 
53  int x() const; // In OpenGL style coordinates with origin in lower left corner
54  int y() const; // In OpenGL style coordinates with origin in lower left corner
55  MouseButtons buttons() const;
56  KeyboardModifiers modifiers() const;
57 
58 private:
59  int m_x; // In OpenGL style coordinates with origin in lower left corner
60  int m_y; // In OpenGL style coordinates with origin in lower left corner
61  MouseButtons m_mouseButtonsDown; // Combination of mouse buttons that are down
62  KeyboardModifiers m_keyboardModifiersDown; // Combination of modifier keys that are down.
63 };
64 
65 } // namespace vis
66 } // namespace cee
Namespace cee contains all functionality and structures under the Core component. ...
Definition: AppComponent.cpp:26
Mouse event.
Definition: MouseEvent.h:47
KeyboardModifier
List of keyboard modifiers.
Definition: MouseEvent.h:32
Control key.
Definition: MouseEvent.h:36
Left mouse button.
Definition: MouseEvent.h:24
Middle mouse button.
Definition: MouseEvent.h:26
int MouseButtons
Mouse button state. The button state is a combination of LeftButton, RightButton and MiddleButton usi...
Definition: MouseEvent.h:29
No keyboard modifier.
Definition: MouseEvent.h:34
No mouse button.
Definition: MouseEvent.h:23
Shift key.
Definition: MouseEvent.h:35
MouseButton
List of mouse buttons states.
Definition: MouseEvent.h:21
Right mouse button.
Definition: MouseEvent.h:25
int KeyboardModifiers
Keyboard modifier state. The modifier state is a combination of ShiftModifier and ControlModifier usi...
Definition: MouseEvent.h:39