TSkinForm 1.5 Readme

CONTENTS
1.Overview
2.Features
3.What's new
4.Development
5.Example
6.Use Internal Skins
Overview

  Are you bored by Windows95 UI? Do you want to create an application which has a cool and changeable UI just like WPlay and WinAmp?
  If so, SkinForm might be the thing that you want. This component can help you to change the visual appearance of your project and make non-rectangular windows forms quite easily.The only thing you need do is to create your bitmap files and a description file for a skin.
  This component can be freely used and distributed in commercial and private products, if you like it, please drop me an e-mail and send your screenshots.
Please feel free to contact me if you have any comments or suggestions.

Notice:
  From v1.4, this component is not FREE, although you have got all of it and needn't pay anything. The reason is my girl friend. I met her one year ago in Beijing and then went to Japan for my new job in Tokyo. I promised her that I would telephone her every month. However, recently I busied with myself updating this component, I forgot to call her and didn't replied her letter untill I have finished this version, but she did. Although she said that she could understand, I am really regretful for it, so I want to give her a gift, a special gift. She is a college student in Beijing, studying foreign culture, a stamp collector. I think that maybe you would like to help me, if you think this component is helpful for you, would you like to send me some stamps or postcards of your country? Photograph of your country's landscape is also acceptable.

If you would like to do, my address is here

Author: Xue Huai Qing xhq@writeme.com

Some functions come from Jscalco & Eddie Shipman, many thanks to them.
Thanks to Anders Melander [http://www.melander.dk] for his GREAT COMPONENT ---- TGIFImage
Thanks to Andre Inghillieri for his suggestions and improvements.
Thanks to Konrad Swart for his .dcr file.
Tanks to Scott Jarkoff [http://www.cybertropix.com] for his advice.
Thanks to Ben Huang (Huangbili) & Gerd Zanker for the most changes and ideas of visual design mode

Thanks to all people who give me a lot of encouragement and suggestions.

If you use Delphi 3, please add "{$DEFINE DELPHI3}" as a new line
If you don't need the support of GIF, please remove the line "{$DEFINE GIFSUPPORT}"

Features
1.The ability to change the visual apperance of the application.
2.Support of windows of the nonrectangular form.
3.Support graphic buttons (button, switch-style button, radio button)
4.Support graphic trackbar (horizonal, vertical)
5.Support text display
6.With an embeded skineditor
What's new
v1.5     Add function to avoid duplicate ID
            Add preview support at design time
            Add support of visual design
            Add SetTrackBarMinMax method
            Add hint support to button and trackbar
            Add support of   internal skins

v1.40   Add support of JPEG, GIF format file. If you need the support of GIF, you need the TGIFImage
            Add support of graphic text display
            Add support of graphic number display

v1.30    Fixed some bugs and make trackbar moving more smoothly
             Add support of Radio Button
             Add functions to manage the ID of HotArea
             Add OnTrackBarNotify event
             Add an embedded-editor
Development
  All files of one skin should be placed in one directory.
  These files consist of the following types:
  skin.ini - main file containing the description of a skin.
  *.bmp  bitmap pictures for the skin.

The following is a sample of skin.ini:
[BITMAPINFO]
MaskBitmap=mainmask.bmp
MouseUpBitmap=main.bmp
MouseDownBitmap=selected.bmp
MouseOnBitmap=selected.bmp
//ID, x, y, width, height, initial state if it is a switch-style button, group name if it is a radio button
[HOTAREAINFO]
Count=11
1=BUTTON_PLAY, 29, 249, 26, 18
2=BUTTON_STOP, 92, 246, 28, 20
3=BUTTON_PAUSE, 60, 271, 29, 16
4=BUTTON_PREV, 60, 220, 26, 17
5=BUTTON_NEXT, 60, 237, 28, 17
6=BUTTON_EJECT, 25, 318, 25, 17
7=BUTTON_MINIMIZE, 24, 340, 24, 16
8=BUTTON_EXIT, 101, 68, 19, 25
9=BUTTON_MENU, 31, 215, 27, 23
10=BUTTON_REPEAT, 99, 293, 24, 17, FALSE
11=BUTTON_SHUFFLE, 60, 293, 30, 18, FALSE
//ID, font name, bold, italic, size, color, x, y, text style, default text
[DISPLAYINFO]
Charset=1

Count=5
1=FILENAME, MS Sans Serif, FALSE, FALSE, 9, $FFFFFF, 31, 163, Normal, Filename
2=REPEAT, Arial, FALSE, FALSE, 7, 0, 32, 150, Normal
3=SHUFFLE, Arial, FALSE, FALSE, 7, 0, 70, 150, Normal
4=VOLUME, MS Sans Serif, FALSE, FALSE, 9, $FFFFFF, 32, 108, Number
5=TIME, MS Sans Serif, FALSE, FALSE, 9, $FFFFFF, 80, 108, Number
// ID, bitmap of up state, bitmap of down state, x, y, length, style, initial position
[TRACKBARINFO]
Count=2
1=VOLUME, scrollup.bmp, scrolldown.bmp, 45, 184, 64, H, 50
2=TIME, scrollup.bmp, scrolldown.bmp, 33, 175, 80, H, 50

procedure SetKeyColor(KeyColor : TColor); //Set the transparent color of the mask bitmap
procedure SetTolerance(Tolerance : TColor); //Set the tolerance of transparent color

procedure LoadSkinFile(const Skin : string); //Load a skin file

OnMouseDownNotify,OnMouseUpNotify,OnMouseMoveNotify,OnTrackBarNotify

function GetHotAreaState(ID : string) : Boolean;                  //Get the current state of a hotarea
procedure SetHotAreaState(ID : string; state : Boolean);     //Set the current state of a hotarea
function GetTrackBarPos(ID : string) : integer;                     //Get the current position of a trackbar
procedure SetCharset(Charset : TFontCharset);                  //Set the charset of all the text
procedure SetDisplayText(ID : string; Text : string);             //Set the text of a display area
function IDToNumber(ID : string) : integer;                          //Get the number of a hotarea
function NumberToID(Index : integer) : string;                     //Get the ID of a hotarea from a number
  
Example
  SkinTest is a  very simple application written in Delphi that demonstrates how to uses the TSkinForm. SkinTest has three different skins, they come from the skins of WPlay -  Another wonderful MP3 Player.
Step A:
        Create your bitmap files of skins,  the opacity bitmap for creating windows region, the bitmaps of inactive, mouseon  and mousedown state.In this sample, we used the skins of WPlay.
Step B:
        Create the skin.ini files for the skin
Step C:
        Create a new project in Delphi IDE and place a TSkinForm component on the form.Then double click the form to add the FormCreate procedure and add code to load a skin file.
Step D:
        Add code to the OnMouseDownNotify, OnMouseUpNotify, OnMouseMoveNotify, OnTrackBarNotify event to handle the the mouse action.

See the source code of demo  for the details.

Use Internal Skins
Step A: Prepare all the graphic file need and make the skin.ini
          
Step B:
Use a text editor to make a .RC file like the following
             skin INI "skin.ini"                                     Format is : Resource name, Resource Type, Filename
             mainmask BMP "mainmask.bmp"             ** Resource name must be same as the Filename **
             main JPG "main.jpg"
             selected JPG "selected.jpg"
             numbers BMP "numbers.bmp"
             scrolldown BMP "scrolldown.bmp"
             scrollup BMP "scrollup.bmp"
             text GIF "text.gif"

Step C:
Use brcc32.exe to compile the .RC file to .RES file
             For example : C:\SkinTest\Default>brcc32 default.rc
           
Step D:
In your project file, add a compiler directive to include your this resource file:
             {$R default.res}

Step E:
Use the procedure named LoadDefaultSkin to load the default skin
105-0004
Tokyo Bijyutsu Club Bldg 6F, 6-19-15 Shinbashi, Minato-ku , Tokyo, Japan
Xue Huai Qing