Multi selection in ListBox()

Is there any way to enable multi-selection inside of the list box?
Or maybe there is some other controller that has that available? :thinking:

MultiListBox() should work…

1 Like

@Helvetosaur,
Thanks for the suggestion, I’ll give it a try when I get back to the office.
Is there some documentation on that somewhere?
In regards to code in python, does it take/work exactly the same as a regular list box?
Does it return a list for indexes? And would it take a list back for reselection?

https://developer.rhino3d.com/api/RhinoScriptSyntax/

2 Likes

@Helvetosaur,
I was just trying to implement the MultiListBox. and it’s kicking out an error ‘Eto.Forms’ object has no attribute ‘MultiListBox’. Is there some other function to pull that out and populate it in Eto? Or is this only a rhino script thing?
This is what I am doing code wise right now

	def CreateListBox(self):
		#Create ListBox
		listbox = forms.ListBox()
		listbox.DataStore = self.organizedKeys()

		listbox.SelectedIndex = self.SelectedListBoxIndex
		listbox.Size = drawing.Size(200,300)
		self.m_listbox = listbox
		return self.m_listbox

I don’t know anything about ETO, I suppose I will need to learn some of it someday, but unfortunately no time now. Why do you need it in this case?

@Helvetosaur
I am making an attribute assignment dialog.


And some parts are made from the same type of material. Say angle iron, there might be like 5 parts that are using the same size angle iron (1.25" x 1.25" x 0.125")

I want to be able to select a bunch of parts and have it all assign at the same time.
Cause of some of the projects we do we might have like 20 parts or more that are from the same material.
Right now how I have it would take longer then I would really like to do the attribute assignment.
If I can have someone multi-select and slap the same properties on a bunch of objects that be pretty good time saved.

OK, that’s well beyond my programming capabilities for the moment…

Hi @mikhail,

I don’t believe Eto supports mutl-select listboxes. @Trav, can you confirm (or deny)?

– Dale

@mikhail the ETO namespace does not currently have a MultiListBox. I made generic dialog version using an ETO GridView control for RhinoScript and added it to Rhino.UI.Forms.MultiListBoxDialog. Not what you’re after but you could view as reference.

Your best bet for today is use the Gridview control which will allow for multi-row selections. You can turn off column headers and other typical Grid features to make it behave fairly similar to a standard Listbox control.

1 Like

@Trav,
Thanks for the suggestion, I’ll look into that.