mIRC Home    About    Download    Register    News    Help

Print Thread
/did to activate a custom dialog tab #263712 08/09/18 09:36 AM
Joined: Aug 2003
Posts: 303
P
Protopia Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
P
Joined: Aug 2003
Posts: 303
Is there any way to use /did to activate a custom dialog tab?

Re: /did to activate a custom dialog tab [Re: Protopia] #263713 08/09/18 10:04 AM
Joined: Apr 2010
Posts: 966
F
FroggieDaFrog Offline
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 966
From the help file's Dialog -> Tab control section:

Quote:
You can use /did -fu to set the focus on a specific tab, [...]


Though looking at what the -u switch does, you may need to exclude it: /did -f ...

Last edited by FroggieDaFrog; 08/09/18 10:05 AM.

I am SReject
My Stuff
Re: /did to activate a custom dialog tab [Re: FroggieDaFrog] #263714 08/09/18 10:49 AM
Joined: Aug 2003
Posts: 303
P
Protopia Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
P
Joined: Aug 2003
Posts: 303
Originally Posted By: FroggieDaFrog
From the help file's Dialog -> Tab control section:

Quote:
You can use /did -fu to set the focus on a specific tab, [...]


Though looking at what the -u switch does, you may need to exclude it: /did -f ...


Tried loads of options - -f on the second or later tab shows the first tab with the focus on it, but when you use cursor keys to change the tab, it moves from the tab you selected.

So I guess this may be a bug...

Re: /did to activate a custom dialog tab [Re: Protopia] #263715 08/09/18 11:02 AM
Joined: Apr 2010
Posts: 966
F
FroggieDaFrog Offline
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 966
Could you post a sample dialog with tabs to test against
nvm. after testing, it seems to be an issue with the init event:

Code:
alias test {
  dialog -m test test
}
dialog test {
  title "test"
  size -1 -1 200 200
  option map

  tab "a", 1, 0 0 200 200
  tab "b", 2
}
on *:DIALOG:test:init:0:{

  ;; doesn't work
  did -fu $dname 2

  ;; works
  .timer 1 0 did -fu $dname 2
}


Probably should make a bug report

Last edited by FroggieDaFrog; 08/09/18 11:15 AM.

I am SReject
My Stuff
Re: /did to activate a custom dialog tab [Re: FroggieDaFrog] #263716 08/09/18 11:16 AM
Joined: Aug 2003
Posts: 303
P
Protopia Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
P
Joined: Aug 2003
Posts: 303
My equivalent code:
Code:
dialog TestTabActivate {
  title TestTabActivate
  size -1 -1 100 100
  option dbu
  tab "Tab 1", 1, 2 2 96 96
  tab "Tab 2", 2
  tab "Tab 3", 3
}

on *:dialog:TestTabActivate:init:0: {
  did -f $dname 2
}

alias TestTab dialog -mdh TestTabActivate TestTabActivate

Re: /did to activate a custom dialog tab [Re: Protopia] #263717 08/09/18 11:18 AM
Joined: Aug 2003
Posts: 303
P
Protopia Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
P
Joined: Aug 2003
Posts: 303
Putting the did -f on a timer 1 0 makes it work.

Code:
dialog TestTabActivate {
  title TestTabActivate
  size -1 -1 100 100
  option dbu
  tab "Tab 1", 1, 2 2 96 96
  tab "Tab 2", 2
  tab "Tab 3", 3
}

on *:dialog:TestTabActivate:init:0: {
  .timer 1 0 did -f $dname 2
}

alias TestTab dialog -mdh TestTabActivate TestTabActivate


So yes - an issue when run inside the Init event.