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.   Xt_ghjm:=nil;
  41. end;
  42. procedure TXt_ghjm.FlatSpeedButton2Click(Sender: TObject);
  43. begin
  44.   mainfrm.Image1.Align:=alclient;
  45.   mainfrm.Image1.Picture:=image1.Picture;
  46.   close;
  47. //  mainfrm.Image1.Picture.LoadFromFile(edit1.Text);
  48. end;
  49. procedure TXt_ghjm.FlatSpeedButton1Click(Sender: TObject);
  50. begin
  51.   if OpenPictureDialog1.execute then
  52.    begin
  53.      image1.picture.LoadFromFile(OpenPictureDialog1.filename);
  54.    end;
  55. end;
  56. procedure TXt_ghjm.Edit1Change(Sender: TObject);
  57. begin
  58.      if OpenPictureDialog1.execute then
  59.      begin
  60.   // dbimage1.picture.LoadFromFile(OpenPictureDialog1.filename);
  61.   // edit1.Text:=OpenPictureDialog1.FileName;
  62.    end;
  63. end;
  64. procedure TXt_ghjm.FlatSpeedButton3Click(Sender: TObject);
  65. begin
  66.   close;
  67. end;
  68. procedure TXt_ghjm.FlatButton1Click(Sender: TObject);
  69. begin
  70.   mainfrm.Image1.Align:=alclient;
  71.   mainfrm.Image1.Visible:=false;
  72. end;
  73. procedure TXt_ghjm.Image1DblClick(Sender: TObject);
  74. begin
  75.   if OpenPictureDialog1.execute then
  76.    begin
  77.      image1.picture.LoadFromFile(OpenPictureDialog1.filename);
  78.    end;
  79. end;
  80. end.