Class GeoVectorHotSpot
- Namespace
- CADability.UserInterface
- Assembly
- CADability.dll
A hotspot (IHotSpot) that stands in for a GeoVectorProperty in the drawing area: a draggable handle at Position through which the user can modify the vector with the mouse. Selecting the hotspot selects the property entry in the control center, dragging it calls StartModifyWithMouse() on the property, and its context menu and menu commands are those of the property. The owner of the property (e.g. the property entry of a text, a bitmap or an ellipse) creates the hotspot and updates Position when the object changes.
public class GeoVectorHotSpot : IHotSpot, ICommandHandler
- Inheritance
-
GeoVectorHotSpot
- Implements
- Inherited Members
Constructors
GeoVectorHotSpot(GeoVectorProperty)
Creates a hotspot that manipulates the given vector property.
public GeoVectorHotSpot(GeoVectorProperty geoVectorProperty)
Parameters
geoVectorPropertyGeoVectorPropertyThe property whose vector is modified when the hotspot is dragged
Fields
Position
The position of the hotspot in world coordinates, returned by GetHotspotPosition(). The owner of the hotspot keeps it up to date, typically the point where the vector is attached to the object.
public GeoPoint Position
Field Value
Properties
Hidden
True when the associated property is read-only; the hotspot is then not displayed.
public bool Hidden { get; }
Property Value
IsSelected
The selection state of the hotspot, which is the selection state of the associated GeoVectorProperty on its property page: selecting the hotspot selects the property entry in the control center and vice versa.
public bool IsSelected { get; set; }
Property Value
ResourceId
The resource id of the associated GeoVectorProperty, which identifies its label text.
public string ResourceId { get; }
Property Value
Methods
GetHotspotPosition()
Gets the position of the HotSpot
public GeoPoint GetHotspotPosition()
Returns
- GeoPoint
The position in the world coordinate system
GetInfoText(InfoLevelMode)
Returns the tooltip text of the hotspot, which is the label of the associated GeoVectorProperty.
public string GetInfoText(InfoLevelMode Level)
Parameters
LevelInfoLevelModeRequested info level; ignored, the label is returned for every level
Returns
- string
The label text of the associated property
OnCommand(string)
Forwards the menu command to the associated GeoVectorProperty, which processes the commands of its context menu (modify with mouse, direction of a curve or a surface, direction from two points, format settings).
public virtual bool OnCommand(string MenuId)
Parameters
MenuIdstringId of the menu command
Returns
- bool
true if the property handled the command, false otherwise
OnUpdateCommand(string, CommandState)
Forwards the request for the state of a menu item to the associated GeoVectorProperty.
public virtual bool OnUpdateCommand(string MenuId, CommandState CommandState)
Parameters
MenuIdstringId of the menu command
CommandStateCommandStateState object to modify (enabled, checked)
Returns
- bool
true if the property handled the request, false otherwise
StartDrag(IFrame)
Called when the user starts dragging a hotspot, i.e. the left mouse button is pushed while the mouse position leaves the hotspot square.
public void StartDrag(IFrame frame)
Parameters
frameIFrame