#include <opimgset.h>
Inheritance diagram for OpOverprintFill:
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. |
Definition at line 431 of file opimgset.h.
|
Constructor for OpOverprintFill operation.
Definition at line 954 of file opimgset.cpp.
|
|
Applies the "overprint fill" attribute to the selection.
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 }
|
|
As usual for GetStates.
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 }
|
|
Registers this Op.
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 }
|
|
Reimplemented from SelOperation. Definition at line 444 of file opimgset.h. 00444 { return FALSE; }
|