Added OnKeyDown, OnKeyUp.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1404 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -3,8 +3,9 @@
|
||||
A class for manipulating the clipboard. Note that this is not compatible with the
|
||||
clipboard class from wxWindows 1.xx, which has the same name but a different implementation.
|
||||
|
||||
To use the clipboard, construct a wxClipboard object on the stack and
|
||||
call \helpref{wxClipboard::Open}{wxclipboardopen}. If this operation returns TRUE, you
|
||||
To use the clipboard, you call member functions of the global {\bf wxTheClipboard} object.
|
||||
|
||||
Call \helpref{wxClipboard::Open}{wxclipboardopen} to get ownership of the clipboard. If this operation returns TRUE, you
|
||||
now own the clipboard. Call \helpref{wxClipboard::SetData}{wxclipboardsetdata} to put data
|
||||
on the clipboard (one or more times), or \helpref{wxClipboard::GetData}{wxclipboardgetdata} to
|
||||
retrieve data from the clipboard. Call \helpref{wxClipboard::Close}{wxclipboardclose} to close
|
||||
@@ -13,22 +14,21 @@ the clipboard and relinquish ownership. You should keep the clipboard open only
|
||||
For example:
|
||||
|
||||
\begin{verbatim}
|
||||
wxClipboard clipboard;
|
||||
|
||||
// Write some text to the clipboard
|
||||
if (clipboard.Open())
|
||||
if (wxTheClipboard->Open())
|
||||
{
|
||||
wxTextDataObject object("Some text");
|
||||
clipboard.SetData(& object);
|
||||
clipboard.Close();
|
||||
// This object is held by the clipboard, so do not delete it in the app.
|
||||
wxTextDataObject* object = new wxTextDataObject("Some text");
|
||||
wxTheClipboard->SetData(& object);
|
||||
wxTheClipboard->Close();
|
||||
}
|
||||
|
||||
// Read some text
|
||||
if (clipboard.Open() && clipboard.IsSupportedFormat(wxDF_TEXT))
|
||||
if (wxTheClipboard->Open() && wxTheClipboard->IsSupportedFormat(wxDF_TEXT))
|
||||
{
|
||||
wxTextDataObject object;
|
||||
clipboard.GetData(& object);
|
||||
clipboard.Close();
|
||||
wxTheClipboard->GetData(& object);
|
||||
wxTheClipboard->Close();
|
||||
|
||||
wxMessageBox(object.GetText());
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
\section{\class{wxKeyEvent}}\label{wxkeyevent}
|
||||
|
||||
This event class contains information about keypress (character) events. See \helpref{wxWindow::OnChar}{wxwindowonchar}.
|
||||
This event class contains information about keypress (character) events.
|
||||
|
||||
\wxheading{Derived from}
|
||||
|
||||
@@ -13,10 +13,20 @@ functions that take a wxKeyEvent argument.
|
||||
|
||||
\twocolwidtha{7cm}
|
||||
\begin{twocollist}\itemsep=0pt
|
||||
\twocolitem{{\bf EVT\_CHAR(func)}}{Process a wxEVT\_CHAR event (an ASCII key has been pressed).}
|
||||
\twocolitem{{\bf EVT\_KEY\_DOWN(func)}}{Process a wxEVT\_KEY\_DOWN event (any key has been pressed).}
|
||||
\twocolitem{{\bf EVT\_KEY\_UP(func)}}{Process a wxEVT\_KEY\_UP event (any key has been released).}
|
||||
\twocolitem{{\bf EVT\_CHAR(func)}}{Process a wxEVT\_CHAR event.}
|
||||
\twocolitem{{\bf EVT\_CHAR\_HOOK(func)}}{Process a wxEVT\_CHAR\_HOOK event.}
|
||||
\end{twocollist}%
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{wxWindow::OnChar}{wxwindowonchar},
|
||||
\helpref{wxWindow::OnCharHook}{wxwindowoncharhook},
|
||||
\helpref{wxWindow::OnKeyDown}{wxwindowonkeydown},
|
||||
\helpref{wxWindow::OnKeyUp}{wxwindowonkeyup}
|
||||
|
||||
\latexignore{\rtfignore{\wxheading{Members}}}
|
||||
|
||||
\membersection{wxKeyEvent::m\_altDown}
|
||||
|
@@ -807,7 +807,7 @@ otherwise it returns FALSE (it is being deactivated).
|
||||
|
||||
\func{void}{OnChar}{\param{wxKeyEvent\&}{ event}}
|
||||
|
||||
Called when the user has pressed a key.
|
||||
Called when the user has pressed a key, which has been translated into an ASCII value.
|
||||
|
||||
\wxheading{Parameters}
|
||||
|
||||
@@ -823,10 +823,15 @@ default function to achieve default keypress functionality.
|
||||
Note that the ASCII values do not have explicit key codes: they are passed as ASCII
|
||||
values.
|
||||
|
||||
Note that not all keypresses can be intercepted this way. If you wish to intercept special
|
||||
keys, such as shift, control, and function keys, then you will need to use \helpref{wxWindow::OnKeyDown}{wxwindowonkeydown} or
|
||||
\helpref{wxWindow::OnKeyUp}{wxwindowonkeyup}.
|
||||
|
||||
Most, but not all, windows allow keypresses to be intercepted.
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{wxWindow::OnKeyDown}{wxwindowonkeydown}, \helpref{wxWindow::OnKeyUp}{wxwindowonkeyup},\rtfsp
|
||||
\helpref{wxKeyEvent}{wxkeyevent}, \helpref{wxWindow::OnCharHook}{wxwindowoncharhook},\rtfsp
|
||||
\helpref{Event handling overview}{eventhandlingoverview}
|
||||
|
||||
@@ -999,6 +1004,65 @@ To intercept this event, use the EVT\_ERASE\_BACKGROUND macro in an event table
|
||||
|
||||
\helpref{wxEraseEvent}{wxeraseevent}, \helpref{Event handling overview}{eventhandlingoverview}
|
||||
|
||||
\membersection{wxWindow::OnKeyDown}\label{wxwindowonkeydown}
|
||||
|
||||
\func{void}{OnKeyDown}{\param{wxKeyEvent\&}{ event}}
|
||||
|
||||
Called when the user has pressed a key, before it is translated into an ASCII value using other
|
||||
modifier keys that might be pressed at the same time.
|
||||
|
||||
\wxheading{Parameters}
|
||||
|
||||
\docparam{event}{Object containing keypress information. See \helpref{wxKeyEvent}{wxkeyevent} for
|
||||
details about this class.}
|
||||
|
||||
\wxheading{Remarks}
|
||||
|
||||
This member function is called in response to a key down event. To intercept this event,
|
||||
use the EVT\_KEY\_DOWN macro in an event table definition. Your {\bf OnKeyDown} handler may call this
|
||||
default function to achieve default keypress functionality.
|
||||
|
||||
Note that not all keypresses can be intercepted this way. If you wish to intercept special
|
||||
keys, such as shift, control, and function keys, then you will need to use \helpref{wxWindow::OnKeyDown}{wxwindowonkeydown} or
|
||||
\helpref{wxWindow::OnKeyUp}{wxwindowonkeyup}.
|
||||
|
||||
Most, but not all, windows allow keypresses to be intercepted.
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{wxWindow::OnChar}{wxwindowonchar}, \helpref{wxWindow::OnKeyUp}{wxwindowonkeyup},\rtfsp
|
||||
\helpref{wxKeyEvent}{wxkeyevent}, \helpref{wxWindow::OnCharHook}{wxwindowoncharhook},\rtfsp
|
||||
\helpref{Event handling overview}{eventhandlingoverview}
|
||||
|
||||
\membersection{wxWindow::OnKeyUp}\label{wxwindowonkeyup}
|
||||
|
||||
\func{void}{OnKeyUp}{\param{wxKeyEvent\&}{ event}}
|
||||
|
||||
Called when the user has released a key.
|
||||
|
||||
\wxheading{Parameters}
|
||||
|
||||
\docparam{event}{Object containing keypress information. See \helpref{wxKeyEvent}{wxkeyevent} for
|
||||
details about this class.}
|
||||
|
||||
\wxheading{Remarks}
|
||||
|
||||
This member function is called in response to a key up event. To intercept this event,
|
||||
use the EVT\_KEY\_UP macro in an event table definition. Your {\bf OnKeyUp} handler may call this
|
||||
default function to achieve default keypress functionality.
|
||||
|
||||
Note that not all keypresses can be intercepted this way. If you wish to intercept special
|
||||
keys, such as shift, control, and function keys, then you will need to use \helpref{wxWindow::OnKeyDown}{wxwindowonkeydown} or
|
||||
\helpref{wxWindow::OnKeyUp}{wxwindowonkeyup}.
|
||||
|
||||
Most, but not all, windows allow key up events to be intercepted.
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{wxWindow::OnChar}{wxwindowonchar}, \helpref{wxWindow::OnKeyDown}{wxwindowonkeydown},\rtfsp
|
||||
\helpref{wxKeyEvent}{wxkeyevent}, \helpref{wxWindow::OnCharHook}{wxwindowoncharhook},\rtfsp
|
||||
\helpref{Event handling overview}{eventhandlingoverview}
|
||||
|
||||
\membersection{wxWindow::OnKillFocus}\label{wxwindowonkillfocus}
|
||||
|
||||
\func{void}{OnKillFocus}{\param{wxFocusEvent\& }{event}}
|
||||
|
@@ -41,10 +41,10 @@ High Priority
|
||||
|
||||
- Get wxGLCanvas from 1.68 working.
|
||||
|
||||
- Implement missing wxImage functions for Motif.
|
||||
|
||||
- wxClipboard
|
||||
|
||||
- EVT_KEY_DOWN, EVT_KEY_UP events.
|
||||
|
||||
Low Priority
|
||||
------------
|
||||
|
||||
|
Reference in New Issue
Block a user