OpOverprintFill Class Reference

An Op for toggling the AttrOverprintFill attribute. More...

#include <opimgset.h>

Inheritance diagram for OpOverprintFill:

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

Public Member Functions

 OpOverprintFill ()
 Constructor for OpOverprintFill operation.
void Do (OpDescriptor *OpDesc)
 Applies the "overprint fill" attribute to the selection.
virtual BOOL MayChangeNodeBounds () const

Static Public Member Functions

static BOOL Init (void)
 Registers this Op.
static OpState GetState (String_256 *ShadeReason, OpDescriptor *OpDesc)
 As usual for GetStates.

Detailed Description

An Op for toggling the AttrOverprintFill attribute.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/7/96
Notes: This Op is available from the context menu, when popped up over a selection. It resides in the "Imagesetting" submenu. See viewmenu.cpp for details.

Definition at line 431 of file opimgset.h.


Constructor & Destructor Documentation

OpOverprintFill::OpOverprintFill  ) 
 

Constructor for OpOverprintFill operation.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/7/96

Definition at line 954 of file opimgset.cpp.

00955 {
00956 }


Member Function Documentation

void OpOverprintFill::Do OpDescriptor OpDesc  )  [virtual]
 

Applies the "overprint fill" attribute to the selection.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/7/96

Reimplemented from Operation.

Definition at line 971 of file opimgset.cpp.

00972 {
00973     // Determine if we can apply ourself at the moment. We call GetState
00974     // so that the state determination code is nicely centralised.
00975     OpState State = GetState(NULL, OpDesc);
00976 
00977     if (!State.Greyed)
00978     {
00979         // Create a new overprint attribute
00980         NodeAttribute *Attrib = new AttrOverprintFill;
00981 
00982         if (Attrib != NULL)
00983         {
00984             // By default we've made an attribute which is OFF. If the State indicates
00985             // (via the ticked flag) that the selection contains some item(s) which are ON,
00986             // then we want to toggle the state OFF - otherwise, we force the attribute ON.
00987             if (!State.Ticked)
00988                 ((OverprintFillAttrValue *)Attrib->GetAttributeValue())->SetOverprint(TRUE);
00989 
00990             // And apply it
00991             AttributeManager::AttributeSelected(Attrib);
00992         }
00993     }
00994 
00995     End();
00996 }

OpState OpOverprintFill::GetState String_256 ShadeReason,
OpDescriptor OpDesc
[static]
 

As usual for GetStates.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/7/96
Parameters:
ShadeReason - If this is non-NULL, and if the returned OpState [OUTPUTS] indicates that this Op is shaded, it will be returned filled in with a string describing why the Op is shaded. Otherwise this string is left untouched
OpDesc - The descriptor with which we'll be invoked

Returns:
An OpState indicating this Op's state

Definition at line 1056 of file opimgset.cpp.

01057 {
01058     OpState State;
01059 
01060     SelRange *Selection = GetApplication()->FindSelection();
01061     if (Selection == NULL || Selection->Count() < 1)
01062     {
01063         State.Greyed = TRUE;
01064         if (ShadeReason != NULL)
01065             ShadeReason->MakeMsg(_R(IDS_NO_OBJECTS_SELECTED));
01066     }
01067     else
01068     {
01069         // If any of the selection has the attribute applied, tick the op
01070         NodeAttribute *CurAttr = NULL;
01071 
01072         SelRange::CommonAttribResult result =
01073             Selection->FindCommonAttribute(CC_RUNTIME_CLASS(AttrOverprintFill), &CurAttr);
01074 
01075         if (result == SelRange::ATTR_MANY)
01076             State.Ticked = TRUE;            // Selection includes all states, so mark it as ON
01077         else if (result == SelRange::ATTR_COMMON)
01078         {
01079             // The entire selection uses the same attribute - but is it ON or OFF?
01080             if ( ((OverprintFillAttrValue *)CurAttr->GetAttributeValue())->IsOverprintOn() )
01081                 State.Ticked = TRUE;        // It's ON
01082         }
01083     }
01084 
01085     return(State);
01086 }

BOOL OpOverprintFill::Init void   )  [static]
 

Registers this Op.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/7/96

Reimplemented from SimpleCCObject.

Definition at line 1011 of file opimgset.cpp.

01012 {
01013     return(Operation::RegisterOpDescriptor(
01014                         0,
01015                         _R(IDS_ATTROVERPRINTFILL),
01016                         CC_RUNTIME_CLASS(OpOverprintFill),
01017                         OPTOKEN_OVERPRINTFILL,
01018                         OpOverprintFill::GetState,
01019                         _R(IDS_HELP_OVERPRINTFILL),
01020                         _R(IDS_BBL_OVERPRINTFILL),      // bubble help ID
01021                         _R(IDD_BARCONTROLSTORE),        // resource ID
01022                         _R(IDC_OVERPRINTFILL),          // control ID
01023                         SYSTEMBAR_UTILITIES,        // Bar ID
01024                         TRUE,                       // Recieve system messages
01025                         FALSE,                      // No smart duplicate operation
01026                         FALSE,                      // Not Clean operation
01027                         NULL,                       // No vertical counterpart
01028                         0,                          // String for one copy only error
01029                         GREY_WHEN_NO_SELECTION |    // Auto state flags
01030                         DONT_GREY_WHEN_SELECT_INSIDE
01031                     ));
01032 }

virtual BOOL OpOverprintFill::MayChangeNodeBounds  )  const [inline, virtual]
 

Reimplemented from SelOperation.

Definition at line 444 of file opimgset.h.

00444 { return FALSE; }


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