

   -----   Shortcut Bar     build: 02/14/01   -----


New in this version:  Image Tinting!!
Font changes also work now.

(This is the last of the "spandex" builds.  I'm working on a
rewrite of the layout code for enhanced module happiness.)

--

In this module, you've got yer bars and you've got yer
bar styles.  The bar styles define how a bar is drawn.

Just to get the hang of things at first, I recommend
ignoring bar styles altogether and just play with plain
bars, then delve into bar styles once you've figured that
out.




]]]]]]]]]]]]]]]             Bars            [[[[[[[[[[[[[[

Bars are defined almost exacly the same way as popup menus.
The first line of each bar defines its start location, size,
alignment, style, name, and any folder to read items from.
(this may seem more like a shortcut setting)

*ScBar x y width height [#flags] name [style] [!special commands]

x and y can be:
 a positive number: pixel coord relative to top left
 a negative number: pixel coord relative to bottom right
 %<number>: a percent across the screen
          (i forget if this can be negative)
 c<number>: a pixel coord relative to the center of the screen
            this can be positive or negative.

width and height can be:
 a positive number: fixed width in pixels
 a negative number: fixed width relative to screen size
 %<number>: a percent of the screen size
 d<number>: dynamically size to hold all of the items,
            x and y coords align to <number>% across the bar
            "d d" aligns to the top left of the bar
            "d50 d50" aligns to the center of the bar
            "d100 d100" aligns to the bottom right of the bar

(recommended width and height: "d d")

#flags:
  H : bar is initially hidden
  T : bar is "on top" (doesn't work yet)

if style is not specified, the default bar style is used
when i do popup emulation, the popup style will be the default
for some bars

The special commands don't work yet.

----
Unless a special command is given, the bar items follow
until a "*scbar ~" line is ecountered.

Each item in the folder has this form:

*scbar <label> [<image>] [<hover-image>] [<click-image>] [!special command] action

if the action has no paramenters (ie, no spaces), you can
leave out items before it.  (except label)
Use "" for items you wish to leave out.

Special commands:
  !folder  creates a subfolder/bar thingy
           another bar will popup when the mouse hovers
           over this item for a while.  The items for this
           bar follow until a "*scbar ~" line is found.
           This item may still have an action.
  !separator  creates a separator
           This item never uses the hover or click images,
           although any label/image given on the line
           will still be used.
           Clicking on this item will behave the same as
           clicking on the bar itself.
           Any action will be ignored.
  !title  creates a title item
           currently this item is always draw as if the
           mouse is over it.
           Any action will be ignored.

Monochrome images will be drawn with white as transparent
and black as the text color.  (to look like text)
If you really want black and white, use a different color
depth in the image.




]]]]]]]]]]]]]]]         Bang Commands     [[[[[[[[[[[[[[[[


These are here because they're easier to deal with than
bar styles.... i think...

!scbarshow <bar name>
!scbarhide <bar name>
!scbartoggle <bar name>

Show or hide the named bar.  Toggle doesn't work yet.


!scbarpopup <bar name> [<x> <y>]

Show the named bar as a popup at (x,y).
If x and y are omitted, popup at the mouse location.
(no stupid "x=" & "y=" garbage!)


!scbarmove <bar name> <x> <y>
!scbarsize <bar name> <width> <height>

Move/resize the named bar.  See the section on bars above
for the different values you can use.


!scbarstyle <bar name> [<bar style name>]

Change the style of the named bar.
(That's right!  without recycle!)


!scbarabout [<bar name>]

Boring debug info on the module/named bar.
Later this may give memory statistics or be removed.


!scbarenum

List the bars by name.





]]]]]]]]]]]]]]]           Bar Styles         [[[[[[[[[[[[[


*ScBarStyle name [base style]

This defines a new bar style, either copying settings from
the default style, or from the base style speciified.
All options below come in the format:

ScBarStyle(style name)(option)

For the default style, leave out the style name.
For the popup style, the style name is "Popup"
(no, nothing is case sensitive)


 BackBmp <image>
 Overlay <image>
 OverlayBorder size | left top right bottom
 BackTile (bool)

These four specify the background for an image.
The BackBmp is drawn first, either stretched to the entire
size of the bar (default) or tiled, depending on BackTile
The Overlay is then drawn over it (using magic pink).  The
areas covered by the OverlayBorder aren't stretched, but
the rest is.  This allows a perfect border around bitmaps.

 HotPinkTest (bool)

This sets all the colors to pink to help tell you if you've
forgotten to set one of them.  Otherwise the bar style might
be dependent on other bar styles or your system colors.

 Labels (bool)
 Images (bool)

These toggle whether images/labels are displayed in the bar
items.  The default is currently labels only.

 Back <color>
 AutoBevel [<amount>] | <light> <dark>
 BackLight <color>
 BackDark <color> 
 NoBevel (bool)

These set the color of the background of the bar if you're
not using an image.  AutoBevel automatically sets the light
and dark colors, the default autobevel amount is 40?
The default colors for this are the system colors for
"3D Objects"  (eg, buttons in dialog boxes)

 ItemBackBmp <image>
 ItemOverlay <image>
 ItemOverlayBorder size | left top right bottom
 ItemBackTile (bool)

These set the image for items when the mouse is not over them.

 ItemBack <color>
 ItemAutoBevel [amount] | <light> <dark>
 ItemBackLight <color>
 ItemBackDark <color>
 ItemNoBevel (bool)

Item color, same as for bar color.
If you set the ItemBackLight color to FF00FF, the bar background
will show through in the border area instead of drawing the bevel.
If you set the ItemBack color to FF00FF, the item background will
not be drawn.  (unless you supply an image)
Setting the dark color to FF00FF has no effect.
(just set the light color for that)

 ItemTextColor <color>
* ItemTextAlign [l%%|c%%|r%%]
 ItemTextSize size
 ItemTextFace <font name>

text options, * don't work.
Default text color is system color.

 ItemSize width height

This allows you to have fixed size items. 
The default is "d d" which allows automatic/variable size.
For all items to be 120x16: "...ItemSize 120 16"
For all items to be 120xvariable: "...ItemSize 120 d"

 ItemImageSize <size>

This doesn't work quite how I want yet.  All images are
scaled to this size.

 ItemOffset x y

The image and label within the bar item are shifted by this
amount, this is to simulate a button being depressed.

 HoverBackBmp <image>
 HoverOverlay <image>
 HoverOverlayBorder size | left top right bottom
 HoverBackTile (bool)
 HoverBack <color>
 HoverAutoBevel [<amount>] | <light> <dark>
 HoverBackLight <color>
 HoverBackDark <color>
 HoverTextColor <color>
 HoverNoBevel (bool)
 HoverOffset x y

for mouse over

 ClickBackBmp <image>
 ClickOverlay <image>
 ClickOverlayBorder size | left top right bottom
 ClickBackTile (bool)
 ClickBack <color>
 ClickAutoBevel [<amount>] | <light> <dark>
 ClickBackLight <color>
 ClickBackDark <color>
 ClickTextColor <color>
 ClickNoBevel (bool)
 ClickOffset x y

for mouse over, button down

 PopupOffset x y

Offset in pixels for the sub-folder popups.  Use negative
values if you want it shifted up.
The default is to line up the first item of the sub-folder
with the selected item in the main folder.
(note to self: allow a way to set this in derived bar styles)

 Border size | left top right bottom
 ItemBorder size | left top right bottom

Extra space reserved inside each item and around the entire
block of items.

 ItemSpacing pixels

Pixels between each item, along the flow direction.

 Flow l|r|u|d [l|r|u|d] [l|r|u|d] [l|r|u|d]

Flow is the direction in which consecutive items are placed.
Items in a popup menu tend to flow down, items in a menubar
or toolbar tend to flow left.  You can specify up to 4 flow
values, which will be used in order for different sub-folder
levels:

...Flow left down
 ---------   <- main bar
     |  <- sub folder
     |----- <- sub folder of the sub folder

...Flow left
 ---------  <- main bar
     -------  <- sub folder
        ------   <- sub folder of the sub folder


>>>> Image Tinting:

The image tinting used in scbar is more complex than the "hue"
setting for grdtray.  More complex means more flexible and,
best of all, more confusing!!

...ItemTintAmount <percent>
     Amount of tint effect to apply.
...ItemTintWhite <color>
     White pixels in the image become this color.
...ItemTintBlack <color>
     Black pixels in the image become this color.
...ItemTintColor <color>
     Half-brightness pixels become this color.

If you use a TintAmount of 100 and ignore the other settings,
all your images will be in grayscale.  Set all three colors to
the same value for grdTray style tinting.  Play with it, find
happy values.


(um... Copyright 2001 Joshua Seagoe...)

