Custom Tray Notifies 1.5

This addon creates a nice looking window above your taskbar which can be filled with text, icons and other nice looking things.

/ctnotify

Creates, shows and deletes a notify.

/ctnotify -n

/ctnotify -n [name]
Creates a new notify with the name [name]. Needs to be called befor any other /ctnotify-alias is used.
Notes:
  • Without setting the +d-flag at /ctnotify -o a notify won't be deleted after using it. So you don't have to create a new one every time.
  • All notifies will be stored in the hash table "notify" for maximum speed.
  • An existing notify can be edited as you want (if it is not shown - on-the-fly-editing may be added in the future). If you need two notifies with just different headlines creating two isn't needed. Instead create one and edit it.

/ctnotify -c

/ctnotify -c [name] [rgb value1] [rgb value2] [rgb value3] [rgb value4] [rgb value5]
Sets the colors of a notify.
  • [rgb value1] is the background color and - if the title uses a gradient - the ending color of the gradient.
  • [rgb value2] is the title background color or - if the title uses a gradient - the starting color of the gradient.
  • [rgb value3] is the border color.
  • [rgb value4] is the headline text color.
  • [rgb value5] is the text color.
  • Notes:

    /ctnotify -t

    /ctnotify -t [name] [theme name]
    Applies a theme to the notify. [theme name] can be:
  • StandardGreen
  • StandardBlue
  • LightYellow
  • LightRed
  • Notes:

    /ctnotify -i

    /ctnotify -i [name] [+s] [icon path]
    Adds an icon to the notify. If +s is set the icon will be small and displayed beneath the headline.
    Notes:

    /ctnotify -h

    /ctnotify -h [name] [text]
    Sets the headline text.
    Notes:

    /ctnotify -s

    /ctnotify -s [name] [text]
    Sets the text.
    Notes:

    /ctnotify -o

    /ctnotify -o [name] [n] (+dtfrl)
    Changes some of the notifies options. [n] is the time the notify will appear on screen.
  • +d: Notify will be deleted after closing
  • +t: Time at creation will show in title
  • +f: Notify will be flat (no gradient in title)
  • +r: Right click on the notify will close it
  • +l: Left click on the notify will close it
  • Notes:

    /ctnotify -l

    /ctnotify -l [name] [n]
    Changes the transparency of a notify to value [n].
    Notes:

    /ctnotify -m

    /ctnotify -m [name] [data]
    Stores some data in the notifies hash table which can be called later.
    Notes:

    /ctnotify

    /ctnotify [name]
    Will show the notify.

    /ctnotify -d

    /ctnotify -d [name]
    Will delete the notify.

    $ctget

    ctget is an identifier that will return some information about the specified notify.
    $ctget(name/n)
    If n is zero it will return the total numbers of notifies, if property open is set it will show the total number of open notifies.

    If n is greater than zero or a specific name it will return the name.
    Properties can be:

  • open: Returns $true if the notify is currently shown.
  • text: Returns the text of the notify.
  • head: Returns the headline of the notify.
  • data: Returns the notifies stored data.
  • time: Returns the deletion total time of the notify
  • l: Returns $true if the notify will close on left-click.
  • r: Returns $true if the notify will close on right-click.
  • Click Signal

    When you click left or right on a notify it will fire a signal with the following data:
  • name: notify
  • $1: notify name
  • $2: Mouse x
  • $3: Mouse y
  • $4: right or left
  • $5-: data
  • On this way you can easily create own on-click events (for example opening a dialog, send a notice or whatever you want). To react on a signal just use this code:
    on *:signal:notify: { }
    For example you can echo all returned data:
    1. on *:signal:notify: {
    2.     echo -a NAME: $1
    3.     echo -a MOUSE: $2 $+ x $+ $3
    4.     echo -a CLICK: $4
    5.     echo -a DATA: $5-
    6. }

    Examples

    1. A simple test

    1. alias ctnotifytest1 {
    2.     ctnotify -n test1
    3.     ctnotify -c test1 239,236,202 4,99,128 0,47,47 239,236,202 0,47,47
    4.     ctnotify -h test1 Just for testing issues
    5.     ctnotify -s test1 I'm a cool colored test. Close me by rightclicking!
    6.     ctnotify -o test1 5 +dtfr
    7.     ctnotify test1
    8. }

    2. Putting some images into it!

    1. alias ctnotifytest2 {
    2.     ctnotify -n test2
    3.     ctnotify -t test2 StandardGreen
    4.     ctnotify -h test2 Supporting icons now!
    5.     ctnotify -o test2 5 +dtr
    6.     ctnotify -i test2 hello.jpg
    7.     ctnotify test2
    8. }

    3. It's getting complicated

    1. on *:start: {
    2.     ctnotify -n notice
    3.     ctnotify -t notice StandardBlue
    4.     ctnotify -i notice gfx\query.jpg
    5.     ctnotify -h notice Notice Recieved
    6.     ctnotify -o notice 5 +rt
    7. }
    8.  
    9. on *:notice:*:*: {
    10.     if (!$ctget(notify).open) {
    11.         ctnotify -s notice $nick writes to you: $1-
    12.         ctnotify -m $nick
    13.         ctnotify notice
    14.    }
    15. }
    16.  
    17. on *:signal:notify: {
    18.     if ($4 == left) { notice $5 Hey, i will be there for you soon! }
    19. }
    This time we don't use an alias to create (and show) the notify. It is created on mirc start (l. 1). When recieving a notice (l. 9) we check, if notify isn't open (would cause errors) (l. 10). If not we set the text and the data (l. 11) (which are different every time) and show it. When clicking it with left mouse button we send a reply to the guy who noticed us (l. 18).

    Extra-Aliases

    CTNotifies has some build-in aliases, that are needed for the creation. Maybe someone needs one or both of them, so their syntax is explained too.

    /fade

    /fade -ioc [@name] [speed] [start/end-value]
    Fades a window in or out by setting it's transparency up or down. [start/end-value] is the value, where the fading ends, e.g. if it ist 150 the window will have a transparency of 150 after fading. If you fade out it must be the actual transparency of the window.
    Switches are:
  • If i is set, the window will fade in.
  • If o is set, the window will fade out.
  • If c is set, the window will close after fading (just with o)
  • /drawgradient

    /drawgradient [-nrh] [@window] [color1] [color2] [x y w h]
    Draws a gradient from [color1] to [color2] in the rectangle specified by [x y w h].
    Switches are:
  • If h is set, the gradient will be horizontal, else it will be vertical.
  • If r is set, the colors are rgb-values.
  • If n is set, the alias won't draw immediately.