FrameBehindOpDescriptor Class Reference

New FrameBehindOpDescriptor class whose purpose is to allow an OpDescriptor to be created which allows us to over-ride the virtual function GetText. More...

#include <zordops.h>

Inheritance diagram for FrameBehindOpDescriptor:

OpDescriptor MessageHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 FrameBehindOpDescriptor (const TCHAR *pcszToken, CCRuntimeClass *pClass=CC_RUNTIME_CLASS(FrameBehindOpDescriptor), pfnGetState gs=FrameBehindOpDescriptor::GetState)
 Constructs the new FrameInFrontOpDescriptor.
virtual BOOL GetText (String_256 *Description, OpTextFlags WhichText)
 Depending upon the document Mode, (i.e Frame or Layer), this function will obtain the 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 (FrameBehindOpDescriptor)

Detailed Description

New FrameBehindOpDescriptor class whose purpose is to allow an OpDescriptor to be created which allows us to over-ride the virtual function GetText.

Author:
Ranbir_Rana (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/10/97

Definition at line 366 of file zordops.h.


Constructor & Destructor Documentation

FrameBehindOpDescriptor::FrameBehindOpDescriptor const TCHAR pcszToken,
CCRuntimeClass pClass = CC_RUNTIME_CLASS(FrameBehindOpDescriptor),
pfnGetState  gs = FrameBehindOpDescriptor::GetState
 

Constructs the new FrameInFrontOpDescriptor.

Author:
Ranbir_Rana (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/12/96
Parameters:
pcszToken the "OpToken" of the associated Operation [INPUTS] pClass the runtime class to use. gs the GetState function to use.
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 3452 of file zordops.cpp.

03454   : OpDescriptor(   0,                                                          // tool ID
03455                     _R(IDS_MOVELAYERBEHIND),                                        // String resource ID (use same for all)
03456                     pClass,                                                     //CC_RUNTIME_CLASS(PlugInOp), Runtime class
03457                     (TCHAR*) pcszToken,                                         // OpToken
03458                     gs,                                                         // GetState function
03459                     0,                                                          // help ID
03460                     _R(IDBBL_MOVELAYERBEHIND),                                      // bubble help
03461                     _R(IDD_ANIMATIONBAR),                                           // resource ID
03462                     _R(IDC_FRAME_MOVEDOWNAFRAME),                                   // control ID
03463                     TRUE,                                                       // Recieve system messages
03464                     FALSE,                                                      // Smart duplicate operation
03465                     TRUE,                                                       // Clean operation
03466                     0,                                                          // String for one copy only error
03467                     (GREY_WHEN_NO_SELECTION | GREY_WHEN_NO_CURRENT_DOC)         // Auto state flags
03468                 )
03469 {}


Member Function Documentation

FrameBehindOpDescriptor::CC_DECLARE_DYNAMIC FrameBehindOpDescriptor   )  [private]
 

OpState FrameBehindOpDescriptor::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:
Ranbir_Rana (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/10/97
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 3488 of file zordops.cpp.

03489 {
03490     // At present, this item is always available.
03491     OpState OpSt;
03492     return OpSt;
03493 }

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

Depending upon the document Mode, (i.e Frame or Layer), this function will obtain the 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:
Ranbir_Rana (Xara Group Ltd) <camelotdev@xara.com> (From Mario code in base class.)
Date:
21/10/97
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.

Reimplemented from OpDescriptor.

Definition at line 3512 of file zordops.cpp.

03513 {   
03514     // Assume we are in layer mode.
03515     BOOL LayerMode = TRUE;
03516     TCHAR* ok;
03517     
03518     //Determine the document mode.
03519     Document* pDoc = Document::GetSelected();
03520 
03521     // Ensure a valid ptr.
03522     if(pDoc)
03523     {
03524         // Get a ptr to the selected spread
03525         Spread* pSpread = pDoc->GetSelectedSpread();
03526     
03527         // Ensure a valid spread ptr.
03528         if(pSpread)
03529         {
03530             // Are there any frame layers?
03531             Layer* pFrameLayer = pSpread->FindFirstFrameLayer();    
03532 
03533             //If a frame layer exists, then this is an animation doc.
03534             if (pFrameLayer)
03535                 LayerMode = FALSE;
03536         }
03537     }
03538 
03539     if(LayerMode)
03540     {
03541         // In layer mode.
03542         String_256  ResourceText( _R(IDS_MOVELAYERBEHIND), ModuleID );
03543 
03544         // Explicitly cast return value from GetDescription from a TCHAR* to a String_256
03545         ok = GetDescription((TCHAR*) ResourceText, WhichText);
03546     }
03547     else
03548     {
03549         // In frame mode.
03550         String_256 ResourceText( _R(IDS_MOVERFAMEBEHIND), ModuleID );
03551 
03552         // Explicitly cast return value from GetDescription from a TCHAR* to a String_256
03553         ok = GetDescription((TCHAR*) ResourceText, WhichText);
03554     }
03555     
03556     // if description is found then return true else return false
03557     if (ok)        
03558     {
03559         *Description = String_256(ok);
03560         return TRUE;
03561     }
03562     else
03563         return FALSE;
03564 
03565 }


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