Hide the CheckBox

Is there a tech note on how to use the community forum? Can't post in other sections. Just trying to post here it keeps loading more posts as you have to go to the bottom to find the post form and it keeps moving. ??? Why is it at the bottom? 

Just looking for a way to hide the CheckBox Control wizard used in InTocuh. In WindowMaker it has a check box for the Visible property but no way to animate it. Is there no way to change the setting outside of WindowMaker?

In WindowMaker there is a button with Visibility covering it and it is covering it on WIndowMaker but once you open the screen in WindowView the ChaeckBox is ontop of the button.

They are now on 2020 R2 but I guess the button used to cover them. 

Parents
  • Hi  ,

    The CheckBox Control wizard is quite limited in the possibilities as compared to content created in Industrial Graphics.

    But to solve your issue you could use the SetProperty"X" function Slight smile

    The following will hide your control in a script:

    SetPropertyD ( "CheckBox_1.Visible", 0);

    and to show it :

    SetPropertyD ( "CheckBox_1.Visible", 1);

    Keep in mind that the control has to be loaded for the script to function, if not, it will generate result code -5
    and an error in log:

    (From the helpfile)

    Getting or Setting Properties
    Properties are accessible through the GetPropertyX() function, where X is the data type (D for Discrete, I for Integer, and M for Message). For example:

    GetPropertyM(ControlName.Property, MsgTag)

    For more information on the GetPropertyX() functions, see Built-In Functions.

    When you run the script that includes the GetPropertyX() function, the property value is saved to the MsgTag. If multiple rows are selected, the property assigned to MsgTag is the tag value in the first row of the multiple selection.

    SetPropertyD() Function
    Sets a discrete property in a wizard and returns a success code.

    Syntax

    result = SetPropertyD(controlname.property, Boolean)

    Parameters

    controlname

    The name of a wizard that supports properties. A literal string value, message tagname, or string expression.

    property

    The discrete property of the wizard that is to be set. Together with controlname can be a literal string value, message tagname, or string expression.

    Boolean

    The Boolean value to pass to the wizard property. A literal Boolean value, discrete tagname or Boolean expression.

    Return Value

    An integer error code. For more information about the error codes, see Understanding Windows Controls Error Messages.

    Example(s)

    With a check box wizard Checkbox1 and a discrete tagname dtag you can control the visibility of the check box with the following script function:

    result=SetPropertyD("Checkbox1.visible",dtag);

Reply
  • Hi  ,

    The CheckBox Control wizard is quite limited in the possibilities as compared to content created in Industrial Graphics.

    But to solve your issue you could use the SetProperty"X" function Slight smile

    The following will hide your control in a script:

    SetPropertyD ( "CheckBox_1.Visible", 0);

    and to show it :

    SetPropertyD ( "CheckBox_1.Visible", 1);

    Keep in mind that the control has to be loaded for the script to function, if not, it will generate result code -5
    and an error in log:

    (From the helpfile)

    Getting or Setting Properties
    Properties are accessible through the GetPropertyX() function, where X is the data type (D for Discrete, I for Integer, and M for Message). For example:

    GetPropertyM(ControlName.Property, MsgTag)

    For more information on the GetPropertyX() functions, see Built-In Functions.

    When you run the script that includes the GetPropertyX() function, the property value is saved to the MsgTag. If multiple rows are selected, the property assigned to MsgTag is the tag value in the first row of the multiple selection.

    SetPropertyD() Function
    Sets a discrete property in a wizard and returns a success code.

    Syntax

    result = SetPropertyD(controlname.property, Boolean)

    Parameters

    controlname

    The name of a wizard that supports properties. A literal string value, message tagname, or string expression.

    property

    The discrete property of the wizard that is to be set. Together with controlname can be a literal string value, message tagname, or string expression.

    Boolean

    The Boolean value to pass to the wizard property. A literal Boolean value, discrete tagname or Boolean expression.

    Return Value

    An integer error code. For more information about the error codes, see Understanding Windows Controls Error Messages.

    Example(s)

    With a check box wizard Checkbox1 and a discrete tagname dtag you can control the visibility of the check box with the following script function:

    result=SetPropertyD("Checkbox1.visible",dtag);

Children
  • Thanks for the SetProperty"X" function info. I'll try to keep that in mind. It's odd that the CheckBox Control has a visibility selection but no way to use it outside of WindowMaker.

    The issue here is that the button is an ArchestrA/industrial graphic and while I did find the visibility expression, it has about 5 me dot references and I don't know an easy way to get that same true/false state into InTouch to use on the CheckBox Control wizard.

    I was able to use the other Check Box Control wizard from the Buttons options. It will stay hidden in WindowViewer. It looks a little different having an 'X' and not a check mark but works.

    It's odd, the CheckBox Control wizard found in the Windows Controls shows an 'X' in the checkbox but once on the screen it's a check mark. ??? 

  • Hi, The visibility selection is available for the wizard checkbox, but through the Get and SetPropertyD function. We have to keep in mind that the wizard controls are very legacy and probably mostly kept for backward combability, they were introduced at the time where elements did not have properties as in Industrial Graphics, as you could compare with the Wizard Trend Object witch require a tag bound to be able to manipulate in Runtime and so on.

    A Industrial Graphics checkbox element that is bound to a Custom Property could be enough to bind it to a InTouch tag, when embedded in a Window.

    Or you could do direct referencing from your symbol to a InTouch tag.

    Symbol with CheckBox, animation bound to a Custom Property

    Defined Custom Property, note the setting Public, allowing it to be bound when embedded.

    In InTouch you can then bind it to the tag of your choice

    Similar scenario could be added to a button (if they are not part of the same symbol), exposing the button state to link to a tag

    Or as an alternative, (but not very dynamic) you can reference directly in the symbol.

    And you can also use legacy InTouch animations on an embedded symbol

    As you can see there are many creative ways of achieving what I hope to have understand what you are asking for. 

    And as per the X vs Checkmark, I would believe that the 'preview' wizard was created at the time of Windows having an X in its standard control library (Win 3.11-Win NT), but as Windows components modernized and changed to an checkmark, the preview in window maker did not.