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 


Highlight multiple items in a multi select list box?

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Thu Jan 22, 2009 3:07 am    Post subject: Highlight multiple items in a multi select list box? Reply with quote

I thought I had seen reference to highlighting multiple items in a list box before, but can't find anything in searching the forums here.

I took a look at the "LB" messages in the API help file, but the only thing close is the LB_SETANCHORINDEX and LB_SETCURSEL, while the first one almost does what needs to be done, it will only highlight a range. If I want to highlight say index 1,2,3 and 5, the SETANCHORINDEX I don't believe will suffice since it seems to be used for consecutive items without any breaks, unless I'm reading it wrong.

Does anyone know how to set the highlight of multiple items in a multi select list box? Specifically if they are not one after another, but broken up?

Thanks in advance,
~Garrett

_________________
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
Back to top
View user's profile Send private message
uvedese
Contributor
Contributor


Joined: 21 Jan 2006
Posts: 169
Location: Spain

PostPosted: Thu Jan 22, 2009 12:42 pm    Post subject: Reply with quote

Hi Garret:

Maybe this topic can be used but with modifications ...

http://forum.vdsworld.com/viewtopic.php?t=3906&start=0&postdays=0&postorder=asc&highlight=

Good luck

____________

uVeDeSe
____________

http://www.uvedese.es
Back to top
View user's profile Send private message Visit poster's website
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Thu Jan 22, 2009 3:06 pm    Post subject: Reply with quote

Quick example
Code:

DIALOG CREATE,New Dialog,-1,0,200,225
  DIALOG ADD,LIST,LIST1,9,9,182,182,,MULTI
  DIALOG ADD,BUTTON,BUTTON1,195,55,90,25,Selected Items
  DIALOG SHOW
  LIST ADD,LIST1,1
  LIST ADD,LIST1,2
  LIST ADD,LIST1,3
  LIST ADD,LIST1,4
  LIST ADD,LIST1,5
  REM $0185 = LB_SETSEL
  REM An application sends an LB_SETSEL message to select a string in a multiple-selection list box.
  REM @sendmsg(@winexists(~LIST1),$0185,<TRUE/FALSE>,<Item Index>)
  %P = @sendmsg(@winexists(~LIST1),$0185,1,0)
  %P = @sendmsg(@winexists(~LIST1),$0185,1,1)
  %P = @sendmsg(@winexists(~LIST1),$0185,1,3)
:Evloop
  wait event
  goto @event()
:BUTTON1BUTTON
  gosub GetSelectedItems
  info Selected Indexes: %%items
  goto evloop
:Close
  exit
:GetSelectedItems
  %i = @count(LIST1)
  %x = 0
  %%items = ""
  repeat
    if @greater(@sendmsg(@winexists(~LIST1),$0187,%x,0),0)
      if @greater(@len(%%items),0)
        %%items = %%items"|"%x
      else
        %%items = %x
      end
    end
    %x = @succ(%x)
  until @equal(%x,%i)
  exit

_________________
-Sheep
My pockets hurt...
Back to top
View user's profile Send private message Send e-mail
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Thu Jan 22, 2009 8:15 pm    Post subject: Reply with quote

Wow... I assumed the SETSEL would only allow a single selection and that a second call of it would reset the first one.

Thanks a bunch SnarlingSheep, and thanks uvedese.
~Garrett

_________________
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
Back to top
View user's profile Send private message
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