Home   Help Search Login Register  

Author Topic: Two Listboxes, but only one Selection - How?  (Read 1331 times)

0 Members and 1 Guest are viewing this topic.

Offline SnowSky

  • Members
  • *
Two Listboxes, but only one Selection - How?
« on: 26 Feb 2009, 16:31:36 »
Hey Guys,

first of all - Hello :).
I'm new here, and I'm also a Rookie in ArmA Scripting, so please excuse me if I ask sometimes stupid questions. Now I read some Tutorials, made some scripts, and now I actually pass those Dialogs.
My Problem is the following: I have 2 Listboxes, they are both "LB_TEXTURES" means that you can select only one Value in the Listbox, so far so good. Now If there has been something selected on the first Listbox, and I select something on the second now, I want that the selection in the first Listbox will be canceled (not removed, only unselected).
To reach this, I tried some ways, for example in my onLBSelChanged action:
"for [{_i=0},{_i< (lbSize IDC_DEFENSE_ID)},{_i=_i+1}] do {((findDisplay IDD_CONSTRUCTION_ID) displayCtrl IDC_DEFENSE_ID) lbSetSelected [_i, FALSE];};";
//For this try I set the Listboxes to LB_MULTI

or with lbSetCurSel I tried to set it on 0, or even 1, but it doesn't matter what I give in, because it doesn't change anything. Do you Guys know something I could try?
Otherwhise I think I have to do a WorkAround like deleting the content of the ListBox and then fill it again :(

well then,
yours sincerly, SnowSky
cheers
« Last Edit: 26 Feb 2009, 16:41:24 by SnowSky »

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Two Listboxes, but only one Selection - How?
« Reply #1 on: 26 Feb 2009, 18:30:56 »
I tried that method too, to no avail. I ended up manually managing 2 multi-selection boxes, which can be selected 0 or more times, to get this functionality in SPON Money. Worked, though it was a bit messy...
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline SnowSky

  • Members
  • *
Re: Two Listboxes, but only one Selection - How?
« Reply #2 on: 26 Feb 2009, 19:29:32 »
Thanks for your reply!

Well after some hours of triing I was stucked of it - so now I did a WorkAround which wasn't such a bad Idea, seems it looks better now.