Hi Jeremy, In a nutshell: 00__html_dlist_fix.dillo2 10__html_select_multiple.dillo2 10__listresource.dw2 15__listresource_selection.dw2 16__listresource_sizerequest.dw2 committed with minor changes! Some minor changes: * Used (long) cast for 64bit compatibility (please somebody test). * single return point in FltkListResource::widgetCallback. * added some comments. * Removed: //blindly copied from FltkOptionMenuResource, is it necessary? R: yes, it's necessary. Each new added item may change the Width. On Fri, May 02, 2008 at 11:42:18PM +0100, Jeremy Henty wrote:
I am attaching two patches that get ListResource selection working properly, ie. you can click items as you wish and FltkListResource::isSelected() will now return the correct value.
The first patch is my previous selection patch, unchanged. The second is a small fix that I proposed in the lout::misc::StringBuffer fix thread: it makes FltkListResource::addItem call Widget::set_selected() on fltk::Item widgets, and the call to Menu::set_item() becomes conditional on a virtual boolean hook that defaults to false, but is redefined to true in FltkOptionMenuResource() .
Yes, it looks simple enough. Added a reminding comment anyway.
[...] Currently FltkListResource::sizeRequest() is a stub with some hardwired values that are not very useful. This patch replaces it with something more appropriate (closely following the existing implementation of FltkOptionMenuResource::sizeRequest() ).
Added some minor adjustments to fit the new size. Good work! -- Cheers Jorge.-