OpChangeBrushDefinition Class Reference

This operation exists so that we can make undoable edits to the brush definitions stored in the brush component. More...

#include <brushop.h>

Inheritance diagram for OpChangeBrushDefinition:

UndoableOperation Operation MessageHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 OpChangeBrushDefinition ()
 Constructor.
 ~OpChangeBrushDefinition ()
 destructor
virtual void DoWithParam (OpDescriptor *, OpParam *pOpParam)
 This changes the flag specified in FlagType (given in pOpParam->Param1) in all the selected brush objects to have the same as state of pOpParam->Param2.
virtual void GetOpName (String_256 *OpName)
 The GetOpName fn is overridden so that we return back a description appropriate to the type of attribute that the operation applies. Although this looks identical to the OpChangeBrush fn. it is worth keeping this separate because the ChangeAll string needs to be used for saving the brush definition.

Static Public Member Functions

static BOOL Declare ()
 Adds the operation to the list of all known operations.
static OpState GetState (String_256 *Description, OpDescriptor *)
 Find out the state of the operation at the specific time.

Private Member Functions

 CC_DECLARE_DYNCREATE (OpChangeBrushDefinition)

Private Attributes

ChangeBrushType ChangeType

Detailed Description

This operation exists so that we can make undoable edits to the brush definitions stored in the brush component.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/11/99
See also:
-

Definition at line 122 of file brushop.h.


Constructor & Destructor Documentation

OpChangeBrushDefinition::OpChangeBrushDefinition  ) 
 

Constructor.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Returns:
-

Definition at line 140 of file brushop.cpp.

00141 {
00142      ChangeType = CHANGEBRUSH_NONE; 
00143 }

OpChangeBrushDefinition::~OpChangeBrushDefinition  ) 
 

destructor

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Returns:
-

Definition at line 156 of file brushop.cpp.

00157 {
00158     
00159 }


Member Function Documentation

OpChangeBrushDefinition::CC_DECLARE_DYNCREATE OpChangeBrushDefinition   )  [private]
 

BOOL OpChangeBrushDefinition::Declare  )  [static]
 

Adds the operation to the list of all known operations.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Returns:
TRUE if all went OK, FALSE otherwise

Definition at line 172 of file brushop.cpp.

00173 {
00174     return (RegisterOpDescriptor(
00175                                 0, 
00176                                 0,
00177                                 CC_RUNTIME_CLASS(OpChangeBrushDefinition), 
00178                                 OPTOKEN_CHANGEBRUSHDEF,
00179                                 OpChangeBrushDefinition::GetState,
00180                                 0,  /* help ID */
00181                                 0,  /* bubble ID */
00182                                 0   /* bitmap ID */
00183                                 ));
00184 }

void OpChangeBrushDefinition::DoWithParam OpDescriptor ,
OpParam pOpParam
[virtual]
 

This changes the flag specified in FlagType (given in pOpParam->Param1) in all the selected brush objects to have the same as state of pOpParam->Param2.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Returns:
-

Reimplemented from Operation.

Definition at line 288 of file brushop.cpp.

00289 {
00290     ERROR3IF(pOpParam == NULL,"NULL OpParam ptr");
00291     if (pOpParam == NULL) 
00292     {
00293         FailAndExecute();
00294         return;
00295     }
00296 
00297     ChangeBrushDefOpParam* pChangeParam = (ChangeBrushDefOpParam*)pOpParam;
00298     
00299     // no point doing anything if we have a default brush
00300     if (pChangeParam->m_Handle == BrushHandle_NoBrush)
00301     {
00302         FailAndExecute();
00303         return;
00304     }
00305 
00306     ChangeBrushDefAction* pAction;
00307 
00308     // change the brush in an undoable way
00309     BOOL ok = ChangeBrushDefAction::Init(this,&UndoActions,
00310                                         pChangeParam,&pAction) != AC_FAIL;
00311     
00312     if (ok) 
00313     {
00314         // Note the way the selected brush were changed
00315         ChangeType = pChangeParam->ChangeType;
00316     }
00317     else
00318         FailAndExecute();
00319 
00320     End();
00321 }

void OpChangeBrushDefinition::GetOpName String_256 OpName  )  [virtual]
 

The GetOpName fn is overridden so that we return back a description appropriate to the type of attribute that the operation applies. Although this looks identical to the OpChangeBrush fn. it is worth keeping this separate because the ChangeAll string needs to be used for saving the brush definition.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Parameters:
- [INPUTS]
The undo string for the operation [OUTPUTS]
Returns:

Errors: -

See also:
-

Reimplemented from Operation.

Definition at line 231 of file brushop.cpp.

00232 { 
00233     UINT32 IDS = _R(IDS_MARKN_EMPTY);
00234 
00235     switch (ChangeType)
00236     {
00237         case CHANGEBRUSH_NONE:              break;
00238         case CHANGEBRUSH_SPACING:           IDS = _R(IDS_BRUSHSPACING_UNDO);    break;
00239         case CHANGEBRUSH_SPACING_INCRPROP:  IDS = _R(IDS_BRUSHSPACING_INCR);    break;
00240         case CHANGEBRUSH_SPACING_INCRCONST: IDS = _R(IDS_BRUSHSPACING_INCR);    break;
00241         case CHANGEBRUSH_SPACING_MAXRAND:   IDS = _R(IDS_BRUSHSPACING_MAXRAND); break;
00242         case CHANGEBRUSH_SPACING_RANDSEED:  IDS = _R(IDS_BRUSHSPACING_RANDSEED); break;
00243         case CHANGEBRUSH_SCALING:           IDS = _R(IDS_BRUSHSCALING_UNDO);    break;
00244         case CHANGEBRUSH_SCALING_INCR:      IDS = _R(IDS_BRUSHSCALING_INCR);    break;
00245         case CHANGEBRUSH_SCALING_INCRCONST: IDS = _R(IDS_BRUSHSCALING_INCR);    break;
00246         case CHANGEBRUSH_SCALING_MAXRAND:   IDS = _R(IDS_BRUSHSCALING_MAXRAND); break;
00247         case CHANGEBRUSH_SCALING_RANDSEED:  IDS = _R(IDS_BRUSHSCALING_RANDSEED); break;
00248         case CHANGEBRUSH_OFFSET_TYPE:       IDS = _R(IDS_BRUSHOFFSET_TYPE_UNDO);break;
00249         case CHANGEBRUSH_OFFSET_TYPE_SEED:  IDS = _R(IDS_OFFSETTYPE_RANDSEED);  break;
00250         case CHANGEBRUSH_OFFSET_VAL:        IDS = _R(IDS_BRUSHOFFSET_VAL_UNDO); break;
00251         case CHANGEBRUSH_OFFSET_VALSEED:    IDS = _R(IDS_OFFSETVAL_RANDSEED);   break;
00252         case CHANGEBRUSH_OFFSET_INCRPROP:   IDS = _R(IDS_BRUSHOFFSET_INCR);     break;
00253         case CHANGEBRUSH_OFFSET_INCRCONST:  IDS = _R(IDS_BRUSHOFFSET_INCR);     break;
00254         case CHANGEBRUSH_OFFSET_MAXRAND:    IDS = _R(IDS_OFFSETVAL_MAXRAND);    break;
00255         case CHANGEBRUSH_TILED:             IDS = _R(IDS_BRUSHTILE_UNDO);       break;
00256         case CHANGEBRUSH_TANGENTIAL:        IDS = _R(IDS_BRUSHROTATE_UNDO);     break;
00257         case CHANGEBRUSH_ROTATE_ANGLE:      IDS = _R(IDS_BRUSHROTATE_ANGLE_UNDO); break;
00258         case CHANGEBRUSH_ROTATE_PRESSURE:   IDS = _R(IDS_BRUSHROTATE_PRESSURE); break;
00259         case CHANGEBRUSH_NAME:              IDS = _R(IDS_BRUSHNAME_UNDO);       break;
00260         case CHANGEBRUSH_SEQUENCE:          IDS = _R(IDS_BRUSHNAME_UNDO);       break;
00261         case CHANGEBRUSH_SEQUENCE_RANDSEED: IDS = _R(IDS_SEQUENCE_RANDSEED);    break;
00262         case CHANGEBRUSH_USELOCALFILLCOL:   IDS = _R(IDS_BRUSH_USELOCAL_FILLCOL);       break;
00263         case CHANGEBRUSH_ALL:               IDS = _R(IDS_BRUSH_SAVEDEFINITION);     break;
00264         case CHANGEBRUSH_ROTATE_MAXRAND:    IDS = _R(IDS_ROTATE_MAXRAND);       break;
00265         case CHANGEBRUSH_ROTATE_RANDSEED:   IDS = _R(IDS_ROTATE_RANDSEED);      break;
00266         case CHANGEBRUSH_TIMESTAMP:         IDS = _R(IDS_TIMESTAMP_PERIOD);     break;
00267         case CHANGEBRUSH_REGEN:             break;
00268         
00269         default: ERROR3_PF(("Unknown flag type (%d)",ChangeType));  break;
00270     }
00271 
00272     *OpName = String_256(IDS);
00273 }  

OpState OpChangeBrushDefinition::GetState String_256 Description,
OpDescriptor
[static]
 

Find out the state of the operation at the specific time.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Parameters:
Description - GetState fills this string with an approriate description [OUTPUTS] of the current state of the operation
Returns:
The state of the operation, so that menu items (ticks and greying) can be done properly

Definition at line 202 of file brushop.cpp.

00203 {
00204     OpState Bob;
00205     
00206 
00207     return Bob;
00208 
00209 }


Member Data Documentation

ChangeBrushType OpChangeBrushDefinition::ChangeType [private]
 

Definition at line 141 of file brushop.h.


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