RestoreFillRampAction Class Reference

An action which undoes the modification of Grad Fill data. This action can be used for undoing changing control points. This operation Changes the Colour of a Fill already in the tree. This operation Changes the Colour of a Fill already in the tree. An action which undoes the modification of Grad Fill data. This action can be used for undoing changing colours. Action for restoring fill ramps after changes have been made. More...

#include <opgrad.h>

Inheritance diagram for RestoreFillRampAction:

Action ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 RestoreFillRampAction ()
 Constructor for the action.
 ~RestoreFillRampAction ()
virtual ActionCode Execute ()
 Executes the action. This will reset the num blend steps in pThisNodeBlend to OldNumSteps, after creating another action to record the current num steps of pThisNodeBlend.

Static Public Member Functions

static ActionCode Init (Operation *pOp, ActionList *pActionList, AttrFillGeometry *pFill, RestoreFillRampAction **NewAction)
 Stores the fill ramp of the given attribute for restoring on undo.

Protected Attributes

AttrFillGeometrym_pAttr
ColourRamp m_LastRamp

Detailed Description

An action which undoes the modification of Grad Fill data. This action can be used for undoing changing control points. This operation Changes the Colour of a Fill already in the tree. This operation Changes the Colour of a Fill already in the tree. An action which undoes the modification of Grad Fill data. This action can be used for undoing changing colours. Action for restoring fill ramps after changes have been made.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/10/99
See also:
-

Definition at line 448 of file opgrad.h.


Constructor & Destructor Documentation

RestoreFillRampAction::RestoreFillRampAction  ) 
 

Constructor for the action.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/10/99
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 3864 of file opgrad.cpp.

03865 {
03866     m_pAttr  = NULL;
03867 }

RestoreFillRampAction::~RestoreFillRampAction  ) 
 

Definition at line 3984 of file opgrad.cpp.

03985 {
03986 }


Member Function Documentation

ActionCode RestoreFillRampAction::Execute  )  [virtual]
 

Executes the action. This will reset the num blend steps in pThisNodeBlend to OldNumSteps, after creating another action to record the current num steps of pThisNodeBlend.

Author:
Olivier_Gascoin (Xara Group Ltd) <camelotdev@xara.com>
Date:
07/01/96
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
ActionCode, one of AC_OK, AC_NO_RECORD or AC_FAIL

Errors: -

See also:
Action::Init()

Reimplemented from Action.

Definition at line 3938 of file opgrad.cpp.

03939 {
03940     ActionCode Act;
03941     RestoreFillRampAction* pAction;
03942 
03943     Act = RestoreFillRampAction::Init(  pOperation, 
03944                                         pOppositeActLst,
03945                                         m_pAttr,
03946                                         &pAction
03947                                         );
03948 
03949     if (Act != AC_FAIL)
03950     {
03951         Document * pDoc = Document::GetCurrent();
03952         
03953         if (pDoc)
03954         {
03955             /*
03956             DocRect dr = pController->GetBoundingRect();
03957             
03958             pDoc->ForceRedraw(pController->FindParentSpread(), 
03959                 dr, FALSE);
03960                 */
03961 
03962             // CGS - we need to check for a NULL colour ramp - cause we may have deleted it!
03963             
03964             ColourRamp* ColRamp = m_pAttr->GetColourRamp();
03965 
03966             if (ColRamp)
03967             {
03968                 *m_pAttr->GetColourRamp() = m_LastRamp;
03969             }
03970             else
03971             {
03972                 // if it is NULL, then we need to recreate one BEFORE making the above call!
03973 
03974                 ColRamp = new ColourRamp ();
03975                 m_pAttr->SetColourRamp (ColRamp);
03976                 *m_pAttr->GetColourRamp() = m_LastRamp;
03977             }
03978         }
03979     }
03980     
03981     return Act;
03982 }

ActionCode RestoreFillRampAction::Init Operation pOp,
ActionList pActionList,
AttrFillGeometry pFill,
RestoreFillRampAction **  NewAction
[static]
 

Stores the fill ramp of the given attribute for restoring on undo.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/6/99
Parameters:
pOp = ptr to the operation to which this action belongs [INPUTS] pActionList = ptr to action list to which this action should be added pFill = ptr to the fill geometry attribute to store its ramp
ppNewAction = ptr to a ptr to an action, allowing the function to return [OUTPUTS] a pointer to the created action
Returns:
ActionCode, one of AC_OK, AC_NO_RECORD or AC_FAIL

Errors: -

See also:
Action::Init()

Definition at line 3894 of file opgrad.cpp.

03898 {
03899     UINT32 ActSize = sizeof(RestoreFillRampAction);
03900 
03901     ActionCode Ac = Action::Init(pOp,pActionList,ActSize,
03902         CC_RUNTIME_CLASS(RestoreFillRampAction),
03903         (Action**)NewAction);
03904 
03905 //  Document * pDoc = Document::GetCurrent();   
03906 
03907     DocRect dr;
03908 
03909     if (Ac != AC_FAIL)
03910     {
03911         if (pFill->GetColourRamp() != NULL)
03912         {
03913             (*NewAction)->m_LastRamp = *pFill->GetColourRamp();
03914         }       
03915         // bugfix #6835 (Marc 22/09/04) - make sure we store the fill even if there is no ramp
03916         (*NewAction)->m_pAttr    = pFill;
03917     }
03918 
03919     return Ac;
03920 }


Member Data Documentation

ColourRamp RestoreFillRampAction::m_LastRamp [protected]
 

Definition at line 464 of file opgrad.h.

AttrFillGeometry* RestoreFillRampAction::m_pAttr [protected]
 

Definition at line 463 of file opgrad.h.


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