OpSnapToGrid Class Reference

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

#include <snapops.h>

Inheritance diagram for OpSnapToGrid:

Operation MessageHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

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

Static Public Member Functions

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

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/2/94

Definition at line 154 of file snapops.h.


Constructor & Destructor Documentation

OpSnapToGrid::OpSnapToGrid  ) 
 

Constructor for OpSnapToGrid operation. It is not undoable.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/2/94
Parameters:
[INPUTS] 
[OUTPUTS] 
Returns:

Errors: None

Definition at line 298 of file snapops.cpp.

00299 {
00300 }


Member Function Documentation

void OpSnapToGrid::Do OpDescriptor  )  [virtual]
 

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

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

Errors: None

Reimplemented from Operation.

Definition at line 316 of file snapops.cpp.

00317 {
00318     DocView *pDocView = DocView::GetSelected();
00319 
00320     if (pDocView != NULL)
00321         pDocView->SetSnapToGridState(!pDocView->GetSnapToGridState());
00322 
00323     End();
00324 }

OpState OpSnapToGrid::GetState String_256 ,
OpDescriptor
[static]
 

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

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/2/94
Parameters:
[INPUTS] 
[OUTPUTS] 
Returns:

Errors: None

Definition at line 340 of file snapops.cpp.

00341 {
00342     OpState OpSt;
00343 
00344     DocView *pDocView = DocView::GetSelected();
00345     if (pDocView != NULL)
00346         OpSt.Ticked = pDocView->GetSnapToGridState();
00347     
00348     return OpSt;
00349 }

BOOL OpSnapToGrid::Init void   )  [static]
 

Declares op descriptors for snap to grid toggle op.

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

00263 {
00264     return RegisterOpDescriptor(0,                          // tool id
00265                                 _R(IDS_SNAPTOGRID),             // String resource ID
00266                                 CC_RUNTIME_CLASS(OpSnapToGrid),// Runtime class
00267                                 OPTOKEN_SNAPTOGRID,         // Token string
00268                                 GetState,                   // GetState function                                0,                          // help ID 
00269                                 0,                              // help ID
00270                                 _R(IDBBL_SNAPTOGRIDOP),         // bubble help
00271                                 _R(IDD_BARCONTROLSTORE),        // resource ID
00272                                 _R(IDC_BTN_WINDOWSNAP),         // control ID
00273                                 SYSTEMBAR_WINDOW,           // Bar ID
00274                                 TRUE,                       // Recieve system messages
00275                                 FALSE,                      // Smart duplicate operation
00276                                 TRUE,                       // Clean operation
00277                                 0,                          // No vertical counterpart
00278                                 0,                          // String for one copy only error
00279                                 (DONT_GREY_WHEN_SELECT_INSIDE | GREY_WHEN_NO_CURRENT_DOC), // Auto state flags
00280                                 TRUE                        // fCheckable
00281                               );
00282 }


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