ListBox Class¶
-
class
NXOpen.BlockStyler.ListBox¶ Bases:
NXOpen.BlockStyler.UIBlockRepresents 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
AllowDeselectForSingleSelectReturns: Return type: bool New in version NX8.5.0.
License requirements: None.
-------------------------------------Setter Method
Signature
AllowDeselectForSingleSelectParameters: allow (bool) – New in version NX8.5.0.
License requirements: None.
Height¶
-
ListBox.Height¶ Returns or sets the Height
-------------------------------------Getter Method
Signature
HeightReturns: Return type: int New in version NX8.5.0.
License requirements: None.
-------------------------------------Setter Method
Signature
HeightParameters: height (int) – New in version NX8.5.0.
License requirements: None.
IsAddButtonSensitive¶
-
ListBox.IsAddButtonSensitive¶ Returns or sets the IsAddButtonSensitive
-------------------------------------Getter Method
Signature
IsAddButtonSensitiveReturns: Return type: bool New in version NX8.5.0.
License requirements: None.
-------------------------------------Setter Method
Signature
IsAddButtonSensitiveParameters: sensitive (bool) – New in version NX8.5.0.
License requirements: None.
IsDeleteButtonSensitive¶
-
ListBox.IsDeleteButtonSensitive¶ Returns or sets the IsDeleteButtonSensitive
-------------------------------------Getter Method
Signature
IsDeleteButtonSensitiveReturns: Return type: bool New in version NX8.5.0.
License requirements: None.
-------------------------------------Setter Method
Signature
IsDeleteButtonSensitiveParameters: 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
LocalizeReturns: Return type: bool New in version NX8.5.0.
License requirements: None.
-------------------------------------Setter Method
Signature
LocalizeParameters: localize (bool) – New in version NX8.5.0.
License requirements: None.
MaximumHeight¶
-
ListBox.MaximumHeight¶ Returns or sets the MaximumHeight
-------------------------------------Getter Method
Signature
MaximumHeightReturns: Return type: int New in version NX8.5.0.
License requirements: None.
-------------------------------------Setter Method
Signature
MaximumHeightParameters: maxHeight (int) – New in version NX8.5.0.
License requirements: None.
MaximumStringLength¶
-
ListBox.MaximumStringLength¶ Returns or sets the MaximumStringLength
-------------------------------------Getter Method
Signature
MaximumStringLengthReturns: Return type: int New in version NX8.5.0.
License requirements: None.
-------------------------------------Setter Method
Signature
MaximumStringLengthParameters: maxLength (int) – New in version NX8.5.0.
License requirements: None.
MinimumHeight¶
-
ListBox.MinimumHeight¶ Returns or sets the MinimumHeight
-------------------------------------Getter Method
Signature
MinimumHeightReturns: Return type: int New in version NX8.5.0.
License requirements: None.
-------------------------------------Setter Method
Signature
MinimumHeightParameters: minHeight (int) – New in version NX8.5.0.
License requirements: None.
ResizeHeightWithDialog¶
-
ListBox.ResizeHeightWithDialog¶ Returns or sets the ResizeHeightWithDialog
-------------------------------------Getter Method
Signature
ResizeHeightWithDialogReturns: Return type: bool New in version NX8.5.0.
License requirements: None.
-------------------------------------Setter Method
Signature
ResizeHeightWithDialogParameters: 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
SelectedItemIndexReturns: Return type: int New in version NX8.5.0.
License requirements: None.
-------------------------------------Setter Method
Signature
SelectedItemIndexParameters: 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
SelectedItemStringReturns: Return type: str New in version NX8.5.0.
License requirements: None.
-------------------------------------Setter Method
Signature
SelectedItemStringParameters: 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
ShowAddButtonReturns: Return type: bool New in version NX8.5.0.
License requirements: None.
-------------------------------------Setter Method
Signature
ShowAddButtonParameters: 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
ShowDeleteButtonReturns: Return type: bool New in version NX8.5.0.
License requirements: None.
-------------------------------------Setter Method
Signature
ShowDeleteButtonParameters: 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
ShowMoveUpDownButtonsReturns: Return type: bool New in version NX8.5.0.
License requirements: None.
-------------------------------------Setter Method
Signature
ShowMoveUpDownButtonsParameters: 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
SingleSelectReturns: Return type: bool New in version NX8.5.0.
License requirements: None.
-------------------------------------Setter Method
Signature
SingleSelectParameters: 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.