[Iup-users] Inserting text into matrix cell during editing...
Re:auto completion in Iup.matrix
Antonio Scuri
scuri at tecgraf.puc-rio.br
Fri Mar 9 15:32:42 BRT 2007
Sorry, it is a bug. The VALUE attribute was not working as espected. I just
fixed the problem.
But I should change your code to:
function matrix:action(c,line,col,active,after)
print("action",c,line,col,active,after)
-- append string "more" into current cell
-- VALUE will check if a text edit is shown and update it
-- instead of just updating the matrix cell
-- experiment to press Esc after editing the text,
-- the result will have "more" appended in the current implementation.
-- The "L:C" attribute will only update the cell.
self.value = after.."more"
-- alway put caret at beginning
self.caret = 1
-- force redraw
self.redraw = "ALL"
return c -- return c or other return value
end
Since I'm working in the next IUP version It will be released soon. If you
want to edit the source code I can send you the changes.
Best,
scuri
> -----Original Message-----
> From: Andrew Wilson [mailto:agrwagrw at gmail.com]
> Sent: sexta-feira, 9 de março de 2007 00:52
> To: Antonio Scuri
> Cc: iup-users at lists.luaforge.net
> Subject: Re: [Iup-users] Inserting text into matrix cell
> during editing... Re:auto completion in Iup.matrix
>
> Antonio,
>
> I'm sure I'm missing something simple, but here is a short iuplua
> script which attempts to append the string "more" to all input, but
> unfortunately doesn't work. But the caret does get positioned, also
> the callback action_cb doesn't work but action does?
>
> Any ideas as to what I'm doing wong?
>
> -- test append to cell
> local matrix = iup.matrix{ numlin=3, numcol=4, scrollbar="YES",
> RESIZEMATRIX="YES", }
>
> function matrix:action(c,line,col,active,after)
> print("action",c,line,col,active,after)
>
> local current=line..":"..col
>
> -- append string "more" into current cell
> iup.SetAttribute(matrix,current,after.."more")
>
> -- alway put carat at beginning
> iup.SetAttribute(matrix,"CARET","1")
>
> -- force redraw
> iup.SetAttribute(matrix,"REDRAW","ALL")
>
> return c,iup.DEFAULT
> end
>
> dlg = iup.dialog{matrix,title="test" }
> dlg:showxy(iup.CENTER, iup.CENTER)
>
> Thanks
> Andrew
>
>
>
>
> On 3/8/07, Antonio Scuri <scuri at tecgraf.puc-rio.br> wrote:
> >
> > Hi,
> >
> > Inside the ACTION_CB callback, set VALUE and CARET attributes.
> >
> > Best,
> > Scuri
> >
> > > -----Original Message-----
> > > From: iup-users-bounces at lists.luaforge.net
> > > [mailto:iup-users-bounces at lists.luaforge.net] On Behalf Of
> > > Andrew Wilson
> > > Sent: quinta-feira, 8 de março de 2007 09:49
> > > To: iup-users at lists.luaforge.net
> > > Subject: [Iup-users] Inserting text into matrix cell during
> > > editing... Re:auto completion in Iup.matrix
> > >
> > > Maybe a clearer statement of the problem would be "How
> can you append
> > > text into a Iup.Matrix cell while editing the cell?"
> > >
> > > AGRW
> > >
> > > On 3/7/07, Andrew Wilson <agrwagrw at gmail.com> wrote:
> > > > Hi Iup list,
> > > >
> > > > I'm attempting to make a little app that uses iup.matrix
> > > and does auto
> > > > completion in the cells, but there doesn't seem to be a way
> > > to do this
> > > > (I've tried variation of call backs action,value,
> redraw etc), so
> > > > question is can iup.matrix implement auto completion of
> > > text in cells?
> > > >
> > > > I'd really like to be able to do auto completion because it make
> > > > repetitive input easy.
> > > >
> > > > Cheers
> > > > Andrew
> > > >
> > >
> > > _______________________________________________
> > > iup-users mailing list
> > > iup-users at lists.luaforge.net
> > > http://lists.luaforge.net/cgi-bin/mailman/listinfo/iup-users
> > >
> >
> >
>
More information about the iup-users
mailing list