Marco Web Center

[an error occurred while processing this directive]

Home: Code Repository: Mastering Delphi 6

Chapter 11 - Project FrameClock

Project Structure

FrameClock.dpr
program FrameClock;

uses
  Forms,
  FrameCForm in 'FrameCForm.pas' {Form1};

{$R *.RES}

begin
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.Run;
end.
FrameCForm.pas
unit FrameCForm;

interface

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

type
  TForm1 = class(TForm)
    MdFramedClock1: TMdFramedClock;
    MdFramedClock2: TMdFramedClock;
    procedure MdFramedClock1Timer1Timer(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.MdFramedClock1Timer1Timer(Sender: TObject);
begin
  MdFramedClock1.Timer1Timer(Sender);
  Caption := TimeToStr (now);
end;

end.
FrameCForm.dfm
object Form1: TForm1
  Left = 325
  Top = 104
  Width = 368
  Height = 280
  Caption = 'FrameClock'
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = False
  DesignSize = (
    360
    253)
  PixelsPerInch = 96
  TextHeight = 13
  object MdFramedClock1: TMdFramedClock
    Left = 72
    Top = 32
    Width = 215
    Height = 83
    Anchors = [akLeft, akTop, akRight, akBottom]
    TabOrder = 0
    SubLabel.Left = 0
    SubLabel.Top = 0
    SubLabel.Width = 215
    SubLabel.Height = 83
    SubLabel.Align = alClient
    SubLabel.Alignment = taCenter
    SubLabel.Caption = '3:19:30 PM'
    SubLabel.Font.Charset = DEFAULT_CHARSET
    SubLabel.Font.Color = clWindowText
    SubLabel.Font.Height = -19
    SubLabel.Font.Name = 'Arial'
    SubLabel.Font.Style = [fsBold]
    SubLabel.ParentFont = False
    SubLabel.Layout = tlCenter
    SubLabel.WordWrap = True
    SubTimer.Left = 24
    SubTimer.Top = 16
  end
  object MdFramedClock2: TMdFramedClock
    Left = 72
    Top = 120
    Width = 217
    Height = 81
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -11
    Font.Name = 'Modern'
    Font.Style = []
    ParentFont = False
    TabOrder = 1
    SubLabel.Left = 0
    SubLabel.Top = 0
    SubLabel.Width = 217
    SubLabel.Height = 81
    SubLabel.Align = alClient
    SubLabel.Alignment = taCenter
    SubLabel.Caption = '3:19:30 PM'
    SubLabel.Font.Charset = DEFAULT_CHARSET
    SubLabel.Font.Color = clWindowText
    SubLabel.Font.Height = -19
    SubLabel.Font.Name = 'Arial Narrow'
    SubLabel.Font.Style = [fsBold]
    SubLabel.ParentFont = False
    SubLabel.Layout = tlCenter
    SubLabel.WordWrap = True
    SubTimer.Left = 24
    SubTimer.Top = 16
  end
end