]> git.saurik.com Git - wxWidgets.git/commitdiff
added and documented wxKey/MouseEvent::CmdDown()
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 1 Jul 2004 00:04:48 +0000 (00:04 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 1 Jul 2004 00:04:48 +0000 (00:04 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28118 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
docs/latex/wx/keyevent.tex
docs/latex/wx/mouseevt.tex
include/wx/event.h

index 5775f10bfe4e5dce8cfa4fb400217c94a1357f12..a0d54f66a4ce437cfcd215914c0c013a7849cfe3 100644 (file)
@@ -17,6 +17,9 @@ INCOMPATIBLE CHANGES SINCE 2.4.x
   wxFULL_REPAINT_ON_RESIZE to force this (wxNO_FULL_REPAINT_ON_RESIZE still
   exists but doesn't do anything any more, this behaviour is default now)
 
+! wxWindow::m_font and m_backgroundColour/m_foregroundColour are no longer
+  always set, use GetFont(), GetBack/ForegroundColour() to access them
+
 
 - no initialization/cleanup can be done in wxApp/~wxApp because they are
   now called much earlier/later than before; please move any exiting code
@@ -124,6 +127,7 @@ All (GUI):
 - Added wxWindow::Navigate for programmatic navigation to the next control.
 - wxTextCtrl::OnChar now inserts a tab character if wxTE_PROCESS_TAB is set
 - added wxKeyEvent::GetUnicodeKey()
+- added wxKeyEvent::CmdDown() and wxMouseEvent::CmdDown()
 
 Unix:
 
index ad045258a250b53bfaadf791e2c93604dce34c17..a76d181b19d64670a4e331ae3bd1449088d28b24 100644 (file)
@@ -142,7 +142,20 @@ Constructor. Currently, the only valid event types are wxEVT\_CHAR and wxEVT\_CH
 Returns true if the Alt key was down at the time of the key event.
 
 
-\membersection{wxKeyEvent::ControlDown}
+\membersection{wxKeyEvent::CmdDown}\label{wxkeyeventcmddown}
+
+\constfunc{bool}{CmdDown}{\void}
+
+"Cmd" is a pseudo key which is the same as Control for PC and Unix platforms
+but the special "Apple" (a.k.a as "Command") key under Macs: it makes often
+sense to use it instead of, say, ControlDown() because Cmd key is used for the
+same thing under Mac as Ctrl elsewhere (but Ctrl still exists, just not used
+for this purpose under Mac). So for non-Mac platforms this is the same as 
+\helpref{ControlDown()}{wxkeyeventcontroldown} and under Mac this is the same
+as \helpref{MetaDown()}{wxkeyeventmetadown}.
+
+
+\membersection{wxKeyEvent::ControlDown}\label{wxkeyeventcontroldown}
 
 \constfunc{bool}{ControlDown}{\void}
 
@@ -225,7 +238,7 @@ the latter is that it is common for {\sc NumLock} key to be configured as
 be still processed normally).
 
 
-\membersection{wxKeyEvent::MetaDown}
+\membersection{wxKeyEvent::MetaDown}\label{wxkeyeventmetadown}
 
 \constfunc{bool}{MetaDown}{\void}
 
index ef941e7d906276f6d7bd99ce890a5bc8f2dcfe6e..4c0f33b8c128b82d9c9637a2d5cb09b435ef4d93 100644 (file)
@@ -227,7 +227,19 @@ values).
 
 
 
-\membersection{wxMouseEvent::ControlDown}
+\membersection{wxKeyEvent::CmdDown}\label{wxmouseeventcmddown}
+
+\constfunc{bool}{CmdDown}{\void}
+
+Same as \helpref{MetaDown}{wxmouseeventmetadown} under Mac, same as 
+\helpref{ControlDown}{wxmouseeventcontroldown} elsewhere.
+
+\wxheading{See also}
+
+\helpref{wxKeyEvent::CmdDown}\label{wxkeyeventcmddown}
+
+
+\membersection{wxMouseEvent::ControlDown}\label{wxmouseeventcontroldown}
 
 \func{bool}{ControlDown}{\void}
 
@@ -393,7 +405,7 @@ mouse" messages to determine whether the user is (still) dragging the mouse.
 Returns true if the left mouse button changed to up.
 
 
-\membersection{wxMouseEvent::MetaDown}
+\membersection{wxMouseEvent::MetaDown}\label{wxmouseeventmetadown}
 
 \constfunc{bool}{MetaDown}{\void}
 
index e15b70b22539ffd2fc1287c5e25f54f9bbc99cd8..1d76255ff5de3be53ac6b6ee1ceca31aad0983ea 100644 (file)
@@ -703,6 +703,14 @@ public:
     bool MetaDown() const { return m_metaDown; }
     bool AltDown() const { return m_altDown; }
     bool ShiftDown() const { return m_shiftDown; }
+    bool CmdDown() const
+    {
+#if defined(__WXMAC__) || defined(__WXCOCOA__)
+        return MetaDown();
+#else
+        return ControlDown();
+#endif
+    }
 
     // Find which event was just generated
     bool LeftDown() const { return (m_eventType == wxEVT_LEFT_DOWN); }
@@ -878,6 +886,20 @@ public:
     bool AltDown() const { return m_altDown; }
     bool ShiftDown() const { return m_shiftDown; }
 
+    // "Cmd" is a pseudo key which is Control for PC and Unix platforms but
+    // Apple ("Command") key under Macs: it makes often sense to use it instead
+    // of, say, ControlDown() because Cmd key is used for the same thing under
+    // Mac as Ctrl elsewhere (but Ctrl still exists, just not used for this
+    // purpose under Mac)
+    bool CmdDown() const
+    {
+#if defined(__WXMAC__) || defined(__WXCOCOA__)
+        return MetaDown();
+#else
+        return ControlDown();
+#endif
+    }
+
     // exclude MetaDown() from HasModifiers() because NumLock under X is often
     // configured as mod2 modifier, yet the key events even when it is pressed
     // should be processed normally, not like Ctrl- or Alt-key