Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Objective Grid User's Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

5.7 Events

5.7.1 Keyboard Events

Microsoft Windows sends keyboard events to the active window. MFC will call the message method OnKeyDown() for the active window. Objective Grid will call the method CGXGridCore::ProcessKeys().

ProcessKeys() is called both from the current cell control and the grid itself, depending on active state of the current cell. ProcessKeys() needs to know which window is calling it. For this reason, the calling window passes the this pointer to ProcessKeys().

If you want to process keyboard events, you should override ProcessKeys() in a derived grid class. The return value of ProcessKeys() specifies if the event has been processed.

The following example illustrates how to override ProcessKeys() to process the F1 and TAB keys. If the user presses TAB at the bottom-right cell, a new row will be added to the table.

It is important to realize that ProcessKeys() is called from both OnKeyDown and OnKeyUp message handlers. You should keep this in mind when overriding ProcessKeys(), as it may be necessary to distinguish between WM_KEYDOWN and WM_KEYUP messages.

5.7.2 Keyboard Shortcuts

Table 4 lists keyboard shortcuts available in Objective Grid.

Table 4: Keyboard shortcuts

Shortcut Action
CTRL+Z Undo
CTRL+R Redo
CTRL+C Copy
CTRL+V Paste
CTRL+X Cut


Previous fileTop of DocumentContentsNo linkNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo, and Stingray, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.