This component is freeware and can be distributed by everyone.
No person or company may charge a fee for the distribution of this product.
No warranty of any kind is expressed or implied. You use at your own risk. The author will not be liable for data loss, damages, loss of profits or any other kind of loss while using or misusing this component.
You may not rent, lease, sell, modify, and decompile component. Any such unauthorized use shall result in immediate and automatic termination of this license and may result in criminal and/or civil prosecution.
Installing and using this component signifies acceptance of these terms and conditions of the license.
By installing and using this component you will automatically accept these terms and conditions of the license.
This control is a type of SpeedButton that can get the shape of its image.
Each state of the button has an effect class that defines the changes in appearance of the button.
You can also make an animation for any state of the button.
The state of button is changing smoothly and you can define the framerate of animation.
This component built for Delphi and is tested on "Delphi 2007" and "Delphi XE2".
No external packages required to use this button, but if your Delphi does not support PNG images, you'll need PNGImage package to view images of demo application in Delphi.
AnimatedEffect: Boolean If you want to make an animated state for the button, set this property to true.
AnimateFromLastState: Boolean If this property is true, the appearance of the button will change by this effect smoothly.
AnimationInterval: Cardinal Specifies the interval between frames of effect change animation in milliseconds.
AnimationDuration: Cardinal Specifies the length of effect change animation in milliseconds.
AnimationScript: TStrings If you want to make an animated state for the button, put your animation script here.
ApplyChangesNow: Boolean (Runtime) Set this property to true to start the animation of changing properties to their new values. By setting this property to false you are able to change the value of several properties then by setting back it to true animation of changing all properties together will be started. If you change several properties while this property is true, each property changes by its own animation.
Brightness: SmallInt Specifies the amount of image brightness.
ColorInversionR: Byte Specifies the amount of colors red channel inversion value.
ColorInversionG: Byte Specifies the amount of colors green channel inversion value.
ColorInversionB: Byte Specifies the amount of colors blue channel inversion value.
ColorPercentageR: SmallInt The value of colors red channel will be multiplied by one hundredth of this value before changing by ColorShiftR property.
ColorPercentageG: SmallInt The value of colors green channel will be multiplied by one hundredth of this value before changing by ColorShiftG property.
ColorPercentageB: SmallInt The value of colors blue channel will be multiplied by one hundredth of this value before changing by ColorShiftB property.
ColorPercentageA: SmallInt The value of colors alpha channel will be multiplied by one hundredth of this value before changing by ColorShiftA property.
ColorPercentageH: SmallInt The value of colors hue will be multiplied by one hundredth of this value before changing by ColorShiftH property.
ColorPercentageS: SmallInt The value of colors saturation will be multiplied by one hundredth of this value before changing by ColorShiftS property.
ColorPercentageV: SmallInt The value of colors ligtness (V of HSV) will be multiplied by one hundredth of this value before changing by ColorShiftV property.
ColorShiftR: SmallInt Specifies the amount of change in red channel of colors.
ColorShiftG: SmallInt Specifies the amount of change in green channel of colors.
ColorShiftB: SmallInt Specifies the amount of change in blue channel of colors.
ColorShiftA: SmallInt Specifies the amount of change in alpha channel of colors.
ColorShiftH: SmallInt Specifies the amount of change in hue of colors.
ColorShiftS: SmallInt Specifies the amount of change in saturation of colors.
ColorShiftV: SmallInt Specifies the amount of change in lightness (V of HSV) of colors.
Contrast: SmallInt Specifies the amount of image contrast.
CustomColoring: Boolean If this property is true, OnCustomColoring event of the button will be occurred when the effect want to change the image after its own procedure.
CustomMapping: Boolean If this property is true, OnCustomMapping event of the button will be occurred when the effect want to change the image after its own procedure.
EffectType: TdihavButtonEffectType (Read Only) Indicates the state of button which this effect is assigned to.
GrayScale: Boolean Specifies whether the effect draws image in grayscale.
HeightPercentage: SmallInt Specifies the height scale of the image.
ImageIndex: TImageIndex Specifies the index of picture used for the effect in the ImageList. If this property is -1, the picture of button will be used.
InvertColors: Boolean Specifies whether the effect draws image inverted.
MaskColor: TColor Specifies the color of the mask.
Masked: Boolean Specifies whether the effect draws image masked with MaskColor.
MoveX: Integer Specifies the horizontal position of the image.
MoveY: Integer Specifies the vertical position of the image.
OverlayImage: Boolean If this property is true, the image of the effect will be drawn over the image of the button.
Owner: TdihavButton (Read Only) The button that is owner of the effect.
Picture: TPicture Specifies the picture used for the effect. If this property is (none), the picture of button will be used.
ReplayAnimation: Boolean Specifies whether the animation scripts restarts at the end.
RotationAngle: SmallInt Specifies the rotation angle of the image in one tenth of degrees.
Shadow: Boolean Specifies whether a shadow drawn under the image.
ShadowAlpha: Byte Specifies the opacity of the shadow.
ShadowBlurRadius: Byte Specifies the blur radius of the shadow.
ShadowColor: TColor Specifies the color of the shadow.
ShadowX: Integer Specifies the shadow horizontal position related to image position.
ShadowY: Integer Specifies the shadow vertical position related to image position.
WidthPercentage: SmallInt Specifies the width scale of the image.
The other properties are the same as TPersistent class.
TdihavButton
AnimationPosition: Real (Read Only) Indicates the position of running animation (0 to 1).
AutoCheckButtonState: Boolean If this property is true, the value of CheckButtonState property will be specified automatically.
AutoSize: Boolean If this property is true the size of the button will be adjusted automatically.
ButtonState: TdihavButtonState (Runtime) The current state of the button.
CaptionAlignment: TAlignment Specifies the horizontal alignment of the button caption.
CaptionLayout: TTextLayout Specifies the vertical alignment of the button caption.
CheckButtonState: Boolean Specifies whether the button acts like a checkbox and must stay down when pressed. This property only affects the behavior of the button. In some cases (depends on the effects) the button that must stay down when it is pressed acts abnormal and this is when you must set this property to false. Anytime you see abnormal behavior of buttons with non-zero GroupIndex set this property to false otherwise let it to be automatically adjusted by setting AutoCheckButtonState property true. It is better to play with the buttons of second row of demo program yourself to understand the role of this property.
ConsiderRotationSize: Boolean If this property and AutoSize are true, rotation of the button will be considered while calculating its size.
CurrentEffect: TdihavButtonEffect (Read Only) Indicates the active effect of the button.
CustomBackground: Boolean If this property is true OnCustomBackground event will be occurred while drawing button background.
EffectNormal: TdihavButtonEffect The effect for Normal state of the button.
EffectOver: TdihavButtonEffect The effect for Over state of the button.
EffectDown: TdihavButtonEffect The effect for Down state of the button.
EffectFocused: TdihavButtonEffect The effect for Focused state of the button.
EffectDisabled: TdihavButtonEffect The effect for Disabled state of the button.
EffectActive: TdihavButtonEffect The effect for Active state of the button.
ImageIndex: TImageIndex Specifies the index of picture used for the button in the ImageList.
Images: TCustomImageList Specifies the ImageList of the button.
ImageShape: Boolean Specifies whether the button gets the shape of its image.
Picture: TPicture Specifies the image of the button.
RGN: HRGN (Read Only) If the ImageShape property is true, this property will contain the button RGN.
The other properties are the same as TButton and TSpeedButton classes.
Each line of the script must contains only one command. There are for type of commands:
effectpropertyname := value; Use this command to change effect properties. When using this command ApplyChangesNow property became false.
- This command means that all changes in properties must be performed and execution of script will be paused until end of changes. This command is equivalent to "ApplyChangesNow := True;".
ms (Just a number) Pauses ms milliseconds.
*AText OnCustomAnimationScript script will be occurred and AText will be passed to it as a parameter.
This sample script changes effect Brightness to 100 and RotationAngle to 900 together, executes a custom code, waits for a second, changes Brightness to 0 and then changes RotationAngle to 0.
Brightness := 100;
RotationAngle := 900;
-
*This text will be passed to event
1000
Brightness := 0;
-
RotationAngle := 0;
-
Note that to execute animation script you must set AnimatedEffect property to true.