#include <opimgset.h>
Inheritance diagram for OpPrintOnAllPlates:
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. |
Definition at line 464 of file opimgset.h.
|
Constructor for OpPrintOnAllPlates operation.
Definition at line 1113 of file opimgset.cpp.
|
|
Applies the "print on all plates" attribute to the selection.
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 }
|
|
As usual for GetStates.
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 }
|
|
Registers this Op.
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 }
|
|
Reimplemented from SelOperation. Definition at line 477 of file opimgset.h. 00477 { return FALSE; }
|