Re: new widget



On Tue, 24 Aug 1999, plex wrote:

> hi folx,
> i'm just in need of some widget classes, so here are my suggestions what i
> would like to contribute and some general questions about the starting point
> 
> AreaList
> 
> a list that does not order their items in a horizontal list but in a sorted
> direction, like the icon-view of gmc or the pattern-selection in gimp (which
> is otherwised implemented) 
> I thought about a widget class, where the programmer can set the direction in
> which the items are layed out, and if the widget got resized, the items reorder.
> I searched the widget tree but didn't find any of it. So if there is a need
> for it, I'll write it. I need it for a fixed-size pixmap-pattern chooser.

I've already written such a widget for my own filer. It's called the
Collection widget (although AreaList might be better...):

You can't change the sort direction though - it always fills left to right
and then onto the next row. It automatically rearranges the items when you
resize the window enough (and doesn't flicker otherwise). It does its own
scrolling, so you can have windows larger than the largest possible X
window. It can deal with selections of multiple items and give a signal on
double click, or just give the signal when you click without selecting
anything (there's a toggle). You can also select items by dragging out a
lasso box, and dragging from an item gives another signal (so you can
start doing drag-and-drop). Other signals allow you to claim and release X
selections as selections are made in the collection widget. There is also
provision for a cursor which can be moved positioned by the application
using the widget. The width and height of the items can be changed
dynamically (by all must be the same size).

Drawing individual items and testing to see if a click counts as being
inside or not are done by providing call-back functions. There are still a
few features missing, such as the ability to remove a single item from the
collection without having to clear it and refill it, but these can easily
be added if there is demand...

Hope that helps; email me if you're interested.

[ snip rest ]


Thomas Leonard
-- 
tal197@ecs.soton.ac.uk
3rd year computer science
RISC OS freeware to download at http://www.ecs.soton.ac.uk/~tal197/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]