Changeset 11158 in ntrip for trunk/BNC/qwt/qwt_event_pattern.h
- Timestamp:
- Nov 3, 2026, 10:53:35 AM (3 weeks ago)
- File:
-
- 1 edited
-
trunk/BNC/qwt/qwt_event_pattern.h (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/qwt/qwt_event_pattern.h
r9383 r11158 1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*-*****************************1 /****************************************************************************** 2 2 * Qwt Widget Library 3 3 * Copyright (C) 1997 Josef Wilgen … … 9 9 10 10 #ifndef QWT_EVENT_PATTERN 11 #define QWT_EVENT_PATTERN 111 #define QWT_EVENT_PATTERN 12 12 13 13 #include "qwt_global.h" 14 14 15 #include <qnamespace.h> 15 16 #include <qvector.h> … … 19 20 20 21 /*! 21 \brief A collection of event patterns 22 23 QwtEventPattern introduces an level of indirection for mouse and 24 keyboard inputs. Those are represented by symbolic names, so 25 the application code can be configured by individual mappings. 26 27 \sa QwtPicker, QwtPickerMachine, QwtPlotZoomer 28 */ 22 \brief A collection of event patterns 23 24 QwtEventPattern introduces an level of indirection for mouse and 25 keyboard inputs. Those are represented by symbolic names, so 26 the application code can be configured by individual mappings. 27 28 \sa QwtPicker, QwtPickerMachine, QwtPlotZoomer 29 */ 29 30 class QWT_EXPORT QwtEventPattern 30 31 { 31 public: 32 public: 32 33 /*! 33 \brief Symbolic mouse input codes 34 35 QwtEventPattern implements 3 different settings for 36 mice with 1, 2, or 3 buttons that can be activated 37 using initMousePattern(). The default setting is for 38 3 button mice. 39 40 Individual settings can be configured using setMousePattern(). 41 42 \sa initMousePattern(), setMousePattern(), setKeyPattern() 43 */ 34 \brief Symbolic mouse input codes 35 36 QwtEventPattern implements 3 different settings for 37 mice with 1, 2, or 3 buttons that can be activated 38 using initMousePattern(). The default setting is for 39 3 button mice. 40 41 Individual settings can be configured using setMousePattern(). 42 43 \sa initMousePattern(), setMousePattern(), setKeyPattern() 44 */ 44 45 enum MousePatternCode 45 46 { 46 47 /*! 47 The default setting for 1, 2 and 3 button mice is: 48 49 - Qt::LeftButton 50 - Qt::LeftButton 51 - Qt::LeftButton 48 The default setting for 1, 2 and 3 button mice is: 49 50 - Qt::LeftButton 51 - Qt::LeftButton 52 - Qt::LeftButton 52 53 */ 53 54 MouseSelect1, 54 55 55 56 /*! 56 The default setting for 1, 2 and 3 button mice is: 57 58 - Qt::LeftButton + Qt::ControlModifier 59 - Qt::RightButton 60 - Qt::RightButton 57 The default setting for 1, 2 and 3 button mice is: 58 59 - Qt::LeftButton + Qt::ControlModifier 60 - Qt::RightButton 61 - Qt::RightButton 61 62 */ 62 63 MouseSelect2, 63 64 64 65 /*! 65 The default setting for 1, 2 and 3 button mice is: 66 67 - Qt::LeftButton + Qt::AltModifier 68 - Qt::LeftButton + Qt::AltModifier 69 - Qt::MidButton 66 The default setting for 1, 2 and 3 button mice is: 67 68 - Qt::LeftButton + Qt::AltModifier 69 - Qt::LeftButton + Qt::AltModifier 70 - Qt::MidButton 70 71 */ 71 72 MouseSelect3, 72 73 73 74 /*! 74 The default setting for 1, 2 and 3 button mice is: 75 76 - Qt::LeftButton + Qt::ShiftModifier 77 - Qt::LeftButton + Qt::ShiftModifier 78 - Qt::LeftButton + Qt::ShiftModifier 75 The default setting for 1, 2 and 3 button mice is: 76 77 - Qt::LeftButton + Qt::ShiftModifier 78 - Qt::LeftButton + Qt::ShiftModifier 79 - Qt::LeftButton + Qt::ShiftModifier 79 80 */ 80 81 MouseSelect4, 81 82 82 83 /*! 83 The default setting for 1, 2 and 3 button mice is: 84 85 - Qt::LeftButton + Qt::ControlButton | Qt::ShiftModifier 86 - Qt::RightButton + Qt::ShiftModifier 87 - Qt::RightButton + Qt::ShiftModifier 84 The default setting for 1, 2 and 3 button mice is: 85 86 - Qt::LeftButton + Qt::ControlButton | Qt::ShiftModifier 87 - Qt::RightButton + Qt::ShiftModifier 88 - Qt::RightButton + Qt::ShiftModifier 88 89 */ 89 90 MouseSelect5, 90 91 91 92 /*! 92 The default setting for 1, 2 and 3 button mice is: 93 94 - Qt::LeftButton + Qt::AltModifier + Qt::ShiftModifier 95 - Qt::LeftButton + Qt::AltModifier | Qt::ShiftModifier 96 - Qt::MidButton + Qt::ShiftModifier 93 The default setting for 1, 2 and 3 button mice is: 94 95 - Qt::LeftButton + Qt::AltModifier + Qt::ShiftModifier 96 - Qt::LeftButton + Qt::AltModifier | Qt::ShiftModifier 97 - Qt::MidButton + Qt::ShiftModifier 97 98 */ 98 99 MouseSelect6, … … 103 104 104 105 /*! 105 \brief Symbolic keyboard input codes 106 107 Individual settings can be configured using setKeyPattern() 108 109 \sa setKeyPattern(), setMousePattern() 110 */ 106 \brief Symbolic keyboard input codes 107 108 Individual settings can be configured using setKeyPattern() 109 110 \sa setKeyPattern(), setMousePattern() 111 */ 111 112 enum KeyPatternCode 112 113 { … … 148 149 class MousePattern 149 150 { 150 public: 151 public: 151 152 //! Constructor 152 153 MousePattern( Qt::MouseButton btn = Qt::NoButton, 153 Qt::KeyboardModifiers modifierCodes = Qt::NoModifier ):154 Qt::KeyboardModifiers modifierCodes = Qt::NoModifier ): 154 155 button( btn ), 155 156 modifiers( modifierCodes ) … … 167 168 class KeyPattern 168 169 { 169 public: 170 public: 170 171 //! Constructor 171 172 KeyPattern( int keyCode = Qt::Key_unknown, 172 Qt::KeyboardModifiers modifierCodes = Qt::NoModifier ):173 Qt::KeyboardModifiers modifierCodes = Qt::NoModifier ): 173 174 key( keyCode ), 174 175 modifiers( modifierCodes ) … … 195 196 Qt::KeyboardModifiers modifiers = Qt::NoModifier ); 196 197 197 void setMousePattern( const QVector<MousePattern >& );198 void setKeyPattern( const QVector<KeyPattern >& );199 200 const QVector<MousePattern > &mousePattern() const;201 const QVector<KeyPattern > &keyPattern() const;202 203 QVector<MousePattern > &mousePattern();204 QVector<KeyPattern > &keyPattern();205 206 bool mouseMatch( MousePatternCode, const QMouseEvent * ) const;207 bool keyMatch( KeyPatternCode, const QKeyEvent * ) const;208 209 protected: 210 virtual bool mouseMatch( const MousePattern &, const QMouseEvent* ) const;211 virtual bool keyMatch( const KeyPattern &, const QKeyEvent* ) const;212 213 private: 214 215 #if defined( _MSC_VER)198 void setMousePattern( const QVector< MousePattern >& ); 199 void setKeyPattern( const QVector< KeyPattern >& ); 200 201 const QVector< MousePattern >& mousePattern() const; 202 const QVector< KeyPattern >& keyPattern() const; 203 204 QVector< MousePattern >& mousePattern(); 205 QVector< KeyPattern >& keyPattern(); 206 207 bool mouseMatch( MousePatternCode, const QMouseEvent* ) const; 208 bool keyMatch( KeyPatternCode, const QKeyEvent* ) const; 209 210 protected: 211 virtual bool mouseMatch( const MousePattern&, const QMouseEvent* ) const; 212 virtual bool keyMatch( const KeyPattern&, const QKeyEvent* ) const; 213 214 private: 215 216 #if defined( _MSC_VER ) 216 217 #pragma warning(push) 217 218 #pragma warning(disable: 4251) 218 219 #endif 219 QVector<MousePattern > d_mousePattern;220 QVector<KeyPattern > d_keyPattern;221 #if defined( _MSC_VER)220 QVector< MousePattern > m_mousePattern; 221 QVector< KeyPattern > m_keyPattern; 222 #if defined( _MSC_VER ) 222 223 #pragma warning(pop) 223 224 #endif … … 226 227 //! Compare operator 227 228 inline bool operator==( QwtEventPattern::MousePattern b1, 228 QwtEventPattern::MousePattern b2 )229 QwtEventPattern::MousePattern b2 ) 229 230 { 230 231 return b1.button == b2.button && b1.modifiers == b2.modifiers; … … 233 234 //! Compare operator 234 235 inline bool operator==( QwtEventPattern::KeyPattern b1, 235 QwtEventPattern::KeyPattern b2 )236 QwtEventPattern::KeyPattern b2 ) 236 237 { 237 238 return b1.key == b2.key && b1.modifiers == b2.modifiers;
Note:
See TracChangeset
for help on using the changeset viewer.
