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_MacOS 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_MacOS::CP_RegisterCommand( kCP_Graphics_ShapesCommand,
                CPLAT_MacOS::CP_Command::CP_E_CH_AlwaysEnable)->connect( CPLAT_MacOS::CP_SigSlot::slot(this, &CP_Graphics_Application::HandleShapes) );

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

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

Generated on Tue Sep 20 20:22:25 2005 for CPLAT_MacOS by  doxygen 1.4.0