From: Dirk B. <db...@us...> - 2006-01-13 17:50:41
|
Update of /cvsroot/win32forth/win32forth/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26243/doc Modified Files: p-classes.htm p-index.htm Added Files: p-AcceleratorTables.htm Log Message: Added documentation for the Accelerator table support and the file I/O classes --- NEW FILE: p-AcceleratorTables.htm --- <html> <head> <meta http-equiv="Content-Language" content="en-gb"> <meta name="GENERATOR" content="dexh00"> <meta name="ProgId" content="FrontPage.Editor.Document"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title> </title><style><!-- h1 { font-family: Tahoma; font-size: 24pt; font-weight: bold } h2 { font-family: Tahoma; font-size: 18pt; font-weight: bold } --> </style> </head> <body><h1 align="center"> <a href="mailto:win...@ya...?subject=DOC:Doc error in $Id: p-AcceleratorTables.htm,v 1.1 2006/01/13 17:50:32 dbu_de Exp $"> <img border="0" src="TELLUS.gif" align="left" width="32" height="32"></a> <img border="0" src="FORTHPRO.gif" width="32" height="32"> Win32Forth</h1> <hr /><h1>Windows Accelerator Table support </h1><hr /><p>To use Accelerator Tables in an application: </p><p>Define the Accelerator Tables required using: AcceleratorTable <name> </p><p>Start the entries for each table with: <name> table </p><p>Add entries with: ( flags key-code command-id ) AccelEntry </p><p>End the table with: ( Window ) HandlesThem This will add code to process the Accelerator Keys in the message chain. </p><p>Use: <name> EnableAccelerators to enable the accelerator commands and send them to the window used with HandlesThem. </p><p>These accelerator commands are handled in the window's OnWmCommand: method. </p><p>Use: <name> DisableAccelerators to disable the accelerator commands for this table. Always disable (destroy) every table before the application closes to prevent memory leaks. </p><h2>Glossary </h2><pre><b><a name="0">: Dump-Accelerator-Key-Table ( a -- ) \ W32F sys </a></b></pre><p>Dump an Accelerator Table to the console window- </p><pre><b><a name="0">: AcceleratorTable ( <name> -- ) </a></b></pre><p>Create a new named Accelerator Table </p><pre><b><a name="0">: Table ( a -- ) \ W32F sys </a></b></pre><p>Start a table of entries in the dictionary </p><pre><b><a name="0">: AccelEntry ( flags key-code command-id -- ) \ W32F sys </a></b></pre><p>Add a entry to the current table </p><pre><b><a name="0">: HandlesThem ( Window -- ) \ W32F </a></b></pre><p>Close a table and assign it to the given window. </p><pre><b><a name="0">: DisableAccelerators ( a -- ) \ W32F </a></b></pre><p>Destroys the Windows Accelerator Table. It does not matter trying to destroy a table more than once </p><pre><b><a name="0">: EnableAccelerators ( a -- ) \ W32F </a></b></pre><p>Creates the Windows Accelerator Table. It does not matter creating the same table again as long as it is destroyed first </p><h2>Example </h2><pre> \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \ Define some accelerator tables \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ AcceleratorTable FunctionKeys AcceleratorTable CharKeys AcceleratorTable NumKeys \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \ Define a small window that will receive the accelerator commands \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ :Object TEST <Super Window :M StartSize: 220 50 ;M :M On_Init: ( -- ) NumKeys EnableAccelerators FunctionKeys EnableAccelerators CharKeys EnableAccelerators ;M :M OnWmCommand: ( hwnd msg wparam lparam -- hwnd msg wparam lparam ) over LOWORD ( Command ID ) cr ." Accelerator command ID: " . ;M :M On_Done: ( -- ) NumKeys DisableAccelerators FunctionKeys DisableAccelerators CharKeys DisableAccelerators ;M ;Object \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \ Accelerator table entries \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ NumKeys table \ Flags Key Code Command ID FCONTROL VK_NUMPAD0 0 AccelEntry FCONTROL VK_NUMPAD1 1 AccelEntry FCONTROL VK_NUMPAD2 2 AccelEntry FCONTROL VK_NUMPAD3 3 AccelEntry FCONTROL VK_NUMPAD4 4 AccelEntry FCONTROL VK_NUMPAD5 5 AccelEntry FCONTROL VK_NUMPAD6 6 AccelEntry FCONTROL VK_NUMPAD7 7 AccelEntry FCONTROL VK_NUMPAD8 8 AccelEntry FCONTROL VK_NUMPAD9 9 AccelEntry FCONTROL VK_DECIMAL 16 AccelEntry FCONTROL VK_RETURN 17 AccelEntry FCONTROL VK_ADD 18 AccelEntry FCONTROL VK_SUBTRACT 19 AccelEntry TEST HandlesThem FunctionKeys table \ Flags Key Code Command ID FSHIFT VK_F1 65 AccelEntry FSHIFT VK_F2 66 AccelEntry FSHIFT VK_F3 67 AccelEntry FSHIFT VK_F4 68 AccelEntry TEST HandlesThem CharKeys table \ Flags Key Code Command ID 0 'Z' 129 AccelEntry 0 'X' 130 AccelEntry 0 'C' 131 AccelEntry 0 'V' 132 AccelEntry 0 'B' 133 AccelEntry 0 'N' 134 AccelEntry 0 'M' 135 AccelEntry TEST HandlesThem \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \ Instructions \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ cr NumKeys Dump-Accelerator-Key-Table FunctionKeys Dump-Accelerator-Key-Table CharKeys Dump-Accelerator-Key-Table start: test cr .( Make sure the test window has the focus.) cr .( Press some of the accelerator keys to see the IDs in the console window.) cr .( In this example NumPad keys need Ctrl [Num Lock needs to be on].) cr .( Function keys work with Shift, Char keys work without Shift, Ctrl or Alt.) cr .( All combinations of Shift, Ctrl, Alt or nothing are possible.) cr .( CharKeys DisableAccelerators will disable the CharKeys accelerators.) cr .( CharKeys EnableAccelerators will enable them again.) cr .( Closing the Test window will disable all the accelerators) </pre><hr><p>Document $Id: p-AcceleratorTables.htm,v 1.1 2006/01/13 17:50:32 dbu_de Exp $</p> </body></html> Index: p-index.htm =================================================================== RCS file: /cvsroot/win32forth/win32forth/doc/p-index.htm,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** p-index.htm 9 Jan 2006 13:33:42 -0000 1.8 --- p-index.htm 13 Jan 2006 17:50:32 -0000 1.9 *************** *** 149,152 **** --- 149,153 ---- <li><a href="p-structures.htm">Structures in Win32Forth</a></li> <li><a href="p-numconv.htm">Number Conversion</a></li> + <li><a href="p-AcceleratorTables.htm">Accelerator tables</a></li> <li><a href="p-relnotes.6.12.htm">Release Notes</a></li> </ul> Index: p-classes.htm =================================================================== RCS file: /cvsroot/win32forth/win32forth/doc/p-classes.htm,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** p-classes.htm 13 Jan 2006 12:09:26 -0000 1.6 --- p-classes.htm 13 Jan 2006 17:50:32 -0000 1.7 *************** *** 96,101 **** --- 96,107 ---- <p>All these classes are rewritten to use the GDI class library.</p> + <h2>Other classes</h2> + <ul> + <li><a href="./classes/File.htm#File">File</a> Class for file I/O.</li> + <li><a href="./classes/File.htm#ReadFile">ReadFile</a> Class for loading/saving a complete file from/to memory.</li> <hr> + <p>Document $Id$</p> + </body> </html> |