home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2003 January
/
Chip_2003-01_cd1.bin
/
zkuste
/
delphi
/
kompon
/
D34567
/
SMDBG
/
SMGRDEMO.ZIP
/
Main.pas
< prev
Wrap
Pascal/Delphi Source File
|
2000-03-13
|
3KB
|
117 lines
unit Main;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Grids, DBGrids, SMDBGrid, ExtCtrls, Db, DBTables, ComCtrls;
type
TfrmMain = class(TForm)
pcMain: TPageControl;
tsBoolean: TTabSheet;
SMDBGridBoolean: TSMDBGrid;
dSrcReservat: TDataSource;
tblReservat: TTable;
tsStandardPopup: TTabSheet;
SMDBGridStandardPopup: TSMDBGrid;
tsFixed: TTabSheet;
SMDBGridFixed: TSMDBGrid;
tblReservatResNo: TAutoIncField;
tblReservatEventNo: TIntegerField;
tblReservatCustNo: TIntegerField;
tblReservatNumTickets: TIntegerField;
tblReservatAmt_Paid: TCurrencyField;
tblReservatPay_Method: TStringField;
tblReservatCard_No: TStringField;
tblReservatCard_Exp: TDateField;
tblReservatPay_Notes: TMemoField;
tblReservatPurge_Date: TDateField;
tblReservatPaid: TBooleanField;
tsMultiSelect: TTabSheet;
SMDBGridMultiSelect: TSMDBGrid;
tsGlyph: TTabSheet;
imgGlyph1: TImage;
imgGlyph2: TImage;
tsLookup: TTabSheet;
SMDBGridLookup: TSMDBGrid;
tblCustomer: TTable;
tsGraphics: TTabSheet;
tblBiolife: TTable;
dSrcBiolife: TDataSource;
tblBiolifeSpeciesNo: TFloatField;
tblBiolifeCategory: TStringField;
tblBiolifeCommon_Name: TStringField;
tblBiolifeSpeciesName: TStringField;
tblBiolifeLengthcm: TFloatField;
tblBiolifeLength_In: TFloatField;
tblBiolifeNotes: TMemoField;
tblBiolifeGraphic: TGraphicField;
SMDBGridGraphic1: TSMDBGrid;
tsNoAppendDelete: TTabSheet;
SMDBGridNoAppendDelete: TSMDBGrid;
tsColors: TTabSheet;
SMDBGridColors: TSMDBGrid;
SMDBGridGlyph: TSMDBGrid;
SMDBGridGraphic2: TSMDBGrid;
Splitter1: TSplitter;
tsSort: TTabSheet;
SMDBGridSort: TSMDBGrid;
tsEnterLikeTab: TTabSheet;
SMDBGridEnterLikeTab: TSMDBGrid;
tsMultilined: TTabSheet;
SMDBGrid1: TSMDBGrid;
procedure SMDBGridGlyphGetGlyph(Sender: TObject; var Bitmap: TBitmap);
procedure SMDBGridColorsGetCellParams(Sender: TObject; Field: TField;
AFont: TFont; var Background: TColor; Highlight: Boolean);
procedure pcMainChange(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmMain: TfrmMain;
implementation
{$R *.DFM}
procedure TfrmMain.SMDBGridGlyphGetGlyph(Sender: TObject;
var Bitmap: TBitmap);
begin
if tblReservat.FieldByName('Paid').AsBoolean then
Bitmap := imgGlyph1.Picture.Bitmap
else
Bitmap := imgGlyph2.Picture.Bitmap
end;
procedure TfrmMain.SMDBGridColorsGetCellParams(Sender: TObject;
Field: TField; AFont: TFont; var Background: TColor; Highlight: Boolean);
begin
if tblReservat.RecNo mod 2 = 0 then
Background := cl3DLight
end;
procedure TfrmMain.pcMainChange(Sender: TObject);
begin
with SMDBGridSort do
begin
DataSource.DataSet.DisableControls;
{clear the all sorted columns}
SortColumns.Clear;
with SortColumns.Add do
begin
FieldName := tblReservat.IndexFieldNames;
SortType := stAscending
end;
DataSource.DataSet.EnableControls;
end
end;
end.