mIRC Home    About    Download    Register    News    Help

Print Thread
Hide/Show group of controls in a table for dialog #72357 22/02/04 02:07 PM
Joined: Feb 2004
Posts: 201
J
Jae Offline OP
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Feb 2004
Posts: 201
I couldnt seem to find anything in a search

I was looking for a simple way to say have (an item in a lsitbox for example) so u can click on it. and and have all items with certain ages of ID's in a diag change to "hide" except the few that i want to be shown "visible" for the current "screen"
I may be missing something or could have given it more thought. i also dont quite understand the significance of (grouping) ID's ..and so on. maybe someone could help clarify as to what this entails

kThx in advance

Re: Hide/Show group of controls in a table for dialog #72358 22/02/04 08:48 PM
Joined: Mar 2003
Posts: 1,271
L
LocutusofBorg Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
You can hide items with

/did -h $dname id,id,id,id,id

And unhide them with

did -v $dname id,id,id,id


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
Re: Hide/Show group of controls in a table for dialog #72359 22/02/04 09:31 PM
Joined: Feb 2004
Posts: 201
J
Jae Offline OP
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Feb 2004
Posts: 201
THANKYOU! THANKYOU! THANKYOU!
I could kiss you!
But im not going to..
i guess im going to have to pass on a few variables onto it..

loop..
var %range = %range [ $+ %i ] ....

did -h $dname %rangeHIDE
did -v $dname %rangeSHOW


with a few if's buts and NOO's i'll get there :P
Thx AGAIN LOADS! laugh

Cheers Col

I GOT IT ! #72360 23/02/04 06:30 PM
Joined: Feb 2004
Posts: 201
J
Jae Offline OP
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Feb 2004
Posts: 201
Thanks to the help of LocutusofBorg i managed to devise a simple way to turn many id's on and off i guess efficient for now.

The following bit of code i used to set 'ranges' of id's i wanted to set all at once.

Code:
 
alias diag_range_set { 
  var %i $gettok($2,1,45)
  var %tmp %i
  var %i = %i + 1
  while (%i <= $gettok($2,2,45)) {
    var %tmp  %tmp $+ , $+ %i
    inc %i
  }
  set %range [ $+ [ $1 ] ]  %tmp
}
 


This left me with somehting like this in variables:

Code:
 
var %range1 = 10
var %range2 = 20,21,22,23,24,25,26,27,28,29
var %range3 = 30
..
var %range10 = 100
var %range11 = 110
var %range12 = 120,121
 


From that on a click of such event i used the following code:

Code:
 
  var %i = 1
  while (%i <= %rang.top) {
    did -h $dname [ %range [ $+ [ %i ] ] ]
    inc %i
  }

  var %i $did($dname,2).sel
  did -v k.so [ %range [ $+ [ %i ] ] ]
 


%rang.top would be set to whatever the highest number of groups of ranges of id's there are

Post and let me know what you think of my outcome.

Cheers Col

Re: I GOT IT ! #72361 23/02/04 09:07 PM
Joined: Dec 2002
Posts: 102
M
MIMP Offline
Vogon poet
Offline
Vogon poet
M
Joined: Dec 2002
Posts: 102
Regarding "grouping" of id's that really only pertains to radio selections. If you have multiple sets of radio boxes you can use the group logic to separate them.
Code:
dialog test {
  size -1 -1 108 50
  option dbu
  radio "North", 1, 29 5 26 10, group
  radio "East", 2, 41 16 19 10, left
  radio "South", 3, 29 28 25 10
  radio "West", 4, 6 16 25 10
  radio "Up", 5, 79 5 23 10, group
  radio "Down", 6, 79 16 27 10
  button "GO", 7, 70 32 29 12, ok
}
on *:dialog:test:init:0:{
  did -c test 1
  did -c test 5
}

If you remove the "group" tag from the "UP" radio and try it again you'll see all 6 buttons act as one group.


-
MIMP
Re: I GOT IT ! #72362 23/02/04 09:22 PM
Joined: Feb 2004
Posts: 201
J
Jae Offline OP
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Feb 2004
Posts: 201
I can understand grouping of a radio button. I more aiming athiding and showing of groups of id's on a form at any one time. saving something like
did -h $dname %id
... 500 times on a large table.
then
did -v $dname %showid
another 5-15 times for that. then finally show the content. not to mention the permutations of such a thing. im sure other scripters have already solved this just i am not going to look through 100's or scripts looking for one little thing and then go through reverse engineering. Anyway. im jsut hoping it will help someone out there. Perhaps my intructions arent 100% clear.

Cheers Col