TdihavButton

http://www.dihav.com/
By Mohammad Yousefi
vahid_you2004@yahoo.com
April 2013

Contents


License Agreement

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.

Top


Introduction

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.

Top


Compatibility

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.

Top


Installation

  1. Run Delphi.
  2. Create a new package or open an existing package.
  3. Add "dihavBtn.pas", "Ico.dcr" files to the package.
  4. Save, compile and install the package.
  5. Component will be appeared on "dihav" tab in "Component Palette".
  6. Add component files directory to "Library Path" accessible from "Tools>Environment Options...>Library" or "Tools>Options...>Environment Options>Delphi Options>Library - Win32".

Top


Unit definitions

Top


Properties

TdihavButtonEffect

The other properties are the same as TPersistent class.

TdihavButton

The other properties are the same as TButton and TSpeedButton classes.

Top


Methods

TdihavButtonEffect

The other methods are the same as TPersistent class.

TdihavButton

The other methods are the same as TButton and TSpeedButton classes.

Top


Events

TdihavButton

The other events are the same as TButton and TSpeedButton classes.

Top


Writing Animation Scripts

Each line of the script must contains only one command. There are for type of commands:
  1. effectpropertyname := value;
     Use this command to change effect properties.
     When using this command ApplyChangesNow property became false.
  2. -
     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;".
  3. ms (Just a number)
     Pauses ms milliseconds.
  4. *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.

Top


Visit dihav website.