mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Apr 2006
Posts: 400
K
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
This is kind of a wierd question, but, is there a way that I can
click on a radio, and then a button by using something like:

Code:
/did -r nick_dialog
or
/did -a nick_dialog


I made a quick dialog to see if it was possible, please help if possible, thanks. and I will be posting here again, for more questions, lol, sorry!



Code:
dialog Nick_Dialog {
  title "Nicks/Chans"
  size -1 -1 109 106
  option dbu
  button "Add", 2, 48 21 37 12
  radio "Nicks", 3, 40 49 50 10, group
  radio "Chans", 4, 40 67 50 10
  box "Example Dialog", 1, 2 2 97 95
}

alias test dialog -m nick_dialog nick_Dialog

Last edited by Kurdish_Assass1n; 18/05/06 01:07 AM.
Joined: May 2005
Posts: 449
Fjord artisan
Offline
Fjord artisan
Joined: May 2005
Posts: 449
Do you mean that you want to see if a certain radio button is checked when you hit a button? If that's what you mean, then this is what you want:
Code:
On *:Dialog:Nick_Dialog:sclick:2: {
  if ($did(Nick_Dialog,3).state == 1) {
    echo -s selected
  }
}

That's just a quick example. That will echo "selected" in your status window if your Nicks radio button is selected when you hit the button.

Joined: Apr 2006
Posts: 400
K
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
hey bwr30060, sorry, I edited this thread, read again please, thanks.


-Kurdish_Assass1n
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
I think bwr30060 answered you
Code:
dialog Nick_Dialog {
  title "Nicks/Chans"
  size -1 -1 109 106
  option dbu
  button "Add", 2, 48 21 37 12
  radio "Nicks", 3, 40 49 50 10, group
  radio "Chans", 4, 40 67 50 10
  box "Example Dialog", 1, 2 2 97 95
}
alias test dialog -m nick_dialog nick_Dialog

On *:Dialog:Nick_Dialog:sclick:2: {
  if ($did(Nick_Dialog,3).state == 1) {
    echo -a Nicks selected
  }
  elseif ($did(Nick_Dialog,4).state == 1) {
    echo -a Chans selected
  }
}

Joined: May 2005
Posts: 449
Fjord artisan
Offline
Fjord artisan
Joined: May 2005
Posts: 449
Although I'm not sure what the /did -r nick_dialog
part in the edited post was about. Can you be more clear if that's not what you want to do? /did -r and -a is making me think that you want to add or remove channels or nicks from a listbox depending on what radio button is checked. Is that it?

Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
@bwr 30060: although you clicked my nick for the reply I'm sure you meant the OP

here is some more code using the -ra

Code:
dialog Nick_Dialog {
  title "Nicks/Chans"
  size -1 -1 100 80
  option dbu
  edit "", 10, 5 15 90 10 
  button "Add", 2, 25 45 50 20
  radio "Nicks", 3, 25 30 24 8, group
  radio "Chans", 4, 50 30 24 8
  box "Choose Wisely Sir Knight", 1, 2 2 96 76
}
alias test dialog -m nick_dialog nick_Dialog

On *:Dialog:Nick_Dialog:sclick:2: {
  if ($did(Nick_Dialog,3).state == 1) && ($did(nick_dialog,10)) {  did -ra $dname 1 $did(nick_dialog,10) added to Nicks }
  elseif ($did(Nick_Dialog,4).state == 1) && ($did(nick_dialog,10)) {  did -ra $dname 1 $did(nick_dialog,10) added to Chans }
  else {
    if (!$did(nick_dialog,10))  {
      if ($did(Nick_Dialog,3).state == 1) {
        did -ra $dname 1 Nicks Selected
      }
      elseif ($did(Nick_Dialog,4).state == 1) {
        did -ra $dname 1 Chans Selected
      }
    }
  }
}


if the edit box is empty, it changes the box text to say nicks or Chans selected
if the edit box has text in it, the box text then is changed to whatever the text is in the editd box, followed by "was added to" and again the Nicks or Chans depending.

no error control is here for having not chosen either nicks or chans

Joined: Apr 2006
Posts: 400
K
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
Quote:

I made a quick dialog to see if it was possible

I made the Nick/Channel Dialog JUST to use as an example, it has nothing to do with the dialog that I am actually making, I just can't show ppl what the dialog is / looks like.


-Kurdish_Assass1n
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
then explain what you are wanting better, give a better sample of what you want the button to do inrelation to the radio buttos
like:
I want to type info into an edit box, then depending on which radio is selected, have the info added to either a nick list or a chans list when i click the add button


Code:
dialog nickchan {
  title "Nicks or Chans"
  size -1 -1 210 140
  option dbu
  box "Selectable Edit Box", 1, 2 2 206 136, center
  edit "", 100,  5 10 200 10
  radio "Nicks", 200, 50 25 25 10, group
  radio "Chans", 201, 150 25 25 10
  list 500, 5 40 95 75
  list 501, 100 40 95 75
  button "ADD", 900, 75 120 50 15 
}
alias test dialog -m nickchan nickchan
on *:init:nicchan:init:0:{
  did -t $dname 200
}
on *:dialog:nickchan:sclick:900:{ 
  if (!$did($dname,100)) { noop $input(You Must Enter Text in the Editbox,ok5) | return }
  if ($did($dname,200).state == 1) { did -a $dname 500 $did($dname,100) | did -r $dname 100 }
  elseif ($did($dname,201).state == 1) { did -a $dname 501 $did($dname,100) | did -r $dname 100 }
  else { noop $input(You Must Choose Nicks Or Chans,ok5) }
}

Joined: Apr 2006
Posts: 400
K
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
ok guys, forget that I ever posted anything before this..

This is what I want, instead of actually Clicking on a radio button, is there a way that I could type something and it would click by itself, and same for a Button.


-Kurdish_Assass1n
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
dialog nickchan {
title "Nicks or Chans"
size -1 -1 100 55
option dbu
box "Sample", 1, 2 2 98 52, center
radio "Nicks", 200, 5 35 25 10, group
radio "Chans", 201, 70 35 25 10
button "ADD", 900, 25 15 50 15
}
alias test dialog -m nickchan nickchan
on *:dialog:nickchan:init:0:{
did -c $dname 200
.timernickchanbutd1 1 5 did -b $dname 900
.timernickchanbutu2 1 7 did -e $dname 900
.timernickchan 1 15 did -c $dname 201
.timernickchan2 1 15 did -u $dname 200
.timernickchanbutd3 1 17 did -b $dname 900
.timernickchanbutu4 1 19 did -e $dname 900
}

Joined: Apr 2006
Posts: 400
K
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
ok guys, I'm really sorry, I know I confused you guys with my questions..and, really, i'm sorry.
but, this is exactly what I'm looking for..


and
Code:
dialog Fake_Dialog {
  title "Example Dialog"
  size -1 -1 258 182
  option dbu
  combo 1, 12 18 105 111, size
  radio "Radio Button", 2, 133 22 50 10, group
  radio "Radio Button", 3, 133 47 50 10
  button "Button", 4, 144 86 37 12
}

I wanna know what to type instead of
/did -a fake_dialog 1 hi
for it to go IN the editbox, now do you guys understand? pleaseeee help


-Kurdish_Assass1n
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
dialog Fake_Dialog {
title "Example Dialog"
size -1 -1 258 182
option dbu
combo 1, 12 18 232 111
radio "Radio Button", 2, 133 122 50 10, group
radio "Radio Button", 3, 133 142 50 10
button "Button", 4, 144 162 37 12
}
on *:dialog:fake_dialog:init:0:{
did -a fake_dialog 1 Try using an edit box Over a list box
.timerfaker 1 3 did -c fake_dialog 1 1
}


Link Copied to Clipboard