[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: IUPMatrix (Re: GTK Binding)
- From: "Rafael Sabbagh Armony" <rafael.sabbagh@...>
- Date: Thu, 26 Feb 2004 15:18:48 -0300
> > As you say, IUPMatrix does lack flexibility - the stopper for me is that
the
> > element values must solely be text fields - no graphics, check boxes or
drop
> > down lists. This would mean another navigation for my users (i.e. look
at
> > list, then double click to pop up an editable for of one of the rows).
You really can't have graphics or check boxes as element values in IUPMatrix
(althought you can change cell colors) , but dropdown lists are very easy to
implement: all you have to do is use the DROP_CB and set all dropdown values
with IupSetAttribute(drop, index, value) for the correct line and column.
E.g.:
iumatrix1 = iupmatrix {
...
}
iupmatrix1.drop = mydrop
function mydrop(self, drop, lin, col)
if (lin ==1 and col == 1) then
IupSetAttribute (drop, 1, "First Option")
IupSetAttribute (drop, 2, "Second Option")
IupSetAttribute (drop, 3, "Third Option")
return IUP_DEFAULT
else
return IUP_IGNORE
end
end
You have to double-click the cell to see the dropdown.
> > I also found it difficult to show a change of sort direction in the
title
> > bars (i.e. sort one way when title is clicked - changing the title to
> > indicate current sort order).
Well, you can always change the title, but you can't use graphics. You have
to find a way to indicate the sort order with simple text (maybe \/ and /\).
For implementing the sort itselft, there are two simple methods:
1) You switch the values in the matrix.
2) You use the iupmatrix in callback mode, change your data structure and
then use REDRAW.
- Rafael
----- Original Message -----
From: "Ivan Kolev" <ikolev@abac.com>
To: "Lua list" <lua@bazar2.conectiva.com.br>
Sent: Thursday, February 26, 2004 2:45 PM
Subject: IUPMatrix (Re: GTK Binding)
> You *can* have drop-down lists, which is quite useful. And you can
> simulate checkboxes with them, by simply putting ON/OFF or TRUE/FALSE
> inside them. Though it's ugly, of course :)
>
> Ivan
>
> Martin Kendall wrote:
>
> > As you say, IUPMatrix does lack flexibility - the stopper for me is that
the
> > element values must solely be text fields - no graphics, check boxes or
drop
> > down lists. This would mean another navigation for my users (i.e. look
at
> > list, then double click to pop up an editable for of one of the rows).
> >
> > I also found it difficult to show a change of sort direction in the
title
> > bars (i.e. sort one way when title is clicked - changing the title to
> > indicate current sort order).
> >
> > Thanks for pointing it out though,
> >
> > Martin
> > "Vadim Macagon" <vadim_mcagon@hotmail.com> wrote in message
> > BAY2-DAV22NEbre8nYU0000721c@hotmail.com">news:BAY2-DAV22NEbre8nYU0000721c@hotmail.com...
> >
> >>"Martin Kendall" wrote
> >>
> >>>I love the idea of using IUP - It fits so well with the lua philosophy,
> >>>however it doesn't seem to have a grid control (Multiple rows like a
> >
> > list,
> >
> >>b
> >>
> >>>ut with multiple columns).
> >>>
> >>>I think that is the only stopper for me.
> >>
> >>The IupMatrix looks like a grid control to me :), unless it's not
flexible
> >>enough for you.
> >>
> >>
> >>Regards,
> >>
> >>Vadim.
> >>
> >
> >
> >
> >
> >
>
>
>