IWxShape.GroupBehaviour

Syntax

GroupBehaviour: WxGroupBehaviour;

GroupBehaviour: Prognoz.Platform.Interop.Andy.WxGroupBehaviour;

Description

The GroupBehaviour property determines an object behavior during resizing of a group that contains this object.

By default, this property is set to ScaleWithGroup (if the group is resized, the object scales up or down).

Example

Executing the example requires a form with the Button1 button, the WorkspaceBox component named WorkspaceBox1 and a data source for the WorkspaceBox1.

Add links to the Andy, Drawing, Workspace system assemblies.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    Ws: IWxWorkspace;
    i: Integer;
    shape: IWxShape;
    Reg: IWxRegulargon;
    Rec: IWxRoundedRectangle;
Begin
    Ws := WorkspaceBox1.View.Workspace;
    Reg := Ws.CreateRegulargon;
    Reg.Id := "Reg1";
    Reg.PinPosition := New GxPointF.Create(122);
    Reg.NumberOfSides := 5;
    Reg.Text := "Trapezoid";
    Rec := Ws.CreateRoundedRectangle;
    Rec.Id := "Rectangle1";
    Rec.PinPosition := New GxPointF.Create(12.3,-2);
    Rec.RoundingOffset := 9;
    Rec.Text := "Shape";
    shape := Ws.Shapes.Item(0);
    shape.GroupBehaviour := WxGroupBehaviour.RepositionOnly;
    For i := 0 To Ws.Shapes.Count - 1 Do
        WorkspaceBox1.View.SelectedShapes.Add(Ws.Shapes.Item(i));
    End For;
    WorkspaceBox1.View.GroupSelectedShapes;
End Sub Button1OnClick;
Imports Prognoz.Platform.Interop.Andy;
Imports Prognoz.Platform.Interop.Drawing;
Imports Prognoz.Platform.Interop.Workspace;


Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
    Ws: IWxWorkspace;
    i: Integer;
    shape: IWxShape;
    Reg: IWxRegulargon;
    Rec: IWxRoundedRectangle;
    OutPoint: GxPointF = 
New GxPointFClass();
Begin
    Ws := workspaceBoxNet1.View.Workspace;
    Reg := Ws.CreateRegulargon();
    Reg.Id := 
"Reg1";
    OutPoint.Create(
122);
    Reg.PinPosition := OutPoint;
    Reg.NumberOfSides := 
5;
    Reg.Text := 
"Trapezoid";
    Rec := Ws.CreateRoundedRectangle();
    Rec.Id := 
"Rectangle1";
    OutPoint.Create(
12.3,-2);
    Rec.PinPosition := OutPoint;
    Rec.RoundingOffset := 
9;
    Rec.Text := 
"Shape";
    shape := Ws.Shapes.Item[
0];
    shape.GroupBehaviour := WxGroupBehaviour.wgbRepositionOnly;
    
For i := 0 To Ws.Shapes.Count - 1 Do
        workspaceBoxNet1.View.SelectedShapes.Add(Ws.Shapes.Item[i]);
    
End For;
    workspaceBoxNet1.View.GroupSelectedShapes();
End Sub;

 

After executing the example all objects in a workspace are grouped, and if the group is resized, only the size of the first object remains the same.

See also:

IWxShape