#include <snapops.h>
Inheritance diagram for OpSnapToObjects:
Public Member Functions | |
OpSnapToObjects () | |
Constructor for OpSnapToObjects operation. It is not undoable. | |
void | Do (OpDescriptor *) |
Toggles the "snap to objects" flag in the selected DocView. | |
Static Public Member Functions | |
static BOOL | Init () |
Declares op descriptors for snap to objects toggle op. | |
static OpState | GetState (String_256 *, OpDescriptor *) |
This item is always available, so long as a document is visible. |
Definition at line 182 of file snapops.h.
|
Constructor for OpSnapToObjects operation. It is not undoable.
Definition at line 410 of file snapops.cpp.
|
|
Toggles the "snap to objects" flag in the selected DocView.
Reimplemented from Operation. Definition at line 428 of file snapops.cpp. 00429 { 00430 DocView *pDocView = DocView::GetSelected(); 00431 00432 if (pDocView != NULL) 00433 { 00434 // Find out the new value for the magnetic snapping 00435 BOOL NewState = !pDocView->GetSnapToObjectsState(); 00436 pDocView->SetSnapToObjectsState(NewState); 00437 00438 // update all slider controls that show the view quality 00439 OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_SNAPTOOBJECTS); 00440 if (pOpDesc!=NULL) 00441 { 00442 // Found the opdescriptor. Now find all the gadgets associated with it 00443 List Gadgets; 00444 if (pOpDesc->BuildGadgetList(&Gadgets)) 00445 { 00446 // Found some. Set the controls position according to the quality 00447 GadgetListItem* pGadgetItem = (GadgetListItem*) Gadgets.GetHead(); 00448 00449 while (pGadgetItem!=NULL) 00450 { 00451 // Set the sliders position 00452 pGadgetItem->pDialogOp->SetLongGadgetValue(pGadgetItem->gidGadgetID, NewState, FALSE); 00453 00454 // go find the next gadget 00455 pGadgetItem = (GadgetListItem*) Gadgets.GetNext(pGadgetItem); 00456 } 00457 00458 // Clean out the list 00459 Gadgets.DeleteAll(); 00460 } 00461 } 00462 } 00463 00464 End(); 00465 }
|
|
This item is always available, so long as a document is visible.
Definition at line 481 of file snapops.cpp. 00482 { 00483 OpState OpSt; 00484 00485 DocView *pDocView = DocView::GetSelected(); 00486 if (pDocView != NULL) 00487 OpSt.Ticked = pDocView->GetSnapToObjectsState(); 00488 00489 return OpSt; 00490 }
|
|
Declares op descriptors for snap to objects toggle op.
Reimplemented from SimpleCCObject. Definition at line 374 of file snapops.cpp. 00375 { 00376 return RegisterOpDescriptor(0, // Tool ID 00377 _R(IDS_SNAPTOOBJECTS), // String resource ID 00378 CC_RUNTIME_CLASS(OpSnapToObjects),// Runtime class 00379 OPTOKEN_SNAPTOOBJECTS, // Token string 00380 GetState, // GetState function 00381 0, // help ID 00382 _R(IDBBL_SNAPTOOBJECTS), // Bubble ID 00383 _R(IDD_BARCONTROLSTORE), // resource ID 00384 0, // control ID 00385 SYSTEMBAR_WINDOW, // Bar ID 00386 TRUE, // Recieve system messages 00387 FALSE, // Smart duplicate operation 00388 TRUE, // Clean operation 00389 0, // No vertical counterpart 00390 0, // String for one copy only error 00391 (DONT_GREY_WHEN_SELECT_INSIDE | GREY_WHEN_NO_CURRENT_DOC), // Auto state flags 00392 TRUE // fCheckable 00393 ); 00394 }
|