Quantcast

list with 2 colums

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

list with 2 colums

Helton Eduardo Ritter
I whant display 2 colums of data, like this:

description1   value1
description2   value2
description3   value3
description4   value4

Now I have this code (show only 1 colum):

registers ={}
registers[0]="description1"
registers[1]="description2"
registers[2]="description3"
registers[3]="description4"

gui.control{type="list", lines=11, columns=30, list=registers,
handler=generalControler}

How I can display 2 ou more data coumls?

I'm using plua 2.0

Thanks

--
#------------------------------------------------------------------------------------------------------------------------#
Helton Eduardo Ritter - www.sourcedreams.com.br
Equipe técnica da PHP Magazine - www.phpmagazine.org.br
Blog Pessoal: livehelton.blogspot.com
No mundo da Lua! vonluawelt.blogspot.com
Técnico em Informática - programador web - SETREM - www.setrem.com.br
Bacharelando em sistemas de informação

"Tudo o que fazemos cansa. Feliz daquele que não perde as forças"(Goethe)


[Non-text portions of this message have been removed]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: list with 2 colums

Helton Eduardo Ritter
Good week dear mail-list!

Well, any solution to display data in 2 or more colums using Plua?

Here too are report of my problem (with picture)
http://vonluawelt.blogspot.com/2009/05/sdmm-data-grid-list-problem.html

Many thanks.

Bye

2009/4/26 Helton Eduardo Ritter <[hidden email]>

> I whant display 2 colums of data, like this:
>
> description1   value1
> description2   value2
> description3   value3
> description4   value4
>
> Now I have this code (show only 1 colum):
>
> registers ={}
> registers[0]="description1"
> registers[1]="description2"
> registers[2]="description3"
> registers[3]="description4"
>
> gui.control{type="list", lines=11, columns=30, list=registers,
> handler=generalControler}
>
> How I can display 2 ou more data coumls?
>
> I'm using plua 2.0
>
> Thanks
>
> --
>
> #------------------------------------------------------------------------------------------------------------------------#
> Helton Eduardo Ritter - www.sourcedreams.com.br
> Equipe técnica da PHP Magazine - www.phpmagazine.org.br
> Blog Pessoal: livehelton.blogspot.com
> No mundo da Lua! vonluawelt.blogspot.com
> Técnico em Informática - programador web - SETREM - www.setrem.com.br
> Bacharelando em sistemas de informação
>
> "Tudo o que fazemos cansa. Feliz daquele que não perde as forças"(Goethe)
>



--
#------------------------------------------------------------------------------------------------------------------------#
Helton Eduardo Ritter - www.sourcedreams.com.br
Equipe técnica da PHP Magazine - www.phpmagazine.org.br
Blog Pessoal: livehelton.blogspot.com
No mundo da Lua! vonluawelt.blogspot.com
Técnico em Informática - programador web - SETREM - www.setrem.com.br
Bacharelando em sistemas de informação

"Tudo o que fazemos cansa. Feliz daquele que não perde as forças"(Goethe)


[Non-text portions of this message have been removed]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Re: list with 2 colums

Morten Agerlin Petersen (MAP)
Hi

The only way I know is to use a series of fields:  gui.field().

Its been quite a whike since I've done Plua programming, so I don't remember the details....

Regards Morten

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Helton Eduardo Ritter
Sent: 18. maj 2009 05:48
To: [hidden email]
Subject: [plua] Re: list with 2 colums

Good week dear mail-list!

Well, any solution to display data in 2 or more colums using Plua?

Here too are report of my problem (with picture) http://vonluawelt.blogspot.com/2009/05/sdmm-data-grid-list-problem.html

Many thanks.

Bye

2009/4/26 Helton Eduardo Ritter <[hidden email]>

> I whant display 2 colums of data, like this:
>
> description1   value1
> description2   value2
> description3   value3
> description4   value4
>
> Now I have this code (show only 1 colum):
>
> registers ={}
> registers[0]="description1"
> registers[1]="description2"
> registers[2]="description3"
> registers[3]="description4"
>
> gui.control{type="list", lines=11, columns=30, list=registers,
> handler=generalControler}
>
> How I can display 2 ou more data coumls?
>
> I'm using plua 2.0
>
> Thanks
>
> --
>
> #---------------------------------------------------------------------
> ---------------------------------------------------#
> Helton Eduardo Ritter - www.sourcedreams.com.br Equipe técnica da PHP
> Magazine - www.phpmagazine.org.br Blog Pessoal:
> livehelton.blogspot.com No mundo da Lua! vonluawelt.blogspot.com
> Técnico em Informática - programador web - SETREM - www.setrem.com.br
> Bacharelando em sistemas de informação
>
> "Tudo o que fazemos cansa. Feliz daquele que não perde as
> forças"(Goethe)
>



--
#------------------------------------------------------------------------------------------------------------------------#
Helton Eduardo Ritter - www.sourcedreams.com.br Equipe técnica da PHP Magazine - www.phpmagazine.org.br Blog Pessoal: livehelton.blogspot.com No mundo da Lua! vonluawelt.blogspot.com Técnico em Informática - programador web - SETREM - www.setrem.com.br Bacharelando em sistemas de informação

"Tudo o que fazemos cansa. Feliz daquele que não perde as forças"(Goethe)


[Non-text portions of this message have been removed]



------------------------------------

Yahoo! Groups Links



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Re: list with 2 colums

Helton Eduardo Ritter
Ok, I will try so, is a good idea. Thanks Morten!

Tomorrow I will post a result here in mail list.



2009/5/18, Morten Agerlin Petersen (MAP) <[hidden email]>:

>
>
>
> Hi
>
> The only way I know is to use a series of fields: gui.field().
>
> Its been quite a whike since I've done Plua programming, so I don't
> remember the details....
>
> Regards Morten
>
>
> -----Original Message-----
> From: [hidden email] <plua%40yahoogroups.com> [mailto:
> [hidden email] <plua%40yahoogroups.com>] On Behalf Of Helton Eduardo
> Ritter
> Sent: 18. maj 2009 05:48
> To: [hidden email] <plua%40yahoogroups.com>
> Subject: [plua] Re: list with 2 colums
>
> Good week dear mail-list!
>
> Well, any solution to display data in 2 or more colums using Plua?
>
> Here too are report of my problem (with picture)
> http://vonluawelt.blogspot.com/2009/05/sdmm-data-grid-list-problem.html
>
> Many thanks.
>
> Bye
>
> 2009/4/26 Helton Eduardo Ritter <[hidden email]<heltonritter%40gmail.com>
> >
>
> > I whant display 2 colums of data, like this:
> >
> > description1 value1
> > description2 value2
> > description3 value3
> > description4 value4
> >
> > Now I have this code (show only 1 colum):
> >
> > registers ={}
> > registers[0]="description1"
> > registers[1]="description2"
> > registers[2]="description3"
> > registers[3]="description4"
> >
> > gui.control{type="list", lines=11, columns=30, list=registers,
> > handler=generalControler}
> >
> > How I can display 2 ou more data coumls?
> >
> > I'm using plua 2.0
> >
> > Thanks
> >
> > --
> >
> > #----------------------------------------------------------
> > ---------------------------------------------------#
> > Helton Eduardo Ritter - www.sourcedreams.com.br Equipe técnica da PHP
> > Magazine - www.phpmagazine.org.br Blog Pessoal:
> > livehelton.blogspot.com No mundo da Lua! vonluawelt.blogspot.com
> > Técnico em Informática - programador web - SETREM - www.setrem.com.br
> > Bacharelando em sistemas de informação
> >
> > "Tudo o que fazemos cansa. Feliz daquele que não perde as
> > forças"(Goethe)
> >
>
> --
> #----------------------------------------------------------#
> Helton Eduardo Ritter - www.sourcedreams.com.br Equipe técnica da PHP
> Magazine - www.phpmagazine.org.br Blog Pessoal: livehelton.blogspot.com No
> mundo da Lua! vonluawelt.blogspot.com Técnico em Informática - programador
> web - SETREM - www.setrem.com.br Bacharelando em sistemas de informação
>
> "Tudo o que fazemos cansa. Feliz daquele que não perde as forças"(Goethe)
>
> [Non-text portions of this message have been removed]
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>  
>



--
#------------------------------------------------------------------------------------------------------------------------#
Helton Eduardo Ritter - www.sourcedreams.com.br
Equipe técnica da PHP Magazine - www.phpmagazine.org.br
Blog Pessoal: livehelton.blogspot.com
No mundo da Lua! vonluawelt.blogspot.com
Técnico em Informática - programador web - SETREM - www.setrem.com.br
Bacharelando em sistemas de informação

"Tudo o que fazemos cansa. Feliz daquele que não perde as forças"(Goethe)


[Non-text portions of this message have been removed]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Re: list with 2 colums

Helton Eduardo Ritter
Hello list!

Well, using Morten sugestion, I created dinamicly "gui.list" for each colum
of data in my matix, table ... The code is here, for each colum I set a y
position, and so is like a grid.

-- tool to easy display multi colums data using Plua

function eventsHandler(e, id, arg)
        --print("e"..e.." id"..id.."arg"..arg)

        -- incredible bad code here !
        -- dont make this in your house please :)
        gui.setstate(1800,arg)
        gui.setstate(1801,arg)
        gui.setstate(1802,arg)

end

function datagrid(data,lines,colums,height,widthColums)
        d={}
        x = 0
        for j=1, colums do
                for i=1, lines do
                        d[i] = data[i][j]
                end

                screen.moveto(x)
                x = x + (widthColums[j]*5) +1

                list = gui.list(height,widthColums[j],d)
                gui.sethandler(list,eventsHandler)
        end

end

-- testing ------------------------------------

mydata = {}
for a=1,30 do
        mydata[a] = {}
        mydata[a][1] = a;
        mydata[a][2] = "description "..a;
        mydata[a][3] = "value "..a;
end

screen.moveto(0,30)
gui.title("Data grid with >= 2 colums")

widthColums = {}
widthColums[1] = 5
widthColums[2] = 18
widthColums[3] = 8

-- data, lines,colums, height, width for each colum of matrix
datagrid(mydata,30,3,12,widthColums)

gui.main()

So it works fine, but I not like the number of "for" loops, that is so
"hard" to fragile device process... that's work, but I don't like this.


Ps.: My palm is a Palm Z22, 160x160 px screen, 200MHZ processor

Bye friends, and thanks for ideas, if are more ... please report.


[Non-text portions of this message have been removed]

Loading...