| View previous topic :: View next topic |
| Author |
Message |
Tdk161 Valued Contributor


Joined: 08 Feb 2005 Posts: 399 Location: ITALY
|
Posted: Sun Nov 22, 2009 7:56 pm Post subject: Table with checkboxes seletion [SOLVED] |
|
|
Hi to all,
I'm writing a little program and I would like using a table and can select more items with checkboxes using extable dsu , checkboxses swowed but how I can retrive selected items by check checkboxes? I tried @Items() but not work
Any Idea?
Many thanks in advance for any info
Last edited by Tdk161 on Fri Dec 11, 2009 10:45 am; edited 2 times in total |
|
| Back to top |
|
 |
bornsoft Contributor

Joined: 19 Feb 2009 Posts: 113 Location: Germany
|
Posted: Sun Nov 22, 2009 11:29 pm Post subject: |
|
|
hi,
this should work:
at first define a function
| Code: |
#Define Function,Checked
|
now loop through your table
| Code: |
%H = @winexists(~Table1)
%i = @index(Table1)
repeat
if @checked(%H,%i)
# do useful things
info Item #%i is checked.
end
%i = @next(Table1)
until @not(@ok())
|
so this function is called
| Code: |
:Checked
# LVM_GETITEMSTATE
%x = 4140
# LVIS_STATEIMAGEMASK
%y = 61440
%x = @SendMsg(%1,%x,%2,%y)
if @equal(%x,8192)
%R = 1
end
exit %R
|
FYI this code I derived from a table-control-unit called "utils.dsc" by vdsalchemist which can be found somewhere here in the forum.
greetings |
|
| Back to top |
|
 |
Tdk161 Valued Contributor


Joined: 08 Feb 2005 Posts: 399 Location: ITALY
|
Posted: Wed Nov 25, 2009 4:03 pm Post subject: |
|
|
Tnx, I will try it  |
|
| Back to top |
|
 |
Aslan Valued Contributor


Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Thu Nov 26, 2009 3:26 pm Post subject: |
|
|
Tdk161,
Sorry, for getting back to you so late.
With extTable you will need to process each row with @tItem(<Table>,CHECKBOX,<tIndex>). It will return 1 if checked and 0 if not. The internal code of this function is similar to the code "bornsoft" shows above. |
|
| Back to top |
|
 |
Tdk161 Valued Contributor


Joined: 08 Feb 2005 Posts: 399 Location: ITALY
|
Posted: Tue Dec 01, 2009 4:49 pm Post subject: |
|
|
Hi Aslan,
I Tried using this code
| Code: | :Selezione
#%%Inp = @New(List)
%%Out = @New(List)
#List Assign,%%Inp,Griglia
List Seek,Griglia,0
#%r = @Index(Griglia)
Repeat
If @tItem(Griglia,CHECKBOX,@Index(Griglia))
List Add,%%Out,@Item(Griglia)
End
%i = @Next(Griglia)
Until @Not(@Ok()) |
But not work the condition return always 1 what I wrong?
Many tnx |
|
| Back to top |
|
 |
Aslan Valued Contributor


Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Sun Dec 06, 2009 1:11 am Post subject: |
|
|
Sorry Tdk161 I checked my internal code and noticed that I left out a character in the @tItem(Checked) function
It is fixed now and I updated the the DSU http://www.vdsworld.com/download.php?id=508 and included a Checkbox example.
Sorry for the inconvienence |
|
| Back to top |
|
 |
Scheben Newbie

Joined: 09 Apr 2002 Posts: 9 Location: Stuttgart,Germany
|
Posted: Sun Dec 06, 2009 10:22 am Post subject: |
|
|
Great! It works.
I have just stepped in because the checkbox @item did not work for me and so I have found your update in this thead.
Aslan, thank you very much |
|
| Back to top |
|
 |
Tdk161 Valued Contributor


Joined: 08 Feb 2005 Posts: 399 Location: ITALY
|
Posted: Fri Dec 11, 2009 2:23 am Post subject: |
|
|
Many Tnx Aslan now Work and it's a really great dsu |
|
| Back to top |
|
 |
|