ImageEn, unit imageenview

TIEMouseInteractLayerItems

TIEMouseInteractLayerItems


Declaration


TIEMouseInteractLayerItems = (mlMoveLayers, mlResizeLayers, mlRotateLayers, mlCreateImageLayers, mlCreateShapeLayers, mlCreateLineLayers, mlCreatePolylineLayers, mlCreateAngleLayers, mlCreateTextLayers, mlClickCreateLineLayers, mlClickCreatePolylineLayers, mlDrawCreatePolylineLayers, mlClickCreateAngleLayers, mlEditLayerPoints);


Description


Actions that occur when the user moves or clicks the mouse, which are related to creating and editing layers.

Also see TIEMouseInteractItems, which are general actions that can occur.

mlClickCreateAngleLayers Click three points to create a TIEAngleLayer (Note 1,2). Click Esc to cancel insertion
mlClickCreateLineLayers Click start and end points to create a TIELineLayer (Note 1,2). Click Esc to cancel insertion
mlClickCreatePolylineLayers Click multiple points to create a TIEPolylineLayer (Note 1,2). Click Enter, Double-click, or click near the start point to complete the polyline. Use LayersAutoClosePolylines to determine whether the polyline is closed (i.e. becomes a polygon). Click Esc to cancel insertion, or DEL to delete the last added point.
mlDrawCreatePolylineLayers Click and drag to freehand draw a TIEPolylineLayer (Note 1,2)
mlCreateImageLayers Click and drag the mouse to create a TIEImageLayer (Note 1)
mlCreateShapeLayers Click and drag the mouse to create a TIEShapeLayer (Note 1)
mlCreateLineLayers Click and drag the mouse to create a TIELineLayer (Note 1)
mlCreateAngleLayers Click and drag the mouse to create a TIEAngleLayer (Note 1)
mlCreatePolylineLayers Click and drag the mouse to create a TIEPolylineLayer (Note 1). This creates area of the layer, you will need to add points
mlCreateTextLayers Click and drag the mouse to create a TIETextLayer (Note 1)
mlEditLayerPoints Click and drag points of a TIELineLayer or TIEPolylineLayer to move them. Click on the polyline to add a point, Alt key to convert a point to a curve, Ctrl+click or delete key to remove a point (Note 2, 3)
mlMoveLayers User can move layers
mlResizeLayers User can resize layers using grips
mlRotateLayers User can rotate layers using grips (Notes 2,3,4)


Notes:
1. If you are unable to create layers on the background, ensure that ImageEnView1.Layers[0].Selectable = False.
2. Hold Shift key to lock line angles to LayersRotateStep
3. Hold Alt key to convert point to a curve. Alt+Shift will give an exact half circle. Use LayersCurvePoints to specify how many points are used for a curve
4. Use mlRotateLayers in layer applications, and miRotateTool in other (single layer) applications


Usage Notes


You can only select one of the following:
mlCreateImageLayers, mlCreateShapeLayers, mlCreateLineLayers, mlCreatePolylineLayers, mlCreateAngleLayers, mlCreateTextLayers,
mlClickCreateLineLayers, mlClickCreatePolylineLayers, mlDrawCreatePolylineLayers, mlClickCreateAngleLayers

The following are often used in combinations with others:
miZoom, miMovingScroll, mlEditLayerPoints,
mlMoveLayers, mlResizeLayers, mlRotateLayers
mlRotateLayers cannot be used in combination with any layer creation interactions (mlCreate*Layers, mlClickCreate*Layers and , mlDrawCreatePolylineLayers ]
if mlEditLayerPoints and mlResizeLayers are used in combination, point layers will only be resizable by dragging their points


Common Usages


Layer Creation (create, move and resize layers):
ImageEnView1.MouseInteractLayers := [ mlCreate*Layers, mlMoveLayers, mlResizeLayers ]; // Note: Not mlRotateLayers

Layer Editing (move, resize and rotate layers):
ImageEnView1.MouseInteractLayers := [ mlMoveLayers, mlResizeLayers, mlRotateLayers ];

Polyline Layer Creation (create and edit polyline layers):
ImageEnView1.MouseInteractLayers := [ mlClickCreatePolylineLayers, mlEditLayerPoints ];

Line Layer Creation (create and edit line layers):
ImageEnView1.MouseInteractLayers := [ mlClickCreateLineLayers, mlEditLayerPoints ];

Angle Layer Creation (create and edit angle layers):
ImageEnView1.MouseInteractLayers := [ mlClickCreateAngleLayers, mlEditLayerPoints ];

Line, Angle and Polyline Layer Editing (move, point editing, resizing and rotation):
ImageEnView1.MouseInteractLayers := [ mlMoveLayers, mlEditLayerPoints, mlRotateLayers, mlResizeLayers ];


Demos


  Demos\Other\MouseInteract\MouseInteract.dpr
  Demos\LayerEditing\RotateLayers\RotateLayers.dpr
  Demos\LayerEditing\Layers_AllTypes\Layers.dpr
  Demos\LayerEditing\Layers_Lines\Layers.dpr



Examples


// Allow users to create image layers. Prompt for an image file after selection
ImageEnView1.LayerOptions := ImageEnView1.LayerOptions + [ loAutoPromptForImage ];
ImageEnView1.MouseInteractLayers := [ mlCreateImageLayers ];

// Allow user to move and resize layers (allow multiple layer selection and ensure masks are moved with layers)
ImageEnView1.LayerOptions := ImageEnView1.LayerOptions + [ loAllowMultiSelect, loAutoSelectMask ];
ImageEnView1.MouseInteractLayers := [ mlMoveLayers, mlResizeLayers ];

A selected text layer with resize grips:


// Allow user to rotate layers (allow multiple layer selection and ensure masks are moved with layers)
ImageEnView1.LayerOptions := ImageEnView1.LayerOptions + [ loAllowMultiSelect, loAutoSelectMask ];
ImageEnView1.MouseInteractLayers := [ mlRotateLayers ];


See Also


- MouseInteractLayers
- MouseInteractGeneral
- SelectionOptions
- LayerDefaults
- LayersAutoClosePolylines