[Gambas-user] Iconview selection behavior

Benoit Minisini gambas at ...1...
Mon Dec 19 13:13:49 CET 2005


On Monday 19 December 2005 09:59, Ulf wrote:
> Hello All, Benoit
>
> if I use the Iconview in Extended or Multi Selection Mode it is only
> possible to set an item's property to .Selected = True if I use CTRL or
> SHIFT (in Extended Mode) to select items, not if I try to select items with
> the mouse only (draw rectanglurar box around items) the items get
> highlighted inside the control but the .Selected Property does not change,
> furthermore the Event Selected is also not raised in this case.  If I box
> select first and than add an item with CTRL though all highlighted items
> will .Selected=True.
>
> The Listbox behavior is different in this case, here everytime the mouse
> selection box reaches one more item the Selected Event is raised and
> the .Selected property for this item is changed immediately.
>
> I sthis by design?
>
> BTW: what is the most elegant way to loop through all selected items in an
> IconView?
>
> Best Regards
>
> Ulf Wedemeyer
>

I didn't notice what you described. Which version of gambas do you use?

I tested by adding a "Select" event handler in the Explorer example, with this 
code:

--8<-----------------------------------------------------------------
PUBLIC SUB ivwExplorer_Select()

  ' Prints all selected item each time the selection change
  ivwExplorer.MoveFirst
  WHILE ivwExplorer.Available
    IF ivwExplorer.Item.Selected THEN PRINT ivwExplorer.Item.Text;;
    ivwExplorer.MoveNext
  WEND
  PRINT

END
--8<-----------------------------------------------------------------

Regards,

-- 
Benoit Minisini





More information about the User mailing list