[script]
n0=on *:load: { if ($version < 6.03) { echo -a * This addon was made for the latest version of mIRC (6.03) | echo -a * Please download the current mIRC version and try loading the addon again... | .timer 1 4 .unload -rs switchbar/switchbar.ini | halt } }
n1=#switchbaron off
n2=on *:start: { .hmake newmsg 50 | .hmake switchbar 100 | if ($isfile(switchbar\switchbar.sys)) { hload -i switchbar switchbar\switchbar.sys } | .switchbar }
n3=#switchbaron end
n4=#switchbaroff on
n5=on *:start: { .hmake newmsg 50 | .hmake switchbar 100 | if ($isfile(switchbar\switchbar.sys)) { hload -i switchbar switchbar\switchbar.sys } }
n6=#switchbaroff end
n7=on *:exit: { hsave -oi switchbar switchbar/switchbar.sys }
n8=on *:quit: { hsave -oi switchbar switchbar/switchbar.sys }
n9=on *:active:#: { mircustom SetIcon -w $window($active).hwnd $hdata(icon.channel) }
n10=on *:active:?: { mircustom SetIcon -w $window($active).hwnd $hdata(icon.query) }
n11=on *:ACTIVE:*:{
n12=  if ($active == Status Window) { mircustom SetIcon -w $window($active).hwnd $hdata(icon.status) }
n13=  if ($chr(61) isin $mid($active,1,40)) { mircustom SetIcon -w $window($active).hwnd $hdata(icon.DCC.Chat) }
n14=  if ($chr(64) isin $mid($active,1,40)) { mircustom SetIcon -w $window($active).hwnd $hdata(icon.@windows) }
n15=  if ($active = Channels List) { mircustom SetIcon -w $window($active).hwnd $hdata(icon.@chanlist) }
n16=  if ($active = URL List) { mircustom SetIcon -w $window($active).hwnd $hdata(icon.@urllist) }
n17=  if ($active = Notify List) { mircustom SetIcon -w $window($active).hwnd $hdata(icon.@notifylist) }
n18=  if (get = $gettok($active,1,32) && $gettok($active,2,32)) { mircustom SetIcon -w $window($active).hwnd $hdata(icon.DCC.get) }
n19=  if (send = $gettok($active,1,32) && $gettok($active,2,32)) { mircustom SetIcon -w $window($active).hwnd $hdata(icon.DCC.send) }
n20=  .signal -n switchbar update
n21=}
n22=on *:disconnect:{ .signal -n SWITCHBAR update }
n23=on *:join:#:{ if ($nick == $me) { .signal -n SWITCHBAR update } }
n24=on *:part:#:{ if ($nick == $me) { .timer 1 50 .signal -n SWITCHBAR update } }
n25=on *:kick:#:{ if ($knick == $me) { .timer 1 50 .signal -n SWITCHBAR update } }
n26=on *:open:*:{ .timerupdate -m 1 500 .signal -n SWITCHBAR update }
n27=on *:close:*: { .timerupdate -m 1 100 .signal -n SWITCHBAR update }
n28=on *:connect:{ scid $activecid | .signal -n SWITCHBAR update }
n29=on *:filesent:*: { .signal -n SWITCHBAR update }
n30=on *:filercvd:*: { .signal -n SWITCHBAR update }
n31=on *:sendfail:*: { .signal -n SWITCHBAR update }
n32=on *:getfail:*: { .signal -n SWITCHBAR update }
n33=ctcp :*:*:*: { if ($1 == dcc) { .timer 1 1 .signal -n switchbar update | return } }
n34=on *:text:*:?: { if ($active != $nick) && ($hget(newmsg,$+($server,-,$nick)) != $true) { $iif($hdata(highlight) == $true,highlight.query) } | else { halt } }
n35=on *:text:*:#: { if ($active != $chan) && ($hget(newmsg,$+($server,-,$chan)) != $true) { $iif($hdata(highlight) == $true,highlight.chan) } | else { halt } } 
n36=on *:chat:*: { if ($active != =$nick) && ($hget(newmsg,$+($server,-,=$nick)) != $true) { $iif($hdata(highlight) == $true,highlight.chat) } | else { halt } }
n37=on *:signal:SWITCHBAR: { if ($dialog(switchbar)) { if ($1- == update) { updateswitchbar } } }
n38=alias highlight.query { hadd -m newmsg $+($server,-,$nick) $true | .signal -n SWITCHBAR update }
n39=alias highlight.chan { hadd -m newmsg $+($server,-,$chan) $true | .signal -n SWITCHBAR update }
n40=alias highlight.chat { hadd -m newmsg $+($server,-,=$nick) $true | .timerupdate -m 1 50 .signal -n SWITCHBAR update }
n41=alias highlight.@window { hadd -m newmsg $+($server,-,=$nick) $true | .timerupdate -m 1 50 .signal -n SWITCHBAR update }
n42=alias highlight.@window { hadd -m newmsg $+($server,-,=$server) $true | .timerupdate -m 1 50 .signal -n SWITCHBAR update }
n43=alias list { list $1- | .timerupate -m 1 1000 .signal -n switchbar update | mircustom SetIcon -w $window($active).hwnd $hdata(icon.@chanlist) }
n44=
n45=alias -l dir1 { $iif($1,return $+($mircdir,$1)) }
n46=alias -l dlldir { $iif($1,return $dir1($+(dll\,$1))) }
n47=alias -l mdx { dll $+(",$dlldir(mdx.dll),") $$1- }
n48=alias -l mircustom { dll $+(",$dlldir(mircustom.dll),") $$1- }
n49=alias -l bars { return $dlldir(bars.mdx) }
n50=alias -l views { return $dlldir(views.mdx) }
n51=alias -l ktools { dll $+(",$dlldir(ktools.dll),") $$1- }
n52=alias -l pdll { return $dlldir(Popups.dll) }
n53=alias -l popups { return $dll($pdll,$1,$2-) }
n54=alias -l icons { return $+(",switchbar\archive\icons\*.ico,") }
n55=alias -l pop tokenize 32 $dll($pdll,Popup,$1-) | if ($isid) return $1- | $iif($4- != did not select a menu item,$4-)
n56=alias -l hash.refresh { hsave -oi switchbar switchbar\switchbar.sys }
n57=
n58=alias switchbar { if (!$dialog(switchbar)) { dialog -mh switchbar switchbar | disable #switchbaroff | enable #switchbaron } | else { dialog -c switchbar | enable #switchbaroff | disable #switchbaron } }
n59=alias _s.editor { if (!$dialog(editor)) { dialog -md editor editor } | else { dialog -x editor editor } }
n60=alias -l hdata { return $hget(switchbar, $+ $1 $+ ) }
n61=alias -l up.case { return $upper($mid($1-,1,1)) $+ $mid($1-,2,$len($1-)) }
n62=alias query { .query $$1 | .signal -n SWITCHBAR update }
n63=alias dcc { .dcc $1- | if ($1 == Send) || ($1 == chat) { .timer -m 1 100 .signal -n SWITCHBAR update } }
n64=alias close { .close $1- | .signal -n SWITCHBAR update } 
n65=alias -l multi-serv { var %x $$?"Zu welchem Server?" | server -m %x }
n66=alias dopopup { 
n67=  if ($1 == list) { switch.pop | pop server.pop $mouse.dx $mouse.dy }
n68=  if ($1 == shift-click) { shift-click.pop | pop shift-click.pop $mouse.dx $mouse.dy | .signal -n switchbar update }
n69=}
n70=alias sbar {
n71=  if ($1 = $null) { halt }
n72=  if ($1 = position) { var %pos = $gettok($readini(mirc.ini,Options,n4),21,44),%pos.1 = $iif(%pos == 0 || %pos == 1,1,0) | hadd -m switchbar position %pos.1 }
n73=  if ($1 = width) { return $gettok($readini(mirc.ini,options,n5),32,44) }
n74=  if ($1 = height) { return $gettok($readini(mirc.ini,options,n5),24,44) }
n75=  if ($1 = move) { if ($hdata(position) == 0) { mdx MoveControl switchbar 1 2 22 $sbar(width) $window(-2).h | did -h switchbar 3 | did -v switchbar 2 } | elseif ($hdata(position) == 1) { mdx MoveControl switchbar 1 17 2 $window(-2).w 25 | did -h switchbar 2 | did -v switchbar 3 } }
n76=}
n77=
n78=alias -l switchbar.edit {
n79=  if ($dialog(editor)) { 
n80=    var %d = $dname | did -r %d 2 | did -i %d 2 1 clearicons normal 
n81=    did -i %d 2 1 seticon normal 0 $hdata(icon.status) | did -i %d 2 1 seticon normal 0 $hdata(icon.channel) | did -i %d 2 1 seticon normal 0 $hdata(icon.query) | did -i %d 2 1 seticon normal 0 $hdata(icon.@windows) | did -i %d 2 1 seticon normal 0 $hdata(icon.DCC.send) | did -i %d 2 1 seticon normal 0 $hdata(icon.DCC.get) | did -i %d 2 1 seticon normal 0 $hdata(icon.DCC.chat) | did -i %d 2 1 seticon normal 0 $hdata(icon.@chanlist) | did -i %d 2 1 seticon normal 0 $hdata(icon.@urllist) | did -i %d 2 1 seticon normal 0 $hdata(icon.@notifylist) | did -i %d 2 1 seticon normal 0 $hdata(highlight.chan) | did -i %d 2 1 seticon normal 0 $hdata(highlight.query) | did -i %d 2 1 seticon normal 0 $hdata(highlight.chat) | did -i %d 2 1 seticon normal 0 $hdata(icon.fserv)  
n82=    did -a %d 2 + 1 1 Status $chr(9) $hdata(icon.status) | did -a %d 2 + 2 2 Channel $chr(9) $hdata(icon.channel) | did -a %d 2 + 3 3 Query $chr(9) $hdata(icon.query) | did -a %d 2 + 14 14 FServ $chr(9) $hdata(icon.fserv) | did -a %d 2 + 5 5 DCC.Send $chr(9) $hdata(icon.DCC.send) | did -a %d 2 + 6 6 DCC.Get $chr(9) $hdata(icon.DCC.get) | did -a %d 2 + 7 7 DCC.Chat $chr(9) $hdata(icon.DCC.chat) | did -a %d 2 + 4 4 @Windows  $chr(9) $hdata(icon.@windows) | did -a %d 2 + 8 8 @Chanlist $chr(9) $hdata(icon.@chanlist) | did -a %d 2 + 10 10 @Notifylist  $chr(9) $hdata(icon.@notifylist) | did -a %d 2 + 9 9 @URLlist  $chr(9) $hdata(icon.@urllist) | did -a %d 2 + 11 11 Highlight.chan  $chr(9) $hdata(highlight.chan)
n83=    did -a %d 2 + 12 12 Highlight.query  $chr(9) $hdata(highlight.query) | did -a %d 2 + 13 13 Highlight.chat  $chr(9) $hdata(highlight.chat)
n84=  }
n85=}
n86=
n87=alias -l load.preview.switch {
n88=  if ($dialog(editor)) {
n89=    var %d = $dname | did -r %d 16 | mdx SetColor %d 16 background reset | did -i %d 16 1 setbkg none | mdx SetControlMDX %d 16 toolbar $iif($hdata(flat.buttons) == $true,flat) list nodivider arrows > $bars 
n90=    if ($hdata(custom.font) == $true) { mdx SetFont %d 16 $+(+,$iif($hdata(font.style) == italic || $hdata(font.style) == bold/italic,i),$iif($hdata(font.underline) == $true,u),$iif($hdata(font.strikeout) == $true,s)) $+(-,$hdata(font.size)) $iif($hdata(font.style) == Bold || $hdata(font.style) == Bold/Italic,900,90) $hdata(font) }
n91=    if ($hdata(background) == $true) { if ($hdata(background.col) == $true) { mdx SetColor %d 16 background $hdata(background.color) } | if ($hdata(background.image) == $true) { did -i %d 16 1 setbkg $hdata(background.image.style) $hdata(background.image.file) } }
n92=    did -i %d 16 1 bmpsize 16 16 | if ($hdata(autosize) != $true) did -i %d 16 1 bwidth $hdata(button.size) $hdata(button.size)
n93=    did -i %d 16 1 setimage +nhd 0 icon small 10, $+ $hdata(switch.server) | did -i %d 16 1 setimage +nhd 0 icon small $hdata(icon.status) | did -i %d 16 1 setimage +nhd 0 icon small $hdata(icon.channel) | did -i %d 16 1 setimage +nhd 0 icon small $hdata(icon.query) | did -i %d 16 1 setimage +nhd 0 icon small $hdata(icon.@windows) | did -i %d 16 1 setimage +nhd 0 icon small $hdata(highlight.chan)
n94=    did -a %d 16 +W 12 1 | did -a %d 16 +cg $+ $iif($hdata(autosize) == $true,a,W $hdata(button.size)) 2 Status | did -a %d 16 $+(+cg,$iif($hdata(highlight) == $true && $hdata(highlight.type) == button,i),$iif($hdata(autosize) == $true,a,W $hdata(button.size))) $iif($hdata(highlight) == $true && $hdata(highlight.type) == icon,6,3) Channel | did -a %d 16 +cg $+ $iif($hdata(autosize) == $true,a,W $hdata(button.size)) 4 Query | did -a %d 16 +cg $+ $iif($hdata(autosize) == $true,a,W $hdata(button.size)) 5 @Window
n95=  }
n96=}
n97=
n98=dialog editor {
n99=  title "Switchbar Editor"
n100=  size -1 -1 176 128
n101=  option dbu
n102=  icon archive\icons\config2.ico, 0
n103=  box "", 14, 1 111 175 4
n104=  list 16, 2 99 171 0, size
n105=  button "&Nehmen", 17, 113 117 30 10
n106=  button "&Ende", 18, 145 117 30 10, cancel
n107=  tab "Icons", 21, 1 0 173 95
n108=  list 2, 6 19 164 61, group tab 21 size
n109=  box "", 1, 4 14 168 68, group tab 21
n110=  text "", 5, 7 84 51 8, tab 21
n111=  edit "", 6, 60 83 101 10, disable tab 21 autohs
n112=  button "!", 20, 162 83 9 9, tab 21
n113=  tab "Optionen", 22
n114=  box "", 3, 4 14 168 79, tab 22
n115=  check "Query(s)", 24, 15 37 32 8, tab 22 flat
n116=  radio "Zeige alle Features", 4, 6 19 72 8, tab 22 flat
n117=  radio "Zeige ausgewählte Features", 29, 6 27 73 8, tab 22 flat
n118=  check "Dcc Chat(s)", 25, 15 48 39 8, tab 22 flat
n119=  check "Active Transfers", 26, 15 59 51 8, tab 22 flat
n120=  check "@Windows", 28, 15 70 38 8, tab 22 flat
n121=  check "Chan/Notify/Url List", 30, 15 80 63 8, tab 22 flat
n122=  check "Highlight", 7, 85 20 35 8, tab 22 flat
n123=  check "Auto-Größe", 10, 85 30 35 8, tab 22 flat
n124=  text "Größe:", 12, 98 38 27 8, tab 22 right
n125=  edit "", 13, 126 37 44 10, tab 22 autohs center
n126=  check "Flache Buttons", 11, 85 47 40 8, tab 22 flat
n127=  box "", 33, 81 19 1 70, tab 22
n128=  edit "", 15, 126 57 44 10, tab 22 center
n129=  text "Größe:", 27, 96 69 29 8, tab 22 right
n130=  edit "", 31, 126 68 13 10, tab 22 center
n131=  check "Schriftart", 32, 85 58 40 8, tab 22 flat
n132=  check "Unterstrichen", 50, 84 80 39 8, tab 22 flat
n133=  check "Durchgestrichen", 9, 123 79 46 10, tab 22 flat
n134=  combo 49, 139 68 31 27, drop tab 22
n135=  combo 8, 126 19 44 24, drop tab 22
n136=  tab "Hintergund", 23
n137=  box "", 35, 4 14 168 79, tab 23
n138=  check "Nutze Hintergrund", 36, 7 20 57 8, tab 23 flat
n139=  radio "Farbe", 37, 15 30 30 8, tab 23 flat
n140=  list 39, 121 39 48 17, tab 23 size
n141=  list 40, 28 39 93 9, tab 23 size
n142=  list 41, 28 48 93 9, tab 23 size
n143=  text "R", 43, 20 40 7 8, tab 23 center
n144=  edit "", 46, 121 56 48 10, disable tab 23 center
n145=  radio "Grafik (Funktioniert nur bei den Top/Bottombars von mIRC)", 38, 15 70 145 8, tab 23 flat
n146=  edit "", 47, 20 79 73 10, disable tab 23
n147=  button "&Suche", 48, 94 79 31 9, tab 23
n148=  text "G", 44, 20 49 7 8, tab 23 center
n149=  text "B", 45, 20 58 7 8, tab 23 center
n150=  list 42, 28 57 93 9, tab 23 size
n151=  combo 34, 128 79 41 50, tab 23 sort drop
n152=}
n153=
n154=on *:dialog:editor:*:*:{
n155=  var %d = $dname
n156=  if ($devent == init) {
n157=    mdx SetMircVersion $version | mdx MarkDialog %d | mdx SetControlMDX %d 2 ListView report oneclick rowselect > $views | mdx SetBorderStyle %d 2 staticedge | mdx SetBorderStyle %d 16,40,41,42 windowedge | mdx SetFont %d 1,2,4,6,7,8,9,10,11,12,13,14,15,17,18,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,47,48,49,50 +a Default -10 90 Tahoma | mdx SetFont %d 3,5,46 +a Default -10 900 Tahoma
n158=    mdx SetControlMDX %d 40,41,42 TrackBar > $bars | did -i %d 40,41,42 1 params 0 0 255 1 1 * * 10 | did -i %d 2 1 headerdims 110 200 | did -i %d 2 1 headertext Window $chr(9) Icon Pfad | didtok %d 34 32 Center Stretch Tile | didtok %d 8 32 Button Icon | didtok %d 49 44 Regular,Italic,Bold,Bold/Italic | if (!$hget(switchbar)) .hmake switchbar 50 | if ($isfile(switchbar\switchbar.sys)) { hload -i switchbar switchbar\switchbar.sys } | switchbar.edit | load.preview.switch
n159=  }
n160=  if ($devent == sclick) {
n161=    if ($did == 2) { did -ra $dname 5 $gettok($did(2).seltext,6,32) : | did -ra $dname 6 $hdata($+(icon.,$gettok($did(2).seltext,6,32))) }
n162=    if ($did == 4) { if ($did(4).state == 1) { var %x switchbar | hadd -m %x show.all $true | hadd -m %x show.query $true | hadd -m %x show.chat $true | hadd -m %x show.transfers $true | hadd -m %x show.@window $true | hadd -m %x show.chan-not-url $true | did -bc %d 24,25,26,28,30 } }
n163=    if ($did == 7) { if ($did(7).state == 1) { hadd -m switchbar highlight $true } | else { hdel switchbar highlight } }
n164=    if ($did == 8) { if ($did(8).seltext == button) { hadd -m switchbar highlight.type button } | else { hadd -m switchbar highlight.type icon } }
n165=    if ($did == 9) { if ($did(9).state == 1) { hadd -m switchbar font.strikeout $true } | else { hdel switchbar font.strikeout } }
n166=    if ($did == 10) { if ($did(10).state == 1) { hadd -m switchbar autosize $true | did -b %d 12,13 } | else { hdel switchbar autosize | did -e %d 12,13 } }
n167=    if ($did == 11) { if ($did(11).state == 1) { hadd -m switchbar flat.buttons $true } | else { hdel switchbar flat.buttons } | mdx SetMDXStyle %d 16 toolbar $iif($hdata(flat.buttons) == $true,flat) list nodivider arrows }
n168=    if ($did == 16) { if ($did(16).sel == 2) { load.preview.switch } }
n169=    if ($did == 17) { hash.refresh | load.preview.switch | switchbar.edit | dialog -c switchbar switchbar | dialog -m switchbar switchbar }
n170=    if ($did == 18) { hash.refresh }
n171=    if ($did == 20) { var %icon.type $icons , %icon.location = $file="Choose An Icon" %icon.type | if ($right(%icon.location,4) == .ico) { did -ra %d 6 $remove(%icon.location,$mircdir) | hadd -m switchbar $+(icon.,$gettok($did(5).text,1,$asc(:))) $remove(%icon.location,$mircdir) } | switchbar.edit | load.preview.switch } 
n172=    if ($did == 22) {
n173=      if ($hdata(show.query) == $true) { did -c %d 24 } | if ($hdata(show.chat) == $true) { did -c %d 25 } | if ($hdata(show.transfers) == $true) { did -c %d 26 } | if ($hdata(show.@window) == $true) { did -c %d 28 } | if ($hdata(show.chan-not-url) == $true) { did -c %d 30 } | if ($hdata(show.all)) { did -c %d 4 | did -bc %d 24,25,26,28,30 } | elseif ($hget(swithbar,show.all) != $true) { did -c %d 29 } 
n174=      if ($hdata(highlight) != $null) { did -c %d 7 } | if ($hdata(highlight.type) == button) { did -c editor 8 1 } | if ($hdata(highlight.type)) { did -c editor 8 2 } | if ($hdata(autosize) == $true) { did -c %d 10 | did -b %d 12,13 } | if ($hdata(flat.buttons) == $true) { did -c %d 11 } | if ($hdata(button.size) != $null) { did -ra %d 13 $hdata(button.size) } | if ($hdata(custom.font) == $true) { did -c %d 32 } | else { did -b %d 15,31,27,50,49,9 } | if ($hdata(font) != $null) { did -ra %d 15 $hdata(font) } | if ($hdata(font.size) != $null) { did -ra %d 31 $hdata(font.size) }
n175=      if ($hdata(font.style) != $null) { var %x = $hdata(font.style) | if (%x == regular) { did -c %d 49 1 } | if (%x == italic) { did -c %d 49 2 } | if (%x == bold) { did -c %d 49 3 } | if (%x == bold/italic) { did -c %d 49 4 } } | if ($hdata(font.underline) == $true) { did -c %d 50 } | if ($hdata(font.strikeout) == $true) { did -c %d 9 }
n176=    }
n177=    if ($did == 23) {
n178=      if ($hdata(background) == $true) { did -c %d 36 } | if ($hdata(background.col) == $true) { did -c %d 37 } | if ($hdata(background.image) == $true) { did -c %d 38 } | if ($hdata(background.color) != $null) { did -ra %d 46 $hdata(background.color) } | mdx SetColor %d 39 background $hdata(background.color) 
n179=      if (center isin $hdata(background.image.style)) { did -c %d 34 1 } | elseif (stretch isin $hdata(background.image.style)) { did -c %d 34 2 } | elseif (tile isin $hdata(background.image.style)) { did -c %d 34 3 } | else { did -c %d 34 0 } | if ($hdata(background.image.file) != $null) { did -ra %d 47 $hdata(background.image.file) }
n180=    }
n181=    if ($did == 24) { if ($did(24).state == 1) { hadd -m switchbar show.query $true } | else { hdel switchbar show.query } }
n182=    if ($did == 25) { if ($did(25).state == 1) { hadd -m switchbar show.chat $true } | else { hdel switchbar show.chat } }
n183=    if ($did == 26) { if ($did(26).state == 1) { hadd -m switchbar show.transfers $true } | else { hdel switchbar show.transfers } }
n184=    if ($did == 28) { if ($did(28).state == 1) { hadd -m switchbar show.@window $true } | else { hdel switchbar show.@window } }
n185=    if ($did == 29) { hdel switchbar show.all | did -e %d 24,25,26,28,30 }
n186=    if ($did == 30) { if ($did(30).state == 1) { hadd -m switchbar show.chan-not-url $true } | else { hdel switchbar show.chan-not-url } }
n187=    if ($did == 32) { if ($did(32).state == 1) { hadd -m switchbar custom.font $true | did -e %d 15,31,27,50,49,9 } | else { hdel switchbar custom.font | did -b %d 15,31,27,50,49,9  } }
n188=    if ($did == 34) { hadd -m switchbar background.image.style $did(34).seltext }
n189=    if ($did == 36) { if ($did(36).state == 1) { hadd -m switchbar background $true } | else { hdel switchbar background } }
n190=    if ($did == 37) { if ($did(37).state == 1) { hadd -m switchbar background.col $true | hdel switchbar background.image } | else { hdel switchbar background.col } }
n191=    if ($did == 38) { if ($did(38).state == 1) { hadd -m switchbar background.image $true | hdel switchbar background.col } | else { hdel switchbar background.image } }
n192=    if ($did == 40) || ($did == 41) || ($did == 42) {
n193=      var %colorsel = $rgb($gettok($did(40,1),1,32),$gettok($did(41,1),1,32),$gettok($did(42,1),1,32))
n194=      mdx SetColor %d 39 background $rgb($gettok($did(40,1),1,32),$gettok($did(41,1),1,32),$gettok($did(42,1),1,32))
n195=      did -ra %d 46 $gettok($did(40,1),1,32) $+ , $+ $gettok($did(41,1),1,32) $+ , $+ $gettok($did(42,1),1,32)
n196=      hadd -m switchbar background.color $rgb($gettok($did(40,1),1,32) $+ , $+ $gettok($did(41,1),1,32) $+ , $+ $gettok($did(42,1),1,32))
n197=    }
n198=    if ($did == 48) { var %file.type *.bmp , %file.location = $file="Choose A Background Image..." %file.type | if ($right(%file.location,4) == .bmp) { did -ra %d 47 $remove(%file.location,$mircdir) | hadd -m switchbar background.image.file $remove(%file.location,$mircdir) } }
n199=    if ($did == 49) { hadd -m switchbar font.style $did(49).seltext }
n200=    if ($did == 50) { if ($did(50).state == 1) { hadd -m switchbar font.underline $true } | else { hdel switchbar font.underline } } 
n201=  }
n202=  if ($devent == edit) {
n203=    if ($did == 13) { hadd -m switchbar button.size $did(13).text }
n204=    if ($did == 15) { hadd -m switchbar font $did(15).text }
n205=    if ($did == 31) { hadd -m switchbar font.size $did(31).text }
n206=  }
n207=}
n208=
n209=dialog switchbar {
n210=  size 0 0 $window(-2).w $window(-2).h
n211=  title "switchbar"
n212=  list 1,1 2 $window(-2).w 16 ,size
n213=  list 2,1 3 $calc($sbar(width) - 4) 8 ,size
n214=  list 3,2 2 13 16 ,size
n215=}
n216=
n217=on *:dialog:switchbar:*:*: {
n218=  if ($devent == init) {
n219=    mdx SetMircVersion $version | mdx MarkDialog $dname | mdx SetControlMDX switchbar 1 toolbar $iif($hdata(flat.buttons) == $true,flat) nodivider list wrap > $bars | mdx SetControlMDX switchbar 2 toolbar arrows $iif($hdata(flat.buttons) == $true,flat) nodivider > $bars | mdx SetControlMDX switchbar 3 toolbar list arrows $iif($hdata(flat.buttons) == $true,flat) nodivider > $bars
n220=    if ($hdata(custom.font) == $true) { mdx SetFont switchbar 1 $+(+,$iif($hdata(font.style) == italic || $hdata(font.style) == bold/italic,i),$iif($hdata(font.underline) == $true,u),$iif($hdata(font.strikeout) == $true,s)) $+(-,$hdata(font.size)) $iif($hdata(font.style) == Bold || $hdata(font.style) == Bold/Italic,900,90) $hdata(font) } | mdx SetDialog switchbar style tool | mdx SetBorderStyle switchbar 1,2,3,4 windowedge
n221=    if ($hdata(background) == $true) { if ($hdata(background.col) == $true) { mdx SetDialog switchbar bgcolor $hdata(background.color) | mdx SetColor switchbar 1,2,3 background $hdata(background.color) } | if ($hdata(background.image) == $true) { did -i switchbar 1,2,3 1 setbkg $hdata(background.image.style) $hdata(background.image.file) } } | ktools DockSwitchbar $dialog(switchbar).hwnd 
n222=    did -i switchbar 1 1 bmpsize 16 16 | did -i switchbar 1 1 setimage +nhd 0 icon small $hdata(icon.status) | did -i switchbar 1 1 setimage +nhd 0 icon small $hdata(icon.channel) | did -i switchbar 1 1 setimage +nhd 0 icon small $hdata(icon.query) | did -i switchbar 1 1 setimage +nhd 0 icon small $hdata(icon.@windows) | did -i switchbar 1 1 setimage +nhd 0 icon small $hdata(icon.DCC.chat) | did -i switchbar 1 1 setimage +nhd 0 icon small $hdata(icon.DCC.send) | did -i switchbar 1 1 setimage +nhd 0 icon small $hdata(icon.DCC.get) | did -i switchbar 1 1 setimage +nhd 0 icon small $hdata(highlight.chan) | did -i switchbar 1 1 setimage +nhd 0 icon small $hdata(highlight.query) | did -i switchbar 1 1 setimage +nhd 0 icon small $hdata(highlight.chat)
n223=    did -i switchbar 1 1 setimage +nhd 0 icon small $hdata(icon.@chanlist) | did -i switchbar 1 1 setimage +nhd 0 icon small $hdata(icon.@urllist) | did -i switchbar 1 1 setimage +nhd 0 icon small $hdata(icon.@notifylist) | did -i switchbar 1 1 setimage +nhd 0 icon small $hdata(icon.fserv) | did -i switchbar 1 1 bwidth $hdata(button.size) $hdata(button.size) 
n224=    did -i switchbar 2 1 bmpsize 8 8 | did -i switchbar 2 1 pad 4 10 | did -i switchbar 2 1  setimage +nhd 0 icon small 15, $+ $hdata(switch.server) | did -a switchbar 2 +W $calc($sbar(width) - 4) 1 $chr(9) Server List
n225=    did -i switchbar 3 1 bmpsize 16 16 | did -i switchbar 3 1  setimage +nhd 0 icon small 10, $+ $hdata(switch.server) | did -a switchbar 3 +W 12 1 Server $chr(9) Server List 
n226=    .scid $activecid window $iif(x !isin $gettok(%t,1,32),-a,-n) "status window" 
n227=    .signal -n switchbar update
n228=    .timer 0 10 .signal -n switcbar update
n229=  }
n230=  if ($devent == sclick) {
n231=    var %t = $did(1).seltext,%window = $gettok(%t,5-,32),%window.x = $gettok(%t,6-,32),%cid1 = $gettok(%t,6,32),%window2 = $iif($numtok(%window,32) > 1,$+(",$iif(channels isin %t || notify isin %t || url isin %t,%window.x,%window),"),$iif(channels isin %t || notify isin %t || url isin %t,%window.x,%window))
n232=    if ($did == 1) { if ($mouse.key != 4) { if ($did(1).sel == 2) { .scid $activecid window $iif(x isin $gettok(%t,1,32),-n,-a) %window2 } | else { scid $activecid window $iif(x isin $gettok(%t,1,32),-n,-a) %window2 | hdel newmsg $+($server,-,%window2) } | .signal switchbar update } | else { $dopopup(shift-click) } }
n233=    if ($did == 2) || ($did == 3) { if ($did(2).sel = 2) || ($did(3).sel = 2) { $dopopup(list) | .signal -n switchbar update } }
n234=  }
n235=}
n236=
n237=alias updateswitchbar {
n238=  did -r switchbar 1 | sbar position | sbar move | scid $activecid 
n239=  mdx SetMDXStyle switchbar 1 toolbar $iif($hdata(flat.buttons) == $true,flat) list nodivider arrows
n240=  if ($hdata(position) == 0) { did -i switchbar 1 1 bwidth $calc($sbar(width) - 4) $calc($sbar(width) - 4) }
n241=  if ($hdata(position) == 1) { did -i switchbar 1 1 bwidth $hdata(button.size) $hdata(button.size) }
n242=  did -a switchbar 1 $+(+,$iif($hdata(position) == 0,w),$iif($active = Status Window && $window($active).state != minimized,x),$iif($hdata(autosize) == $true,a)) 1 $iif($server,$up.case($network),Disconnected) $chr(9) Status Window
n243=  if ($window(Channels List)) && ($window(Channels List).cid == $cid) { if ($hdata(show.chan-not-url) == $true) { did -a switchbar 1 $+(+,$iif($hdata(position) == 0,w),$iif($active = $window(Channels List) && $window($active).state != minimized,x),$iif($hdata(autosize) == $true,a)) 11 $window(Channels List) $chr(9) Channels List } }
n244=  if ($chan(0)) { haltdef }
n245=  var %x = 1 | while (%x <= $chan(0)) { if ($chan(%x).cid == $cid) { did -a switchbar 1 $+(+,$iif($hdata(position) == 0,w),$iif($active == $chan(%x) && $window($active).state != minimized,x),$iif($hdata(highlight) == $true && $hdata(highlight.type) == button && $hget(newmsg,$+($server,-,$chan(%x))) == $true,i),$iif($hdata(autosize) == $true,a)) $iif($hdata(highlight) == $true && $hdata(highlight.type) == icon && $hget(newmsg,$+($server,-,$chan(%x))) == $true,8,2) $chan(%x) $chr(9) $chan(%x) | inc %x } }
n246=  if ($query(0)) { haltdef }
n247=  if ($hdata(show.query) == $true) { var %x = 1 | while (%x <= $query(0)) { if ($query(%x).cid == $cid) { did -a switchbar 1 $+(+,$iif($hdata(position) == 0,w),$iif($active == $query(%x) && $window($active).state != minimized,x),$iif($hdata(highlight) == $true && $hdata(highlight.type) == button && $hget(newmsg,$+($server,-,$query(%x))) == $true,i),$iif($hdata(autosize) == $true,a)) $iif($hdata(highlight) == $true && $hdata(highlight.type) == icon && $hget(newmsg,$+($server,-,$query(%x))) == $true,9,3) $query(%x)  $chr(9) $query(%x) | inc %x } } }
n248=  if ($fserv(0)) { haltdef }
n249=  if ($hdata(show.transfers) == $true) { var %x = 1 | while (%x <= $fserv(0)) { if ($fserv(%x).cid == $cid) { did -a switchbar 1 $+(+,$iif($hdata(position) == 0,w),$iif($active == $+(=,$fserv(%x)) && $window($active).state != minimized,x),$iif($hdata(autosize) == $true,a)) 14 $fserv(%x)  $chr(9) $+(=,$fserv(%x)) | inc %x } } }
n250=  if ($chat(0)) { haltdef }
n251=  if ($hdata(show.chat) == $true) { var %x = 1 | while (%x <= $chat(0)) { if ($chat(%x).cid == $cid) { did -a switchbar 1 $+(+,$iif($hdata(position) == 0,w),$iif($active == $+(=,$chat(%x)) && $window($active).state != minimized,x),$iif($hdata(highlight) == $true && $hdata(highlight.type) == button && $hget(newmsg,$+($server,-,=,$chat(%x))) == $true,i),$iif($hdata(autosize) == $true,a)) $iif($hdata(highlight) == $true && $hdata(highlight.type) == icon && $hget(newmsg,$+($server,-,=,$chat(%x))) == $true,10,5) $chat(%x)  $chr(9) $+(=,$chat(%x)) | inc %x } } }
n252=  if ($get(0)) { haltdef }
n253=  if ($hdata(show.transfers) == $true) { var %x = 1 | while (%x <= $get(0)) { if ($get(%x).cid == $cid) { did -a switchbar 1 $+(+,$iif($hdata(position) == 0,w),$iif($active == Get $get(%x) $get(%x).file && $window($active).state != minimized,x),$iif($hdata(autosize) == $true,a)) 6 $get(%x)  $chr(9) Get $get(%x) $get(%x).file | inc %x } } }
n254=  if ($send(0)) { haltdef }
n255=  if ($hdata(show.transfers) == $true) { var %x = 1 | while (%x <= $send(0)) { if ($send(%x).cid == $cid) { did -a switchbar 1 $+(+,$iif($hdata(position) == 0,w),$iif($active == Send $send(%x) $send(%x).file && $window($active).state != minimized,x),$iif($hdata(autosize) == $true,a)) 7 $send(%x) $chr(9) Send $send(%x) $send(%x).file | inc %x } } }
n256=  scid -r
n257=  if ($window(0)) || ($window(Url List)) || ($window(Notify List)) { haltdef }
n258=  if ($hdata(show.@window) == $true) { var %x = 1 | while (%x <= $window(0)) { if ($window(%c).state != hidden)  { did -a switchbar 1 $+(+,$iif($hdata(position) == 0,w),$iif($active = $window(%x) && $window($active).state != minimized,x),$iif($hdata(autosize) == $true,a)) 4 $window(%x) $chr(9) $window(%x) } | inc %x } }
n259=  if ($window(Notify List)) { if ($hdata(show.chan-not-url) == $true) { did -a switchbar 1 $+(+,$iif($hdata(position) == 0,w),$iif($active = $window(Notify List) && $window($active).state != minimized,x),$iif($hdata(autosize) == $true,a)) 13 $window(Notify List) $chr(9) Notify List } }
n260=  if ($window(URL List)) { if ($hdata(show.chan-not-url) == $true) { did -a switchbar 1 $+(+,$iif($hdata(position) == 0,w),$iif($active = $window(URL List) && $window($active).state != minimized,x),$iif($hdata(autosize) == $true,a)) 12 $window(URL List) $chr(9) URL List } }
n261=}
n262=
n263=alias shift-click.pop { 
n264=  var %t = $did(1).seltext,%window = $gettok(%t,5-,32),%window.x = $gettok(%t,6-,32),%cid1 = $gettok(%t,6,32),%window2 = $iif($numtok(%window,32) > 1,$+(",$iif(channels isin %t || notify isin %t || url isin %t,%window.x,%window),"),$iif(channels isin %t || notify isin %t || url isin %t,%window.x,%window))
n265=  popups New shift-click.pop 16 16
n266=  popups LoadImg shift-click.pop icon small $hdata(icon.close) | popups LoadImg shift-click.pop icon small $hdata(icon.maximize) | popups LoadImg shift-click.pop icon small $hdata(icon.minimize) | popups LoadImg shift-click.pop icon small $hdata(icon.restore)
n267=  popups AddItem shift-click.pop end $iif($window($remove(%window2,")).state == normal,+d) 4 Restore $cr window -r %window2 | popups AddItem shift-click.pop end $iif($window($remove(%window2,")).state == minimized,+d) 3 Minimize $cr window -n %window2 | popups AddItem shift-click.pop end $iif($window($remove(%window2,")).state == maximized,+d) 2 Maximize $cr window -x %window2 | popups AddItem shift-click.pop end + | popups AddItem shift-click.pop end + 1 Close $cr window -c %window2
n268=}
n269=
n270=alias switch.pop { 
n271=  popups New server.pop 16 16 | popups LoadImg server.pop icon small $hdata(icon.true) | popups LoadImg server.pop icon small $hdata(icon.false)
n272=  var %c = 1 | while %c <= $scon(0) { popups AddItem server.pop end $+(+,$iif($scon(%c) == $activecid && $scon(0) > 1,D)) 1 $iif($scon(%c).network && $scon(%c).server,$up.case($scon(%c).network),$iif($scon(%c).server,$scon(%c).server,Disconnected)) $cr scon %c window -a "Status Window" | inc %c }
n273=  popups AddItem server.pop end + | popups AddItem server.pop end + 2 New Server... $cr multi-serv
n274=}
