OpShapeToggleElipPoly Class Reference

This class is an operation that toggles the ellipse/polygon state of all selected QuickShapes. More...

#include <shapeops.h>

Inheritance diagram for OpShapeToggleElipPoly:

OpShapeToggleBase SelOperation UndoableOperation Operation MessageHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 OpShapeToggleElipPoly ()
 Constructs an OpShapeToggleElipPoly object.

Static Public Member Functions

static BOOL Init ()
 Initialise the toggle ellipseness operation by registering it.
static OpState GetState (String_256 *, OpDescriptor *)
 Find the state of the OpShapeToggleElipPoly operation.

Protected Member Functions

BOOL DoAction (NodeRegularShape *pShape)
 Toggles the ellipse/polygon state of a shape.

Detailed Description

This class is an operation that toggles the ellipse/polygon state of all selected QuickShapes.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/04/95
See also:
OpShapeToggleBase

Definition at line 545 of file shapeops.h.


Constructor & Destructor Documentation

OpShapeToggleElipPoly::OpShapeToggleElipPoly  ) 
 

Constructs an OpShapeToggleElipPoly object.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/04/95

Definition at line 3503 of file shapeops.cpp.

03503                                             : OpShapeToggleBase()
03504 {
03505 }


Member Function Documentation

BOOL OpShapeToggleElipPoly::DoAction NodeRegularShape pShape  )  [protected, virtual]
 

Toggles the ellipse/polygon state of a shape.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/4/95
Parameters:
pShape - points to the shape to toggle [INPUTS]
- [OUTPUTS]
Returns:
TRUE/FALSE for successful toggle

Errors: -

See also:
-

Reimplemented from OpShapeToggleBase.

Definition at line 3609 of file shapeops.cpp.

03610 {
03611     BOOL Success = TRUE;
03612 
03613     if (Success)
03614         Success = (ChangeShapeDataAction::DoToggle(this, &UndoActions, pShape,
03615                 ChangeShapeDataAction::CHANGE_CIRCULAR, pShape->IsCircular() ? 1.0 : 0.0) != AC_FAIL);
03616     if (Success)
03617         pShape->SetCircular(!pShape->IsCircular());
03618 
03619     return Success;
03620 }

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

Find the state of the OpShapeToggleElipPoly operation.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/04/95
Parameters:
UIDescription - the name of the opertaion to display [INPUTS] OpDescriptor - To help update the state
UIDescription - The name of the operation [OUTPUTS]
Returns:
The state of the operation

Errors: -

See also:
-

Definition at line 3525 of file shapeops.cpp.

03526 {
03527     OpState OpSt;  
03528     OpSt.Greyed = TRUE; 
03529     BOOL FoundEllipse = FALSE;  
03530     BOOL FoundPolygon = FALSE;  
03531     ObjChangeFlags cFlags;
03532     ObjChangeParam ObjChange(OBJCHANGE_STARTING,cFlags,NULL,NULL);
03533 
03534     SelRange* pSelection = GetApplication()->FindSelection();
03535     Node* pNode = pSelection->FindFirst();
03536 
03537     while (pNode != NULL)
03538     {
03539         if (IS_A(pNode, NodeRegularShape))
03540         {
03541             NodeRegularShape* pShape = (NodeRegularShape*)pNode;
03542         
03543             // Convert this shape if it's parents allow
03544             if (pShape->AllowOp(&ObjChange))                
03545             {
03546                 if (pShape->IsCircular())
03547                     FoundEllipse = TRUE;
03548                 else
03549                     FoundPolygon = TRUE;
03550             }
03551         }
03552 
03553         // Get the next selected thing
03554         pNode = pSelection->FindNext(pNode);
03555     }
03556 
03557     if (FoundEllipse || FoundPolygon)
03558         OpSt.Greyed = FALSE;
03559     if (FoundEllipse && !FoundPolygon)
03560         UIDescription->Load(_R(IDS_OPSHAPETOGGLE_ELIP_PO));
03561     if (!FoundEllipse && FoundPolygon)
03562         UIDescription->Load(_R(IDS_OPSHAPETOGGLE_ELIP_EP));
03563 
03564     return(OpSt);   
03565 }                                    

BOOL OpShapeToggleElipPoly::Init void   )  [static]
 

Initialise the toggle ellipseness operation by registering it.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/4/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE/FALSE for successful init

Errors: -

See also:
-

Reimplemented from SimpleCCObject.

Definition at line 3584 of file shapeops.cpp.

03585 {
03586     return(RegisterOpDescriptor(0, 
03587                                 _R(IDS_OPSHAPETOGGLE_ELIP),
03588                                 CC_RUNTIME_CLASS(OpShapeToggleElipPoly), 
03589                                 OPTOKEN_TOGGLEELIPPOLY,
03590                                 OpShapeToggleElipPoly::GetState)); 
03591 }


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