forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Table with checkboxes seletion [SOLVED]

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
Tdk161
Valued Contributor
Valued Contributor


Joined: 08 Feb 2005
Posts: 399
Location: ITALY

PostPosted: Sun Nov 22, 2009 7:56 pm    Post subject: Table with checkboxes seletion [SOLVED] Reply with quote

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 Sad
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
View user's profile Send private message Send e-mail
bornsoft
Contributor
Contributor


Joined: 19 Feb 2009
Posts: 113
Location: Germany

PostPosted: Sun Nov 22, 2009 11:29 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Tdk161
Valued Contributor
Valued Contributor


Joined: 08 Feb 2005
Posts: 399
Location: ITALY

PostPosted: Wed Nov 25, 2009 4:03 pm    Post subject: Reply with quote

Tnx, I will try it Very Happy
Back to top
View user's profile Send private message Send e-mail
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Thu Nov 26, 2009 3:26 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Tdk161
Valued Contributor
Valued Contributor


Joined: 08 Feb 2005
Posts: 399
Location: ITALY

PostPosted: Tue Dec 01, 2009 4:49 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Sun Dec 06, 2009 1:11 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Scheben
Newbie


Joined: 09 Apr 2002
Posts: 9
Location: Stuttgart,Germany

PostPosted: Sun Dec 06, 2009 10:22 am    Post subject: Reply with quote

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
View user's profile Send private message
Tdk161
Valued Contributor
Valued Contributor


Joined: 08 Feb 2005
Posts: 399
Location: ITALY

PostPosted: Fri Dec 11, 2009 2:23 am    Post subject: Reply with quote

Very Happy Very Happy Very Happy

Many Tnx Aslan now Work and it's a really great dsu
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group