Add links to the Andy, Drawing, Workspace system assemblies.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
ws: IWxWorkspace;
view: IWxView;
arrow: IWxArrow;
ellipse: IWxEllipse;
SStyle: IWxSelectionStyle;
Begin
// Get workspace for editing
ws := UiWorkspace1.WxWorkspace;
view := ws.CreateView;
view := ws.Views.Item(0);
ellipse := ws.CreateEllipse;
arrow := ws.CreateArrow;
Arrow.FirstPoint := New GxPointF.Create(10, 10);
Arrow.LastPoint := New GxPointF.Create(3, 19);
ellipse := ws.CreateEllipse;
SStyle := view.SelectionStyle;
SStyle.ActivePointColor := GxColor.FromName("Red");
SStyle.SelectedRotationPointColor := GxColor.FromName("Pink");
SStyle.SelectionPointStyle := WxSelectionPointStyle.Corners;
SStyle.SelectionPointSize := 2;
SStyle.ActiveRotationPointColor := New GxColor.CreateRGB(0, 128, 255);
SStyle.ConnectionPointColor := New GxColor.CreateRGB(0, 192, 0);
End Sub Button1OnClick;
Imports Prognoz.Platform.Interop.Andy;
Imports Prognoz.Platform.Interop.Workspace;
Imports Prognoz.Platform.Interop.Drawing;
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
ws: IWxWorkspace;
view: IWxView;
arrow: IWxArrow;
ellipse: IWxEllipse;
PinPoint, PointF: GxPointF = New GxPointFClass();
Color: GxColorClassClass = New GxColorClassClass();
OutColor: GxColor;
SStyle: IWxSelectionStyle;
Begin
// Get workspace for editing
ws := uiWorkspaceNet1.WxWorkspace;
view := ws.CreateView();
view := ws.Views.Item[0];
arrow := ws.CreateArrow();
PinPoint.Create(10, 10);
Arrow.FirstPoint := PinPoint;
PinPoint.Create(3, 19);
Arrow.LastPoint := PinPoint;
ellipse := ws.CreateEllipse();
SStyle := view.SelectionStyle;
SStyle.ActivePointColor := Color.FromName("Red");
SStyle.SelectedRotationPointColor := Color.FromName("Pink");
SStyle.SelectionPointStyle := WxSelectionPointStyle.wspsCorners;
SStyle.SelectionPointSize := 2;
OutColor := New GxColorClass_2();
OutColor.CreateRGB(0, 128, 255);
SStyle.ActiveRotationPointColor := OutColor;
OutColor.CreateRGB(0, 192, 0);
SStyle.ConnectionPointColor := OutColor;
End Sub;
After executing the example a selection style for objects in a workspace is set.