#include <shapeops.h>
Inheritance diagram for OpShapeToggleElipPoly:
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. |
Definition at line 545 of file shapeops.h.
|
Constructs an OpShapeToggleElipPoly object.
Definition at line 3503 of file shapeops.cpp. 03503 : OpShapeToggleBase() 03504 { 03505 }
|
|
Toggles the ellipse/polygon state of a shape.
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 }
|
|
Find the state of the OpShapeToggleElipPoly operation.
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 }
|
|
Initialise the toggle ellipseness operation by registering it.
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 }
|