I think I read the initial post too quickly, I thought the proposed
container would put the components in a single line and move to the
next line if they don't fit. An horizontal scrollbar wouldn't be
useful for my usecase.
>
> >
>
see enclosed image
Dean Browne a écrit :
However you should apply the proposal patch for issues #18 #20 #21
additionnaly I modify the Dialog.getAt method to behave on absolute
coordinates (this is mandatory if you want the pointer to react as expected)
private int getAt (int x, int y)
{
Enumeration elts = components.elements();
int count = 0;
while(elts.hasMoreElements())
{
Component c = (Component) elts.nextElement();
int top = c.getY();
int bottom = top+c.getHeight();
int left = c.getX();
int right = c.getWidth();
// Does the point fall within this component?
if ( (y >= top) && (y < bottom) &&
(x >= left) && (x < right) )
{
// This is the component that (x, y) falls within.
return count;
}
count++;
}
return -1;
}
I also value the simplicity of j4me, that's why I started to use it.
However I think that more complex components are valuable for many
users. Maybe we can achieve both goals by packaging new components
separately, just an idea.
br,
edgar