mapu.pas
上传用户:hylc_2004
上传日期:2014-01-23
资源大小:46800k
文件大小:3k
源码类别:

Delphi控件源码

开发平台:

Delphi

  1. unit mapu;
  2. interface
  3. uses
  4.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  5.   fcButton, fcImgBtn, ExtCtrls, fcImageForm, StdCtrls, Mask, Db, DBTables,
  6.   fcShapeBtn, fcImage, DBCtrls, fcLabel, fcClearPanel, fcButtonGroup;
  7. type
  8.   TMapForm = class(TForm)
  9.     fcImageBtn1: TfcImageBtn;
  10.     fcImageBtn2: TfcImageBtn;
  11.     fcImageBtn7: TfcImageBtn;
  12.     fcImageBtn8: TfcImageBtn;
  13.     fcImageBtn9: TfcImageBtn;
  14.     fcImageBtn10: TfcImageBtn;
  15.     DataSource1: TDataSource;
  16.     Table1: TTable;
  17.     Table1CountyName: TStringField;
  18.     Table1SalesTaxRate: TCurrencyField;
  19.     Table1NumberOfCities: TIntegerField;
  20.     Table1EstimatedPopulation: TIntegerField;
  21.     Table1EstimatedHousingUnits: TIntegerField;
  22.     Table1CountyCode: TStringField;
  23.     Panel1: TPanel;
  24.     Label1: TLabel;
  25.     DBEdit1: TDBEdit;
  26.     Label2: TLabel;
  27.     DBEdit2: TDBEdit;
  28.     Label4: TLabel;
  29.     DBEdit4: TDBEdit;
  30.     Label6: TLabel;
  31.     DBEdit6: TDBEdit;
  32.     Table1CityTownList: TMemoField;
  33.     Image2: TImage;
  34.     fcLabel4: TfcLabel;
  35.     fcImageBtn3: TfcImageBtn;
  36.     fcImageBtn4: TfcImageBtn;
  37.     fcImageBtn5: TfcImageBtn;
  38.     fcImageBtn6: TfcImageBtn;
  39.     DBMemo1: TDBMemo;
  40.     Label3: TLabel;
  41.     procedure fcShapeBtn1Click(Sender: TObject);
  42.     procedure fcImageBtn6Click(Sender: TObject);
  43.     procedure FormShow(Sender: TObject);
  44.   private
  45.     { Private declarations }
  46.   public
  47.     { Public declarations }
  48.   end;
  49. var
  50.   MapForm: TMapForm;
  51. implementation
  52. {$R *.DFM}
  53. procedure TMapForm.fcShapeBtn1Click(Sender: TObject);
  54. begin
  55.   Close;
  56. end;
  57. procedure TMapForm.fcImageBtn6Click(Sender: TObject);
  58. begin
  59.   fcLabel4.Caption := (Sender as TFcImageBtn).Caption;
  60.   case (Sender as TfcImageBtn).Tag of
  61.     1:Table1.Locate('CountyName','Marin',[loPartialKey]);
  62.     2:Table1.Locate('CountyName','Sonoma',[loPartialKey]);
  63.     3:Table1.Locate('CountyName','Napa',[loPartialKey]);
  64.     4:Table1.Locate('CountyName','Solano',[loPartialKey]);
  65.     5:Table1.Locate('CountyName','Contra Costa',[loPartialKey]);
  66.     6:Table1.Locate('CountyName','Alameda',[loPartialKey]);
  67.     7:Table1.Locate('CountyName','Santa Clara',[loPartialKey]);
  68.     8:Table1.Locate('CountyName','Santa Cruz',[loPartialKey]);
  69.     9:Table1.Locate('CountyName','San Mateo',[loPartialKey]);
  70.     10:Table1.Locate('CountyName','San Francisco',[loPartialKey]);
  71.   end;
  72. end;
  73. procedure TMapForm.FormShow(Sender: TObject);
  74. begin
  75.   // Don't Show Background if 256 or less Colors
  76.   if ((GetDeviceCaps(Image2.Canvas.Handle, BITSPIXEL) *
  77.        GetDeviceCaps(Image2.Canvas.Handle, PLANES)) <= 8) then
  78.      Image2.Visible := False;
  79. end;
  80. end.