OpShowGuides Class Reference

Allows the user to toggle the visible state of all guides. Notes: -. More...

#include <snapops.h>

Inheritance diagram for OpShowGuides:

Operation MessageHandler ListItem CCObject SimpleCCObject List of all members.

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.

Detailed Description

Allows the user to toggle the visible state of all guides. Notes: -.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/9/95

Definition at line 230 of file snapops.h.


Constructor & Destructor Documentation

OpShowGuides::OpShowGuides  ) 
 

Constructor for OpShowGuides operation. It is not undoable.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/9/95
Parameters:
[INPUTS] 
[OUTPUTS] 
Returns:

Errors: None

Definition at line 669 of file snapops.cpp.

00670 {
00671 }


Member Function Documentation

void OpShowGuides::Do OpDescriptor  )  [virtual]
 

Forces a redraw of the selected DocView and toggles the view's ShowGuides flag.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/9/95
Parameters:
None [INPUTS]
None [OUTPUTS]
Returns:
None

Errors: None

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 }

OpState OpShowGuides::GetState String_256 pUIDescription,
OpDescriptor
[static]
 

This item is always available, so long as a document is visible.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/9/95
Parameters:
[INPUTS] 
[OUTPUTS] 
Returns:

Errors: None

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 }

BOOL OpShowGuides::Init void   )  [static]
 

Declares op descriptors for show grid toggle op.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/9/95
Parameters:
None [INPUTS]
None [OUTPUTS]
Returns:
TRUE if worked, FALSE if failed (out of memory)

Errors: Returns FALSE on failure. Scope: Static

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 }


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:58:56 2007 for Camelot by  doxygen 1.4.4