www.gusucode.com > 精典源码Delphi130:顺某指纹考勤管理系统 > 精典源码Delphi130:顺某指纹考勤管理系统/11065顺某指纹考勤管理系统delphi/UseOCX/CoolspdButton/TransBtn.txt

    (set wordwrap on if you're viewing this with Notepad )

NEW RELEASE August 4 1997!

A (SpeedBar)Button with transparency. Win32 (95/NT4) and Delphi 2.0 only.
Includes demo program (in examples.zip)
Now inclues full source



Current version is 1.05

Freeware by Peter Th鰎nqvist feb 1997

Contact me at NMA96PTH@STUDENT2.LU.SE

INSTALLING (D2):
Backup your cmplib32.dcl file.
Start Delphi
Select Components|Install | Add from Delphi
Browse to the directory where you unpacked the files.
Select TransBtn.pas.
Click Ok
Wait (...)
The component will be available on the 'Personal' page.
If anything went wrong, restore the dcl file and try again (and again, and again...)


NEW! INSTALLING (D3):
Select Components | Install Components | Into new package  
Give the package a name and a directory to live in.
Browse to where you placed the Transbtn.pas. Click OK
Rest is the same as for D2

Unpack the example to see a demo of the button.

FIXES:
970315: Fixed Mouse handling omissions and errors
970407: Fixed stupid bug in MouseMove handler (thanks to Magnus Myhrberg) 
970419: Added Explorer style and run-time mov(e?)able (thanks to Alejandro Llorca)
970617: added CMEnabledChanged handler so button will go up when disabled programmatically and also fixed csDoubleClicks bug (both by Sebastien Gandon) 

ADDED:
970501: Autogenerates grayed bitmap when unfocused (fsExplorer) and disabled bitmap when, eh... disabled (and NumGlyphs = 1).
970519: Wordwrap,Down and PopUpMenu added.
fsExplorer is looking more and more like M$'s...


PROPERTIES:

BorderWidth:
  Sets the width of the border. Default is 1 pixel. Wide borders look ugly (it's a truth).
Caption:
  The text to display
FrameStyle:
  Sets the type of border on the button. If you want a truly transparent button, set FrameStyle to fsNone, and Transparent to True
Glyph:
  The bitmap to show. The component will generate a bitmap automatically for the disabled state if NumGlyphs = 1, otherwise it will use Glyph # 2.  Also, when using the fsExplorer style, a grayed bitmap will be displayed when the button looses focus.
Movable:
  Specifies if the button should be movable at run-time (Alejandro Llorca)
ShowPressed:
  If set to True, will shift the bitmap down/right when pressed. Set this to false if you want to manage the pressed look yourself (i.e. using a different bitmap etc)
Spacing:
  Determines the spacing between glyph / text and border: can be negative.
  Not used when TextAlign = ttaCenter
TextAlign:
  Sets where text will be displayed on the button. If you want text and bitmap in the middle, set this to ttaCenter (default). Text is always displayed on top of the bitmap.
Transparent:
  If true, makes the button transparent.  Does not make the border transparent.

NEW PROPERTIES (May 19):

Down:
 Set this to true if you want to show the button in a pressed state. Note that this property does NOT work like the one in TSpeedButton:
 there is no AllowAllUp or GroupIndex property here: you will have to handle this yourself. Also, no OnClick event is generated when the property is changed.
PopUpMenu:
 Specifies a TPopUpMenu to associate with the button. Setting the PopUpmenus Alignment property will affect where the menu will be displayed horizontally. Vertical placement is always below the button. If you want a downarrow on the button to indicate that it has a menu, you will
 have to add it to your bitmaps.
WordWrap:
 Wraps the text on the button if necessary.


MORE NEWS May 26:
1  The accelerator key now actually works, i.e setting an Accel. Key (by specifying a "&" before a letter in the caption ) will trigger the Click event if Alt+Letter is pressed.
2  Cleaned up alot of unnecessary code in the different Paint procedures. The Spacing property is working more as intended and is also more important for getting a good look.
3  To get a good result with the grayed / disabled bitmap generation it is important to have a row of "unused" pixels at the bottom and right:
If you have a row of "used" pixels at the bottom or right, no shadow will be generated for that line: it will fall outside the bitmaps bounds.


Enjoy!


Regards, Peter