<< Return to Main Index

< Return to Class Index

CGXGridCore::CanUndo

virtual BOOL CanUndo(CCmdUI* pCmdUI);

pCmdUI

Points to a CCmdUI object which contains state of user interface items with the menu id.

Return Value

TRUE if there are commands in the undo list; otherwise FALSE.

Remarks

Checks if there are command objects in the undo list and fills the CCmdUI object with a description of the next undo operation.

If you want to display a short description of the next undo operation in the menu item, you should add a third entry to the menu item description (after the tooltip-text). CanUndo will replace the menu item text with this description and replace the %1 parameter with the undo description.

If the menu item is for example

   MENUITEM “&Undo\tCtrl+Z”,            ID_EDIT_UNDO

you should replace the menu item description with

   ID_EDIT_UNDO  “Undo the last action\nUndo\n&Undo %1\tCtrl+Z”

The last entry in the menu item description contains a %1. This will be replaced with the undo command description.

Control-Factory Specific ->

This method has been implemented using the abstraction mechanism as discussed in the chapter "Reducing the size of your application" in the user's guide. A call to the ImplementUndoRedo method from within the control factory class' InitializeGridComponents method will make the concrete implementation of this method available to your application.

If no concrete implementation is available this method returns FALSE. No action is performed.

END Control-Factory Specific

See Also

CGXCommand

CGXGridCore

Class Overview | Class Members