cancel
Showing results for 
Search instead for 
Did you mean: 

Slidebar and default (listbox) selection in UI Builder?

Phenom
Phenom

To all,

 

a couple of (stupid) questions on the NX UI builder

 

1. It seems that there is no 'slide bar' option. Am I correct? Went through all the options but cannot see anything. Just need to double check.

 

2. If one "loads" a list of name in a list box, when the GUI is displayed to the user is there a way of selecting all the items in the list (by default)

 

Thanks

Regards

Production: NX9.0.3.4, NX10.0.2.6
Development: VB.NET (amateur level !)
3 REPLIES

Re: Slidebar and default (listbox) selection in UI Builder?

Phenom
Phenom
  1. By 'slidebar' I presume you mean a scale that can control an integer or double value by sliding a handle along a scale? If this is what you want you use an Integer or Double block and change the PresentationStyle to either Scale or ScaleKeyin.
  2. To select all items in a ListBox, you need to make sure the ListBox allows mutiple selection. You can set this at design time using the SingelSelection option to false. To select all items the ListBox object has the following methods:
  • setSelectedItemBooleans()
    Here you pass an array of integers with the same number of elements as there are list items. The values must be 0 to not select that item, anything else to select that item.
  • setSelectedItems()
    Here you pass an array of integers holding the list positions that you want selected.
  • setSelectedItemStrings()
    Here you pass an array of strings holding the ones you want selected.
    This is probably the easiest way to select ALL items in a ListBox. Simply use getListItems() method to get an array of the list items, then pass that array into the setSelectedItemStrings() method.
Graham Inchley Snr R&D Engineer (Systems Development), Sandvik Coromant
Lenovo ThinkPad W540, Win7, 16GB. Developing in: Java | C | C# | KF
Production: NX8.5.3.3 MP11 64bit Testing: NX9.0.2.5

Re: Slidebar and default (listbox) selection in UI Builder?

Phenom
Phenom

Thanks a lot

 

1. Found the 'scale' option. Not sure if one can control the step for the slide bar but will play with the option

 

2. Will most likely use setSelectedItemStrings() 

 

Thanks again

 

Regards

Production: NX9.0.3.4, NX10.0.2.6
Development: VB.NET (amateur level !)

Re: Slidebar and default (listbox) selection in UI Builder?

Phenom
Phenom

You can control the step for the scale using the LineIncrement and PageIncrement properties.

LineIncrement is how much it moves when you use the keyboard arrow keys while that block is selected and PageIncrement is how much it moves when you click on the line either side of the scale handle.

Note that recently I wanted to have a LineIncrement of 0.001mm but there seems to be some internal logic that disallows this and limits it to 0.01mm depending on the scale maximum/minimum limits. I have PR7441686 open on this matter.

Graham Inchley Snr R&D Engineer (Systems Development), Sandvik Coromant
Lenovo ThinkPad W540, Win7, 16GB. Developing in: Java | C | C# | KF
Production: NX8.5.3.3 MP11 64bit Testing: NX9.0.2.5