Xt_ghjms.~pas
上传用户:szruida
上传日期:2007-06-01
资源大小:6518k
文件大小:2k
源码类别:

Delphi控件源码

开发平台:

Delphi

  1. unit Xt_ghjms;
  2. interface
  3. uses
  4.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  5.   Dialogs, TFlatButtonUnit, TFlatSpeedButtonUnit, StdCtrls, DBCtrls,
  6.   ExtCtrls, TFlatPanelUnit, ExtDlgs;
  7. type
  8.   TXt_ghjm = class(TForm)
  9.     FlatPanel1: TFlatPanel;
  10.     FlatPanel2: TFlatPanel;
  11.     Label1: TLabel;
  12.     Edit1: TEdit;
  13.     FlatSpeedButton1: TFlatSpeedButton;
  14.     FlatButton1: TFlatButton;
  15.     FlatSpeedButton2: TFlatSpeedButton;
  16.     FlatSpeedButton3: TFlatSpeedButton;
  17.     OpenPictureDialog1: TOpenPictureDialog;
  18.     Panel1: TPanel;
  19.     Image1: TImage;
  20.     procedure FormClose(Sender: TObject; var Action: TCloseAction);
  21.     procedure FlatSpeedButton2Click(Sender: TObject);
  22.     procedure FlatSpeedButton1Click(Sender: TObject);
  23.     procedure Edit1Change(Sender: TObject);
  24.     procedure FlatSpeedButton3Click(Sender: TObject);
  25.     procedure FlatButton1Click(Sender: TObject);
  26.     procedure Image1DblClick(Sender: TObject);
  27.   private
  28.     { Private declarations }
  29.   public
  30.     { Public declarations }
  31.   end;
  32. var
  33.   Xt_ghjm: TXt_ghjm;
  34. implementation
  35. uses mainfrms;
  36. {$R *.dfm}
  37. procedure TXt_ghjm.FormClose(Sender: TObject; var Action: TCloseAction);
  38. begin
  39.   action:=cafree;
  40. end;
  41. procedure TXt_ghjm.FlatSpeedButton2Click(Sender: TObject);
  42. begin
  43.   mainfrm.Image1.Align:=alclient;
  44.   mainfrm.Image1.Picture:=image1.Picture;
  45.   close;
  46. //  mainfrm.Image1.Picture.LoadFromFile(edit1.Text);
  47. end;
  48. procedure TXt_ghjm.FlatSpeedButton1Click(Sender: TObject);
  49. begin
  50.   if OpenPictureDialog1.execute then
  51.    begin
  52.      image1.picture.LoadFromFile(OpenPictureDialog1.filename);
  53.    end;
  54. end;
  55. procedure TXt_ghjm.Edit1Change(Sender: TObject);
  56. begin
  57.      if OpenPictureDialog1.execute then
  58.      begin
  59.   // dbimage1.picture.LoadFromFile(OpenPictureDialog1.filename);
  60.   // edit1.Text:=OpenPictureDialog1.FileName;
  61.    end;
  62. end;
  63. procedure TXt_ghjm.FlatSpeedButton3Click(Sender: TObject);
  64. begin
  65.   close;
  66. end;
  67. procedure TXt_ghjm.FlatButton1Click(Sender: TObject);
  68. begin
  69.   mainfrm.Image1.Align:=alclient;
  70.   mainfrm.Image1.Visible:=false;
  71. end;
  72. procedure TXt_ghjm.Image1DblClick(Sender: TObject);
  73. begin
  74.   if OpenPictureDialog1.execute then
  75.    begin
  76.      image1.picture.LoadFromFile(OpenPictureDialog1.filename);
  77.    end;
  78. end;
  79. end.