tglogo.png

Downloading File

Filename: Hide / Show Window Dialog
menu channel,status {
  .$iif($server, Channel Show/Hide) :winhide
}
alias winhide { dialog $iif($dialog(winhide), -v, -m) winhide winhide } 

dialog winhide {
  title "Hide/Show Windows"
  size -1 -1 150 80
  option dbu
  box "Visible", 1, 3 1 60 75
  list 2, 8 10 50 70, sort autovs
  box "Hidden", 3, 87 1 60 75
  list 4, 92 10 50 70, sort autovs
  button ">", 5, 68 18 15 15, flat
  button ">>", 7, 68 55 15 10, flat
  button "<<", 8, 68 67 15 10, flat
  text "One Item", 9, 68 3 15 15, center
  text "All Items", 10, 68 38 15 15, center
}
on *:dialog:winhide:*:*: {
  if ($devent == init) { ch.load }
  if ($devent == close) { unset %selchan }
  if ($devent == dclick) { 
    if ($did == 2) { 
      if ($window($did(2).seltext).type = channel) { join $did(2).seltext | goto next1 }
      if ($window($did(2).seltext).type = custom) { window -a $did(2).seltext | goto next1 } 
      if ($window($did(2).seltext).type = query) { window -a $did(2).seltext | goto next1 } 
      :next1
      ch.load  
    }
    if ($did == 4) { 
      if ($window($did(4).seltext).type = channel) { join $did(4).seltext | goto next2 }
      if ($window($did(4).seltext).type = custom) { window -a $did(4).seltext | goto next2 } 
      if ($window($did(4).seltext).type = query) { window -a $did(4).seltext | goto next2 } 
      :next2
      ch.load 
    }
  }
  if ($devent == sclick) { 
    if ($did == 2) {
      if ($did(2).seltext) {
        set %selchan $did(2).seltext
        did -u $dname 4
        did -a $dname 5 >
      }
    }
    if ($did == 4) {
      if ($did(4).seltext) {
        set %selchan $did(4).seltext
        did -u $dname 2
        did -a $dname 5 <
      }
    }
    if ($did == 5) {
      if (%selchan != $null) {
        if ($window(%selchan).type = channel) { $iif($did(5) == >, window -h %selchan, window -wr %selchan) | goto next }
        if ($window(%selchan).type = custom) { $iif($did(5) == >, window -h %selchan, window -nw(0) %selchan) | goto next } 
        if ($window(%selchan).type = query) { $iif($did(5) == >, window -h %selchan, window -nw(0) %selchan) | goto next }
        :next
        ch.load        
      }
    }
    if ($did == 7) {
      did -r winhide 2,4
      var %i 1
      while (%i <= $chan(0)) {
        if ($window($chan(%i)).state != hidden) { window -h $chan(%i) }
        inc %i
      }
      var %i 1
      while (%i <= $window(0)) {
        if ($window($window(%i)).state != hidden) { window -h $window(%i) } 
        inc %i
      }
      var %i 1
      while (%i <= $query(0)) {
        if ($window($query(%i)).state != hidden) { window -h $query(%i) }
        inc %i
      }
      ch.load
    }
    if ($did == 8) { 
      did -r winhide 2,4
      var %i 1
      while (%i <= $chan(0)) {
        if ($window($chan(%i)).state == hidden) { window -wr $chan(%i) }
        inc %i
      }
      var %i 1
      while (%i <= $window(0)) {
        if ($window($window(%i)).state == hidden) { window -nw(0) $window(%i) } 
        inc %i
      }
      var %i 1
      while (%i <= $query(0)) {
        if ($window($query(%i)).state == hidden) { window -nw(0) $query(%i) }
        inc %i
      }
      ch.load
    }
  }
}
alias ch.load {
  unset %selchan
  did -r winhide 2,4
  var %i 1
  while (%i <= $chan(0)) {
    $iif($window($chan(%i)).state == hidden, did -a winhide 4 $chan(%i), did -a winhide 2 $chan(%i)) 
    inc %i
  }
  var %i 1
  while (%i <= $window(0)) {
    $iif($window($window(%i)).state == hidden, did -a winhide 4 $window(%i), did -a winhide 2 $window(%i)) 
    inc %i
  }
  var %i 1
  while (%i <= $query(0)) {
    $iif($window($query(%i)).state == hidden, did -a winhide 4 $query(%i), did -a winhide 2 $query(%i)) 
    inc %i
  }
}


on *:action:*:#,?: {
  var %i 1
  while (%i <= $chan(0)) {
    if ($window($chan(%i)).state == hidden) { window -wr $window($chan(%i)) }
    inc %i
  }
  var %i 1
  while (%i <= $query(0)) {
    if ($window($query(%i)).state == hidden) { window -wr $window($query(%i)) }
    inc %i
  }
}
on *:notice:*:#,?: {
  var %i 1
  while (%i <= $chan(0)) {
    if ($window($chan(%i)).state == hidden) { window -wr $window($chan(%i)) }
    inc %i
  }
  var %i 1
  while (%i <= $query(0)) {
    if ($window($query(%i)).state == hidden) { window -wr $window($query(%i)) }
    inc %i
  }
}
on *:text:*:#,?: {
  var %i 1
  while (%i <= $chan(0)) {
    if ($window($chan(%i)).state == hidden) { window -wr $window($chan(%i)) }
    inc %i
  }
  var %i 1
  while (%i <= $query(0)) {
    if ($window($query(%i)).state == hidden) { window -wr $window($query(%i)) }
    inc %i
  }
  var %i 1
  while (%i <= $window(0)) {
    if ($window($window(%i)).state == hidden) { window -nw(0) $window($window(%i)) }
    inc %i
  }
}

Related Files


Please note that on our website we use cookies necessary for the functioning of our website, cookies that optimize the performance. To learn more about our cookies, how we use them and their benefits, please read our Cookie Policy.
I Understand