Inconsistency with input boxes' OK button


#1

Here is something that our team is asking me about.

There are a variety of input tools used when scripting, like rs.MessageBox, rs.MultiListBox, rs.StringBox, etc.

The users are expecting that if the OK button is already highlighted, pressing the spacebar or Enter will engage the OK button. That’s a reasonable expectation. But here is what we are finding:

  1. rs.MessageBox works as expected. Enter or spacebar activates the OK button, the box closes as expected.
  2. rs.MultiListBox does not. Pressing the spacebar deselects the selected objects and only leaves the last selected object in the list. The Enter key does nothing.
  3. rs.StringBox doesn’t have the OK button highlighted, but Enter works anyway. The spacebar doesn’t, but since the whole point is to enter a string of text, it would be frustrating if it did close the box. So no real complaints about this one.
  4. rs.ListBox had OK highlighted, and Enter activates that button. But the spacebar doesn’t. It seems like it should for this method.
  5. rs.PropertyListBox works with both Enter and the spacebar.
  6. rs.ComboListBox has the OK button highlighted, and is activated with the Enter key. However, the spacebar deselects your choice and leaves it blank. There looks like room for improvement here, especially since the selected item in the ComboListBox can’t be edited like it was in V5.
  7. rs.EditBox. Neither works, but that makes sense. Enter moves to the next line, and that’s is preferred over closing the box, No complaints about this one.
  8. rs.CheckListBox has the spacebar unselecting the last selected item instead of engaging the OK button. Enter works fine.

To us, it seems there is room for improvement, for the sake of consistency, on a few of these methods.

Thanks,

Dan


(Dale Fugier) #2

Hi @DanBayn,

I’ve logged the issue.

https://mcneel.myjetbrains.com/youtrack/issue/RH-45078

– Dale


#3

Thanks,


#4

@dale, it would be useful too if the dialog methods save their position, and if possible maybe their size. It was the case when using them with rvb, but somehow under python this got lost in translation.

Using V6 the things imho got worse, eg. the rs.ListBox always opens in the center of the screen and seems to decide itself when enough items are present to display the scrollbars. Below is an example:

import rhinoscriptsyntax as rs

items = ["HelloWorld"] * 100
rs.ListBox(items, "Message", "Title")

On my system (Win7) it opens the dialog centered on screen, but the title is not visible. There is enough room below the dialog to lower it’s position on the y axis.
_
c.


(Dale Fugier) #5

Hi @clement,

The standard forms were ported from WinForms to Eto for Rhino 6. Clearly they did not get enough attention during the process. We’ll get it tuned up.

– Dale