Toggle Class

class NXOpen.UIStyler.Toggle

Bases: NXOpen.UIStyler.StylerItem

Represents a Toggle for UI Styler.

New in version NX5.0.0.

Properties

Property Description
ItemValue Returns or sets an item value
Visibility Returns or sets the visibility of the toggle

Methods

Method Description
AddValueChangedHandler Registers value change callback.
Dispose Free resources associated with the instance.
GetItemType Gets the dialog item type.
GetSensitivity Gets the sensitivity
InitializeAttachment Returns initialized dialog item attachment information
IsEqualTo Equates two styler items
SetAttachment Specifies the updated dialog item attachment information
SetDefaultAction Indicates that this dialog item should override the accelerator on the second mouse button, which normally accelerates to the OK button.
SetFocus Indicates that this dialog item is receiving keyboard focus.
SetLabel Sets the label to display on the right side of the toggle button.
SetSensitivity Sets the sensitivity of the toggle button

Property Detail

ItemValue

Toggle.ItemValue

Returns or sets an item value

-------------------------------------

Getter Method

Signature ItemValue

Returns:
Return type:bool

New in version NX5.0.0.

License requirements: None.

-------------------------------------

Setter Method

Signature ItemValue

Parameters:itemVal (bool) –

New in version NX5.0.0.

License requirements: None.

Visibility

Toggle.Visibility

Returns or sets the visibility of the toggle

-------------------------------------

Getter Method

Signature Visibility

Returns:
Return type:bool

New in version NX5.0.0.

License requirements: None.

-------------------------------------

Setter Method

Signature Visibility

Parameters:type (bool) –

New in version NX5.0.0.

License requirements: None.

Method Detail

AddValueChangedHandler

Toggle.AddValueChangedHandler

Registers value change callback.

This method should be called before calling UIStyler.Dialog.Show() or UIStyler.Dialog.RegisterWithUiMenu()

Signature AddValueChangedHandler(valuechangedevent, isDialogLaunchingEvent)

Parameters:
  • valuechangedevent (CallableObject) – Value changed event
  • isDialogLaunchingEvent (bool) – True if launch any dialog else False

New in version NX5.0.0.

License requirements: None.

GetSensitivity

Toggle.GetSensitivity

Gets the sensitivity

Signature GetSensitivity()

Returns:
Return type:bool

New in version NX5.0.0.

License requirements: None.

SetDefaultAction

Toggle.SetDefaultAction

Indicates that this dialog item should override the accelerator on the second mouse button, which normally accelerates to the OK button.

When you set this attribute, a click on the second mouse button triggers this dialog item’s ON/OFF state and calls the Value Changed callback instead of the action of the OK button.

Signature SetDefaultAction()

New in version NX5.0.0.

License requirements: None.

SetFocus

Toggle.SetFocus

Indicates that this dialog item is receiving keyboard focus.

Signature SetFocus()

New in version NX5.0.0.

License requirements: None.

SetLabel

Toggle.SetLabel

Sets the label to display on the right side of the toggle button.

If the toggle button displays a bitmap, then this text label is used as a popup hint instead

Signature SetLabel(strLabel)

Parameters:strLabel (str) –

New in version NX5.0.0.

License requirements: None.

SetSensitivity

Toggle.SetSensitivity

Sets the sensitivity of the toggle button

Signature SetSensitivity(subitemIndex, type)

Parameters:
  • subitemIndex (int) –
  • type (bool) –

New in version NX5.0.0.

License requirements: None.