-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnewtiersfrm.pas
64 lines (50 loc) · 1.37 KB
/
newtiersfrm.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
unit NewTiersFrm;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
ExtCtrls;
type
{ TNewTiersForm }
TNewTiersForm = class(TForm)
ledtNumTiers: TLabeledEdit;
cbPopType: TComboBox;
lblType: TLabel;
btnOK: TButton;
btnAnnuler: TButton;
procedure FormKeyPress(Sender: TObject; var Key: char);
private
{ Déclarations privées }
public
{ Déclarations publiques }
class function GetNewTiers(var AProprio: TComponent; var ATypeTiers: String;
var ANumTiers: string): Word; virtual;
end;
implementation
{$R *.lfm}
{ TNewTiersForm }
procedure TNewTiersForm.FormKeyPress(Sender: TObject; var Key: char);
begin
if Key = #13 then btnOK.Click;
end;
{ LAzarus/Delphi : remplacé "var AProprio: TForm;" par"var AProprio: TComponent;" sino "invalid typecast" }
class function TNewTiersForm.GetNewTiers(
var AProprio: TComponent;
var ATypeTiers: String;
var ANumTiers: string): Word;
var
NewTiersForm: TNewTiersForm;
begin
NewTiersForm := TNewTiersForm.Create(AProprio);
try
Result := NewTiersForm.ShowModal;
if Result = mrOK then
begin
ATypeTiers := NewTiersForm.cbPopType.Text;
ANumTiers := NewTiersForm.ledtNumTiers.Text;
end;
finally
NewTiersForm.Free;
end;
end;
end.