OpToggleMouldGrid Class Reference

An operation to turn a particular moulds grid on and off. More...

#include <moldtool.h>

Inheritance diagram for OpToggleMouldGrid:

Operation MessageHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 OpToggleMouldGrid ()
 Constructor for toggle mould grid operation.
void Do (OpDescriptor *)

Static Public Member Functions

static BOOL Init ()
 Initialise the toggle mould grid operation so that it can be accessed from the interface.
static OpState GetState (String_256 *, OpDescriptor *)
 For finding the OpToggleMouldGrid state.

Detailed Description

An operation to turn a particular moulds grid on and off.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/01/95
See also:
-

Definition at line 470 of file moldtool.h.


Constructor & Destructor Documentation

OpToggleMouldGrid::OpToggleMouldGrid  ) 
 

Constructor for toggle mould grid operation.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/01/95
See also:
-

Definition at line 2570 of file moldtool.cpp.

02571 {
02572     // Dummy constructor
02573 }


Member Function Documentation

void OpToggleMouldGrid::Do OpDescriptor  )  [virtual]
 

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/01/95
Parameters:
pointer to an OpDescriptor (unused) [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: failandexecute will be called if the operation fails in some way, most likely when no memory is available.

Reimplemented from Operation.

Definition at line 2685 of file moldtool.cpp.

02686 {
02687     // Get a snapshot of the selection
02688     SelRange* Selected = GetApplication()->FindSelection();
02689     Node* pNode = Selected->FindFirst();
02690     while (pNode)
02691     {
02692         if (pNode->GetRuntimeClass() == CC_RUNTIME_CLASS(NodeMould))
02693         {
02694             NodeMould* pMould = (NodeMould*)pNode;
02695             MouldGeometry* pGeometry = pMould->GetGeometry();
02696             if (pGeometry!=NULL)
02697             {
02698                 Spread* pSpread = pNode->FindParentSpread();
02699                 if (pSpread)
02700                     pGeometry->ToggleControlBlobs(pSpread);
02701             }
02702         }
02703         pNode = Selected->FindNext(pNode);
02704     }
02705     End();
02706 }

OpState OpToggleMouldGrid::GetState String_256 UIDescription,
OpDescriptor
[static]
 

For finding the OpToggleMouldGrid state.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/01/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
The state of the OpToggleMouldGrid

Definition at line 2630 of file moldtool.cpp.

02631 {
02632     OpState OpSt;
02633     String_256 DisableReason; 
02634     OpSt.Greyed = FALSE;
02635 
02636 /*
02637     if (Document::GetCurrent() != NULL)
02638     {
02639         SelRange* Selected = GetApplication()->FindSelection();
02640         if (Selected)
02641             if (!Selected->FindObject(CC_RUNTIME_CLASS(NodeMould), NULL))
02642                 OpSt.Greyed = TRUE;
02643     }
02644 */
02645 
02646     BOOL Sel = FALSE;
02647     if (Document::GetCurrent() != NULL)
02648     {
02649         SelRange* Selected = GetApplication()->FindSelection();
02650         if (Selected)
02651         {
02652             Node* pNode = Selected->FindFirst();
02653             while ((pNode!=NULL) && (!Sel))
02654             {
02655                 if (pNode->GetRuntimeClass() == CC_RUNTIME_CLASS(NodeMould))
02656                     Sel=TRUE;
02657 
02658                 pNode = Selected->FindNext(pNode);
02659             }
02660         }
02661     }
02662 
02663     if (!Sel)
02664         OpSt.Greyed = TRUE;
02665 
02666     return (OpSt);   
02667 }

BOOL OpToggleMouldGrid::Init void   )  [static]
 

Initialise the toggle mould grid operation so that it can be accessed from the interface.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/01/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if the operation could be successfully initialised FALSE if no more memory could be allocated

Errors: ERROR will be called if there was insufficient memory to allocate the operation.

See also:
-

Reimplemented from SimpleCCObject.

Definition at line 2596 of file moldtool.cpp.

02597 {
02598     return (RegisterOpDescriptor(0,                                     // tool ID
02599                                 _R(IDS_TOGGLEMOULDGRID),                    // string resource ID
02600                                 CC_RUNTIME_CLASS(OpToggleMouldGrid),    // runtime class for Op
02601                                 OPTOKEN_TOGGLEMOULDGRID,                // Ptr to token string
02602                                 OpToggleMouldGrid::GetState,            // GetState function
02603                                 0,                                      // help ID
02604                                 _R(IDBBL_TOGGLEMOULDGRID),                  // bubble help ID
02605                                 _R(IDD_MOULDTOOLBAR),                       // resource ID
02606                                 _R(IDC_BTN_TOGGLEMOULDGRID),                // control ID
02607                                 SYSTEMBAR_EDIT,                         // Group bar ID
02608                                 TRUE,                                   // Receive messages
02609                                 FALSE,                                  // Smart
02610                                 FALSE,                                  // Clean
02611                                 0,                                      // One open Instance ID
02612                                 (GREY_WHEN_NO_CURRENT_DOC | GREY_WHEN_NO_SELECTION)
02613                                 )); 
02614 }               


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