Animated buttons

Hello,

my task is to create a front form for an application for a tablet PC.
Nothing very complicated- just a couple of buttons big enough to let user switch them with his finger.

Do you know any nicely animated components (buttons)- something that will make this front form look nice and cool.

Best regards

Jack
ActiaAsked:
Who is Participating?
 
mikelittlewoodConnect With a Mentor Commented:
0
 
anorganixConnect With a Mentor Commented:
Hi!
I made a little demo for you...

Get it from:
http://h1.ripway.com/cosmicsoft/EE/ButtonAnimDemo.zip

Also, I will post the source here, in case others can't download...

////////////////////////////// begin main.pas ///////////////////////////////

unit main;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, StdCtrls;

type
  TfrmMain = class(TForm)
    shpClose: TShape;
    lblClose: TLabel;
    tmrAction: TTimer;
    procedure lblCloseMouseEnter(Sender: TObject);
    procedure tmrActionTimer(Sender: TObject);
    procedure lblCloseMouseLeave(Sender: TObject);
    procedure lblCloseClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmMain: TfrmMain;

implementation

{$R *.dfm}

procedure TfrmMain.lblCloseMouseEnter(Sender: TObject);
begin
  shpClose.Brush.Color:=clSkyBlue;
  lblClose.Font.Color:=clNavy;

  tmrAction.Enabled:=true;
end;

procedure TfrmMain.lblCloseMouseLeave(Sender: TObject);
begin
  shpClose.Brush.Color:=clWhite;
  lblClose.Font.Color:=clBlack;

  tmrAction.Enabled:=false;
  shpClose.Pen.Style:=psSolid;
end;

procedure TfrmMain.tmrActionTimer(Sender: TObject);
var
  S: TPenStyle;
begin
  S:=shpClose.Pen.Style;

  case S of
    psSolid:
    begin
      shpClose.Pen.Style:=psDash;
      Exit;
    end;

    psDash:
    begin
      shpClose.Pen.Style:=psDot;
      Exit;
    end;

    psDot:
    begin
      shpClose.Pen.Style:=psDashDot;
      Exit;
    end;

    psDashDot:
    begin
      shpClose.Pen.Style:=psDashDotDot;
      Exit;
    end;

    psDashDotDot:
    begin
      shpClose.Pen.Style:=psSolid;
      Exit;
    end;
  end;
end;

procedure TfrmMain.lblCloseClick(Sender: TObject);
begin
  Close;
end;

end.

///////////////////////////////////// end main.pas //////////////////////////////////

///////////////////////////////////// begin main.dfm /////////////////////////////////

object frmMain: TfrmMain
  Left = 192
  Top = 107
  BorderIcons = [biSystemMenu, biMinimize]
  BorderStyle = bsSingle
  Caption = 'Animation Demo'
  ClientHeight = 73
  ClientWidth = 177
  Color = clBtnFace
  Font.Charset = ANSI_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  OldCreateOrder = False
  Position = poScreenCenter
  PixelsPerInch = 96
  TextHeight = 13
  object shpClose: TShape
    Left = 16
    Top = 16
    Width = 145
    Height = 41
  end
  object lblClose: TLabel
    Left = 17
    Top = 17
    Width = 144
    Height = 39
    Alignment = taCenter
    AutoSize = False
    Caption = 'Close Program'
    Font.Charset = ANSI_CHARSET
    Font.Color = clBlack
    Font.Height = -11
    Font.Name = 'Tahoma'
    Font.Style = [fsBold]
    ParentFont = False
    Transparent = True
    Layout = tlCenter
    OnClick = lblCloseClick
    OnMouseEnter = lblCloseMouseEnter
    OnMouseLeave = lblCloseMouseLeave
  end
  object tmrAction: TTimer
    Enabled = False
    Interval = 100
    OnTimer = tmrActionTimer
    Left = 18
    Top = 18
  end
end

//////////////////////////////////// end main.dfm //////////////////////////////////////

Hope it helps...
Cheers!

 :: Cosmin
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.