1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126
|
<HTML>
<head><title>wxAcceleratorTable</title></head>
<BODY BGCOLOR=#FFFFFF>
<A NAME="wxacceleratortable"></A><CENTER>
<A HREF="wx.htm"><img align=center src="contents.gif" BORDER=0 ALT="Contents"></A> <A HREF="wx22.htm#classref"><img align=center src="up.gif" BORDER=0 ALT="Up"></A> <A HREF="wx23.htm#wxacceleratorentry"><img align=center src="back.gif" BORDER=0 ALT="Previous"></A> <A HREF="wx25.htm#wxactivateevent"><img align=center src="forward.gif" BORDER=0 ALT="Next"></A> </CENTER><HR>
<H2>wxAcceleratorTable</H2>
<P>
An accelerator table allows the application to specify a table of keyboard shortcuts for
menus or other commands. On Windows, menu or button commands are supported; on GTK,
only menu commands are supported.<P>
The object <B>wxNullAcceleratorTable</B> is defined to be a table with no data, and is the
initial accelerator table for a window.<P>
<B><FONT COLOR="#FF0000">Derived from</FONT></B><P>
<A HREF="wx158.htm#wxobject">wxObject</A><P>
<B><FONT COLOR="#FF0000">Include files</FONT></B><P>
<wx/accel.h><P>
<B><FONT COLOR="#FF0000">Example</FONT></B><P>
<FONT SIZE=2><PRE>
wxAcceleratorEntry entries[4];
entries[0].Set(wxACCEL_CTRL, (int) 'N', ID_NEW_WINDOW);
entries[1].Set(wxACCEL_CTRL, (int) 'X', wxID_EXIT);
entries[2].Set(wxACCEL_SHIFT, (int) 'A', ID_ABOUT);
entries[3].Set(wxACCEL_NONE, WXK_DELETE, wxID_CUT);
wxAcceleratorTable accel(4, entries);
frame->SetAcceleratorTable(accel);
</PRE>
</FONT><P>
<B><FONT COLOR="#FF0000">Remarks</FONT></B><P>
An accelerator takes precedence over normal processing and can be a convenient way to program some event handling.
For example, you can use an accelerator table to enable a dialog with a multi-line text control to
accept CTRL-Enter as meaning 'OK' (but not in GTK at present).<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx23.htm#wxacceleratorentry">wxAcceleratorEntry</A>, <A HREF="wx260.htm#wxwindowsetacceleratortable">wxWindow::SetAcceleratorTable</A><P>
<B><FONT COLOR="#FF0000">Members</FONT></B><P>
<A HREF="#wxacceleratortableconstr">wxAcceleratorTable::wxAcceleratorTable</A><BR>
<A HREF="#topic32">wxAcceleratorTable::~wxAcceleratorTable</A><BR>
<A HREF="#wxacceleratortableok">wxAcceleratorTable::Ok</A><BR>
<A HREF="#topic33">wxAcceleratorTable::operator =</A><BR>
<A HREF="#topic34">wxAcceleratorTable::operator ==</A><BR>
<A HREF="#topic35">wxAcceleratorTable::operator !=</A><BR>
<P>
<HR>
<A NAME="wxacceleratortableconstr"></A>
<H3>wxAcceleratorTable::wxAcceleratorTable</H3>
<P>
<B></B> <B>wxAcceleratorTable</B>()<P>
Default constructor.<P>
<B></B> <B>wxAcceleratorTable</B>(<B>const wxAcceleratorTable& </B><I>bitmap</I>)<P>
Copy constructor.<P>
<B></B> <B>wxAcceleratorTable</B>(<B>int</B><I> n</I>, <B>wxAcceleratorEntry</B><I> entries[]</I>)<P>
Creates from an array of <A HREF="wx23.htm#wxacceleratorentry">wxAcceleratorEntry</A> objects.<P>
<B></B> <B>wxAcceleratorTable</B>(<B>const wxString&</B><I> resource</I>)<P>
Loads the accelerator table from a Windows resource (Windows only).<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>n</I><UL><UL>
Number of accelerator entries.</UL></UL>
<P>
<I>entries</I><UL><UL>
The array of entries.</UL></UL>
<P>
<I>resource</I><UL><UL>
Name of a Windows accelerator.</UL></UL>
<P>
<HR>
<A NAME="topic32"></A>
<H3>wxAcceleratorTable::~wxAcceleratorTable</H3>
<P>
<B></B> <B>~wxAcceleratorTable</B>()<P>
Destroys the wxAcceleratorTable object.<P>
<HR>
<A NAME="wxacceleratortableok"></A>
<H3>wxAcceleratorTable::Ok</H3>
<P>
<B>bool</B> <B>Ok</B>() <B>const</B><P>
Returns TRUE if the accelerator table is valid.<P>
<HR>
<A NAME="topic33"></A>
<H3>wxAcceleratorTable::operator =</H3>
<P>
<B>wxAcceleratorTable& </B> <B>operator =</B>(<B>const wxAcceleratorTable& </B><I>accel</I>)<P>
Assignment operator. This operator does not copy any data, but instead
passes a pointer to the data in <I>accel</I> and increments a reference
counter. It is a fast operation.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>accel</I><UL><UL>
Accelerator table to assign.</UL></UL>
<P>
<B><FONT COLOR="#FF0000">Return value</FONT></B><P>
Returns 'this' object.<P>
<HR>
<A NAME="topic34"></A>
<H3>wxAcceleratorTable::operator ==</H3>
<P>
<B>bool</B> <B>operator ==</B>(<B>const wxAcceleratorTable& </B><I>accel</I>)<P>
Equality operator. This operator tests whether the internal data pointers are
equal (a fast test).<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>accel</I><UL><UL>
Accelerator table to compare with 'this'</UL></UL>
<P>
<B><FONT COLOR="#FF0000">Return value</FONT></B><P>
Returns TRUE if the accelerator tables were effectively equal, FALSE otherwise.<P>
<HR>
<A NAME="topic35"></A>
<H3>wxAcceleratorTable::operator !=</H3>
<P>
<B>bool</B> <B>operator !=</B>(<B>const wxAcceleratorTable& </B><I>accel</I>)<P>
Inequality operator. This operator tests whether the internal data pointers are
unequal (a fast test).<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>accel</I><UL><UL>
Accelerator table to compare with 'this'</UL></UL>
<P>
<B><FONT COLOR="#FF0000">Return value</FONT></B><P>
Returns TRUE if the accelerator tables were unequal, FALSE otherwise.<P>
</BODY></HTML>
|