OpColEditCommand Class Reference

A polymorphic Op which is used for all generic colour editor "commands". More...

#include <colmenu.h>

Inheritance diagram for OpColEditCommand:

Operation MessageHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

virtual void Do (OpDescriptor *pOpDesc)
 The nudge op's Do() function.

Static Public Member Functions

static BOOL Init (void)
 OpColEditCommand initialiser method.
static OpState GetCommandState (String_256 *ShadeReason, OpDescriptor *pOpDesc)
 For finding OpColEditCommand's state.

Static Protected Member Functions

static BOOL InitPolymorphicCommand (StringBase *OpToken, UINT32 MenuTextID)
 Given a command OpToken, this creates a new OpDescriptor for the OpColEditCommand Op. This in turn will provide an Upcall to the Editor containing the given command string, whenever the Op is invoked.

Private Member Functions

 CC_DECLARE_DYNCREATE (OpColEditCommand)

Detailed Description

A polymorphic Op which is used for all generic colour editor "commands".

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
3/10/95
A colour editor command is an OpToken along the lines "DoSomething" where "DoSomething" indicates a command supported by the editor.

Definition at line 163 of file colmenu.h.


Member Function Documentation

OpColEditCommand::CC_DECLARE_DYNCREATE OpColEditCommand   )  [private]
 

void OpColEditCommand::Do OpDescriptor pOpDesc  )  [virtual]
 

The nudge op's Do() function.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
3/10/95
Parameters:
pOpDesc = ptr to the op descriptor [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Reimplemented from Operation.

Definition at line 329 of file colmenu.cpp.

00330 {  
00331     if (ColourEditDlg::TheEditor != NULL)
00332         ColourEditDlg::TheEditor->DoCommand(&pOpDesc->Token);
00333 
00334     End();
00335 }

OpState OpColEditCommand::GetCommandState String_256 UIDescription,
OpDescriptor pOpDesc
[static]
 

For finding OpColEditCommand's state.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
3/10/95
Parameters:
UIDescription - ptr to a string to place a description of what went wrong (if it did!) [INPUTS] OpDesc - The OpDescriptor for which we need the state
UIDescription is updated appropriately [OUTPUTS]
Returns:
The state of the OpColEditCommand operation for the given OpDescriptor

Definition at line 300 of file colmenu.cpp.

00301 {
00302     if (ColourEditDlg::TheEditor != NULL)
00303         return(ColourEditDlg::TheEditor->GetCommandState(&pOpDesc->Token, UIDescription));
00304 
00305     // else return a "safe" shaded state
00306     OpState OpSt;
00307     OpSt.Greyed = TRUE;
00308     *UIDescription = String_256(_R(IDS_K_COLMENU_NOEDITOR));
00309     return (OpSt); 
00310 }

BOOL OpColEditCommand::Init void   )  [static]
 

OpColEditCommand initialiser method.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
3/10/95
Returns:
TRUE if the operation could be successfully initialised FALSE if no more memory could be allocated
Notes: Initialises all of the commands available to the colour editor

See also:
SuperGallery::InitMenuCommand

Reimplemented from SimpleCCObject.

Definition at line 262 of file colmenu.cpp.

00263 {
00264 #ifdef WEBSTER
00265     InitPolymorphicCommand((StringBase *) &ColCmd_NewNColour, _R(IDS_NEWCOLOUR));
00266 #endif // WEBSTER
00267     InitPolymorphicCommand((StringBase *) &ColCmd_Name, _R(IDS_SGMENU_RENAME));
00268     InitPolymorphicCommand((StringBase *) &ColCmd_EditParent, _R(IDS_COLMENU_EDITPARENT));
00269 
00270     InitPolymorphicCommand((StringBase *) &ColCmd_HSV, _R(IDS_COLMODEL_HSVT));
00271     InitPolymorphicCommand((StringBase *) &ColCmd_RGB, _R(IDS_COLMODEL_RGBT));
00272     InitPolymorphicCommand((StringBase *) &ColCmd_CMYK, _R(IDS_COLMODEL_CMYK));
00273     InitPolymorphicCommand((StringBase *) &ColCmd_Grey, _R(IDS_COLMODEL_GREY));
00274 
00275     InitPolymorphicCommand((StringBase *) &ColCmd_Help, _R(IDS_COLMENU_HELP));
00276 
00277     return (TRUE);
00278 }               

BOOL OpColEditCommand::InitPolymorphicCommand StringBase OpToken,
UINT32  MenuTextID
[static, protected]
 

Given a command OpToken, this creates a new OpDescriptor for the OpColEditCommand Op. This in turn will provide an Upcall to the Editor containing the given command string, whenever the Op is invoked.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
3/10/95
Parameters:
OpToken - The OpToken for the new Op - use "ColEdit_Command" [INPUTS]
MenuTextID - A String Resource ID for the menu item text

Returns:
TRUE if it succeeded, FALSE if not enough memory to register the OpDescriptor

Definition at line 221 of file colmenu.cpp.

00222 {
00223     return(RegisterOpDescriptor(0,                                  // Tool ID 
00224                                 MenuTextID,                         // String resource ID
00225                                 CC_RUNTIME_CLASS(OpColEditCommand), // Runtime class
00226                                 (TCHAR *) (*OpToken),               // Token string
00227                                 OpColEditCommand::GetCommandState,  // GetState function
00228                                 0,                                  // help ID
00229                                 0,                                  // bubble help
00230                                 0,                                  // resource ID
00231                                 0,                                  // control ID
00232                                 SYSTEMBAR_ILLEGAL,                  // Bar ID
00233                                 FALSE,                              // Recieve system messages
00234                                 FALSE,                              // Smart duplicate operation
00235                                 TRUE,                               // Clean operation
00236                                 NULL,                               // No vertical counterpart
00237                                 0,                                  // String for one copy only error
00238                                 DONT_GREY_WHEN_SELECT_INSIDE        // Auto state flags
00239                                 ));
00240 }


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:57:44 2007 for Camelot by  doxygen 1.4.4