#include <snapops.h>
Inheritance diagram for OpShowGuides:
Public Member Functions | |
OpShowGuides () | |
Constructor for OpShowGuides operation. It is not undoable. | |
void | Do (OpDescriptor *) |
Forces a redraw of the selected DocView and toggles the view's ShowGuides flag. | |
Static Public Member Functions | |
static BOOL | Init () |
Declares op descriptors for show grid toggle op. | |
static OpState | GetState (String_256 *, OpDescriptor *) |
This item is always available, so long as a document is visible. |
Definition at line 230 of file snapops.h.
|
Constructor for OpShowGuides operation. It is not undoable.
Definition at line 669 of file snapops.cpp.
|
|
Forces a redraw of the selected DocView and toggles the view's ShowGuides flag.
Reimplemented from Operation. Definition at line 687 of file snapops.cpp. 00688 { 00689 DocView *pDocView = DocView::GetSelected(); 00690 00691 if (pDocView != NULL) 00692 { 00693 pDocView->SetShowGuidesState(!pDocView->GetShowGuidesState()); 00694 00695 Spread* pSpread = Document::GetSelectedSpread(); 00696 Document* pDoc = Document::GetSelected(); 00697 if (pSpread != NULL && pDoc != NULL) 00698 { 00699 Layer* pLayer = pSpread->FindFirstGuideLayer(); 00700 if (pLayer != NULL) 00701 LayerSGallery::ForceRedrawLayer(pDoc,pLayer); 00702 } 00703 00704 BROADCAST_TO_ALL(SpreadMsg(pSpread,SpreadMsg::LAYERCHANGES)); 00705 } 00706 00707 End(); 00708 }
|
|
This item is always available, so long as a document is visible.
Definition at line 724 of file snapops.cpp. 00725 { 00726 OpState OpSt; 00727 00728 DocView *pDocView = DocView::GetSelected(); 00729 if (pDocView != NULL) 00730 OpSt.Ticked = pDocView->GetShowGuidesState(); 00731 00732 Spread* pSpread = Document::GetSelectedSpread(); 00733 if (pSpread != NULL) 00734 { 00735 // if we have a guide layer, then make the menu item available, if not, grey it 00736 // and give a reason. 00737 if (pSpread->FindFirstGuideLayer() != NULL) 00738 { 00739 OpSt.Greyed = FALSE; 00740 } 00741 else 00742 { 00743 OpSt.Greyed = TRUE; 00744 *pUIDescription = String_256 (_R(IDS_NO_GUIDES)); 00745 } 00746 00747 } // if (pSpread != NULL) 00748 00749 return OpSt; 00750 }
|
|
Declares op descriptors for show grid toggle op.
Reimplemented from SimpleCCObject. Definition at line 633 of file snapops.cpp. 00634 { 00635 return RegisterOpDescriptor( 0, // Tool ID 00636 _R(IDS_SHOWGUIDES), // String resource ID 00637 CC_RUNTIME_CLASS(OpShowGuides),// Runtime class 00638 OPTOKEN_SHOWGUIDES, // Token string 00639 GetState, // GetState function 0, // help ID 00640 0, // help ID 00641 _R(IDBBL_SHOWGUIDES), // bubble help 00642 _R(IDD_BARCONTROLSTORE), // resource ID 00643 _R(IDC_BTN_WINDOWGRID), // control ID 00644 SYSTEMBAR_WINDOW, // Bar ID 00645 TRUE, // Recieve system messages 00646 FALSE, // Smart duplicate operation 00647 TRUE, // Clean operation 00648 0, // No vertical counterpart 00649 0, // String for one copy only error 00650 (DONT_GREY_WHEN_SELECT_INSIDE | GREY_WHEN_NO_CURRENT_DOC), // Auto state flags 00651 TRUE // fCheckable 00652 ); 00653 }
|