Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Command Handling Overview

Commands

Commands, which are issues by menus and various UI elements are handled in a similar way to events, in that you register for an event you want handled. When the user causes some action to trigger that event, the slot you registered with the CP_CommandHandlingManager will be called to handle the command.

An example of how easy CPLAT II makes it to handle commands is shown below. The example is taken from the CP_Graphics demo.

        CP_Graphics_Application::CP_Graphics_Application()
        {
            CPLAT::CP_RegisterCommand( kCP_Graphics_ShapesCommand,
                CPLAT::CP_Command::CP_E_CH_AlwaysEnable)->connect( CPLAT::CP_SigSlot::slot(this, &CP_Graphics_Application::HandleShapes) );

            CPLAT::CP_RegisterCommand( kCP_Graphics_PathsCommand,
                CPLAT::CP_Command::CP_E_CH_AlwaysEnable)->connect( CPLAT::CP_SigSlot::slot(this, &CP_Graphics_Application::HandlePaths) );

            CPLAT::CP_RegisterCommand( kCP_Graphics_ImagesCommand,
                CPLAT::CP_Command::CP_E_CH_AlwaysEnable)->connect( CPLAT::CP_SigSlot::slot(this, &CP_Graphics_Application::HandleImages) );
        }

Generated on Sat Sep 17 20:02:36 2005 for CPLAT by  doxygen 1.4.0