OpOverprintLine Class Reference

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

#include <opimgset.h>

Inheritance diagram for OpOverprintLine:

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

Public Member Functions

 OpOverprintLine ()
 Constructor for OpOverprintLine operation.
void Do (OpDescriptor *OpDesc)
 Applies the "overprint line" 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 AttrOverprintLine 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 398 of file opimgset.h.


Constructor & Destructor Documentation

OpOverprintLine::OpOverprintLine  ) 
 

Constructor for OpOverprintLine operation.

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

Definition at line 797 of file opimgset.cpp.

00798 {
00799 }


Member Function Documentation

void OpOverprintLine::Do OpDescriptor OpDesc  )  [virtual]
 

Applies the "overprint line" attribute to the selection.

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

Reimplemented from Operation.

Definition at line 814 of file opimgset.cpp.

00815 {
00816     // Determine if we can apply ourself at the moment. We call GetState
00817     // so that the state determination code is nicely centralised.
00818     OpState State = GetState(NULL, OpDesc);
00819 
00820     if (!State.Greyed)
00821     {
00822         // Create a new overprint attribute
00823         NodeAttribute *Attrib = new AttrOverprintLine;
00824 
00825         if (Attrib != NULL)
00826         {
00827             // By default we've made an attribute which is OFF. If the State indicates
00828             // (via the ticked flag) that the selection contains some item(s) which are ON,
00829             // then we want to toggle the state OFF - otherwise, we force the attribute ON.
00830             if (!State.Ticked)
00831                 ((OverprintLineAttrValue *)Attrib->GetAttributeValue())->SetOverprint(TRUE);
00832 
00833             // And apply it
00834             AttributeManager::AttributeSelected(Attrib);
00835         }
00836     }
00837 
00838     End();
00839 }

OpState OpOverprintLine::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 899 of file opimgset.cpp.

00900 {
00901     OpState State;
00902 
00903     SelRange *Selection = GetApplication()->FindSelection();
00904     if (Selection == NULL || Selection->Count() < 1)
00905     {
00906         State.Greyed = TRUE;
00907         if (ShadeReason != NULL)
00908             ShadeReason->MakeMsg(_R(IDS_NO_OBJECTS_SELECTED));
00909     }
00910     else
00911     {
00912         // If any of the selection has the attribute applied, tick the op
00913         NodeAttribute *CurAttr = NULL;
00914 
00915         SelRange::CommonAttribResult result =
00916             Selection->FindCommonAttribute(CC_RUNTIME_CLASS(AttrOverprintLine), &CurAttr);
00917 
00918         if (result == SelRange::ATTR_MANY)
00919             State.Ticked = TRUE;            // Selection includes all states, so mark it as ON
00920         else if (result == SelRange::ATTR_COMMON)
00921         {
00922             // The entire selection uses the same attribute - but is it ON or OFF?
00923             if ( ((OverprintLineAttrValue *)CurAttr->GetAttributeValue())->IsOverprintOn() )
00924                 State.Ticked = TRUE;        // It's ON
00925         }
00926     }
00927 
00928     return(State);
00929 }

BOOL OpOverprintLine::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 854 of file opimgset.cpp.

00855 {
00856     return(Operation::RegisterOpDescriptor(
00857                         0,
00858                         _R(IDS_ATTROVERPRINTLINE),
00859                         CC_RUNTIME_CLASS(OpOverprintLine),
00860                         OPTOKEN_OVERPRINTLINE,
00861                         OpOverprintLine::GetState,
00862                         _R(IDS_HELP_OVERPRINTLINE),     // Help ID
00863                         _R(IDS_BBL_OVERPRINTLINE),      // bubble help ID
00864                         _R(IDD_BARCONTROLSTORE),        // resource ID
00865                         _R(IDC_OVERPRINTLINE),          // control ID
00866                         SYSTEMBAR_UTILITIES,        // Bar ID
00867                         TRUE,                       // Recieve system messages
00868                         FALSE,                      // Smart duplicate operation
00869                         FALSE,                      // NOT Clean operation
00870                         NULL,                       // No vertical counterpart
00871                         0,                          // String for one copy only error
00872                         GREY_WHEN_NO_SELECTION |    // Auto state flags
00873                         DONT_GREY_WHEN_SELECT_INSIDE
00874                     ));
00875 }

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

Reimplemented from SelOperation.

Definition at line 411 of file opimgset.h.

00411 { 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