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