⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ezactions.pas

📁 很管用的GIS控件
💻 PAS
📖 第 1 页 / 共 5 页
字号:
            End;
          End;
        idBandsBitmap:
          Begin
            TEzBandsBitmap( Entity ).FileName := ExtractFileName( EditFileName );
          End;
      End;
    Finally
      Free;
    End;
  End;

Begin
  result := true;
  Assert( ( M.ActiveDrawBox <> Nil ) And ( M.ActiveDrawBox.GIS <> Nil ) );
  If Cmd = SCmdCircle2P Then
    M.Push( TDrawCircleAction.CreateAction( M, ct2P ), true, Cmd, ActionID )
  Else If Cmd = SCmdArcSE Then
    M.Push( TDrawArcAction.CreateAction( M ), true, Cmd, ActionID )
  Else If Cmd = SCmdArcFCS Then
    M.Push( TDrawArcAction.CreateAction( M, damFCS ), true, Cmd, ActionID )
  Else If Cmd = SCmdCircle2P Then
    M.Push( TDrawCircleAction.CreateAction( M, ct2P ), true, Cmd,ActionID )
  Else If Cmd = SCmdCircle3P Then
    M.Push( TDrawCircleAction.CreateAction( M, ct3P ), true, Cmd,ActionID )
  Else If Cmd = SCmdCircleCR Then
    M.Push( TDrawCircleAction.CreateAction( M, ctCR ), true, Cmd,ActionID )
  Else If Cmd = SCmdRichText Then
  Begin
    { rich text }
    Lines := TStringList.Create;
    Try
      Ent := TEzRtfText.CreateEntity( Point2D(0, 0), Point2D(0, 0), Lines );
{$IFDEF USE_RICHEDIT}
      TfrmRichTextEditor.Enter( Ent );
{$ENDIF}
      M.Push( TAddEntityAction.CreateAction( M, ent, ImageDims ), true, Cmd,ActionID );
    Finally
      Lines.Free;
    End;
  End
  Else If Cmd = SCmdMeasures Then
    { MEASURES - command }
    M.Push( TMeasuresAction.CreateAction( M ), true, Cmd, ActionID )
  Else If Cmd = SCmdDimHoriz Then
  Begin
    { DIMHORZ - command }
    ent := TEzDimHorizontal.CreateEntity( Point2D(0, 0), Point2D(0, 0), 0 );
    M.Push( TDimAction.CreateAction( M, ent ), true, Cmd,ActionID );
  End
  Else If Cmd = SCmdDimVert Then
  Begin
    { DIMHORZ - command }
    ent := TEzDimVertical.CreateEntity( Point2D(0, 0), Point2D(0, 0), 0 );
    M.Push( TDimAction.CreateAction( M, ent ), true, Cmd,ActionID )
  End
  Else If Cmd = SCmdDimParall Then
  Begin
    { DIMPARALL - command }
    ent := TEzDimParallel.CreateEntity( Point2D(0, 0), Point2D(0, 0), 0 );
    M.Push( TDimAction.CreateAction( M, ent ), true, Cmd,ActionID )
  End
  Else If Cmd = SCmdBreak Then
    { BREAK - command }
    M.Push( TBreakAction.CreateAction( M ), true, Cmd,ActionID )
  Else If Cmd = SCmdTrim Then
    { TRIM - command }
    M.Push( TTrimAction.CreateAction( M ), true, Cmd,ActionID )
  Else If Cmd = SCmdExtend Then
    { EXTEND - command }
    M.Push( TExtendAction.CreateAction( M ), true, Cmd,ActionID )
  Else If Cmd = SCmdFillet Then
    { FILLET - command }
    M.Push( TFilletAction.CreateAction( M ), true, Cmd, ActionID )
  Else If Cmd = SCmdDropSelection Then
    { DROPSELECTION - command }
    M.Push( TDropSelectionAction.CreateAction( M ), true, Cmd, ActionID )
  Else If Cmd = SCmdCustomClick Then
    { CUSTOMCLICK - command }
    M.Push( TCustomClickAction.CreateAction( M ), true, Cmd, ActionID )
  Else If Cmd = SCmdAddMarker Then
    { MARKER - command }
    M.Push( TAddMarkerAction.CreateAction( M ), true, Cmd, ActionID )
  Else If Cmd = SCmdRealTimeZoom Then
    { REALTIMEZOOM - command                     True = use thread }
    M.Push( TRealTimeZoomAction.CreateAction( M, False ), false, Cmd, ActionID )
  Else If Cmd = SCmdRealTimeZoomB Then
    { REALTIMEZOOMB - command }
    M.Push( TRealTimeZoomActionB.CreateAction( M ), false, Cmd, ActionID )
  Else If Cmd = SCmdPolygonSelect Then
    { POLYGONSEL - command }
    M.Push( TPolygonSelectAction.CreateAction( M ), false, Cmd, ActionID )
  Else If Cmd = SCmdZoomIn Then
    { ZOOMIN - command }
    M.Push( TZoomInOutAction.CreateAction( M, zaZoomIn ), false, Cmd, ActionID )
  Else If Cmd = SCmdZoomOut Then
    { ZOOMOUT - command }
    M.Push( TZoomInOutAction.CreateAction( M, zaZoomOut ), false, Cmd, ActionID )
  Else If Cmd = SCmdZoomWindow Then
    { ZOOMWIN - command }
    M.Push( TZoomWindowAction.CreateAction( M ), false, Cmd, ActionID )
  Else If Cmd = SCmdHandScroll Then
    { SCROLL - command }
    M.Push( THandScrollAction.CreateAction( M ), false, Cmd, ActionID )
  Else If Cmd = SCmdCircleSelect Then
    { CIRCLESEL - command }
    M.Push( TCircleSelectAction.CreateAction( M ), false, Cmd, ActionID )
  Else If Cmd = SCmdInsertVertex Then
    { INSERTVERTEX - command }
    M.Push( TInsertVertexAction.CreateAction( M ), false, Cmd, ActionID )
  Else If Cmd = SCmdSelPLine Then
    { SELPLINE - command }
    M.Push( TBufferSelectAction.CreateAction( M ), false, Cmd, ActionID )
  Else If Cmd = SCmdGridOrigin Then
    { GRIDORIGIN - command }
    M.Push( TChangeGridOriginAction.CreateAction( M ), false, Cmd, ActionID )
  Else If Cmd = SCmdSelect Then
    { SELECT - command }
    M.Push( TSelectAction.CreateAction( M,
      Ez_Preferences.ApertureWidth ), false, Cmd, ActionID )
  Else If Cmd = SCmdHints Then
    { HINTS - command }
    M.Push( TShowHintAction.CreateAction( M ), false, Cmd, ActionID )
  Else If Cmd = SCmdMirror Then
    { MIRROR - command }
    M.Push( TTransformSelectionAction.CreateAction( M, ttMirror, false, saBoth ), true, Cmd, ActionID )
  Else If Cmd = SCmdOffset Then
    { OFFSET - command }
    M.Push( TTransformSelectionAction.CreateAction( M, ttTranslate, true, saBoth ), true, Cmd, ActionID )
  Else If Cmd = SCmdMove Then
    { MOVE - command }
    M.Push( TTransformSelectionAction.CreateAction( M, ttTranslate, false, saBoth ), true, Cmd, ActionID )
  Else If Cmd = SCmdScale Then
    { SCALE - command }
    M.Push( TTransformSelectionAction.CreateAction( M, ttScale, false, saBoth ), true, Cmd, ActionID )
  Else If Cmd = SCmdScaleX Then
    { SCALE - command }
    M.Push( TTransformSelectionAction.CreateAction( M, ttScale, false, saX ), true, Cmd, ActionID )
  Else If Cmd = SCmdScaleY Then
    { SCALE - command }
    M.Push( TTransformSelectionAction.CreateAction( M, ttScale, false, saY ), true, Cmd, ActionID )
  Else If Cmd = SCmdRotate Then
    { ROTATE - command }
    M.Push( TTransformSelectionAction.CreateAction( M, ttRotate, false, saBoth ), true, Cmd, ActionID )
  Else If Cmd = SCmdReshape Then
    { RESHAPE - command }
    M.Push( TReshapeEntityAction.CreateAction( M, Ez_Preferences.ApertureWidth ), true, Cmd, ActionID )
  Else If Cmd = SCmdDragDrop Then
    { DRAG&DROP - command }
    M.Push( TDragDropAction.CreateAction( M, Ez_Preferences.ApertureWidth ), true, Cmd, ActionID )
  Else If Cmd = SCmdDeleteVertex Then
    { DELVERTEX - command }
    M.Push( TDeleteVertexAction.CreateAction( M ), true, Cmd, ActionID )
  Else If Cmd = SCmdPictRef Then
  Begin
    { PICTUREREF - command }
    { ask end-user for the picture }
    ent := TEzPictureRef.CreateEntity( Point2D(0, 0), Point2D(0, 0), '' );
    SetPictureFileName( ent );
    If ent = Nil Then
      Exit;
    { if the position was defined, add to the layer and exit }
    If Not EqualRect2D( NULL_EXTENSION, ent.Points.Extension ) Then
    Begin
      ActionAddNewEntity( M, ent );
      exit;
    End;
    M.Push( TAddEntityAction.CreateAction( M, ent, ImageDims ), true, Cmd, ActionID );
  End
  Else If Cmd = SCmdPersistBitmap Then
  Begin
    { PERSISTBITMAP - command }
    ent := TEzPersistBitmap.CreateEntity( Point2D(0, 0), Point2D(0, 0), '' );
    SetPictureFileName( ent );
    If ent = Nil Then exit;
    { if the position was defined, add to the layer and exit }
    If Not EqualRect2D( NULL_EXTENSION, ent.Points.Extension ) Then
    Begin
      ActionAddNewEntity( M, ent );
      exit;
    End;
    M.Push( TAddEntityAction.CreateAction( M, ent, ImageDims ), true, Cmd, ActionID );
  End
  Else If Cmd = SCmdCustomPicture Then
  Begin
    ent := TEzCustomPicture.CreateEntity( Point2D(0, 0), Point2D(0, 0) );
    M.Push( TAddEntityAction.CreateAction( M, ent, ImageDims ), true, Cmd, ActionID );
  End
  Else If Cmd = SCmdBandsBitmap Then
  Begin
    { BANDSBITMAP - command }
    ent := TEzBandsBitmap.CreateEntity( Point2D(0, 0), Point2D(0, 0), '' );
    SetPictureFileName( ent );
    If ent = Nil Then exit;
    { if the position was defined, add to the layer and exit }
    If Not EqualRect2D( NULL_EXTENSION, ent.Points.Extension ) Then
    Begin
      ActionAddNewEntity( M, ent );
      exit;
    End;
    M.Push( TAddEntityAction.CreateAction( M, ent, ImageDims ), true, Cmd, ActionID );
  End
  Else If Cmd = SCmdInsert Then
  Begin
    { block INSERT - command }
    BlockName:= SelectCommonElement( AddSlash(Ez_Preferences.CommonSubDir), '', liBlocks);
    If Length(Blockname)=0 then Exit;
    BlockName:= ExtractFileName( BlockName );
    M.Push( TAddEntityAction.CreateAction( M,
      TEzBlockInsert.CreateEntity( BlockName, Point2D(0, 0), 0.0, 1.0, 1.0 ),
      ImageDims ), true, Cmd, ActionID );
  End Else If Cmd = SCmdNode Then
  Begin
    { NODE - command }
    M.Push( TAddEntityAction.CreateAction( M,
      TEzNode.CreateEntity( Point2D(0, 0) ), ImageDims ), true, Cmd, ActionID )
  End Else If Cmd = SCmdNodeLink Then
  Begin
    { NODELINK - command }
    // 24 = the OsnapSize in pixels
    M.Push( TAddNodeLinkAction.CreateAction( M, 24 ), true, Cmd, ActionID );
  End Else If Cmd = SCmdPoint Then
    { POINT - command }
    M.Push( TAddEntityAction.CreateAction( M,
      TEzPointEntity.CreateEntity( Point2D(0, 0), clblack ), ImageDims ), true, Cmd, ActionID )
  Else If Cmd = SCmdLine Then
  Begin
    { LINE - command }
    ent:= TEzPolyLine.CreateEntity( [Point2D(0, 0), Point2D(0, 0)] );
    ent.Points.CanGrow:= false;
    M.Push( TAddEntityAction.CreateAction( M, ent, ImageDims ), true, Cmd, ActionID );
  End Else If Cmd = SCmdPolyline Then
    { PLINE - command }
    M.Push( TAddEntityAction.CreateAction( M,
      TEzPolyLine.CreateEntity( [Point2D(0, 0)] ), ImageDims ), true, Cmd, ActionID )
  Else If Cmd = SCmdSketch Then
    { SKETCH - command }
    M.Push( TSketchAction.CreateAction( M,
      TEzPolyLine.CreateEntity( [Point2D(0, 0)] ) ), true, Cmd, ActionID )
  Else If Cmd = SCmdPolygon Then
    { POLYGON - command }
    M.Push( TAddEntityAction.CreateAction( M,
      TEzPolygon.CreateEntity( [Point2D(0, 0)] ), ImageDims ), true, Cmd, ActionID )
  Else If Cmd = SCmdArc Then
    { ARC - command }
    M.Push( TAddEntityAction.CreateAction( M,
      TEzArc.CreateEntity( Point2D(0, 0), Point2D(0, 0), Point2D(0, 0) ), ImageDims ), true, Cmd, ActionID )
  Else If Cmd = SCmdEllipse Then
    { ELLIPSE - command }
    M.Push( TAddEntityAction.CreateAction( M,
      TEzEllipse.CreateEntity( Point2D(0, 0), Point2D(0, 0) ), ImageDims ), true, Cmd, ActionID )
  Else If Cmd = SCmdSpline Then
    { SPLINE - command }
    M.Push( TAddEntityAction.CreateAction( M,
      TEzSpline.CreateEntity( [Point2D(0, 0)] ), ImageDims ), true, Cmd, ActionID )
  Else If Cmd = SCmdRectangle Then
    { RECTANGLE - command }
    M.Push( TAddEntityAction.CreateAction( M,
      TEzRectangle.CreateEntity( Point2D(0, 0), Point2D(0, 0) ), ImageDims ), true, Cmd, ActionID )
  Else If Cmd = SCmdTable Then
    { TABLE - command }
    M.Push( TAddEntityAction.CreateAction( M,
      TEzTableEntity.CreateEntity( Point2D(0, 0), Point2D(0, 0) ), ImageDims ), true, Cmd, ActionID )
  Else If Cmd = SCmdSymbol Then
    { SYMBOL - command }
    M.Push( TAddEntityAction.CreateAction( M,
      TEzPlace.CreateEntity( Point2D(0, 0) ), ImageDims ), true, Cmd, ActionID )
  Else If Cmd = SCmdTextSymbol Then
  Begin
    { TEXTSYMBOL - command }
    ent := TEzPlace.CreateEntity( Point2D(0, 0) );
    S := InputBox( SSymbolTextCaption, SSymbolText, '' );
    If Length( s ) = 0 Then
    Begin
      FreeAndNil( ent );
      exit;
    End;
    TEzPlace( ent ).Text := S;
    M.Push( TAddEntityAction.CreateAction( M, ent, ImageDims ), true, Cmd, ActionID );
  End
  Else If Cmd = SCmdUndo Then
    { UNDO - command }
    M.CurrentAction.UndoOperation
  Else If Cmd = SCmdPan Then
    { PAN - command }
    M.Push( TPanningAction.CreateAction( M ), false, Cmd, ActionID )
  Else If Cmd = SCmdPolygonBuffer Then
    { POLYGONBUFFER - command }
    M.Push( TPolygonFromBufferAction.CreateAction( M ), True, Cmd, ActionID )
      //else if Cmd = SCmdDIM then
      { DIM - command }
    //  M.Push(TDimAlignedAction.CreateAction(nil,M), True, Cmd, ActionID)
  Else If Cmd = SCmdHorzGLine Then
    { HGLINE - command }
    M.Push( TGuideLineAction.CreateAction( M, 0 ), true, Cmd, ActionID )
  Else If Cmd = SCmdVertGLine Then
    { VGLINE - command }
    M.Push( TGuideLineAction.CreateAction( M, 1 ), true, Cmd, ActionID )
  Else If Cmd = SCmdZoomAll Then
  Begin
    M.ActiveDrawBox.ZoomToExtension;
    M.Clear;
  End Else If Cmd = SCmdText Then
    { TRUE TYPE text command }
    M.Push( TAddTextAction.CreateAction( M ), true, Cmd, ActionID )
  Else If Cmd = SCmdJustifText Then
    { JUSTIFTEXT command }
    M.Push( TAddVectorialTextAction.CreateAction( M, Nil, true, tbsNone ), true, Cmd, ActionID )
  Else If Cmd = SCmdFittedText Then
    { FITTEDTEXT command }
    M.Push( TAddVectorialTextAction.CreateAction( M, Nil, false, tbsNone ), true, Cmd, ActionID )
  Else If Cmd = SCmdBannerText Then
    { BANNER command }
    M.Push( TAddVectorialTextAction.CreateAction( M, Nil, false, tbsBanner ), true, Cmd, ActionID )
  Else If Cmd = SCmdCalloutText Then
    { CALLOUT command }
    M.Push( TAddVectorialTextAction.CreateAction( M, Nil, false, tbsCallout ), true, Cmd, ActionID )
  Else If Cmd = SCmdBulletLeader Then
    { BULLETLEADER command }
    M.Push( TAddVectorialTextAction.CreateAction( M, Nil, false, tbsBulletLeader ), true, Cmd, ActionID )
  Else If Cmd = SCmdMoveGLine Then
    { VGLINE - command }
    M.Push( TMoveGuideLineAction.CreateAction( M ), true, Cmd, ActionID )
  Else If Cmd = SCmdClipPoly Then
    { CLIP - command }
    M.Push( TClipPolyAction.CreateAction( M ), true, Cmd, ActionID )
  Else If Cmd = SCmdSetClipArea Then
    { SETCLIPAREA - command }
    M.Push( TSetClipAreaAction.CreateAction( M ), True, Cmd, ActionID )
  Else If Cmd = SCmdSetClipPolyArea Then
    { CLIPPOLYAREA - command }
    M.Push( TSetPolygonClipAreaAction.CreateAction( M ), True, Cmd, ActionID )
  Else
    { command not found !!! }
    result := false;
End;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -