ListBox Class¶
-
class
NXOpen.BlockStyler.
ListBox
¶ Bases:
NXOpen.BlockStyler.UIBlock
Represents a ListBox block
New in version NX6.0.0.
Properties¶
Property | Description |
---|---|
AllowDeselectForSingleSelect | Returns or sets the AllowDeselectForSingleSelect. |
Enable | Returns or sets the Enable. |
Expanded | Returns or sets the Expanded |
Group | Returns or sets the Group |
Height | Returns or sets the Height |
IsAddButtonSensitive | Returns or sets the IsAddButtonSensitive |
IsDeleteButtonSensitive | Returns or sets the IsDeleteButtonSensitive |
Label | Returns or sets the Label |
Localize | Returns or sets the Localize. |
MaximumHeight | Returns or sets the MaximumHeight |
MaximumStringLength | Returns or sets the MaximumStringLength |
MinimumHeight | Returns or sets the MinimumHeight |
Name | Returns the name of the block or BlockID |
ResizeHeightWithDialog | Returns or sets the ResizeHeightWithDialog |
SelectedItemIndex | Returns or sets the SelectedItemIndex. |
SelectedItemString | Returns or sets the SelectedItemString. |
Show | Returns or sets the Visibility of block. |
ShowAddButton | Returns or sets the ShowAddButton. |
ShowDeleteButton | Returns or sets the ShowDeleteButton. |
ShowMoveUpDownButtons | Returns or sets the ShowMoveUpDownButtons. |
SingleSelect | Returns or sets the SingleSelect. |
Tag | Returns the Tag for this object. |
Type | Returns the type of block |
Methods¶
Method | Description |
---|---|
Focus | Focuses on the block. |
GetListItems | Gets the ListItems |
GetProperties | Returns the properties of the block |
GetSelectedItemBooleans | Gets the SelectedItemBooleans. |
GetSelectedItemStrings | Gets the SelectedItemStrings |
GetSelectedItems | Gets SelectedItems |
SetAddHandler | Sets the Add handler. |
SetDeleteHandler | Sets the Delete handler. |
SetListItems | Sets the ListItems |
SetSelectedItemBooleans | Sets the SelectedItemStrings. |
SetSelectedItemStrings | Sets the SelectedItemStrings. |
SetSelectedItems | Sets SelectedItems |
Property Detail¶
AllowDeselectForSingleSelect¶
-
ListBox.
AllowDeselectForSingleSelect
¶ Returns or sets the AllowDeselectForSingleSelect.
Allows deselection of item using Ctrl+MB1 when single select is true.
-------------------------------------
Getter Method
Signature
AllowDeselectForSingleSelect
Returns: Return type: bool New in version NX8.5.0.
License requirements: None.
-------------------------------------
Setter Method
Signature
AllowDeselectForSingleSelect
Parameters: allow (bool) – New in version NX8.5.0.
License requirements: None.
Height¶
-
ListBox.
Height
¶ Returns or sets the Height
-------------------------------------
Getter Method
Signature
Height
Returns: Return type: int New in version NX8.5.0.
License requirements: None.
-------------------------------------
Setter Method
Signature
Height
Parameters: height (int) – New in version NX8.5.0.
License requirements: None.
IsAddButtonSensitive¶
-
ListBox.
IsAddButtonSensitive
¶ Returns or sets the IsAddButtonSensitive
-------------------------------------
Getter Method
Signature
IsAddButtonSensitive
Returns: Return type: bool New in version NX8.5.0.
License requirements: None.
-------------------------------------
Setter Method
Signature
IsAddButtonSensitive
Parameters: sensitive (bool) – New in version NX8.5.0.
License requirements: None.
IsDeleteButtonSensitive¶
-
ListBox.
IsDeleteButtonSensitive
¶ Returns or sets the IsDeleteButtonSensitive
-------------------------------------
Getter Method
Signature
IsDeleteButtonSensitive
Returns: Return type: bool New in version NX8.5.0.
License requirements: None.
-------------------------------------
Setter Method
Signature
IsDeleteButtonSensitive
Parameters: sesitive (bool) – New in version NX8.5.0.
License requirements: None.
Localize¶
-
ListBox.
Localize
¶ Returns or sets the Localize.
If true, translates the Label string into the language of the current locale.
-------------------------------------
Getter Method
Signature
Localize
Returns: Return type: bool New in version NX8.5.0.
License requirements: None.
-------------------------------------
Setter Method
Signature
Localize
Parameters: localize (bool) – New in version NX8.5.0.
License requirements: None.
MaximumHeight¶
-
ListBox.
MaximumHeight
¶ Returns or sets the MaximumHeight
-------------------------------------
Getter Method
Signature
MaximumHeight
Returns: Return type: int New in version NX8.5.0.
License requirements: None.
-------------------------------------
Setter Method
Signature
MaximumHeight
Parameters: maxHeight (int) – New in version NX8.5.0.
License requirements: None.
MaximumStringLength¶
-
ListBox.
MaximumStringLength
¶ Returns or sets the MaximumStringLength
-------------------------------------
Getter Method
Signature
MaximumStringLength
Returns: Return type: int New in version NX8.5.0.
License requirements: None.
-------------------------------------
Setter Method
Signature
MaximumStringLength
Parameters: maxLength (int) – New in version NX8.5.0.
License requirements: None.
MinimumHeight¶
-
ListBox.
MinimumHeight
¶ Returns or sets the MinimumHeight
-------------------------------------
Getter Method
Signature
MinimumHeight
Returns: Return type: int New in version NX8.5.0.
License requirements: None.
-------------------------------------
Setter Method
Signature
MinimumHeight
Parameters: minHeight (int) – New in version NX8.5.0.
License requirements: None.
ResizeHeightWithDialog¶
-
ListBox.
ResizeHeightWithDialog
¶ Returns or sets the ResizeHeightWithDialog
-------------------------------------
Getter Method
Signature
ResizeHeightWithDialog
Returns: Return type: bool New in version NX8.5.0.
License requirements: None.
-------------------------------------
Setter Method
Signature
ResizeHeightWithDialog
Parameters: resize (bool) – New in version NX8.5.0.
License requirements: None.
SelectedItemIndex¶
-
ListBox.
SelectedItemIndex
¶ Returns or sets the SelectedItemIndex.
Valid only if SingleSelect is true. Otherwise -1 is returned.
-------------------------------------
Getter Method
Signature
SelectedItemIndex
Returns: Return type: int New in version NX8.5.0.
License requirements: None.
-------------------------------------
Setter Method
Signature
SelectedItemIndex
Parameters: index (int) – New in version NX8.5.0.
License requirements: None.
SelectedItemString¶
-
ListBox.
SelectedItemString
¶ Returns or sets the SelectedItemString.
Valid only if SingleSelect is true. Otherwise empty string is returned.
-------------------------------------
Getter Method
Signature
SelectedItemString
Returns: Return type: str New in version NX8.5.0.
License requirements: None.
-------------------------------------
Setter Method
Signature
SelectedItemString
Parameters: string (str) – New in version NX8.5.0.
License requirements: None.
ShowAddButton¶
-
ListBox.
ShowAddButton
¶ Returns or sets the ShowAddButton.
If true, Add button is shown.
-------------------------------------
Getter Method
Signature
ShowAddButton
Returns: Return type: bool New in version NX8.5.0.
License requirements: None.
-------------------------------------
Setter Method
Signature
ShowAddButton
Parameters: show (bool) – New in version NX8.5.0.
License requirements: None.
ShowDeleteButton¶
-
ListBox.
ShowDeleteButton
¶ Returns or sets the ShowDeleteButton.
If true, Delete button is shown.
-------------------------------------
Getter Method
Signature
ShowDeleteButton
Returns: Return type: bool New in version NX8.5.0.
License requirements: None.
-------------------------------------
Setter Method
Signature
ShowDeleteButton
Parameters: show (bool) – New in version NX8.5.0.
License requirements: None.
ShowMoveUpDownButtons¶
-
ListBox.
ShowMoveUpDownButtons
¶ Returns or sets the ShowMoveUpDownButtons.
If true, MoveUp and MoveDown buttons are shown.
-------------------------------------
Getter Method
Signature
ShowMoveUpDownButtons
Returns: Return type: bool New in version NX8.5.0.
License requirements: None.
-------------------------------------
Setter Method
Signature
ShowMoveUpDownButtons
Parameters: show (bool) – New in version NX8.5.0.
License requirements: None.
SingleSelect¶
-
ListBox.
SingleSelect
¶ Returns or sets the SingleSelect.
If true, only single item can be selected.
-------------------------------------
Getter Method
Signature
SingleSelect
Returns: Return type: bool New in version NX8.5.0.
License requirements: None.
-------------------------------------
Setter Method
Signature
SingleSelect
Parameters: sinleSelect (bool) – New in version NX8.5.0.
License requirements: None.
Method Detail¶
GetListItems¶
-
ListBox.
GetListItems
¶ Gets the ListItems
Signature
GetListItems()
Returns: Return type: list of str New in version NX8.5.0.
License requirements: None.
GetSelectedItemBooleans¶
-
ListBox.
GetSelectedItemBooleans
¶ Gets the SelectedItemBooleans.
This method returns an integer array of boolen values populated with 0 and 1
Signature
GetSelectedItemBooleans()
Returns: Return type: list of int New in version NX8.5.0.
License requirements: None.
GetSelectedItemStrings¶
-
ListBox.
GetSelectedItemStrings
¶ Gets the SelectedItemStrings
Signature
GetSelectedItemStrings()
Returns: Return type: list of str New in version NX8.5.0.
License requirements: None.
GetSelectedItems¶
-
ListBox.
GetSelectedItems
¶ Gets SelectedItems
Signature
GetSelectedItems()
Returns: selected items Return type: list of int New in version NX8.5.0.
License requirements: None.
SetAddHandler¶
-
ListBox.
SetAddHandler
¶ Sets the Add handler.
This handler is called when the Add button is pressed. The handler is responsible for adding an item to the list. Nothing will be added to the list unless the handler adds it.
Signature
SetAddHandler(cb)
Parameters: cb (CallableObject) – New in version NX6.0.0.
License requirements: None.
SetDeleteHandler¶
-
ListBox.
SetDeleteHandler
¶ Sets the Delete handler.
If you set this handler, the handler will be called when the Delete button is pressed. The handler does not need to implement code to delete the item. The list will delete the selected items if and only if the handler returns 0.
Signature
SetDeleteHandler(cb)
Parameters: cb (CallableObject) – New in version NX6.0.0.
License requirements: None.
SetListItems¶
-
ListBox.
SetListItems
¶ Sets the ListItems
Signature
SetListItems(items)
Parameters: items (list of str) – New in version NX8.5.0.
License requirements: None.
SetSelectedItemBooleans¶
-
ListBox.
SetSelectedItemBooleans
¶ Sets the SelectedItemStrings.
Selects the list items based on input boolean array. Item is deselcted if value is 0 and selected otherwise.
Signature
SetSelectedItemBooleans(items)
Parameters: items (list of int) – New in version NX8.5.0.
License requirements: None.