Index: trunk/BNC/qwt/qwt_event_pattern.h
===================================================================
--- trunk/BNC/qwt/qwt_event_pattern.h	(revision 4271)
+++ trunk/BNC/qwt/qwt_event_pattern.h	(revision 8127)
@@ -33,58 +33,70 @@
       \brief Symbolic mouse input codes
 
-      The default initialization for 3 button mice is:
-      - MouseSelect1\n
-        Qt::LeftButton
-      - MouseSelect2\n
-        Qt::RightButton
-      - MouseSelect3\n
-        Qt::MidButton
-      - MouseSelect4\n
-        Qt::LeftButton + Qt::ShiftButton
-      - MouseSelect5\n
-        Qt::RightButton + Qt::ShiftButton
-      - MouseSelect6\n
-        Qt::MidButton + Qt::ShiftButton
-
-      The default initialization for 2 button mice is:
-      - MouseSelect1\n
-        Qt::LeftButton
-      - MouseSelect2\n
-        Qt::RightButton
-      - MouseSelect3\n
-        Qt::LeftButton + Qt::AltButton
-      - MouseSelect4\n
-        Qt::LeftButton + Qt::ShiftButton
-      - MouseSelect5\n
-        Qt::RightButton + Qt::ShiftButton
-      - MouseSelect6\n
-        Qt::LeftButton + Qt::AltButton + Qt::ShiftButton
-
-      The default initialization for 1 button mice is:
-      - MouseSelect1\n
-        Qt::LeftButton
-      - MouseSelect2\n
-        Qt::LeftButton + Qt::ControlButton
-      - MouseSelect3\n
-        Qt::LeftButton + Qt::AltButton
-      - MouseSelect4\n
-        Qt::LeftButton + Qt::ShiftButton
-      - MouseSelect5\n
-        Qt::LeftButton + Qt::ControlButton + Qt::ShiftButton
-      - MouseSelect6\n
-        Qt::LeftButton + Qt::AltButton + Qt::ShiftButton
-
-      \sa initMousePattern()
+      QwtEventPattern implements 3 different settings for
+      mice with 1, 2, or 3 buttons that can be activated
+      using initMousePattern(). The default setting is for
+      3 button mice.
+
+      Individual settings can be configured using setMousePattern().
+
+      \sa initMousePattern(), setMousePattern(), setKeyPattern()
     */
-
     enum MousePatternCode
     {
+        /*! 
+          The default setting for 1, 2 and 3 button mice is:
+
+          - Qt::LeftButton 
+          - Qt::LeftButton 
+          - Qt::LeftButton 
+         */
         MouseSelect1,
+
+        /*!
+          The default setting for 1, 2 and 3 button mice is:
+
+          - Qt::LeftButton + Qt::ControlModifier
+          - Qt::RightButton
+          - Qt::RightButton
+         */
         MouseSelect2,
+
+        /*!
+          The default setting for 1, 2 and 3 button mice is:
+
+          - Qt::LeftButton + Qt::AltModifier
+          - Qt::LeftButton + Qt::AltModifier
+          - Qt::MidButton
+         */
         MouseSelect3,
+
+        /*!
+          The default setting for 1, 2 and 3 button mice is:
+
+          - Qt::LeftButton + Qt::ShiftModifier
+          - Qt::LeftButton + Qt::ShiftModifier
+          - Qt::LeftButton + Qt::ShiftModifier
+         */
         MouseSelect4,
+
+        /*!
+          The default setting for 1, 2 and 3 button mice is:
+
+          - Qt::LeftButton + Qt::ControlButton | Qt::ShiftModifier
+          - Qt::RightButton + Qt::ShiftModifier
+          - Qt::RightButton + Qt::ShiftModifier
+         */
         MouseSelect5,
+
+        /*!
+          The default setting for 1, 2 and 3 button mice is:
+
+          - Qt::LeftButton + Qt::AltModifier + Qt::ShiftModifier
+          - Qt::LeftButton + Qt::AltModifier | Qt::ShiftModifier
+          - Qt::MidButton + Qt::ShiftModifier
+         */
         MouseSelect6,
 
+        //! Number of mouse patterns
         MousePatternCount
     };
@@ -93,43 +105,41 @@
       \brief Symbolic keyboard input codes
 
-      Default initialization:
-      - KeySelect1\n
-        Qt::Key_Return
-      - KeySelect2\n
-        Qt::Key_Space
-      - KeyAbort\n
-        Qt::Key_Escape
-
-      - KeyLeft\n
-        Qt::Key_Left
-      - KeyRight\n
-        Qt::Key_Right
-      - KeyUp\n
-        Qt::Key_Up
-      - KeyDown\n
-        Qt::Key_Down
-
-      - KeyUndo\n
-        Qt::Key_Minus
-      - KeyRedo\n
-        Qt::Key_Plus
-      - KeyHome\n
-        Qt::Key_Escape
+      Individual settings can be configured using setKeyPattern()
+
+      \sa setKeyPattern(), setMousePattern()
     */
     enum KeyPatternCode
     {
+        //! Qt::Key_Return
         KeySelect1,
+
+        //! Qt::Key_Space
         KeySelect2,
+
+        //! Qt::Key_Escape
         KeyAbort,
 
+        //! Qt::Key_Left
         KeyLeft,
+
+        //! Qt::Key_Right
         KeyRight,
+
+        //! Qt::Key_Up
         KeyUp,
+
+        //! Qt::Key_Down
         KeyDown,
 
+        //! Qt::Key_Plus
         KeyRedo,
+
+        //! Qt::Key_Minus
         KeyUndo,
+
+        //! Qt::Key_Escape
         KeyHome,
 
+        //! Number of key patterns
         KeyPatternCount
     };
@@ -140,15 +150,16 @@
     public:
         //! Constructor
-        MousePattern( int btn = Qt::NoButton, int st = Qt::NoButton )
+        MousePattern( Qt::MouseButton btn = Qt::NoButton, 
+                Qt::KeyboardModifiers modifierCodes = Qt::NoModifier ):
+            button( btn ),
+            modifiers( modifierCodes )
         {
-            button = btn;
-            state = st;
         }
 
-        //! Button code
-        int button;
-
-        //! State
-        int state;
+        //! Button 
+        Qt::MouseButton button;
+
+        //! Keyboard modifier
+        Qt::KeyboardModifiers modifiers;
     };
 
@@ -158,8 +169,9 @@
     public:
         //! Constructor
-        KeyPattern( int k = 0, int st = Qt::NoButton )
+        KeyPattern( int keyCode = Qt::Key_unknown, 
+                Qt::KeyboardModifiers modifierCodes = Qt::NoModifier ):
+            key( keyCode ),
+            modifiers( modifierCodes )
         {
-            key = k;
-            state = st;
         }
 
@@ -167,6 +179,6 @@
         int key;
 
-        //! State
-        int state;
+        //! Modifiers
+        Qt::KeyboardModifiers modifiers;
     };
 
@@ -177,6 +189,9 @@
     void initKeyPattern();
 
-    void setMousePattern( uint pattern, int button, int state = Qt::NoButton );
-    void setKeyPattern( uint pattern, int key, int state = Qt::NoButton );
+    void setMousePattern( MousePatternCode, Qt::MouseButton button, 
+        Qt::KeyboardModifiers = Qt::NoModifier );
+
+    void setKeyPattern( KeyPatternCode, int keyCode, 
+        Qt::KeyboardModifiers modifierCodes = Qt::NoModifier );
 
     void setMousePattern( const QVector<MousePattern> & );
@@ -189,6 +204,6 @@
     QVector<KeyPattern> &keyPattern();
 
-    bool mouseMatch( uint pattern, const QMouseEvent * ) const;
-    bool keyMatch( uint pattern, const QKeyEvent * ) const;
+    bool mouseMatch( MousePatternCode, const QMouseEvent * ) const;
+    bool keyMatch( KeyPatternCode, const QKeyEvent * ) const;
 
 protected:
@@ -213,5 +228,5 @@
     QwtEventPattern::MousePattern  b2 )
 {
-    return b1.button == b2.button && b1.state == b2.state;
+    return b1.button == b2.button && b1.modifiers == b2.modifiers;
 }
 
@@ -220,5 +235,5 @@
    QwtEventPattern::KeyPattern  b2 )
 {
-    return b1.key == b2.key && b1.state == b2.state;
+    return b1.key == b2.key && b1.modifiers == b2.modifiers;
 }
 
