ParamOpDescriptor Class Reference

New ParamOpDescriptor class whose purpose in life is to allow an OpDescriptor to be created which instead of using a resource id to get the menu item/operation item text, uses a string resource. This then means we can use the name from the plug-in instead of having to resource all names! More...

#include <opdesc.h>

Inheritance diagram for ParamOpDescriptor:

OpDescriptor MessageHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 ParamOpDescriptor (const TCHAR *pcszToken, CCRuntimeClass *pClass, pfnGetParamState gps)
 Constructs the new ParamOpDescriptor.
virtual BOOL GetText (String_256 *Description, OpTextFlags WhichText)
 This function will use the TextID and ModuleID values to obtain a String resource describing an operation. String resources may have one or more text descriptions in them, therefore, a TextFlag can be used to identify the the appropriate text required.

Static Public Member Functions

static OpState GetState (String_256 *psName, OpDescriptor *pOpDesc)
 Returns the state that this operation should appear in the menus or as a buttom, for example - greyed out, or ticked.

Private Member Functions

 CC_DECLARE_DYNAMIC (ParamOpDescriptor)

Detailed Description

New ParamOpDescriptor class whose purpose in life is to allow an OpDescriptor to be created which instead of using a resource id to get the menu item/operation item text, uses a string resource. This then means we can use the name from the plug-in instead of having to resource all names!

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com> (from code by Neville Humphrys)
Date:
11/10/2004

Definition at line 801 of file opdesc.h.


Constructor & Destructor Documentation

ParamOpDescriptor::ParamOpDescriptor const TCHAR pcszToken,
CCRuntimeClass pClass,
pfnGetParamState  gps
 

Constructs the new ParamOpDescriptor.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/12/96
Parameters:
pcszToken the "OpToken" (OLE verb?) of the associated Operation [INPUTS] NewMenuText string resource of menu text pClass the runtime class to use, defaults to PlugInOp. gs the GetState function to use
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 1683 of file opdesc.cpp.

01686   : OpDescriptor(   0,                          // tool ID
01687                     0,                          // String resource ID (use same for all)
01688                     pClass,                     //CC_RUNTIME_CLASS(PlugInOp),   // Runtime class
01689                     (TCHAR*) pcszToken,         // OpToken
01690                     NULL,                           // GetState function
01691                     0,                          // help ID
01692                     0,                          // bubble help
01693                     0,                          // resource ID
01694                     0,                          // control ID
01695                     TRUE,                       // Recieve system messages
01696                     FALSE,                      // Smart duplicate operation
01697                     TRUE,                       // Clean operation
01698                     0,                          // String for one copy only error
01699                     (DONT_GREY_WHEN_SELECT_INSIDE | GREY_WHEN_NO_CURRENT_DOC) // Auto state flags
01700                 )
01701 {
01702     GetParamState = gps;
01703 }


Member Function Documentation

ParamOpDescriptor::CC_DECLARE_DYNAMIC ParamOpDescriptor   )  [private]
 

OpState ParamOpDescriptor::GetState String_256 psName,
OpDescriptor pOpDesc
[static]
 

Returns the state that this operation should appear in the menus or as a buttom, for example - greyed out, or ticked.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/12/96
Parameters:
pDesc --- A pointer to a String. GetState fills this with the [INPUTS] appropriate details for the conditions arising eg. why "Previous Zoom" is greyed out. pOpDesc --- A pointer to the OpDescriptor whose state is being queried.
Returns:
An OpState containing the flags that show what is valid.

Definition at line 1725 of file opdesc.cpp.

01726 {
01727     // At present, this item is always available.
01728     OpState OpSt;
01729 
01730 //  OpSt.Greyed = (XPEHost::IsEditSessionRunning());
01731 
01732     return OpSt;
01733 }

BOOL ParamOpDescriptor::GetText String_256 Description,
OpTextFlags  WhichText
[virtual]
 

This function will use the TextID and ModuleID values to obtain a String resource describing an operation. String resources may have one or more text descriptions in them, therefore, a TextFlag can be used to identify the the appropriate text required.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/12/96
Parameters:
TextFlag - Identifies which text string to retrieve from the string resource [INPUTS]
Description - Operation description string if it is found or [OUTPUTS] NULL otherwise.
Returns:
TRUE if successfully retrieves the string and FALSE othersise.
See also:
OpDescriptor::GetText

GetDescription

Note: Made virtual by Neville 11/12/96 We do this so that we do not have to store a string with every OpDesciptor. This would be ok if we had dynamic strings but of course we don't. The overhead would be unacceptable. So we use this overriding class instead.

Reimplemented from OpDescriptor.

Definition at line 1762 of file opdesc.cpp.

01763 {
01764     // Leave menu text alone
01765     return TRUE;
01766 } 


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