--------------------------------------------------------------------------
xLabel 2.3
--------------------------------------------------------------------------

Last Modified/Extended: December 18, 2003 
by Andymon <andymon@ls-universe.info>

Modified: December 10, 2003
by Seg@ <inform-sega@freemail.ru>

Author: X <b01011000@hotmail.com>

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

Overview
--------

xLabel is a Litestep module that lets you create skinnable labels and place
them anywhere on your desktop. These labels can display both static text as
well as dynamically updating system information. xLabel is based on
Maduin's Label.dll.

Notes for Version 2.3
-----------------------

A bunch of REALLY NEW COOL FEATURES for xlabel ;)
For details check out the "Configuration" and "Changes". 
P.S.: Please report bugs, if there should be any, to <andymon@ls-universe.info>
      If you have wishes for xlabel tell them also, maybe I can realize them ;)


Notes for Version 2.2.2
-----------------------

The smallest update in xLabel history. I changed nothing except adding
two features listed in changelog. It is only a reply on Joshhh's request :)
Probably skblayout WILL NOT work on Windows 95, but I don't know another way
to get the short layout name.


Notes for Version 2.2.1
-----------------------

It's simply a minimalistic bugfix, which fixes the LSBox support ;)
It was annoying me since Release of xLabel that i didn't get it working.
Now it should work.
ReEnabled TrueTransparency Feature 
( I don't know what was wrong with it, runs flawless for me ;) )


Notes for Version 2.2
---------------------

Wow, I didn't think I'd be able to implement so much stuff so soon. With
this release I've pretty much done everything I wanted to do. So if there
are any more releases they'll probably be just bug fixes or minor feature
additions.


Differences from Label.dll
--------------------------

For the most part xLabel is compatible with Label.dll, but there are a few
incompatible differences that you need to know about if you are used to
Label.dll.

The Label and Labels commands have been replaced by *Label. *Label takes
the name of a single label only. Example:

Labels FirstLabel, SecondLabel, ThirdLabel
- becomes -
*Label FirstLabel
*Label SecondLabel
*Label ThirdLabel

Instead of each label having its own set of bang commands, there is now
just one set. Each bang command now takes an additional first parameter
that is the name of label. Example:

!FirstLabelSetText "Some text"
- becomes -
!LabelSetText FirstLabel "Some text"

Hopefully the reasoning behind these changes is obvious.


Loading the Module
------------------

Add a new LoadModule line to the step.rc file, similar to the following
(this assumes that xLabel.dll resides in C:\Litestep):

LoadModule "C:\Litestep\xLabel.dll"

The following sections describe how to configure xLabel to actually do
something useful. Once you're done configuring, recycle Litestep.


How to Create a Label
---------------------

xLabel lets you create any number of labels. Each labels has its own unique
name which is used to refer to that label for configuration and bang
commands. There are two ways to create labels: automatically and manually.
A label that is created automatically is created when xLabel is loaded. You
declare that a label is automatic by placing a *Label command in the
step.rc:

*Label MyLabel

ATTENTION:
**********
Due to the new builtin "xlabel" prefix and to avoid intersections,
you shouldn't define another label named "xlabel" ;)

Alternatively you can create a label manually using the !LabelCreate bang
command. In that case the label is created if and when the bang command is
executed. Example:

!LabelCreate MyLabel

All labels are automatically destroyed when xLabel is unloaded, regardless
of how they were created.


Configuration
-------------

The following commands are typically placed in the step.rc. See the
Litestep documentation for help modifying this file. Parameters and their
types are denoted by angle brackets (<, >) and optional parameters are
enclosed in square brackets ([, ]).

All commands must be prefixed with the label's name. For example: to set
the Text of a label named MyLabel the actual command you would put in the
step.rc would be MyLabelText.

Text <text>
Sets the text displayed by the label. If no value is provided the label is
left blank. The value can contain both simple text and escape sequences.
Escape sequences are enclosed in square brackets ("Simple text [escape]").
See the discussion of text escape sequences below for more information.
You can assign multiple text items by separating them with semicolons
("Item 1;Item 2") then switch between them with !LabelPrevious and !LabelNext.

X <number>
Sets the horizontal position of the label in pixels. If the value is
positive then it is relative to the left side of the desktop, if negative
then the right side. Additionally you can make the position relative to
the center of the desktop by appending the character 'c' after the number
("32c", "-128c").

Y <number>
Sets the vertical position of the label in pixels. If the value is
positive then it is relative to the top of the desktop, if negative then
the bottom. Additionally you can make the position relative to the center
of the desktop by appending the character 'c' after the number ("32c",
"-128c").

Width <number>
Sets the horizontal size of the label. This can be an absolute value (in
pixels) or a percentage of the desktop width.

Height <number>
Sets the vertical size of the label. This can be an absolute value (in
pixels) or a percentage of the desktop height.

AlwaysOnTop
If this command is present then it makes the label "always on top", that
is, the label stays above all application windows.

StartHidden
If this command is present then the label will be initially invisible. It
can later be shown using bang commands.

Image <file>
Sets the name of the skin file. This file must be in Windows bitmap (BMP)
format. If no value is provided then the label is displayed with the a
default background.

ImageLeftEdge <number>
Sets the number of pixels on the left edge of the bitmap that will not be
stretched or tiled. If no value is provided then the default is 0.

ImageTopEdge <number>
Sets the number of pixels on the top edge of the bitmap that will not be
stretched or tiled. If no value is provided then the default is 0.

ImageRightEdge <number>
Sets the number of pixels on the right edge of the bitmap that will not be
stretched or tiled. If no value is provided then the default is 0.

ImageBottomEdge <number>
Sets the number of pixels on the bottom edge of the bitmap that will not
be stretched or tiled. If no value is provided then the default is 0.

ImageMode "stretch", "tile", "tile-horizontal", or "tile-vertical"
Sets the method used to scale the skin bitmap. If no value is provided
then the default is "stretch".

Transparent
If this command is present then it enables transparency. If a skin is also
in use then areas of the skin bitmap that are pink (RGB 255, 0, 255) will
allow the desktop wallpaper to show through. If no skin is in use and this
command is present then the entire label will be transparent.

TrueTransparency
The command makes pink (RGB 255, 0, 255) areas in the background bitmap really
transparent (eg you will see a window you drag below the label).
Caution: This won't work with a blank background!
Default is false.

Font <font>
Sets the name of the font used to display text. If no value is provided
then the default is "Arial".

FontHeight <number>
Sets the height of the font used to display the text in pixels. If no
value is provided then the default is 15.

FontBold
If this command is present then the font will be bold.

FontItalic
If this command is present then the font will be italic.

FontColor <color>
Sets the color of the font used to display the text. If no value is
provided then the default is black (RGB 0, 0, 0).

FontShadow
If this command is present then the font will be shadowed.

FontShadowColor <color>
Sets the color used to display the text shadow. If no value is provided
then the default is dark gray (RGB 128, 128, 128).

FontShadowX <number>
Sets the number of pixels in the horizontal direction that the shadow is
offset from the rest of the text; this can be negative. If no value is
provided then the default is 1.

FontShadowY <number>
Sets the number of pixels in the vertical direction that the shadow is
offset from the rest of the text; this can be negative. If no value is
provided then the default is 1.

Align "left", "center", or "right"
Sets the horizontal text alignment. If no value is provided then the
default is "center".

VertAlign "top", "center", or "bottom"
Sets the vertical text alignment. If no value is provided then the
default is "center".

LeftBorder <number>
Sets the number of pixels on the left edge to reserve as a border. If no
value is provided then the default is 0.

TopBorder <number>
Sets the number of pixels on the top edge to reserve as a border. If no
value is provided then the default is 0.

RightBorder <number>
Sets the number of pixels on the right edge to reserve as a border. If no
value is provided then the default is 0.

BottomBorder <number>
Sets the number of pixels on the bottom edge to reserve as a border. If no
value is provided then the default is 0.

UpdateInterval <number>
Sets the amount of time in milliseconds between updates for labels that
contain dynamically updated content. If no value is provided then the
default is 1000 (1 second).

UseFahrenheit
If this command is present, mbmTemperature (see below) is diplayed in
Fahrenheit instead of Celsius.

Scroll
If this command is present then the label scrolls its contents if the text
doesn't fit into the label. Note that the text might "jump" a bit if
LabelJustify is not set to "left".

ScrollInterval <number>
Sets the scrolling update interval in milliseconds. If no value is
provided then the default is 100.

ScrollSpeed <number>
Sets the number of pixels to scroll for each update. Negative values allow
you to scroll in the opposite direction. If no value is provided then the
default is 1.

ScrollPad <number>
Sets the the number of pixels between the start and end of the text when
scrolling. If no value is provided then the default is 10.

Moveable
If this command is present, then the label will be draggable with "ModifierKey(s)+LEFTMOUSEBUTTON"
(Enter the label with mouse, press the "ModifierKey(s)" and hold it, then Press AND Hold the MoveMouseButton
 and drag the label around. To stop moving either release "ModifierKey(s)" or MoveMouseButton.)

MoveModifierKey "ctrl", "shift", or "ctrl+shift" ("shift+ctrl")
This command specifies the ModifierKey, which is required to drag the label around.
If no value is provided then the default is "CTRL".

MoveMoveButton "left", "right", or "middle"
This command specifies the MoveButton, which will be used to drag the label around.
If no value is provided then the default is "Left".


Bang Commands
-------------

Bang commands allow you to manipulate labels at run-time through scripts
or other modules. See the Litestep documentation for more information
about bang commands and how to invoke them.

!LabelAlwaysOnTop <label-name>
Makes the label "always on top", that is, it stays above all application
windows.

!LabelCheckWinamp
Resets and performs the WinampCheck manually. Useful if no automatic check is used.

!LabelClipboardCopy <label-name> [<text>]
Copies the contents of the label to the clipboard. If the optional text
parameter is present, it will prefixed to the label's contents.

!LabelClipboardPaste <label-name> [<text>]
Sets the label's text to the current contents of the clipboard. If the
optional text parameter is present, it will be prefixed to the clipboard's
contents. Naturally, this only works if the clipboard contains text.

!LabelCreate <label-name>
Create the label manually.

!LabelDestroy <label-name>
Destroy the label.

!LabelHide <label-name>
Hides the label, making it invisible.

!LabelMove <label-name> <x-coordinate> <y-coordinate> [<steps> <time>]
Moves the label.
With animation, if <steps> AND <time> are also defined.
STEPS are the animation steps and TIME the pause between two steps in milliseconds.

!LabelmzscriptVarCopy <label-name> <mzscript var>
Copies the current text in the label in the given mzscript var.
Naturally, this only works if the mzscript module is loaded.

!LabelNext <label-name>
Switch to the next text.

!LabelPinToDesktop <label-name>
Pins the label to the desktop so that it stays below all application
windows. This the default state and is the opposite of always on top.

!LabelPosmzscriptVarCopy <label-name> <mzscript var posx> <mzscript var posy>
Copies the current label position in the given mzscript vars.
First specified var will get the x Position, second will get the y Position.
Naturally, this only works if the mzscript module is loaded.
(If values are greater then 2/3 of screen, they are automatically negative
  e.g. "-50" instead of 974 on a 1024x768 resolution.)

!LabelPrevious <label-name>
Switch to the previous text.

!LabelRefresh <label-name>
Call this after !reload to reconfigure the label

!LabelReposition <label-name> <x-coordinate> <y-coordinate> <width> <height> [<steps> <time>]
Repositions (moves and resizes) the label
With animation, if <steps> AND <time> are also defined.
STEPS are the animation steps and TIME the pause between two steps in milliseconds.

!LabelResize <label-name> <width> <height> [<steps> <time>]
Resizes the label.
With animation, if <steps> AND <time> are also defined.
STEPS are the animation steps and TIME the pause between two steps in milliseconds.

!LabelScroll <label-name> <number>, "on", "off", or "toggle"
Depending on the parameter this command toggles scrolling/turns it on or off.
If the parameter is a number the label scrolls the given number of times. If
the number is 0 and the label is already scrolling it'll finish the "current
scroll" and then stop.

!LabelSetFontColor <label-name> <color>
Changes the label's font color. You can specify the color as decimal
RGB (128 64 255) or as hexadecimal (8040FF).

!LabelSetText <label-name> [<text>]
Sets the text displayed in the label. If the parameter is not present then
the label will be cleared of any text.

!LabelShow <label-name>
Shows the label, making it visible.

!LabelShowHide <label-name> <seconds>
Shows the label for the specified number of seconds then hides it.

!LabelToggleAlwaysOnTop <label-name>
Switches the label back and forth between the always on top and pinned to
desktop states.

!LabelToggle <label-name>
Switches the label back and forth between the visible and invisible
states.

!LabelUpdate <label-name>
Forces the label to update its contents.


Events
------

NEW Label independent events for xlabel itself!
xLabel supports now some settings to execute Bangs due to the current Winamp state.
-----------------------------------------------------------------------------------------
ATTENTION:
**********
Due to the new builtin "xlabel" prefix and to avoid intersections,
you shouldn't define another label named "xlabel" ;)
-----------------------------------------------------------------------------------------

xLabelOnWinampRunning <action>
Sets an action to perform when xLabel detects that Winamp is currently running 
(Only executed one time till Recycle or Winamp is closed and restarted.
 But you can use !labelcheckwinamp to manually reset and force another check).

xLabelOnWinampPlaying <action>
Sets an action to perform when xLabel detects that Winamp is currently playing a song.

xLabelOnWinampPaused <action>
Sets an action to perform when xLabel detects that Winamp is currently paused.

xLabelOnWinampStopped <action>
Sets an action to perform when xLabel detects that Winamp is currently stopped.

xLabelOnWinampClosed <action>
Sets an action to perform when xLabel detects that Winamp is currently closed.
(Only executed one time till Recycle or Winamp is restarted and again closed.
 But you can use !labelcheckwinamp to manually reset and force another check).

xLabelWinampCheckInterval <number>
Sets the amount of time in seconds between every WinampStatus Check.
If no value is provided then the default is 5 seconds.
To deactivate automatic check set to 0, manually check via bang "!labelcheckwinamp"


Events allow you execute programs or bang commands based on user
interaction with the label. The following work the same as configuration
settings. Each of them takes the name of program or bang commands as their
value. When the event is triggered, the program or bang command is
executed. Note that in the case of mouse clicks, assigning an action to
both the click and the double click event will not work. As before, you must
prefix the command name with the label name.

NEW Region MouseClick Feature:
******************************************

*<label-name>OnLeftClickRegion <left> <top> <right> <bottom> <action>
Specifies a region inside the label which executes the given action when clicked with
the left mousebutton. You can have as many of these lines as you want.

*<label-name>OnRightClickRegion <left> <top> <right> <bottom> <action>
Specifies a region inside the label which executes the given action when clicked with
the right mousebutton. You can have as many of these lines as you want.

*<label-name>OnMiddleClickRegion <left> <top> <right> <bottom> <action>
Specifies a region inside the label which executes the given action when clicked with
the middle mousebutton. You can have as many of these lines as you want.


[If the values are positive then they are relative to the left/top side of the label,
if negative then the right/bottom side. Additionally you can make the positions relative to
the center of the label by appending the character 'c' after the number
("32c", "-128c").

 Clicking outside of these specified regions or if none are defined, executes the normal
 "<label-name>OnLeftClick" command. If regions overlap each other, the first matching region 
  defined in step.rc will be executed.]
 
----------------------------------------------------------------------------------------------

OnEnterLeaveRegion <left> <top> <right> <bottom>
Specifies a region inside the label to which the "OnEnter"  and "OnLeave" commands are 
restricted to. 
If no value is provided then the default is the whole label (like before).

OnEnter <action> 
Sets an action to perform when the mouse cursor enters the label.
NEW optional region definition to react only on one specific area inside label.
See Configuration "OnEnterLeaveRegion"!

OnLeave <action> 
Sets an action to perform when the mouse cursor leaves the label.
NEW optional region definition to react only on one specific area inside label.
See Configuration "OnEnterLeaveRegion"!

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

OnDrop <action>
Sets an action to perform when a file or a folder is dropped on the label.
The full path to the file/folder is passed to the action as an argument.

OnLeftClick <action>
Sets an action to perform when the user left clicks on the label.

OnLeftDoubleClick <action>
Sets an action to perform when the user double-clicks the label with the
left mouse button.

OnMiddleClick <action>
Sets an action to perform when the user middle clicks on the label.

OnMiddleDoubleClick <action>
Sets an action to perform when the user double-clicks the label with the
middle mouse button.

OnRightClick <action>
Sets an action to perform when the user right clicks on the label.

OnRightDoubleClick <action>
Sets an action to perform when the user double-clicks the label with the
right mouse button.

OnTextChange <action>
Sets an action to perform when the text in the label changes.

OnWheelDown <action>
Sets an action to perform when the mouse wheel scrolls down while the
mouse cursor hovers over the label.

OnWheelUp <action>
Sets an action to perform when the mouse wheel is scrolled up while the
mouse cursor hovers over the label.


Text Escape Sequences
---------------------

To include dynamic text in labels, such as system information, you can use
escape sequences mixed in with normal text in labels. Escapes sequences
consist of a data source names and any necessary parameters and possibly
one or more modifier functions all enclosed in square brackets:

LabelText "Just some test... [modifier(dataSource(parameter))]"
ClockLabelText "The time is: [time]"
QuoteLabelText "Quote of the Day: [trim(randomLine('C:\quotes.txt'))]"
SysLabelText "CPU: [cpu], RAM: [memInUse]"

As of version 1.5, labels can have text which spans multiple lines. To
create a line break in the text use the character sequence "\n". If you
need to include a literal backslash then use "\\".

MultiLineLabelText "This is on line 1\nThis is on line 2"
MemLabelText "Memory Info\n\nFree: [memAvailable]\nTotal: [memTotal]"

The following is a list of all the valid data sources and any parameters
they take:

activeTask
Title of the currently active task.
If nothing is found it will show "Unknown Task".

battery
Percentage of battery power remaining.

computerName
Name assigned to this computer.

cpu
Current total CPU usage percent.

date('format')
Current local date. Format is optional and is explained below.

dateCreated('file', 'format')
Date and time file was created. Format is optional.

dateLastModified('file', 'format')
Date and time file was last modified. Format is optional.

diskAvailable('drive', units)
Amount of space currently available on given drive.

diskInUse('drive', units)
Amount of space currently in use on given drive.

diskTotal('drive', units)
Total amount of space on given drive.

firstLine('file')
Retrieves the first line from the given file.

hostName
Host name assigned to this computer.

ip
Internet Procotol (IP) address assigned to this computer.

iTime
Current time as Swatch internet time (beats).

kblayout
Full localized name of the current keyboard layout language.

lastLine('file')
Retrieves the last line from the given file.

line('file', number)
Retrieves the number'th line from the given file.

lineCount('file')
Number of lines in the given file.

mbmCPUUsage
CPU usage as reported by MBM5. Takes an optional numeric index as a
parameter. MBM5 supports 4 CPUs numbered 1 to 4.

mbmFanSpeed
Fan speed as reported by MBM5. Takes an optional numeric index as a
parameter. MBM5 supports 10 fans numbered 1 to 10.

mbmTemperature
Temperature as reported by MBM5. Takes an optional numeric index as a
parameter. MBM5 supports 10 temperature sensors numbered 1 to 10.

mbmVoltage
Voltage as reported by MBM5. Takes an optional numeric index as a
parameter. MBM5 supports 10 voltages numbered 1 to 10.

memAvailable(units)
Amount of physical memory currently available.

memInUse(units)
Amount of physical memory currently in use.

memTotal(units)
Total amount of physical memory in the system.

netIn(units)
Average units per second that data is received from the network. Units is
optional.

netOut(units)
Average units per second that data is sent to the network. Units is
optional.

os
Name of the operating system running on this computer.

powerSource('AC', 'Battery')
Selects what text to display based on whether the system is running on AC
or battery power. Defaults are 'AC' and 'Battery'.

randomLine('file')
Retrieves a randomly selected line from the given file.

skblayout
The abbreviated name of the language based entirely on
the ISO Standard 639 values (2 letters).

size('file', units)
Size of the given file. Units is optional.

swapAvailable(units)
Amount of swap space currently available.

swapInUse(units)
Amount of swap space currently in use.

swapTotal(units)
Total amount of swap space in the system.

time('format')
Current local time. Format is optional and is explained below.

uptime('format')
Current system uptime. Format is optional and is explained below.

userName
Name of the user currently logged on.

winampSong
Song currently loaded in Winamp (QCD or Foobar2K).
If Winamp (and the other supported players) is not running or there is no
song loaded this will show "Player Not Running".

winampTime
Time elapsed on the current song in Winamp.

winampRemainTime
Time remaining on the current song in Winamp.

winampTotalTime
Length of the current song in Winamp.

winampStatus
Current status of Winamp. If Winamp is running this will be one of
"Playing", "Paused", or "Stopped".
If Winamp is not running it shows "Winamp Not Running".

windowTitle('class')
Title of the window with the given class name.

The following is the list of all valid modifier functions. These functions
can be used to modify the output from any of the above data sources. For
instance, the computer name is usually reported in all uppercase letters,
so you could use lowerCase or capitalize to change that.

after(x, delim)
Extracts the part of x after the first occurance of delim.

afterLast(x, delim)
Extracts the part of x after the last occurance of delim.

before(x, delim)
Extracts the part of x before the first occurance of delim.

beforeLast(x, delim)
Extracts the part of x before the last occurance of delim.

between(x, delim1, delim2)
Extracts the part of x that lies between the first occurance of delim1 and
the last occurance of delim2.

capitalize(x)
Makes all characters lowercase except for the first which is uppercased.

hideIfEmpty(x)
If x evaluates to an empty string and the label is visible then it is
hidden. Otherwise if x evaluates to a non-empty string and the label
is hidden then it will be shown. The argument is passed through unchanged.

lowerCase(x)
Makes all characters lowercase.

trim(x)
Removes leading and trailing whitespace.

upperCase(x)
Makes all characters uppercase.

The [date], [time], and [uptime] data sources can optionally take a format
as a parameter. The following character sequences will be interpreted in
the format (anything else is included verbatim):

m			month (1-12)
mm			month with leading zero (01-12)
mmm			abbreviated month name (Jan, Feb, etc)
mmmm		full month name (January, February, etc)
d			day (1-31)
dd			day with leading zero (01-31)
ddd			abbreviated weekday name (Sun, Mon, etc)
dddd		full weekday name (Sunday, Monday, etc)
yy			2-digit year
yyyy		4-digit year
h			hour (1-12)
hh			hour with leading zero (01-12)
i			hour (0-23)
ii			hour with leading zero (00-23)
n			minute (0-59)
nn			minute with leading zero (00-59)
s			second (0-59)
ss			second with leading zero (00-59)
am/pm		am/pm indicator

For [uptime] only the day, hour, minute, and second values are valid. The
[date] and [time] data sources can also take a second parameter that
modifies the timezone used. Here are some examples:

[time('h:nn am/pm', '+4')]
[time('h:nn am/pm', '-2:30')]
[time('h:nn am/pm', 'UTC')]
[time('h:nn am/pm', 'UTC+1')]

UTC means coordinated universal time and is loosely defined as the current
date and time in Greenwich, England.

Data sources that return a size in bytes (mem, swap, etc) take an optional
parameter that specifies the units to use. Legal values are KB, MB, GB, and
% (percent). If no units are given then the units are automatically
selected based on the current value. For example, if 24 MB of memory are
free (out of 64 MB total):

[memAvailable(bytes)] --> 25165824
[memAvailable(KB)]    --> 24576
[memAvailable(MB)]    --> 24
[memAvailable(GB)]    --> 0.02
[memAvailable(%)]     --> 38

Note that when you use specific units, the unit labels are not added for
you, but when the units are implicit they are.

MotherBoard Monitor: As of version 1.9 of Label the MBM data sources
[mbm*] require MBM version 5.1 (or higher). Due to the nature of the
changes this makes Label 1.9 incompatible with earlier versions of MBM.

If you want to include [ or ] in your label's text, use [[ and ]].


Conditional Text Escapes
------------------------

Conditional text escapes let you display different information based on
system conditions. For example, you can have a label that displays Winamp
information if Winamp is currently playing a song, or something else if it
is not. Here are some examples:

LabelText "[if(cond1)]-- Text A --[endIf]"
LabelText "[if(cond1)]-- Text A --[else]-- Text B --[endIf]"
LabelText "[if(cond1)]-- Text A --[elseIf(cond2)]-- Text B --[else]-- Text C --[endIf]"

In the first example, if cond1 is true (a condition can only be true or
false) then text A is displayed otherwise nothing is displayed. In the
second example, if cond1 is true then text A is displayed otherwise text B
is displayed. In the third example, if cond1 is true then text A is
displayed, if cond1 is false and cond2 is true then text B is displayed, if
cond1 and cond2 are both false then text C is displayed. Yeah, that last
one sounds pretty confusing but don't worry, it's not that likely you'll
need to use it.

Now you're probably wondering what these conditions are, well here they are:

connected
True if there is an active network connection.

empty(x)
True if x is an empty string.

fileExists('file')
True if the given file exists.

mbmLoaded
True if MBM is loaded.

notEmpty(x)
True if x is not an empty string.

winampPlaying
True if Winamp is currently playing.

So, let's do a concrete example. Here is a label that displays the currently
playing song in Winamp if Winamp is playing or the date otherwise:

LabelText "[if(winampPlaying)]Playing: [winampSong][else][date][endIf]"


Default Configurations using AllLabels
--------------------------------------

To help reduce redundant commads in the step.rc, label.dll now supports
default settings. By prepending "AllLabels" to the name of the setting you
can make defaults that apply to all labels. For example, the following
sets the a default font which will be used for LabelOne and LabelTwo but
which is overridden by LabelThree:

AllLabelsFont "Tahoma"
AllLabelsFontHeight 12
AllLabelsFontBold
AllLabelsFontColor 255 255 255
AllLabelsJustify left

LabelOneText "Hello!"
LabelOneX 100
LabelOneY 100
LabelOneJustify center

LabelTwoText "Hi!"
LabelTwoX 200
LabelTwoY 100

LabelThreeText "Greetings!"
LabelThreeX 300
LabelThreeY 100
LabelThreeFont "Arial"
LabelThreeFontHeight 11
LabelThreeFontColor 255 255 255


Using Labels inside LSBox
-------------------------

xLabel supports the *ModuleHook feature of LSBox. To create a label inside
of an LSBox, place the following command in the .box file:

*ModuleHook !LabelLSBoxHook <label-name>

All the settings for the label will still be in the step.rc. Make sure that
you do not put the same name in both a *ModuleHook and a *Label command.
Note that xLabel must be loaded before LSBox in order for this to work.

The following bang commands/features do not work for labels inside of an LSBox:
    LabelMoveable
	!LabelAlwaysOnTop
	!LabelCreate
	!LabelDestroy
	!LabelPinToDesktop
	!LabelToggleAlwaysOnTop

-----------------------------------------------------------------------------
Changes for xLabel
-----------------------------------------------------------------------------
2.3, Released on 12-18-2003, Changes by Andymon
- Added: Draggable Labels (via ModifierKey + MoveMouseButton)
         <label-name>Moveable 
         <label-name>MoveModifierKey "ctrl", "shift", or "ctrl+shift" ("shift+ctrl")
         <label-name>MoveButton "left", "right", or "middle"

- Added: Region MouseClick Feature:
         Custom regions ( as many as you want ;) ) inside a label, which execute different actions if clicked
         *<label-name>OnLeftClickRegion <left> <top> <right> <bottom> <action>
         *<label-name>OnRightClickRegion <left> <top> <right> <bottom> <action>
         *<label-name>OnMiddleClickRegion <left> <top> <right> <bottom> <action>
         
- Added: Region MouseEnterLeave Feature:
         Restrict "OnEnter"  and "OnLeave" commands to a region inside the label.
         <label-name>OnEnterLeaveRegion <left> <top> <right> <bottom>
         
- Added: BuiltIn (optional) Animations on !LabelMove, !LabelResize and !LabelReposition

- Added: Bang: !labelcheckwinamp
         Performs the WinampStatusCheck manually ;)
         
- Added: Bang: !labelmzscriptvarcopy <label-name> <mzscript var>
         Sort of thing I wanted/needed, so maybe others ;)
         
- Added: Bang: !labelposmzscriptvarcopy <label-name> <mzscript var for posx> <mzscript var for posy>
         For mzscripters it's so easy to save the new label position, if labels were moved! ;)

- Added: Unique xlabel Commands executed due to the current Winampstate
         xlabelOnWinampRunning <action>
         xlabelOnWinampClosed <action>
         xlabelOnWinampPlaying <action>
         xlabelOnWinampPaused <action>
         xlabelOnWinampStopped <action>
         xlabelWinampCheckInterval <number>

- Changed: [winampsong] extended to support more Players (QCD and Foobar2K)
- Changed: If no [activetask] is found, now shows up "Unknown Task" instead of nothing as before.
- Changed: If Winamp is not running, [winampstatus] shows up "Player Not Running" instead of nothing as before.

2.2.2, Released on 12-10-2003, Changes by Seg@
- Added keyboard layout info: [kblayout] and [skblayout]

2.2.1, Released on 11-22-2003, Changes by Andymon
- Fixed: LSBox Support (now working, exactly the same as in label.dll)
         [ *ModuleHook !LabelLSBoxHook <label-name> ]
- Fixed: Corrected and updated Revision ID to 2.2.1 ;)
- Changed: ReEnabled TrueTransparency Feature for Labels ;)
           ( was alltime present in the docs but deactivated since label-1.96 :\ )
           [Maybe it contains a STILL UNFIXED resource leak in labels using TrueTransparency??,
            but if you don't activate it, it's insignificant for other labels (Default: false !!)]

2.2, Released on 08-06-2003, Changes by X
- Added network I/O stats: [netIn] and [netOut]
- Added file info: [dateCreated], [dateLastModified], [firstLine], and [lastLine]
- Fixed: using % with a metric that didn't support it could crash LS
- Added conditional text escapes ([if], [else], etc)
- Added conditions for [if]: connected, empty, fileExists, mbmLoaded, notEmpty, and winampPlaying

2.1.1, Released on 08-03-2003, Changes by X
- Fixed: !LabelSetFontColor was broken

2.1, Released on 08-01-2003, Changes by X
- Added LabelOnTextChange
- Added support for Winamp 3 (using wa3remote.wac)
- Added !LabelShowHide

2.0, Released on 07-29-2003, Changes by X
- First release as xLabel
- Added *Label
- Removed Label and Labels
- Changed bang command names (!MyLabelHide -> !LabelHide MyLabel)
- Removed LabelBangCommands
- Added !LabelClipboardCopy and !LabelClipboardPaste
- Removed !LabelClipboard
- Renamed LabelOnMouseEnter and LabelOnMouseLeave to LabelOnEnter and LabelOnLeave
- Added [line], [lineCount], and [size]
- Renamed LabelJustify to LabelAlign
- Added LabelVertAlign

-----------------------------------------------------------------------------
Changes for Label.dll (1.0-1.99)
-----------------------------------------------------------------------------

1.99, 02-20-2003 (X)
- added support for multiple texts
- added !LabelPrevious and !LabelNext

1.98, 12-09-2002 (ilmcuts)
- fixed memory leak (thanks xnowfall)
- set charset to DEFAULT_CHARSET, should fix problems with e.g. eastern
  european fonts.
- added support for tabs in LabelText

1.97, 10-03-2002 (ilmcuts, wols)
- fixed Indie LS dependency
- fixed !labelclipboard inserting random characters if used without parameters
- added support for MBM 5.1.9.1

1.96, 08-13-2002 (ilmcuts, MickeM, Vendicator)
- fixed all known resource leaks
- fixed !bang commands not being properly removed
- fixed scrolling
- fixed LabelScrollPad not working
- fixed !LabelSetFontColor not working correctly with hexadecimal (8040FF) parameters
- fixed !LabelLsBoxHook ignoring LabelStartHidden
- a "boxed" label no longer registers !bangs that don't work inside of boxes
- no more default "label". Thus it is possible to use labels exclusively in
  lsboxes, without a "Labels <list>" setting in step.rc.
- added !refresh support
- added !LabelScroll
- added !LabelRefresh. Call this after !reload to reconfigure a single label.
- added LabelOnWheelDown/LabelOnWheelUp
- added LabelOnDrop

1.95, 05-28-2002
- fixed [cpu] bug in non-English versions of Win2K/XP
- label names can now contain periods

1.94, 05-15-2002 (Holger Brunn)
- added LabelScroll
- added LabelScrollInterval
- added LabelScrollSpeed
- added LabelScrollPad
- added LabelTrueTransparency (transparency by changing the window region for pink areas in background bmp)

1.93, 04-07-2002/05-12-2002 (ilmcuts)
- added LabelBangCommands
- added LabelUseFahrenheit
- a & in the LabelText will actually be displayed as &

1.92, 01-30-2002 (Sci)
- added support for lsbox (merged code by blkhawk from 1.8a)

1.91, 01-16-2002 (Sci)
- added !LabelClipboard

1.9, 11-06-2001
- updated MBM info and now requires MBM 5.1
- added support for multiple IPs (little different from Blkhawk's)
- can now specify units for byte sizes

1.8, 08-25-2001
- added power management info: [powerSource], [battery]
- added MotherBoard Monitor 5 info: [mbmFanSpeed], [mbmTemperature], [mbmVoltage]
- bugfix: [itime] didn't always wrap around 1000 as it should

1.7, 08-04-2001
- added !LabelSetFontColor
- added timezone support to [date] and [time]
- added [itime]
- bugfix: fonts now work properly with AllLabels
- bugfix: crash on recycle (special thanks to Paul Haine)

1.61, 05-28-2001
- bugfix: LSBox support now actually works! =)

1.6, 05-28-2001
- added AllLabels support
- added LSBox compatibility
- added native Winamp info
	- winampSong
	- winampTime
	- winampRemainTime
	- winampTotalTime
	- winampStatus

1.51, 04-19-2001
- bugfix: in [date] and [time] midnight showed up as 0 o'clock
- bugfix: in [uptime] the hour wrapped at 12

1.5, 04-11-2001
- added support for dynamic label creation/destruction
- added !LabelCreate
- added !LabelDestroy
- extended [date] and [time] to support user-defined formats
- added [uptime]
- added [windowTitle('class')]
- added more support functions
	- after
	- afterLast
	- before
	- beforeLast
	- between
	- hideIfEmpty
- added support for multiline labels (\n)

1.4, 04-04-2001
- added !LabelMove, !LabelReposition, and !LabelResize
- added !LabelUpdate
- added the following sysinfo functions
	- diskAvailable('drive')
	- diskInUse('drive')
	- diskTotal('drive')
- updated the documentation and converted it to plain text
- bugfix: labels are now hidden from the VWM
- known issue: might not work in PureLS -- I need bug reports

1.3, 03-02-2001
- added support for multiple "Labels" commands
- added the following sysinfo functions
	- hostName
	- IP
	- randomLine('file')
- added the following support functions
	- capitalize(x)
	- trim(x)
- added LabelUpdateInterval: number of milliseconds between updates
- fixed various transparency issues
- known issue: if one item in a label autoupdates, the whole label
  will do so, so don't mix stuff like randomLine with CPU/mem, etc.
- again I haven't updated the docs... next time, I promise! =)

1.2, 02-05-2001
- added support for system info in labels. just put the name of the info you want inside brackets ("The time is [time]")
	- activeTask (title of the currently active task)
	- computerName
	- cpu
	- date
	- memAvailable
	- memInUse
	- memTotal
	- os
	- swapAvailable
	- swapInUse
	- swapTotal
	- time
	- userName
- added support for functions to modify sysinfo ("[lowerCase(computerName)]")
	- lowerCase(x)
	- upperCase(x)
- known issue: [cpu] doesn't work on NT/2K yet
- known issue: documentation is out of date
- bugfix: doesn't crash under PureLS anymore

1.1, 01-25-2001
- added support for center-relative coordinates, like shortcut2 (16c, -200c)
- added transparency support (LabelTransparent)
- improved/fixed painting code
- fixed documentation: missing LabelLeftBorder, etc.
- bugfix: if the skin bitmap file wasn't found, LS could hang
- bugfix: LabelJustify now actually works
