EndInteraction

Similar to the StartInteraction function, EndInteraction either manages the selection (fSelection) or finishes translating an object or selection that was clicked on and dragged in a single operation.

      void
      TCanvasSelectionInteractor::EndInteraction ()
      {
          if ( fRectSelecting ) {
              bool shifted = GetModifierKeys().IsShiftKeyDown();
              if ( !shifted ) fSelection->DeselectAllGraphics ();
              TCanvasFrontToBackFilter filter;
              TGRect bounds (GetFirstPoint(), GetLastPoint());
              bounds.OrderPoints ();
              TCanvasRectSelectionFunnel funnel (bounds, *fSelection, shifted);
              fCanvasView->EnumerateGraphics (filter, funnel);
              fCanvasView->AdoptCurrentSelection (::CopyPointer(fSelection));
              }
          else { 
              unsigned long n = GetNumberOfPoints ();
              if ( n >= 2 ) {
                  fCommand->SetOffset (GetPoint(n-1)-GetPoint(n-2));
                  DoIncrement (*(fBinding.GetObject()));
                  }
              AdoptAndDoEnd (fBinding.OrphanObject());
              fBinding = NIL;
          }
      }

[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker