
      tbtray.dll v0.4 by dohcan (dohcan@mircscripts.org)

   --------------------------------------------------------------------------

This is beta documentation.  It's simply here so you have some idea of
how to use this DLL.

To load the DLL, you must do "/dll tbtray.dll OpenTray NOT_USED"  Do not just
try to use one of the Set* functions right off.  The OpenTray will intialize
the DLL and get it ready.

After the DLL is loaded, you are then ready to use the following functions:

  (any time it says NOT_USED, you can pass any parameter you wish, you just
  must pass SOMETHING in order for mIRC to actually do anything.)

   --------------------------------------------------------------------------

--
OpenTray NOT_USED

  Initializes the tray and shows it, with default values.  This MUST be called
  before any other functions are called.
  
  
--
CloseTray NOT_USED
  
  Closes the tray.  You will need to use OpenTray to reinitialize it.  You can
  also just unload the DLL (/dll -u).


--
SetText <text>

  Sets the current text of the tray.  To clear the text, pass $chr(160) or
  $chr(255) if you are using high ascii.


--  
SetWidth <width>

  Sets the width of the tray.  There is no checking to see if the tray invades
  on the button's space.  The buttons span about 535 pixels across the toolbar,
  so your tray should be no more than $calc($window(-3).w - 535).
  

--  
SetFont [-ibus] <size> <font>

  Sets the font of the text in the tray. i = italic, b = bold, u = underline,
  s = strikeout.
    
  Examples:
  
    SetFont -i 8 Tahoma     ; Sets the font to Tahoma 8 italic
    SetFont 10 Arial        ; Sets the font to Arial 10 normal  
    

--
SetBorder <inset|outset|sunken|raised|etched|solid|none> [rgb]

  Sets the border style of the tray.  The default is inset, and I suggest you
  test out all the available styles to find the one that you like.  The rgb
  parameter is only needed if you specify the type "solid."


--
SetMargins <top> <right> <bottom>

  Sets the margins surrounding the area used by the tray.  Doesn't have much
  effect if you have no border.  The default is 5 4 4.  For some reason, there
  is a 1px horizontal $rgb(face) line that occupies the very top line of the
  toolbar.  That's the reason the top margin is 1px more than the rest, in order
  to give it a uniform look.
  

--
SetColor <rgb>

  Sets the text color.  Must be an integer returned by $rgb(r,g,b).
  

--
SetBkColor <rgb>

  Same as SetColor, but sets the background color of the tray.  Has no effect if
  the tray is transparent.
  

--
SetTransparent <1|0>

  Using 1 makes the tray transparent (for toolbars with backgrounds).  This
  setting is not recommended because text is hard to read on a colorful
  background.  On the other hand, using transparent on a toolbar without a
  background is useless.
  
  
--
Tooltip [-dc] [delay] [text]

  This configures the tooltip for the tray.  The tooltip only appears after the
  mouse has stopped moving for [delay] milliseconds and if there is tooltip text
  to display. Switches -d = delay, -c = clear.  You can't use -d and -c at the
  same time.  The default delay is 200ms and the tip is disabled by default.
  
  Examples:
  
    Tooltip hi mom!             ; Sets the text.
    Tooltip -d 500 tbtray rox!  ; Sets the delay and the text.                                     
    Tooltip -d 100              ; Sets the delay (doesn't change/remove text).
    Tooltip -c                  ; Removes the text, which disables the tip.

  NOTE: Multi-line tooltips are supported.  You can use $cr to break the line.
  
    Tooltip Line 1 $+ $cr $+ Line 2 $+ $cr $+ Line 3
  

--
AddMenu <"caption"|dclick|sclick> </command>

  Adds a menu item to the custom popup.  If the first word is 'dclick' (without
  quotes), then this is a double-click command.  If the first word is 'sclick',
  this is a single-click command.  The format is very strict.  It must be:
  
  AddMenu "Item Caption" /command params
  AddMenu dclick /command params
  
  The / is required for it to evaluate properly.  The double-quotes around the
  caption (for items other than sclick and dclick) are required as well.  If you
  want to use a separator, do this:
  
  AddMenu "-" -
  
  NOTE:  You can add, at most, 256 menu items.


--
ClearMenu NOT_USED

  Clears all the menu items, including sclick and dclick commands.
  

   --------------------------------------------------------------------------

  Obviously, it's not finished.  Later, I hope to implement the ability to add
  icons and separate menus for each icon, along with the tray menu.
  
  There is some error checking, and the functions will return S_OK if successful
  and E_* where * is the type of error that occurred.  Generally, you want to
  use $dll() and check for if (E_* iswm %result).
  
  The source is fully documented and if you want to use some of the code, that's
  fine, I just hope that you give credit where credit is due.  Also, I'd like
  to hear about it. :)  (No, that doesn't mean you have to ask permission, it
  just means I'd be interested in hearing about your project.)
  
  -dohcan (dohcan@mircscripts.org)