Logo New book: Delphi 2007 Handbook
My blog in online
Delphi tech support service: support.marcocantu.com
Google
  Web www.marcocantu.com

Menu for Development

Site Menu
Delphi 2007 Handbook
Mastering Borland Delphi 2005
Essential Pascal
Essential Delphi
Buy Books Online
Code Repository
Newsgroups
White Papers
Tools
Conferences
Training
Delphi Links
Contact Marco

My Other Sites
Italian Site (www.marcocantu.it)
Developers Newsgroups Browser (dev.newswhat.com)
My town (www.piazzacavalli.net)
the delphi search
Wintech Italia (my company)

Breaking News
Buy Mastering Borland Delphi 2005 from Amazon
Free ebook: Mastering Delphi Update for Delphi 2006

Advertising
Home My Blog Books My Bookstore Development Links Marco


Home: Code Repository: Mastering Delphi 6

Chapter 18 - Project DbProgr

Project Structure

DbProgr.dpr
program DbProgr;

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

{$R *.RES}

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

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  ExtCtrls, DBCtrls, ComCtrls, StdCtrls, Mask, DBTables, DB,
  MdProgr;

type
  TForm1 = class(TForm)
    Table1: TTable;
    Table1OrderNo: TFloatField;
    Table1ItemNo: TFloatField;
    Table1PartNo: TFloatField;
    Table1Qty: TIntegerField;
    Table1Discount: TFloatField;
    Label1: TLabel;
    DBEdit1: TDBEdit;
    Label2: TLabel;
    DBEdit2: TDBEdit;
    Label3: TLabel;
    DBEdit3: TDBEdit;
    Label4: TLabel;
    Label5: TLabel;
    DBEdit5: TDBEdit;
    DBNavigator1: TDBNavigator;
    DBText1: TDBText;
    DataSource2: TDataSource;
    MdDbProgress1: TMdDbProgress;
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

end.
DbProgrF.dfm
object Form1: TForm1
  Left = 330
  Top = 220
  Width = 435
  Height = 300
  Caption = 'Data-aware ProgressBar Demo'
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = True
  PixelsPerInch = 96
  TextHeight = 13
  object Label1: TLabel
    Left = 168
    Top = 16
    Width = 40
    Height = 13
    Caption = 'OrderNo'
    FocusControl = DBEdit1
  end
  object Label2: TLabel
    Left = 168
    Top = 56
    Width = 34
    Height = 13
    Caption = 'ItemNo'
    FocusControl = DBEdit2
  end
  object Label3: TLabel
    Left = 168
    Top = 96
    Width = 33
    Height = 13
    Caption = 'PartNo'
    FocusControl = DBEdit3
  end
  object Label4: TLabel
    Left = 168
    Top = 136
    Width = 16
    Height = 13
    Caption = 'Qty'
  end
  object Label5: TLabel
    Left = 168
    Top = 176
    Width = 42
    Height = 13
    Caption = 'Discount'
    FocusControl = DBEdit5
  end
  object DBText1: TDBText
    Left = 200
    Top = 136
    Width = 65
    Height = 17
    DataField = 'Qty'
    DataSource = DataSource2
  end
  object DBEdit1: TDBEdit
    Left = 168
    Top = 32
    Width = 64
    Height = 21
    DataField = 'OrderNo'
    DataSource = DataSource2
    TabOrder = 0
  end
  object DBEdit2: TDBEdit
    Left = 168
    Top = 72
    Width = 64
    Height = 21
    DataField = 'ItemNo'
    DataSource = DataSource2
    TabOrder = 1
  end
  object DBEdit3: TDBEdit
    Left = 168
    Top = 112
    Width = 64
    Height = 21
    DataField = 'PartNo'
    DataSource = DataSource2
    TabOrder = 2
  end
  object DBEdit5: TDBEdit
    Left = 168
    Top = 192
    Width = 64
    Height = 21
    DataField = 'Discount'
    DataSource = DataSource2
    TabOrder = 3
  end
  object DBNavigator1: TDBNavigator
    Left = 88
    Top = 232
    Width = 240
    Height = 25
    DataSource = DataSource2
    TabOrder = 4
  end
  object MdDbProgress1: TMdDbProgress
    Left = 168
    Top = 152
    Width = 150
    Height = 16
    Min = 0
    Max = 100
    Position = 5
    TabOrder = 5
    DataField = 'Qty'
    DataSource = DataSource2
  end
  object Table1: TTable
    Active = True
    DatabaseName = 'DBDEMOS'
    TableName = 'ITEMS.DB'
    Left = 48
    Top = 40
    object Table1OrderNo: TFloatField
      FieldName = 'OrderNo'
    end
    object Table1ItemNo: TFloatField
      FieldName = 'ItemNo'
    end
    object Table1PartNo: TFloatField
      FieldName = 'PartNo'
    end
    object Table1Qty: TIntegerField
      FieldName = 'Qty'
    end
    object Table1Discount: TFloatField
      FieldName = 'Discount'
    end
  end
  object DataSource2: TDataSource
    DataSet = Table1
    Left = 48
    Top = 104
  end
end