MemoExpress — File Browser
MemoExpressv1.7b / MemoExpressv1.7b / mdx / bars.txt
bars.txt — 17.48 KB — Download this file
*** NOTE: This version of MDX is BETA. If you downloaded it from ***
*** a website other than ***
*** http://129.21.129.137/~dragonzap/dlls/ ***
*** or ***
*** http://24.6.139.19/~dragonzap/dlls/ ***
*** then it is NOT an authorized copy and probably ***
*** out of date! Please e-mail dragonzap1@aol.com for a more ***
*** recent copy. ***
MDX Bar Controls v0.91a beta (c) 2000-2001 DragonZap, dragonzap1@aol.com
Portions (c) 1999-2000 Microsoft, used without permission
This is the beta documentation for the MDX bar controls, included
with the MDX DLL. This DLL is not required to be distributed with the
core MDX DLL unless your script uses the controls that it supports.
This DLL provides the following new controls:
ToolBar
StatusBar
TrackBar
ToolBar
Host control: LIST
Host style: size, should not be hsbar, vsbar, or extsel
Control Styles:
flat - The toolbar has flat buttons
list - Any button text is placed to the right of buttons
rather than the bottom
wrap - The toolbar will wrap to the next line automatically
on separator boundaries
nodivider - The two-pixel divider at the top of the control
will not be drawn
arrows - Buttons with the +v (dropdown) style will have a
dropdown arrow button next to them which is
distinct from the button itself.
Events triggered:
sclick - The user has clicked a button
dclick - The user has clicked a dropdown button
On either event, $did().sel will contain the number of the button
clicked (starting from 2).
How to use:
The toolbar control can be manipulated using mIRC's /did and $did
functions. Line 1 is a control line, used for changing non-button
aspects of the toolbar. Line 1 is sent commands using
/did -i <dialog> <id> 1 <command>
The available commands are:
bmpsize <width> <height>
This MUST be sent before adding any buttons to the toolbar
or any images to its image list. It defines the size of the
pictures that will be put on the toolbar. Once set, it cannot
be changed. If either <width> or <height> is 0, the toolbar
will be considered to have no button images; just text.
setimage [+nhd] [list index] <type> <[icon index,]filename>
Adds or replaces an image in the toolbar's internal image
lists. [+nhd] determines which lists are modified.
n - images displayed on a normal button
h - images displayed when the cursor is over a button
d - images displayed on disabled buttons
If [+nhd] is omitted, all three lists will be added to.
Be sure to keep all three lists the same size. (That is,
if don't add to all the lists in one command, make sure
you have other commands directly after which add to the
other lists.)
[list index] determines what position the new image will be
placed in the image lists. If this is 0 or not given, the
images will be added to the end.
<type> can be "bmp", "icon large", or "icon small". If
<type> is "bmp", [list index] is 0 or not given, and the
given bitmap file is wider than the width given in the
"bmpsize" command, then enough images will be added to
the image list to cover the width of the bitmap.
<filename> is the filename of the image or icon resource
to load. If <type> is "icon large" or "icon small", an
icon index can also be specified, and is considered to
be 0 if omitted.
setbkg <rendermethod> [filename]
Sets the toolbar's background image to the bitmap
given in [filename] and draws it using <rendermethod>,
which can be one of the following:
none - Removes the toolbar's background bitmap (no
filename is needed)
center - Centers the bitmap on the toolbar
tile - Tiles the bitmap on the toolbar
stretch - Stretches and/or shrinks the bitmap to cover
the toolbar
setscheme <highlight> <shadow>
Sets the highlight and shadow color for buttons when
the toolbar style is "flat", as well as the color of
separators. <highlight> and <shadow> can either be
a value put together by mIRC's $rgb() function, or
they can be "default" to reset them back to their
normal colors.
bwidth <min> <max>
Sets the button width. Buttons will be sized no smaller
than <min> pixels and no larger than <max> pixels in width.
pad <horizontal> <vertical>
Sets the horizontal and vertical padding (that is,
the amount of space between the button image and the edge
of the button)
Buttons start at line 2, and can be added/modified with /did -a,
/did -i, or /did -o, or retrieved with $did(). They can also be
removed with /did -d, or all buttons can be cleared with /did -r.
Buttons are formatted as follows:
[+flags] [width] [image #] [button text]{tab}[tooltip text]
The available flags are:
a - The button is auto-sized, meaning its width is set to
be just enough to contain the image and text, instead
of being the same size as all the other buttons in the
toolbar.
c - The button is treated like a check box, staying down
when the user clicks it, and popping up when the user
clicks it again.
g - The button is part of a group
G - The button is part of a check group (behaving like
radio buttons)
d - The button is disabled
h - The button is hidden, but still considered part of the
toolbar
i - Indeterminate -- the button is grayed
p - The button is pressed, meaning the user is holding it down
w - The button is followed by a forced line wrap (meaning
that all buttons after it will be put on the next line)
W - Indicates that you have specified a button width in
[width]
v - The button triggers a "dclick" event instead of an "sclick"
event, or if the "arrows" style is set, the button has
a dropdown arrow button next to it
x - The button is checked
[image #] is a number corresponding to an in each of the three
image lists. It can be 0 if no image is desired.
[button text] is the text that is to be displayed on the button.
If the button text is "-" (a single dash) and there is no tooltip,
then the button becomes a separator instead.
[tooltip text] is the text that is displayed when the user hovers
the mouse cursor over the button.
StatusBar
Host control: LIST
Host style: size, should not be hsbar, vsbar, or extsel
Control Styles:
none
Events triggered:
sclick - The user has clicked a status bar cell
dclick - The user has double-clicked a status bar cell
On either event, $did().sel will contain the number of the cell
clicked (starting from 2).
How to use:
Much like many of the other included MDX controls, line 1 is a
"command line", while the other lines are used to control the
actual elements. (In this case, they are used to control the parts
of the status bar.)
The first line has several commands which can be sent using
/did -i:
setparts <position> [position] [position] ...
Sets the "cells" of the status bar control. These are
the panes through which text and icons are viewed.
[position] indicates the position of the right side of
the cell, in pixels. If [position] is -1, then the cell
will go to the end of the control. So for example, if you
had a status bar with a width of 300, and you set the parts
as "100 200 -1", then you would have 3 parts each
approximately 100 pixels wide.
setbkcolor <color>
Sets the background color of the status bar. Use $rgb()
to get a color value.
seticon [list index] <size> <[icon index,]filename>
Adds an icon to the internally managed icon list. If
[list index] is 0 or not given, the icon is added to the
end of the list. <size> can be "large" (32x32 icons) or
"small" (16x16 icons).
Bar parts can be set with /did -i. They must be formatted as such:
[+flags] [icon #] <text>{tab}<tooltip text>
The available flags are:
b - no border
p - pop-out (the cell looks popped out)
[icon #] is the number of an icon from the list made using "seticon".
If it is 0, no icon is set. <text> and <tooltip text> are the cell
text and tooltip text, obviously. The cell text is limited to 127
characters, and tooltips will only be displayed if either there is
no text given, or the text given does not fit in the cell.
The parts can be retrieved using $did() and are formatted the same
way. If $did() is used on line 1, a list of numbers will be returned
in the following format:
<horz. border> <vert. border> <cell border> [position] [position] ...
<horz. border> is the width of the horizontal border of the status
bar, <vert. border> is the width of the vertical border of the status
bar, and <cell border> is the width of the border between the cells.
The [position] values are the values which you set using "setparts".
TrackBar
Host control: LIST
Host style: size, should not be hsbar, vsbar, or extsel
Control Styles:
vertical - The trackbar is vertical instead of horizontal
select - The trackbar allows a selection. The default
behavior to select part of the track is to
require the user to hold down the Shift key
while moving the thumb tracker left or right.
tooltips - The trackbar will show a tooltip indicating the
current value as the user moves it
nothumb - The trackbar will not have a thumb tracker
noticks - The trackbar will not have tick marks
nwticks - Short for "North-West ticks". By default, a
trackbar's tick marks are on the bottom, or on
a vertical trackbar, the right. This makes the
tick marks appear on the left or top instead.
both - Tick marks appear on both sides of the trackbar
autoticks - Once a "ticfreq" command is called, the trackbar's
tick marks will automatically be extended if
necessary when the trackbar is resized.
setips - Short for "South-East tooltips". By default,
if the "tooltips" style is set, the trackbar's
tooltips will appear on top, or on a vertical
trackbar, the left. This causes the tooltips to
appear on the right or the bottom of the trackbar.
noautosel - Disables the preset handling of trackbar selection.
(That is, the behavior that causes the trackbar
to become highlighted when the Shift key is held)
You may use this style if you wish to implement
your own method of selection.
Events triggered:
sclick - The trackbar was moved around in some way
How to use:
You can change the parameters of a trackbar by using /did -i
on line 1 of the trackbar. The commands you can send in this
manner are:
params <values>
Sets the basic trackbar parameters. <values> is a space-
separated list of values in the following order:
[pos] [min] [max] [linesize] [pagesize] [selstart] [selend] [thumb]
[pos] is the position of the thumb tracker on the trackbar.
[min] and [max] define the range of the trackbar. (They
are the minimum and maximum possible values, respectively.)
[linesize] is the amount the thumb tracker will move if the
user uses the arrow keys to manipulate it. [pagesize] is the
amount the thumb tracker will move if the user uses the
PageUp/PageDown keys to move it. [selstart] and [selend]
define the selection start and end positions, and are
not used if the trackbar does not have the "select" style.
Lastly, [thumb] is the length of the thumb tracker, in pixels.
For horizontal trackbars, this is the tracker's height, and
for vertical trackbars, it is the tracker's width. The size
of the trackbar will be adjusted to fit the tracker.
If you do not wish to change a given value, you may put a
non-numeric value in its place, such as "*".
Note that [min] must always be less than [max] or the
trackbar will not work correctly. If you wish to have
the direction of the trackbar reversed, you can calculate
the reversed value as "[min] + [max] - [pos]".
ticfreq <frequency>
Clears all ticks from the trackbar and replaces them with
one tick every <frequency> units. So for example, if your
trackbar ranged from 0 to 100 and you gave a "ticfreq 5"
command, then tick marks would be placed at 5, 10, 15, 20,
etc. If the trackbar has the "autoticks" style, these tick
marks will be extended if the range is enlarged.
/did -r can be used to clear all tick marks except the first and
last ones. You may use /did -a to add tick marks. Once added, a tick
mark cannot be deleted except by using /did -r. The only thing you
need to give /did -a to add a tick mark is the position that you want
the tick mark to appear at. This is also known as the "logical
position". /did -d and /did -o are not used.
To retrieve information about the tick marks on the trackbar,
excluding the first and last ones, you may use $did().
$did().lines will retrieve a count of the ticks on the trackbar + 1,
not including the first and last marks. This means that if
$did().lines gives you "10", for example, that there are 9 tick
marks on the bar that you can get information about. Tick mark
information starts at line 2, and is given in the following format:
<logical position> <pixel position>
<logical position> is the position on the trackbar at which the tick
was added. <pixel position> is the number of pixels from the left
(or, if the trackbar is vertical, from the top) that the tick mark
is at.
$did() on line 1 gives trackbar information in the same format that
is passed to the "params" command, with a little extra. First,
if there is no selection, then [selstart] and [selend] will be
returned as "*" (an asterisk). Secondly, in an sclick event, it will
be followed by:
[action] [direction]
[direction] is the direction that the last action occurred in, if
any. It will be "up" (which also means "left") or "down" (which
also means "right").
[action] can be one of the following:
none - No sclick event has occurred yet
line - The user moved the thumb tracker with the arrow keys
page - The user moved the thumb tracker with PageUp/PageDown, or
by clicking on part of the trackbar
jump - The user moved the thumb tracker with the Home/End keys
track - The user clicked and held the mouse button on the thumb
track and is moving it around
end - The user stopped moving the thumb tracker
----
Version information:
0.91a - Beta release