-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathunit4.pas
109 lines (90 loc) · 3.07 KB
/
unit4.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
(******************************************************************************)
(* *)
(* Author : Uwe Schächterle (Corpsman) *)
(* *)
(* This file is part of Parken *)
(* *)
(* See the file license.md, located under: *)
(* https://github.com/PascalCorpsman/Software_Licenses/blob/main/license.md *)
(* for details about the license. *)
(* *)
(* It is not allowed to change or remove this text from any *)
(* source file of the project. *)
(* *)
(******************************************************************************)
Unit Unit4;
{$MODE objfpc}{$H+}
Interface
Uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
StdCtrls, uparken;
Type
{ TForm4 }
TForm4 = Class(TForm)
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
ColorDialog1: TColorDialog;
Edit1: TEdit;
OpenDialog1: TOpenDialog;
RadioGroup1: TRadioGroup;
SaveDialog1: TSaveDialog;
Procedure Button1Click(Sender: TObject);
Procedure Button2Click(Sender: TObject);
Procedure Button3Click(Sender: TObject);
Procedure Button4Click(Sender: TObject);
Procedure FormClose(Sender: TObject; Var CloseAction: TCloseAction);
Procedure FormCreate(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
End;
Var
Form4: TForm4;
m, m1: TPoint;
Implementation
{$R *.lfm}
Uses unit1, lazutf8;
{ TForm4 }
Procedure TForm4.FormClose(Sender: TObject; Var CloseAction: TCloseAction);
Begin
gamestate := gswait;
End;
Procedure TForm4.Button1Click(Sender: TObject);
Begin
ColorDialog1.Color := button1.font.color;
If ColorDialog1.execute Then Begin
button1.font.color := ColorDialog1.Color;
End;
End;
Procedure TForm4.Button2Click(Sender: TObject);
Begin
close;
End;
Procedure TForm4.Button3Click(Sender: TObject);
Begin
If OpenDialog1.Execute Then Begin
EditArea.LoadFromFile(systoutf8(OpenDialog1.FileName));
End;
End;
Procedure TForm4.Button4Click(Sender: TObject);
Begin
If SaveDialog1.execute Then Begin
editarea.SafeToFile(systoutf8(SaveDialog1.FileName));
End;
End;
Procedure TForm4.FormCreate(Sender: TObject);
Begin
caption := 'Map properties';
OpenDialog1.InitialDir := ExtractFilePath(paramstrutf8(0));
saveDialog1.InitialDir := ExtractFilePath(paramstrutf8(0));
edit1.text := '50';
// Größe des Fensters Festlegen
Constraints.MinHeight := height;
Constraints.MaxHeight := height;
Constraints.MinWidth := Width;
Constraints.MaxWidth := Width;
End;
End.