OpSnapToGuides Class Reference

Allows the user to toggle snap-to-guides on and off. Notes: -. More...

#include <snapops.h>

Inheritance diagram for OpSnapToGuides:

Operation MessageHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 OpSnapToGuides ()
 Constructor for OpSnapToGuides operation. It is not undoable.
void Do (OpDescriptor *)
 Toggles the "snap to guides" flag in the selected DocView.

Static Public Member Functions

static BOOL Init ()
 Declares op descriptors for snap to guides 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 snap-to-guides on and off. Notes: -.

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

Definition at line 206 of file snapops.h.


Constructor & Destructor Documentation

OpSnapToGuides::OpSnapToGuides  ) 
 

Constructor for OpSnapToGuides operation. It is not undoable.

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

Errors: None

Definition at line 546 of file snapops.cpp.

00547 {
00548 }


Member Function Documentation

void OpSnapToGuides::Do OpDescriptor  )  [virtual]
 

Toggles the "snap to guides" flag in the selected DocView.

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

Errors: None

Reimplemented from Operation.

Definition at line 564 of file snapops.cpp.

00565 {
00566     DocView *pDocView = DocView::GetSelected();
00567 
00568     if (pDocView != NULL)
00569         pDocView->SetSnapToGuidesState(!pDocView->GetSnapToGuidesState());
00570 
00571     End();
00572 }

OpState OpSnapToGuides::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:
22/9/95
Parameters:
[INPUTS] 
[OUTPUTS] 
Returns:

Errors: None

Definition at line 588 of file snapops.cpp.

00589 {
00590     OpState OpSt;
00591 
00592     DocView *pDocView = DocView::GetSelected();
00593     if (pDocView != NULL)
00594         OpSt.Ticked = pDocView->GetSnapToGuidesState();
00595 
00596     Spread* pSpread = Document::GetSelectedSpread();
00597     if (pSpread != NULL)
00598     {
00599         // if we have a guide layer, then make the menu item available, if not, grey it 
00600         //  and give a reason.
00601         if (pSpread->FindFirstGuideLayer() != NULL)
00602         {
00603             OpSt.Greyed = FALSE;
00604         }
00605         else
00606         {
00607             OpSt.Greyed = TRUE;
00608             *pUIDescription = String_256 (_R(IDS_NO_GUIDES));
00609         }
00610     }
00611     
00612     return OpSt;
00613 }

BOOL OpSnapToGuides::Init void   )  [static]
 

Declares op descriptors for snap to guides toggle op.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/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 510 of file snapops.cpp.

00511 {
00512     return RegisterOpDescriptor(0,                          // Tool ID
00513                                 _R(IDS_SNAPTOGUIDES),           // String resource ID
00514                                 CC_RUNTIME_CLASS(OpSnapToGuides),// Runtime class
00515                                 OPTOKEN_SNAPTOGUIDES,       // Token string
00516                                 GetState,                   // GetState function
00517                                 0,                          // help ID 
00518                                 _R(IDBBL_SNAPTOGUIDES),         // Bubble ID 
00519                                 _R(IDD_BARCONTROLSTORE),        // resource ID
00520                                 0,                          // control ID
00521                                 SYSTEMBAR_WINDOW,           // Bar ID
00522                                 TRUE,                       // Recieve system messages
00523                                 FALSE,                      // Smart duplicate operation
00524                                 TRUE,                       // Clean operation
00525                                 0,                          // No vertical counterpart
00526                                 0,                          // String for one copy only error
00527                                 (DONT_GREY_WHEN_SELECT_INSIDE | GREY_WHEN_NO_CURRENT_DOC), // Auto state flags
00528                                 TRUE                        // fCheckable
00529                               );
00530 }


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