Picwin balloontips

By brinxy on Nov 18, 2007

Snippet creates balloon tips using picwins through a simple alias. Configure most options via status/channel menus or commands. Includes the ability to manipulate the font, icon, color, and text of the popup.

Syntaxes (if you use commands instead of the menus): /tip.font: Generates two input windows. Enter font name in one and font size in the other. /tip.icon: Generates either one or two input windows. Choose either mIRC's default icon of a one of your choice. /tip.title: Generates one input window; enter the title for your popup windows here. :] /tip

Edit your colors in the variables using $rgb(N,N,N) format. You can also go to the ; var %tip.icon line and remove the ; to start using the icon function. Just re-add the ; in front of the var command if you don't want an icon anymore.

You also have the option to just use the defaults.

/*
Snippet creates balloon tips using picwins through a simple alias. Configure most options via status/channel menus or commands. Includes the ability to manipulate the font, icon, color, and text of the popup. 

Syntaxes (if you use commands instead of the menus):
/tip.font: Generates two input windows. Enter font name in one and font size in the other.
/tip.icon: Generates either one or two input windows. Choose either mIRC's default icon of a one of your choice.
/tip.title: Generates one input window; enter the title for your popup windows here. :]
/tip <text>

Edit your colors in the variables using $rgb(N,N,N) format. You can also go to the ; var %tip.icon line and remove the ; to start using icons. Just re-add the ; in front of the var command if you don't want an icon anymore. 

You also have the option to just use the defaults.
*/

on *:unload:unset %tips.*
on *:load:set %tips.title mIRC $version notification - $time(hh:nntt) | set %tips.icon default | set %tip.font Tahoma | set %tips.font.size 10
alias tip { 
  if ($1- && !$window(@tip)) {
    var %bg = $rgb(255,255,219), %tip = $rgb(0,0,0), %t = 3, %bg2 = $rgb(11,0,14), %tip2 = $rgb(255,255,255)
    var %tip.icon = $iif($($+(%,tips,.,icon),2) = default,$mircexe,$v1)
    var  %h = $iif($isfile($+(",%tip.icon,")) && %tip.icon,$iif($pic($+(",%tip.icon,")).height = 0,35,$calc($pic($+(",%tip.icon,")).height + 5)),$calc($calc($height($1-,%tips.font,%tips.font.size) + 5) + $height($($+(%,tips,.,title),2),%tips.font,%tips.font.size))), %w = $iif(%tip.icon && $isfile($+(",%tip.icon,")),$iif($pic($+(",%tip.icon,")).width = 0,40,$calc($pic($+(",%tip.icon,")).width + 5)))
    window -pdh +d @tip 800 800 $iif($width($1-,%tips.font,%tips.font.size) > $width($($+(%,tips,.,title),3),%tips.font,%tips.font.size),$iif($isfile($+(",%tip.icon,")) && %tip.icon,$calc($width($1-,%tips.font,%tips.font.size) + %w),$calc($width($1-,%tips.font,%tips.font.size) +3)),$iif($isfile($+(",%tip.icon,")) && %tip.icon,$calc($width($($+(%,tips,.,title),3),%tips.font,%tips.font.size) + %w),$calc($width($($+(%,tips,.,title),3),%tips.font,%tips.font.size) +5))) %h
    drawfill -r @tip %bg %bg 1 1
    drawrect -rf @tip %bg2 1 1 1 $window(@tip).w $calc($height($($+(%,tips,.,title),3),%tips.font,%tips.font.size) + 2)
    if (%tip.icon && $isfile($+(",%tip.icon,"))) { drawpic @tip 0 1 $+(",%tip.icon,") }
    drawtext -r @tip %tip2 %tips.font %tips.font.size $iif($isfile($+(",%tip.icon,")),$calc(%w - 3),1) 1 $($+(%,tips,.,title),3)
    drawtext -r @tip %tip %tips.font %tips.font.size $iif($isfile($+(",%tip.icon,")),$calc(%w - 3),1) $iif($isfile($+(",%tip.icon,")),$iif($pic($+(",%tip.icon,")).height = 0,15,$round($calc($pic($+(",%tip.icon,")).height / 2),0)),15) $1-
    .timer 1 %t $iif($window(@tip),window -c @tip)
  }
}

alias tip.title { 
  var %be = $input(Title for popup,e,Choose title:) 
  set %tips.title $iif(%be,%be,mIRC notification)
}
alias tip.icon { 
  var %y = $input(Use mIRC's default icon?,y,Default?)
  if (%y = $true) { set %tips.icon default }
  else {  
    var %selico = $sfile($mircdir,Choose icon)
    set %tips.icon $iif(%selico,%selico,default)
  }
}

alias tip.font {  
  var %tpf = $input(Font name:,e,Font:), %tpfs = $input($iif(%tpf,%tpf,Tahoma) font size:,e,Font size)
  set %tips.font $iif(%tpf,%tpf,Tahoma) 
  set %tips.font.size $iif(%tpfs,%tpfs,10)
}

menu status,channel { 
  Balloontips:
  .tip configuration:
  ..icon:tip.icon
  ..title:tip.title
  ..font:tip.font
  ..-
  .-
  .preview tip:tip Tip preview!
}

menu @tip { 
  sclick:window -c @tip
}

Comments

Sign in to comment.
jaytea   -  Jan 25, 2012

aw that was mean of me. brinxy deserved more than that ;P

More
 Respond  
D4ni   -  Jan 24, 2012

some code can really be shortened a bit, like "$($+(%,tips,.,icon),2)" or "if (%y = $true)" nice work tho :p

More
 Respond  
brinxy   -  Nov 18, 2007

lol.

More
 Respond  
jaytea   -  Nov 18, 2007

.

More
 Respond  
jaytea   -  Nov 18, 2007

you\'re right, this is where we post comments! :P

More
 Respond  
brinxy   -  Nov 18, 2007

Comments?

More
 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.