Browse Source

Initial release on http://luaforge.net

Jean-Francois Goulet 19 years ago
parent
commit
e1179ad8fa
2 changed files with 93 additions and 0 deletions
  1. 49 0
      LuaEdit/GUID.dfm
  2. 44 0
      LuaEdit/GUID.pas

+ 49 - 0
LuaEdit/GUID.dfm

@@ -0,0 +1,49 @@
+object frmGUID: TfrmGUID
+  Left = 407
+  Top = 298
+  BorderStyle = bsSingle
+  Caption = 'Create GUID'
+  ClientHeight = 72
+  ClientWidth = 416
+  Color = clBtnFace
+  Font.Charset = DEFAULT_CHARSET
+  Font.Color = clWindowText
+  Font.Height = -11
+  Font.Name = 'MS Sans Serif'
+  Font.Style = []
+  FormStyle = fsStayOnTop
+  OldCreateOrder = False
+  Position = poOwnerFormCenter
+  OnShow = FormShow
+  PixelsPerInch = 96
+  TextHeight = 13
+  object txtGUID: TEdit
+    Left = 8
+    Top = 8
+    Width = 401
+    Height = 21
+    Color = cl3DLight
+    ReadOnly = True
+    TabOrder = 0
+  end
+  object btnClose: TButton
+    Left = 336
+    Top = 40
+    Width = 75
+    Height = 25
+    Cancel = True
+    Caption = '&Close'
+    ModalResult = 1
+    TabOrder = 1
+  end
+  object btnGenerate: TButton
+    Left = 256
+    Top = 40
+    Width = 75
+    Height = 25
+    Caption = '&Generate'
+    Default = True
+    TabOrder = 2
+    OnClick = btnGenerateClick
+  end
+end

+ 44 - 0
LuaEdit/GUID.pas

@@ -0,0 +1,44 @@
+unit GUID;
+
+interface
+
+uses
+  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
+  Dialogs, StdCtrls, ActiveX;
+
+type
+  TfrmGUID = class(TForm)
+    txtGUID: TEdit;
+    btnClose: TButton;
+    btnGenerate: TButton;
+    procedure btnGenerateClick(Sender: TObject);
+    procedure FormShow(Sender: TObject);
+  private
+    { Private declarations }
+  public
+    { Public declarations }
+  end;
+
+var
+  frmGUID: TfrmGUID;
+
+implementation
+
+{$R *.dfm}
+
+procedure TfrmGUID.btnGenerateClick(Sender: TObject);
+var
+  pGUID: TGUID;
+begin
+  CoCreateGUID(pGUID);
+  txtGUID.Text := GUIDToString(pGUID);
+  txtGUID.SetFocus;
+end;
+
+procedure TfrmGUID.FormShow(Sender: TObject);
+begin
+  btnGenerate.Click;
+  txtGUID.SetFocus;
+end;
+
+end.