mIRC Homepage
Posted By: Protopia /did to activate a custom dialog tab - 08/09/18 09:36 AM
Is there any way to use /did to activate a custom dialog tab?
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 ...
Posted By: Protopia Re: /did to activate a custom dialog tab - 08/09/18 10:49 AM
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...
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
Posted By: Protopia Re: /did to activate a custom dialog tab - 08/09/18 11:16 AM
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
Posted By: Protopia Re: /did to activate a custom dialog tab - 08/09/18 11:18 AM
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.
© mIRC Discussion Forums