#857 LISTCHOICE list truncated

v4.0.1
closed
Mark Miesfeld
5
2012-08-14
2009-11-06
oorexxpert
No

The LISTCHOICE class and routine truncates the list without showing scroll bar thus making items in the list inaccessible. I added another parameter to the LISTCHOICE class and routine which is used as the options for the ADDLISTBOX in the DEFINEDIALOG method for the LISTCHOICE class . This allow the application to provide such options like VSCROLL and SORT. The VSCROLL adds a vertical scroll bar if the list of long. Personally, I think the VSCROLL option ought to be the default.

I believe the truncated list is a bug that I have circumvented. The circumvention should be considered a fix and enhancement.

Discussion

  • Mark Miesfeld
    Mark Miesfeld
    2009-11-06

    I'm pretty sure this has been fixed and the fix is in the next release.

    Unfortunately, the fix came about from a discussion on RexxLA and no bug was opened. So, I'm not 100% sure.

    If you could add a small example program that demonstrates the bug, I'd appreciate it. Then I can determine is this is fixed or not.

     
  • oorexxpert
    oorexxpert
    2009-11-09

    The following example demonstrates the error. I installed the latest version of 4.0 and it still fails.

    parse arg count;
    parse value count 20 with count .;
    list = .array~new;
    do x = 1 to count;
    list~append("Item" x);
    end;
    group_name = listchoice("Select one of" count "items.","Test List Size",list); ::requires oodplain.cls;

     
  • oorexxpert
    oorexxpert
    2009-11-24

    Attached is the sample program that does not show all items and no scroll bar. I can however, use the down arrow to get to additional items, if I knew they were there.

    Since I did not see a button to add an attachment, I'll include the testcase here:

    parse arg count;
    parse value count 20 with count .;
    list = .array~new;
    do x = count to 1 by -1;
    list~append("Item" x);
    end;
    group_name = listchoice("Select one of" count "items.","Test List Size",list,,,,"VSCROLL SORT");
    ::requires oodplain.cls;

     
  • Mark Miesfeld
    Mark Miesfeld
    2009-11-24

    Committed revision 5342.

    Okay, this was not the bug I was thinking about.

    This is why I don't really consider this a bug:

    1.) The ListChoice dialog class and the routine don't truncate the list. The up and down arrow, when the list box has the focus, allow the user to scroll to the end or to the beginning of the list when there are move items than can display. This is standard behavior for Windows dialogs.

    2.) The intent of the standard dialog classes, ListChoice, PassWordBox, IntegerBox, etc., is to provide a simple interface to a dialog that does not need a lot of set up. None of the standard dialogs, (or the standard routines that us the standard dialogs,) have a style argument. So the ListChoice is working as designed.

    3.) Adding an extra option to allow specifying a vertical scroll bar throws off the internal calculations of the proper width of the list box. If any of the list box items are a little long, then adding a vertical scroll bar will truncate the end of the list box item.

    Nevertheless, the intent is for them to be easy to use, and it is not unreasonable to have the ListChoice dialog add the vertical scroll bar when it is needed. So the commit referenced above fixes the ListChoice to correctly add a vertical scroll bar when the number of items would be more than is displayed.

    The fix will be in the next release of ooRexx. Note, that is not the same as the 4.0.0 release on SourceForge. If you want to see the effect of this fix, you need to use a build of ooRexx from trunk. You could get this build from the Build Machine, at http://build.oorexx.org/ (But I think the build machine will be down over Thanksgiving week, you might need to wait until next week.)

    Finally, if you really think an argument to specify extra style options of the list box is worthwhile, I'm not adverse to applying a patch, as an enhancement, if you want to supply one. I just don't want the spend the time right now doing it myself. <grin>

    The patch would have to do these things: it would have to add the option to all the standard dialogs so they are consistent. It would also have to fix any problems that would arise from a style being added to the control(s) of the standard dialogs. For example, adding the VSCROLL style to the ListChoice dialog causes the problem of the end of a list box item being truncated if it is longer than the message. (Because adding a vertical scroll bar throws off the calculation for the width of the list box.)

     
  • oorexxpert
    oorexxpert
    2009-11-24

    I agree with most everything you have said. However, I'm looking at it from a user's point of view. If there is no scroll bar, there is no visible queue that the list is longer than the window. Therefore, the user presumes that the items in the display are all there are. I have never seen a Windows list where there were more items in the list and the list didn't have a scroll bar.

    In my case, I modified the base class to allow another parameter that would be used as the style because not only did I need the scroll bar but the SORT option. I don't have to provide any options and it will work as it always has. I have only needed it in this one place so it's no big deal. I just thought it was wrong to show list that was too long without showing a scroll bar and I wanted to report it as a bug. There's no rush on a fix.

    John

     
  • Mark Miesfeld
    Mark Miesfeld
    2009-12-15

    John, I did fix it so that there is a scroll bar when needed.

    Putting this back in pending.

     


Anonymous


Cancel   Add attachments