CFx SDK Documentation  2022 SP0
FxUIEvent.h
Go to the documentation of this file.
1 //
2 // (C) Copyright 2005-2021 by Graebert GmbH.
3 //
4 // Permission to use, copy, modify, and distribute this software in
5 // object code form for any purpose and without fee is hereby granted,
6 // provided that the above copyright notice appears in all copies and
7 // that both that copyright notice and the limited warranty and
8 // restricted rights notice below appear in all supporting
9 // documentation.
10 //
11 // GRAEBERT PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
12 // GRAEBERT SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
13 // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. GRAEBERT GMBH
14 // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
15 // UNINTERRUPTED OR ERROR FREE.
16 
17 #pragma once
18 #include "../FxCommonFramework.h"
19 
20 #include <QtCore/QRect>
21 #include <QtGui/QRegion>
22 
28 {
29 public:
30 
34  enum Type {
35  None = 0,
36  FocusIn = 8,
37  FocusOut = 9,
38  Paint = 12,
39  Resize = 14,
40  Show = 17,
41  Hide = 18
42  };
43 
49  explicit CFxUIEvent(Type type);
50  //CFxUIEvent(const CFxUIEvent &other);
51 
53  virtual ~CFxUIEvent();
54  //CFxUIEvent &operator=(const CFxUIEvent &other);
55 
61  inline Type type() const { return static_cast<Type>(t); }
62 
63 protected:
65 
66  //...
67 };
68 
73 {
74 public:
75 
78 
81 
82  //...
83 };
84 
89 {
90 public:
91 
94 
97 
98  //...
99 };
100 
105 {
106 public:
112  explicit CFxUIPaintEvent(const QRegion& paintRegion);
113 
119  explicit CFxUIPaintEvent(const QRect &paintRect);
120 
123 
129  inline const QRect &rect() const { return m_rect; }
130 
136  inline const QRegion &region() const { return m_region; }
137 
138 protected:
139  QRect m_rect;
140  QRegion m_region;
141  bool m_erased;
142 
143  //...
144 };
145 
150 {
151 public:
159  CFxUIResizeEvent(const QSize &size, const QSize &oldSize);
160 
163 
169  inline const QSize &size() const { return s; }
170 
176  inline const QSize &oldSize()const { return olds; }
177 protected:
178  QSize s, olds;
179 
180  //...
181 };
182 
187 {
188 public:
192  enum FocusReason {
201  NoFocusReason
202  };
203 
211  explicit CFxUIFocusEvent(Type type, FocusReason reason = OtherFocusReason);
212 
215 
221  inline bool gotFocus() const { return type() == FocusIn; }
222 
228  inline bool lostFocus() const { return type() == FocusOut; }
229 
236 
237 private:
238  FocusReason m_reason;
239 
240  //...
241 };
#define COMMONUI_API
unsigned short ushort
Definition: FxQtCore.h:71
CFxUIEvent(Type type)
Type type() const
Definition: FxUIEvent.h:61
virtual ~CFxUIEvent()
ushort t
Definition: FxUIEvent.h:64
bool gotFocus() const
Definition: FxUIEvent.h:221
FocusReason reason() const
bool lostFocus() const
Definition: FxUIEvent.h:228
CFxUIFocusEvent(Type type, FocusReason reason=OtherFocusReason)
@ ActiveWindowFocusReason
Either window active or inactive.
Definition: FxUIEvent.h:196
@ MouseFocusReason
A mouse action occurred.
Definition: FxUIEvent.h:193
@ TabFocusReason
Tab key is pressed.
Definition: FxUIEvent.h:194
@ ShortcutFocusReason
The user typed a label's buddy shortcut.
Definition: FxUIEvent.h:198
@ OtherFocusReason
Another reason, usually application-specific.
Definition: FxUIEvent.h:200
@ MenuBarFocusReason
The menu bar took focus.
Definition: FxUIEvent.h:199
@ PopupFocusReason
The application opened/closed a pop-up that grabbed/released the keyboard focus.
Definition: FxUIEvent.h:197
@ BacktabFocusReason
Back Tab key is pressed.
Definition: FxUIEvent.h:195
CFxUIPaintEvent(const QRegion &paintRegion)
CFxUIPaintEvent(const QRect &paintRect)
const QRect & rect() const
Definition: FxUIEvent.h:129
const QRegion & region() const
Definition: FxUIEvent.h:136
QRegion m_region
Definition: FxUIEvent.h:140
const QSize & oldSize() const
Definition: FxUIEvent.h:176
const QSize & size() const
Definition: FxUIEvent.h:169
CFxUIResizeEvent(const QSize &size, const QSize &oldSize)
GLsizeiptr size
Definition: gles2_ext.h:182
GLuint GLsizei GLsizei GLint GLenum * type
Definition: gles2_ext.h:274