| View previous topic :: View next topic |
| Author |
Message |
bbelcher Contributor

Joined: 30 Jul 2002 Posts: 172
|
Posted: Thu Dec 16, 2004 1:40 pm Post subject: limit Checkbox selection |
|
|
What I'm trying to do is only allow 2 check boxes to be checked at one time. I've done this but I was wondering if there is a better way? Also what I would really like is if you checked box 1 and box 2 then at a later time checked box 3. box 1 would clear and you would have box 2 and 3 checked. Confused yet?
the short version.
box1,box2 checked
then
box3,
box1 clears
you have
box2,box3 checked
| Code: |
Title test1
DIALOG CREATE,New Dialog,-1,0,488,80
REM *** Modified by Dialog Designer on 12-16-2004 - 08:31 ***
DIALOG ADD,CHECK,CHECK1Z,20,51,69,18,check1,,,CLICK
DIALOG ADD,CHECK,CHECK2Z,40,51,73,18,check2,,,CLICK
DIALOG ADD,CHECK,CHECK3Z,20,155,67,18,check3,,,CLICK
DIALOG ADD,CHECK,CHECK4Z,40,155,66,18,check4,,,CLICK
DIALOG ADD,CHECK,CHECK5z,20,262,66,18,check5,,,CLICK
DIALOG ADD,CHECK,CHECK6z,40,262,66,18,check6,,,CLICK
DIALOG ADD,CHECK,CHECK7z,20,375,67,18,check7,,,CLICK
DIALOG ADD,CHECK,CHECK8z,40,375,67,18,check8,,,CLICK
rem sets check1 and check3 as default
dialog SET,check1z,1
dialog SET,check3z,1
dialog SET,check5z,
dialog SET,check7z,
dialog SET,check2z,
dialog SET,check4z,
dialog SET,check6z,
dialog SET,CHECK8z,
DIALOG SHOW
:Evloop
wait event
goto @event()
:check1zclick
:check2zclick
:check3zclick
:check4zclick
:check5zclick
:check6zclick
:check7zclick
:check8zclick
%%c1 = @dlgtext(check1z)
%%c2 = @dlgtext(check2z)
%%c3 = @dlgtext(check3z)
%%c4 = @dlgtext(check4z)
%%c5 = @dlgtext(check5z)
%%c6 = @dlgtext(check6z)
%%c7 = @dlgtext(check7z)
%%c8 = @dlgtext(check8z)
if @equal(%%c1,1)
%%succ = @succ(%%succ)
end
if @equal(%%c2,1)
%%succ = @succ(%%succ)
end
if @equal(%%c3,1)
%%succ = @succ(%%succ)
end
if @equal(%%c4,1)
%%succ = @succ(%%succ)
end
if @equal(%%c5,1)
%%succ = @succ(%%succ)
end
if @equal(%%c6,1)
%%succ = @succ(%%succ)
end
if @equal(%%c7,1)
%%succ = @succ(%%succ)
end
if @equal(%%c8,1)
%%succ = @succ(%%succ)
end
if @greater(%%succ,2)
dialog SET,check1z,
dialog SET,check3z,
dialog SET,check5z,
dialog SET,check7z,
rem firewall 2 interfaces
dialog SET,check2z,
dialog SET,check4z,
dialog SET,check6z,
dialog SET,check8z,
else
end
rem %%lastcheck =
%%succ = 0
goto evloop
:Close
exit
|
|
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Thu Dec 16, 2004 5:03 pm Post subject: |
|
|
Is that is what you want?
| Code: |
DIALOG CREATE,New Dialog,-1,0,488,80
DIALOG ADD,CHECK,CHECK1Z,20,51,69,18,check1,,,CLICK
DIALOG ADD,CHECK,CHECK2Z,40,51,73,18,check2,,,CLICK
DIALOG ADD,CHECK,CHECK3Z,20,155,67,18,check3,,,CLICK
DIALOG ADD,CHECK,CHECK4Z,40,155,66,18,check4,,,CLICK
DIALOG ADD,CHECK,CHECK5z,20,262,66,18,check5,,,CLICK
DIALOG ADD,CHECK,CHECK6z,40,262,66,18,check6,,,CLICK
DIALOG ADD,CHECK,CHECK7z,20,375,67,18,check7,,,CLICK
DIALOG ADD,CHECK,CHECK8z,40,375,67,18,check8,,,CLICK
DIALOG SHOW
# Sets check1 and check3 as default
dialog SET,check1z,1
dialog SET,check2z,
dialog SET,check3z,1
dialog SET,check4z,
dialog SET,check5z,
dialog SET,check6z,
dialog SET,check7z,
dialog SET,check8z,
# Make sure these two variables keep the names of the two checkboxes which are selected above
%%Check1 = check1z
%%Check2 = check3z
:Evloop
wait event
%%Event = @event()
goto %%Event
:check1zclick
:check2zclick
:check3zclick
:check4zclick
:check5zclick
:check6zclick
:check7zclick
:check8zclick
dialog set,%%Check1,
%%Check1 = %%Check2
%%Check2 = @substr(%%Event,1,@diff(@len(%%Event),5))
dialog set,%%Check2,1
# Execute this while-wend loop, so that the event buffer will be emptied. If this is not
# done, VDS will recognize a CLICK event in the above code, and will loop around...
while @event()
wend
goto Evloop
:Close
exit |
_________________ [ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial! |
|
| Back to top |
|
 |
bbelcher Contributor

Joined: 30 Jul 2002 Posts: 172
|
Posted: Thu Dec 16, 2004 5:52 pm Post subject: |
|
|
yep, thats what I was looking for but is there a easy way to adjust the amount of checkboxes that could be checked. Say three.  |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Thu Dec 16, 2004 6:27 pm Post subject: |
|
|
This is how you can do the same with 3 checkboxes. I've tried to show which things I changed, I hope you can spot them...
| Code: | DIALOG CREATE,New Dialog,-1,0,488,80
DIALOG ADD,CHECK,CHECK1Z,20,51,69,18,check1,,,CLICK
DIALOG ADD,CHECK,CHECK2Z,40,51,73,18,check2,,,CLICK
DIALOG ADD,CHECK,CHECK3Z,20,155,67,18,check3,,,CLICK
DIALOG ADD,CHECK,CHECK4Z,40,155,66,18,check4,,,CLICK
DIALOG ADD,CHECK,CHECK5z,20,262,66,18,check5,,,CLICK
DIALOG ADD,CHECK,CHECK6z,40,262,66,18,check6,,,CLICK
DIALOG ADD,CHECK,CHECK7z,20,375,67,18,check7,,,CLICK
DIALOG ADD,CHECK,CHECK8z,40,375,67,18,check8,,,CLICK
DIALOG SHOW
# Sets check1 and check3 as default
dialog SET,check1z,1
dialog SET,check2z,
dialog SET,check3z,1
dialog SET,check4z,
# [ CHANGED THE LINE BELOW ] #
dialog SET,check5z,1
dialog SET,check6z,
dialog SET,check7z,
dialog SET,check8z,
# Make sure these two variables keep the names of the two checkboxes which are selected above
%%Check1 = check1z
%%Check2 = check3z
# [ ADDED THE LINE BELOW ] #
%%Check3 = check5z
:Evloop
wait event
%%Event = @event()
goto %%Event
:check1zclick
:check2zclick
:check3zclick
:check4zclick
:check5zclick
:check6zclick
:check7zclick
:check8zclick
dialog set,%%Check1,
%%Check1 = %%Check2
# [ ADDED THE LINE BELOW ] #
%%Check2 = %%Check3
# [ CHANGED THE LINE BELOW ] #
%%Check3 = @substr(%%Event,1,@diff(@len(%%Event),5))
# [ CHANGED THE LINE BELOW ] #
dialog set,%%Check3,1
# Execute this while-wend loop, so that the event buffer will be emptied. If this is not
# done, VDS will recognize a CLICK event in the above code, and will loop around...
while @event()
wend
goto Evloop
:Close
exit |
_________________ [ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial! |
|
| Back to top |
|
 |
bbelcher Contributor

Joined: 30 Jul 2002 Posts: 172
|
Posted: Thu Dec 16, 2004 6:33 pm Post subject: |
|
|
Got it. Thanks!  |
|
| Back to top |
|
 |
|
|
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
|
|