OpPrintOnAllPlates Class Reference

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

#include <opimgset.h>

Inheritance diagram for OpPrintOnAllPlates:

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

Public Member Functions

 OpPrintOnAllPlates ()
 Constructor for OpPrintOnAllPlates operation.
void Do (OpDescriptor *OpDesc)
 Applies the "print on all plates" 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 AttrPrintOnAllPlates 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 464 of file opimgset.h.


Constructor & Destructor Documentation

OpPrintOnAllPlates::OpPrintOnAllPlates  ) 
 

Constructor for OpPrintOnAllPlates operation.

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

Definition at line 1113 of file opimgset.cpp.

01114 {
01115 }


Member Function Documentation

void OpPrintOnAllPlates::Do OpDescriptor OpDesc  )  [virtual]
 

Applies the "print on all plates" attribute to the selection.

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

Reimplemented from Operation.

Definition at line 1130 of file opimgset.cpp.

01131 {
01132     // Determine if we can apply ourself at the moment. We call GetState
01133     // so that the state determination code is nicely centralised.
01134     OpState State = GetState(NULL, OpDesc);
01135 
01136     if (!State.Greyed)
01137     {
01138         // Create a new overprint attribute
01139         NodeAttribute *Attrib = new AttrPrintOnAllPlates;
01140 
01141         if (Attrib != NULL)
01142         {
01143             // By default we've made an attribute which is OFF. If the State indicates
01144             // (via the ticked flag) that the selection contains some item(s) which are ON,
01145             // then we want to toggle the state OFF - otherwise, we force the attribute ON.
01146             if (!State.Ticked)
01147                 ((PrintOnAllPlatesAttrValue *)Attrib->GetAttributeValue())->SetPrintOnAllPlates(TRUE);
01148 
01149             // And apply it
01150             AttributeManager::AttributeSelected(Attrib);
01151         }
01152     }
01153 
01154     End();
01155 }

OpState OpPrintOnAllPlates::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 1215 of file opimgset.cpp.

01216 {
01217     OpState State;
01218 
01219     SelRange *Selection = GetApplication()->FindSelection();
01220     if (Selection == NULL || Selection->Count() < 1)
01221     {
01222         State.Greyed = TRUE;
01223         if (ShadeReason != NULL)
01224             ShadeReason->MakeMsg(_R(IDS_NO_OBJECTS_SELECTED));
01225     }
01226     else
01227     {
01228         // If any of the selection has the attribute applied, tick the op
01229         NodeAttribute *CurAttr = NULL;
01230 
01231         SelRange::CommonAttribResult result =
01232             Selection->FindCommonAttribute(CC_RUNTIME_CLASS(AttrPrintOnAllPlates), &CurAttr);
01233 
01234         if (result == SelRange::ATTR_MANY)
01235             State.Ticked = TRUE;            // Selection includes all states, so mark it as ON
01236         else if (result == SelRange::ATTR_COMMON)
01237         {
01238             // The entire selection uses the same attribute - but is it ON or OFF?
01239             if ( ((PrintOnAllPlatesAttrValue *)CurAttr->GetAttributeValue())->IsPrintOnAllPlatesOn() )
01240                 State.Ticked = TRUE;        // It's ON
01241         }
01242     }
01243 
01244     return(State);
01245 }

BOOL OpPrintOnAllPlates::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 1170 of file opimgset.cpp.

01171 {
01172     return(Operation::RegisterOpDescriptor(
01173                         0,
01174                         _R(IDS_ATTRPRINTONALLPLATES),
01175                         CC_RUNTIME_CLASS(OpPrintOnAllPlates),
01176                         OPTOKEN_PRINTONALLPLATES,
01177                         OpPrintOnAllPlates::GetState,
01178                         _R(IDS_HELP_PRINTONALLPLATES),  // Help string ID
01179                         _R(IDS_BBL_PRINTONALLPLATES),   // bubble help ID
01180                         _R(IDD_BARCONTROLSTORE),        // resource ID
01181                         _R(IDC_PRINTONALLPLATES),       // control ID
01182                         SYSTEMBAR_UTILITIES,        // Bar ID
01183                         TRUE,                       // Recieve system messages
01184                         FALSE,                      // Smart duplicate operation
01185                         FALSE,                      // NOT Clean operation
01186                         NULL,                       // No vertical counterpart
01187                         0,                          // String for one copy only error
01188                         GREY_WHEN_NO_SELECTION |    // Auto state flags
01189                         DONT_GREY_WHEN_SELECT_INSIDE
01190                     ));
01191 }

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

Reimplemented from SelOperation.

Definition at line 477 of file opimgset.h.

00477 { return FALSE; }


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