OpChangeBarProperty Class Reference

#include <ngsetop.h>

Inheritance diagram for OpChangeBarProperty:

UndoableOperation Operation MessageHandler ListItem CCObject SimpleCCObject List of all members.

Private Member Functions

 CC_DECLARE_DYNCREATE (OpChangeBarProperty)
virtual void DoWithParam (OpDescriptor *, OpParam *pParam)
 Runs the OPTOKEN_CHANGE_BAR_PROPERTY operation.
virtual BOOL MayChangeNodeBounds () const

Static Private Member Functions

static BOOL DoChangeBarProperty (UndoableOperation *pOp, INT32 Index, NodeBarProperty *pProp, const BarDataType *pBarData, BOOL *pMadeLive=NULL)

Private Attributes

INT32 m_BarIndex
BOOL m_MakingLive

Detailed Description

Definition at line 406 of file ngsetop.h.


Member Function Documentation

OpChangeBarProperty::CC_DECLARE_DYNCREATE OpChangeBarProperty   )  [private]
 

BOOL OpChangeBarProperty::DoChangeBarProperty UndoableOperation pOp,
INT32  Index,
NodeBarProperty pProp,
const BarDataType pBarData,
BOOL *  pMadeLive = NULL
[static, private]
 

Definition at line 1018 of file ngsetop.cpp.

01019 {
01020     if (pMadeLive)
01021         *pMadeLive = FALSE;
01022 
01023     if (!pOp || !pProp || !pBarData)
01024         return FALSE;
01025 
01026     // Try to duplicate the old bar properties.
01027     NodeBarProperty* pCopy;
01028     ALLOC_WITH_FAIL(pCopy, ((NodeBarProperty*) pProp->SimpleCopy()), pOp);
01029     if (pCopy == 0)
01030     {
01031         return FALSE;
01032     }
01033 
01034     // Try to attach the duplicate bar properties in the right place.
01035     pCopy->AttachNode(pOp->GetWorkingDoc()->GetSetSentinel(), LASTCHILD);
01036     HideNodeAction* pHideAct;
01037     if (AC_FAIL == HideNodeAction::Init(pOp, pOp->GetUndoActions(), pCopy,
01038                                         TRUE, (Action**) &pHideAct))
01039     {
01040         delete pCopy;
01041         return FALSE;
01042     }
01043 
01044     // Write the new data into the duplicate.
01045     if (Index >= (INT32)pCopy->HowMany())
01046         pCopy->Add(*pBarData);
01047     else
01048     {
01049         BOOL MakingLive = !pCopy->Bar(Index).IsLive && pBarData->IsLive;
01050         BarDataType* pCopyData = &pCopy->Bar(Index);
01051         *pCopyData = *pBarData;
01052         if (pMadeLive)
01053             *pMadeLive = MakingLive;
01054     }
01055 
01056     // Try to hide the old bar properties.
01057     if (!pOp->DoHideNode(pProp, TRUE, 0, TRUE))
01058     {
01059         return FALSE;
01060     }
01061     
01062     return TRUE;
01063 }

void OpChangeBarProperty::DoWithParam OpDescriptor ,
OpParam pParam
[private, virtual]
 

Runs the OPTOKEN_CHANGE_BAR_PROPERTY operation.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/8/99
Parameters:
pParam->Param2 --- pointer to the OpChangeBarPropParam [INPUTS]
See also:
NodeBarProperty::MakeChange; OpChangeBarPropParam

Reimplemented from Operation.

Definition at line 979 of file ngsetop.cpp.

00980 {
00981     // Extract the parameter.
00982     ERROR3IF(pParam == 0, "OpChangeBarProperty::DoWithParam: no parameter");
00983     OpChangeBarPropParam* pInput = (OpChangeBarPropParam*) (pParam);
00984     NodeBarProperty* pProp = pInput->m_Prop; //(NodeBarProperty*) (pParam->Param1);
00985     ERROR3IF(pInput == 0 || pProp == 0, "OpChangeBarProperty::DoWithParam: no property");
00986 
00987     // Set this to a special value to indicate it's as yet unused.
00988     m_BarIndex = -1;
00989     m_MakingLive = FALSE; // is the live stretch being turned back on?
00990 
00991     // Try to duplicate the old bar properties.
00992     if (!DoChangeBarProperty(this, pInput->m_nIndex, pProp, pInput->m_pbdtInfo, &m_MakingLive))
00993     {
00994         FailAndExecute();
00995         End();
00996         return;
00997     }
00998 
00999     // does this to record what the op was that triggered the extending stuff
01000     // most ops don't do it like this. Instead they go through AllowOp
01001     // but his doesn't need to go through AllowOp and doesn't call that
01002     // so it calls this instead. sjk
01003     NameGallery* pNameGallery = NameGallery::Instance();
01004     if (pNameGallery != 0)
01005     {
01006         // set up for a bar wiggling
01007         pNameGallery->PreTriggerEdit(this, 0, (Node*) 0);
01008 
01009         // make sure this bar does know it has been touched
01010         pNameGallery->m_TouchedBar = pInput->m_nIndex;
01011         m_BarIndex = pInput->m_nIndex;
01012     }
01013 
01014     // Success.
01015     End();
01016 }

virtual BOOL OpChangeBarProperty::MayChangeNodeBounds  )  const [inline, private, virtual]
 

Reimplemented from UndoableOperation.

Definition at line 412 of file ngsetop.h.

00412 { return TRUE; }


Member Data Documentation

INT32 OpChangeBarProperty::m_BarIndex [private]
 

Definition at line 413 of file ngsetop.h.

BOOL OpChangeBarProperty::m_MakingLive [private]
 

Definition at line 414 of file ngsetop.h.


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