home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 21 / IOPROG_21.ISO / SOFT / DFMTOOLS.ZIP / Delphi_DFM / Source / fViewDFM.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1998-11-09  |  1.4 KB  |  60 lines

  1. unit fViewDFM;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   fMDIChild, cShape, Buttons, StdCtrls, ExtCtrls, cdcDelphiTools;
  8.  
  9. type
  10.   TFormViewDFM = class(TChild)
  11.     Panel1: TPanel;
  12.     Memo: TMemo;
  13.     Label3: TLabel;
  14.     SBSelect: TSpeedButton;
  15.     SBExplorer: TSpeedButton;
  16.     OpenDialog: TOpenDialog;
  17.     TranslateDFM: TTranslateDFM;
  18.     procedure SBSelectClick(Sender: TObject);
  19.     procedure SBExplorerClick(Sender: TObject);
  20.   private
  21.     { Private declarations }
  22.   public
  23.     { Public declarations }
  24.   end;
  25.  
  26. implementation
  27.  
  28. Uses FileCtrl;
  29.  
  30. {$R *.DFM}
  31.  
  32. //-----------------------------------------------------------------------------}
  33. procedure TFormViewDFM.SBExplorerClick(Sender: TObject);
  34. begin
  35.   inherited;
  36.   beep
  37. end;
  38.  
  39. //-----------------------------------------------------------------------------}
  40. procedure TFormViewDFM.SBSelectClick(Sender: TObject);
  41. Var s,ss:String;
  42. begin
  43. inherited;
  44. with OpenDialog do begin
  45.     DefaultExt:='dfm';
  46.     Filter:='Delphi Res File (*.dfm)|*.dfm';
  47.     Title:='Delphi Res File :';
  48.     InitialDir:=ExtractFilePath('c:\');
  49.     FileName:=ExtractFileName('Test.dfm');
  50.     If not Execute then Exit;
  51.     s:=FileName;
  52.     Self.Caption:=ExtractFileName(s);
  53.     end;
  54.  
  55. if TTranslateDFM.TranslateDFM(s,ss) then
  56.     Self.Memo.Text:=ss
  57. end;
  58.  
  59. end.
  60.