SelectionModes Enumeration |
Specifies values to indicate the type of objects which will be selectable by picking
Namespace:
ABB.Robotics.RobotStudio.Stations.Forms
Assembly:
ABB.Robotics.RobotStudio.Stations (in ABB.Robotics.RobotStudio.Stations.dll) Version: 7.0.8747.636
Syntax [FlagsAttribute]
public enum SelectionModes
Members Examples Set Selection Mode Example
public void SetSelectionModeExample()
{
Project.UndoContext.BeginUndoStep("Set Selection Mode");
try
{
ToolWindow tw = new ToolWindow();
tw.Caption = "New ToolWindow";
UIEnvironment.Windows.AddDocked(tw, DockStyle.Right);
Button btn = new Button();
btn.Text = "Select surface";
btn.Size = new Size(190, 40);
btn.Location = new Point(5, 5);
btn.Click += new EventHandler(btn1_clicked);
tw.Control.Controls.Add(btn);
Button btn2 = new Button();
btn2.Text = "Select part";
btn2.Size = new Size(190, 40);
btn2.Location = new Point(5, 50);
btn2.Click += new EventHandler(btn2_clicked);
tw.Control.Controls.Add(btn2);
Button btn3 = new Button();
btn3.Text = "Select mechanism";
btn3.Size = new Size(190, 40);
btn3.Location = new Point(5, 95);
btn3.Click += new EventHandler(btn3_clicked);
tw.Control.Controls.Add(btn3);
Button btn4 = new Button();
btn4.Text = "Select disabled";
btn4.Size = new Size(190, 40);
btn4.Location = new Point(5, 140);
btn4.Click += new EventHandler(btn4_clicked);
tw.Control.Controls.Add(btn4);
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
}
static void btn1_clicked(object sender, EventArgs e)
{
SetSelectionMode(SelectionModes.Surface);
}
static void btn2_clicked(object sender, EventArgs e)
{
SetSelectionMode(SelectionModes.Part);
}
static void btn3_clicked(object sender, EventArgs e)
{
SetSelectionMode(SelectionModes.Mechanism);
}
static void btn4_clicked(object sender, EventArgs e)
{
SetSelectionMode(SelectionModes.Disable);
}
static void SetSelectionMode(SelectionModes mode)
{
foreach (Window w in UIEnvironment.Windows)
{
if ((w is DocumentWindow) && (w.Control is GraphicControl))
{
GraphicControl gc = w.Control as GraphicControl;
if (gc != null)
gc.Picker.SelectionMode = mode;
}
}
}
Version Information
Supported in: 1.0.0.0
See Also