Type: BCS.Sym3.Controls.IControlButton

Button control Remarks: Available in Operator only

Properties


ActiveBackgroundColorEnd

  • Description: Gets or sets the second background color in the ‘active’ state
  • Type: IResourceColor
  • Access: Read and Write

ActiveBackgroundColorStart

  • Description: Gets or sets the first background color in the ‘active’ state
  • Type: IResourceColor
  • Access: Read and Write

ActiveBackgroundImage

  • Description: Gets or sets the baqckground image in the ‘active’ state
  • Type: IResourceImage
  • Access: Read and Write

ActiveBackgroundImageWrapMode

  • Description: Gets or sets the background image wrap mode in the ‘active’ state
  • Type: ControlImageWrapMode
  • Access: Read and Write

ActiveBorderColor

  • Description: Gets or sets the border color in the ‘active’ state
  • Type: IResourceColor
  • Access: Read and Write

ActiveBorderStyle

  • Description: Gets or sets the border style in the ‘active’ state
  • Type: ControlBorderStyle
  • Access: Read and Write

ActiveBorderWidth

  • Description: Gets or sets the border width in the ‘active’ state
  • Type: UInt32
  • Access: Read and Write

ActiveFontAlignment

  • Description: Gets or sets the font alignment in the ‘active’ state
  • Type: HorizontalAlignment
  • Access: Read and Write

ActiveFontColor

  • Description: Gets or sets the font color in the ‘active’ state
  • Type: IResourceColor
  • Access: Read and Write

ActiveFontFamily

  • Description: Gets or sets the font family in the ‘active’ state
  • Type: String
  • Access: Read and Write

ActiveFontSize

  • Description: Gets or sets the font size in the ‘active’ state
  • Type: UInt32
  • Access: Read and Write

ActiveFontStyle

  • Description: Gets or sets the font style in the ‘active’ state
  • Type: FontStyle
  • Access: Read and Write

ActiveGradientMode

  • Description: Gets or sets the background gradient mode in the ‘active’ state
  • Type: ControlGradientStyle
  • Access: Read and Write

ActiveRadius

  • Description: Gets or sets the radius in the ‘active’ state
  • Type: UInt32
  • Access: Read and Write

ActiveShadowColor

  • Description: Gets or sets the shadow color in the ‘active’ state
  • Type: IResourceColor
  • Access: Read and Write

ActiveShadowDistance

  • Description: Gets or sets the shadow distance in the ‘active’ state
  • Type: UInt32
  • Access: Read and Write

ActiveText

  • Description: Gets or sets the text in the ‘active’ state
  • Type: String
  • Access: Read and Write

Alias

  • Description: Gets or sets an alias
  • Type: String
  • Access: Read and Write

Anchor

  • Description: Gets or sets the anchor. PLease refer to ‘SetAnchor’ method for a better way to set this property.
  • Type: AnchorStyles
  • Access: Read and Write
  • Example:
This example shows you all possibilities to set the anchor of a control

            myControl.Anchor = System.Windows.Forms.AnchorStyles.None;
            myControl.Anchor = System.Windows.Forms.AnchorStyles.Top;
            myControl.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
            myControl.Anchor = System.Windows.Forms.AnchorStyles.Left;
            myControl.Anchor = System.Windows.Forms.AnchorStyles.Right;
            

BaseProject

  • Description: Gets the project
  • Type: IBaseProject
  • Access: Read

BoundProperties

  • Description: Gets the list of bound properties
  • Type: ObservableCollection`1
  • Access: Read

ButtonType

  • Description: Gets or sets the type of the button
  • Type: ButtonType
  • Access: Read and Write
  • Example:
This example shows you how to set the button type. It will list all possible values

            var myButton;
            ...
            myButton.ButtonType = BCS.Sym3.Controls.ButtonType.Push;
            myButton.ButtonType = BCS.Sym3.Controls.ButtonType.Latch;
            myButton.ButtonType = BCS.Sym3.Controls.ButtonType.Set;
            

DisplayTypeName

  • Description: Gets the display name of the type name of the object. It returns the english display name of the type name.
  • Type: String
  • Access: Read

Dock

  • Description: Get or sets the dock style
  • Type: DockStyle
  • Access: Read and Write
  • Example:
This example shows you all possibilities to set the dock of a control

            myControl.Dock = System.Windows.Forms.DockStyle.None;
            myControl.Dock = System.Windows.Forms.DockStyle.Top;
            myControl.Dock = System.Windows.Forms.DockStyle.Bottom;
            myControl.Dock = System.Windows.Forms.DockStyle.Left;
            myControl.Dock = System.Windows.Forms.DockStyle.Right;
            myControl.Dock = System.Windows.Forms.DockStyle.Fill;
            

FullPathName

  • Description: Gets full path. Example: Window1.Panel1.Panel2.Button1
  • Type: String
  • Access: Read

Height

  • Description: Gets or sets the height of the control
  • Type: Int32
  • Access: Read and Write

Id

  • Description: Gets the globally unique identifier (GUID) id of the object. This unique identifier is generated once at the object creation. This id will be kept unique for the entire life of the object, event after saving/loading the project.
  • Type: Guid
  • Access: Read and Write
  • Example:
This example shows how to get the id of an object in a string format. The following script will output a string like 'b3122ae0-dcf7-43b6-b17c-5381afaca5cb'

            strid = Project.Colors.Get("myColor").Id.ToString();
            print(strid)
            

InactiveBackgroundColorEnd

  • Description: Gets or sets the second background color in the ‘inactive’ state
  • Type: IResourceColor
  • Access: Read and Write

InactiveBackgroundColorStart

  • Description: Gets or sets the first background color in the ‘inactive’ state
  • Type: IResourceColor
  • Access: Read and Write

InactiveBackgroundImage

  • Description: Gets or sets the background image in the ‘inactive’ state
  • Type: IResourceImage
  • Access: Read and Write

InactiveBackgroundImageWrapMode

  • Description: Gets or sets the background image wrap mode in the ‘inactive’ state
  • Type: ControlImageWrapMode
  • Access: Read and Write

InactiveBorderColor

  • Description: Gets or sets the border color in the ‘inactive’ state
  • Type: IResourceColor
  • Access: Read and Write

InactiveBorderStyle

  • Description: Gets or sets the border style in the ‘inactive’ state
  • Type: ControlBorderStyle
  • Access: Read and Write

InactiveBorderWidth

  • Description: Gets or sets the border width in the ‘inactive’ state
  • Type: UInt32
  • Access: Read and Write

InactiveFontAlignment

  • Description: Gets or sets the font alignment in the ‘inactive’ state
  • Type: HorizontalAlignment
  • Access: Read and Write

InactiveFontColor

  • Description: Gets or sets the font color in the ‘inactive’ state
  • Type: IResourceColor
  • Access: Read and Write

InactiveFontFamily

  • Description: Gets or sets the font family in the ‘inactive’ state
  • Type: String
  • Access: Read and Write

InactiveFontSize

  • Description: Gets or sets the font size in the ‘inactive’ state
  • Type: UInt32
  • Access: Read and Write

InactiveFontStyle

  • Description: Gets or sets the font style in the ‘inactive’ state
  • Type: FontStyle
  • Access: Read and Write

InactiveGradientMode

  • Description: Gets or sets the background gradient mode in the ‘inactive’ state
  • Type: ControlGradientStyle
  • Access: Read and Write

InactiveRadius

  • Description: Gets or sets the corner radius in the ‘inactive’ state
  • Type: UInt32
  • Access: Read and Write

InactiveShadowColor

  • Description: Gets or sets the shadow color in the ‘inactive’ state
  • Type: IResourceColor
  • Access: Read and Write

InactiveShadowDistance

  • Description: Gets or sets the shadow distance in the ‘inactive’ state
  • Type: UInt32
  • Access: Read and Write

InactiveText

  • Description: Gets or sets the text in the ‘inactive’ state
  • Type: String
  • Access: Read and Write

IsAnchorBottom

  • Description: Gets or sets the bottom anchor
  • Type: Boolean
  • Access: Read and Write

IsAnchorLeft

  • Description: Gets or sets the left anchor
  • Type: Boolean
  • Access: Read and Write

IsAnchorRight

  • Description: Gets or sets the right anchor
  • Type: Boolean
  • Access: Read and Write

IsAnchorTop

  • Description: Gets or sets the top anchor
  • Type: Boolean
  • Access: Read and Write

IsContainer

  • Description: Indicates if this control is a container.
  • Type: Boolean
  • Access: Read

IsLocked

  • Description: Gets or sets the locking state of the control
  • Type: Boolean
  • Access: Read and Write

Location

  • Description: Gets or sets the location of the control. You can use Location or you can use X and Y properties
  • Type: Point
  • Access: Read and Write

  • Description: Gets or sets the menu associated with the control. This menu will pops up in the client application if the user right clicks on the control.
  • Type: IResourceMenu
  • Access: Read and Write

Name

  • Description: Gets or sets the name of the object. All objects of the same type have a unique name.
  • Type: String
  • Access: Read and Write
  • Example:
This example shows how to get and set the name of an object.

            // get the color name
            colorname = Project.Colors.Get("myColor").Name;
            
            // set the color name
            Project.Colors.Get("myColor").Name = "myNewName";
            

NameSuffix

  • Description: The project explorer will display this after the Name of this object.
  • Type: String
  • Access: Read

OnActiveAction

  • Description: Gets or sets the action executed when the button becomes ‘Active’
  • Type: IBaseAction
  • Access: Read and Write
  • Example:
This example shows you how to assign an action to a button:

            var wnd = Project.Windows["Window1"]
            wnd["Button1"].OnActiveAction = Project.ActionService.NewActionInstance("Display Message")
            

OnButtonClickedEventLogEnabled

  • Description: Gets/Sets a boolean to enable/disable the logging of a Event in the database when the button is pressed
  • Type: Boolean
  • Access: Read and Write

OnButtonClickedEventLogText

  • Description: If log is enabled, this following text will be logged in the database
  • Type: String
  • Access: Read and Write

OnInactiveAction

  • Description: Gets or sets the action executed when the button becomes ‘Inactive’
  • Type: IBaseAction
  • Access: Read and Write
  • Example:
This example shows you how to assign an action to a button:

            var wnd = Project.Windows["Window1"]
            wnd["Button1"].OnInactiveAction = Project.ActionService.NewActionInstance("Display Message")
            

Parent

  • Description: Gets or sets the parent of this control
  • Type: IBaseObject
  • Access: Read and Write

ParentName

  • Description: Gets the name of the parent.
  • Type: String
  • Access: Read

Permissions

  • Description: Gets a list of permissions assigned to the button
  • Type: ObservableCollection`1
  • Access: Read

Template

  • Description: Gets or sets the template
  • Type: ITemplate
  • Access: Read and Write

TypeName

  • Description: Gets the typename of the object. A type name doesn’t contain any space characters.
  • Type: String
  • Access: Read

UserPropertyInstances

  • Description: Gets a list of all the instances of user properties.
  • Type: ObservableCollection`1
  • Access: Read

Visible

  • Description: Gets or sets the control visibility
  • Type: Boolean
  • Access: Read and Write

Width

  • Description: Gets or sets the width of the control
  • Type: Int32
  • Access: Read and Write

Window

  • Description: Gets or sets the owner window of this control
  • Type: IWindow
  • Access: Read and Write

X

  • Description: Gets or sets the X position of the control relative to its container.
  • Type: Int32
  • Access: Read and Write

Y

  • Description: Gets or sets the Y position of the control relative to its container.
  • Type: Int32
  • Access: Read and Write

Methods


ForceRename(System.String,System.Boolean)

Rename the object.

  • Parameters:
    • value: The new name.
    • fireChangingEvent: If false, no change event will fire. In particular, this disables the check for duplicate names, which can be costly as it has to check every equipment. The caller is responsible for ensuring that value is a unique name, or Bad Things will happen.

FromXmlString(BCS.IToolXmlToObjectHelper)

Init object from IToolXmlToObjectHelper. All properties found in the RootElement of IToolXmlToObjectHelper will be set with the value in the rootElement

  • Parameters:
    • xmlHelperObj: xmlHelperObj IToolXmlToObjectHelper

FromXmlString(System.String)

Init object from xml. All properties found in the xml will be set with the value in the xml file

  • Parameters:
    • xmlText: Xml string

FromXmlString(System.Xml.Linq.XElement)

Init object from root element. All properties found in the XElement will be set with the value in the XElement

  • Parameters:
    • objXml: objXml XElement

GetBoundProperty(System.String)

Gets a bound property by property name

  • Parameters:
    • propertyName: Property name
  • Returns:
    • Returns bound property. Null if not found
  • Example:
This example shows you how to get a binding on a property if this one exists

            // get control:
            var td = Project.Windows["Window1"]["Text Display1"]
            
            // bind property 'Value'
            var boundProperty = td.GetBoundProperty("Value")
            

GetCopyPasteXml

Converts the object into an XML string including overrides for for copy/paste functionality

  • Returns:
    • the string that contains xml version of the object for copy/paste

GetUserPropertyInstance(System.String)

Gets the user property instance of the specified name

  • Parameters:
    • userPropertyName: The user property name.
  • Returns:
    • Returns the user property instance object. If not found, the methods returns null.
  • Example:
This example shows how to set the value of a user property by using this method

            cc1 = Project.Equipment.Get("CC1");
            
            // get the value of a user property using the method
            userPropertyInstance = cc1.GetUserPropertyInstance("UserProperty1");
            if(userPropertyInstance != null) {
               userPropertyInstance.Value = 3;
            }
            

GetUserPropertyValue(System.String)

Gets the value of a user property. A better way to get the value of a user property is to use the indexer operator [], see example. Instead of using the method ‘GetUserPropertyInstance’ and then access the ‘Value’ property of the returned value, this method simplifies the way we get the value of a user property.

  • Parameters:
    • userPropertyName: The name of the user property to set.
  • Returns:
    • Returns null if user property is not found. Otherwise returns the value of the user property.
  • Example:
This example shows how to get the value of a user property using this method and also by using the indexer

            cc1 = Project.Equipment.Get("CC1");
            
            // get the value of a user property using the method
            val = cc1.GetUserPropertyValue("UserProperty1");
            
            // get the value of a user property using the indexer operator
            val = cc1["UserProperty1"];
            

IsUserProperty(System.String)

Indicates if the object contains a user property with the name you specify

  • Parameters:
    • userPropertyName: user property name
  • Returns:
    • Returns true if the object contains a user property with the name you specified in parameter.

NewBoundProperty(System.String)

Creates a new bound property

  • Parameters:
    • propertyName: Name of property to bind
  • Returns:
    • If the property (propertyName) doesn’t exist for this object type, no bound property will be created so this method will return null.
  • Example:
This example shows you how to bind a property

            // get control:
            var td = Project.Windows["Window1"]["Text Display1"]
            
            // bind property 'Value'
            var boundProperty = td.NewBoundProperty("Value")
            
            // set expression:
            boundProperty.Expression = "%caller.Name%_Running";
            
            // create a mapping:
            boundProperty.AddMapping("1", "It is true");
            boundProperty.AddMapping("0", "It is false");
            

RemoveBoundProperty(System.String)

Removes a binding

  • Parameters:
    • propertyName:
  • Example:
This example shows you how to remove a binding on a property

            // get control:
            var td = Project.Windows["Window1"]["Text Display1"]
            
            // remove data binding on property 'Value'
            td.RemoveBoundProperty("Value")
            

SetAnchor(System.Boolean,System.Boolean,System.Boolean,System.Boolean)

Better way to set the ‘Anchor’ property

  • Parameters:
    • left: Boolean to indicate if the anchor is left
    • top: Boolean to indicate if the anchor is top
    • right: Boolean to indicate if the anchor is right
    • bottom: Boolean to indicate if the anchor is bottom
  • Example:
This example shows you how to use the SetAnchor method

            var button;
            ...
            button.SetAnchor(false, false, true, true);
            
            // no anchor:
            button.SetAnchor(false, false, false, false);
            

SetUserPropertyValue(System.String,System.Object)

Sets the value of a user property. A better way to set the value of a user property is to use the indexer operator [], see example. Instead of using the method ‘GetUserPropertyInstance’ and then access the ‘Value’ property of the returned value, this method simplifies the way we set the value of a user property.

  • Parameters:
    • userPropertyName: The name of the user property to set.
    • value: If the user property is not found, this methods does nothing.
  • Example:
This example shows how to set the value of a user property using this method and also by using the indexer

            cc1 = Project.Equipment.Get("CC1");
            
            // set the value of a user property using the method
            cc1.SetUserPropertyValue("UserProperty1", 3);
            
            // set the value of a user property using the indexer operator
            cc1["UserProperty1"] = 3;
            

ToCSVString(System.Char)

Returns the object in a CSV string.

  • Returns:
    • A string that contains properties of the object in a CSV format.

ToXmlString

Converts the object in an xml string

  • Returns:
    • the string that contains xml version of the object