From 534c68b3fbe69e2a7146c7c0e7dbad76fe111f1b Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Sun, 16 Aug 2020 22:08:56 +0200 Subject: cleanup --- Slitherlink.lpi | 19 +++++++++---------- unit1.lfm | 36 +++++++++++++++++------------------- unit1.pas | 17 +++-------------- 3 files changed, 29 insertions(+), 43 deletions(-) diff --git a/Slitherlink.lpi b/Slitherlink.lpi index 137ad83..c00d10d 100644 --- a/Slitherlink.lpi +++ b/Slitherlink.lpi @@ -1,7 +1,7 @@ - + @@ -14,21 +14,17 @@ - - - - - - - - + + + + @@ -69,7 +65,7 @@ - + @@ -79,6 +75,9 @@ + + + diff --git a/unit1.lfm b/unit1.lfm index 61427f1..7efa0cd 100644 --- a/unit1.lfm +++ b/unit1.lfm @@ -9,9 +9,8 @@ object Form1: TForm1 OnActivate = FormActivate OnCreate = FormCreate OnDestroy = FormDestroy - OnKeyDown = FormKeyDown OnResize = FormResize - LCLVersion = '1.6.2.0' + LCLVersion = '2.0.10.0' object Button1: TButton Left = 0 Height = 25 @@ -24,7 +23,7 @@ object Form1: TForm1 end object SpinEdit1: TSpinEdit Left = 72 - Height = 21 + Height = 24 Hint = 'Breite' Top = 2 Width = 56 @@ -37,7 +36,7 @@ object Form1: TForm1 end object SpinEdit2: TSpinEdit Left = 136 - Height = 21 + Height = 24 Hint = 'Höhe' Top = 2 Width = 56 @@ -50,7 +49,7 @@ object Form1: TForm1 end object SpinEdit3: TSpinEdit Left = 200 - Height = 21 + Height = 24 Hint = 'Höhe' Top = 2 Width = 56 @@ -62,7 +61,7 @@ object Form1: TForm1 Value = 16 end object ProgressBar1: TProgressBar - Left = 584 + Left = 612 Height = 21 Top = 2 Width = 100 @@ -70,7 +69,7 @@ object Form1: TForm1 TabOrder = 4 end object Button2: TButton - Left = 340 + Left = 368 Height = 25 Top = 0 Width = 48 @@ -80,7 +79,7 @@ object Form1: TForm1 TabOrder = 5 end object Button3: TButton - Left = 392 + Left = 420 Height = 25 Top = 0 Width = 48 @@ -90,7 +89,7 @@ object Form1: TForm1 TabOrder = 6 end object Button4: TButton - Left = 444 + Left = 472 Height = 25 Top = 0 Width = 67 @@ -100,7 +99,7 @@ object Form1: TForm1 TabOrder = 7 end object Button5: TButton - Left = 515 + Left = 543 Height = 25 Top = 0 Width = 64 @@ -113,29 +112,28 @@ object Form1: TForm1 Left = 260 Height = 21 Top = 4 - Width = 100 + Width = 103 Caption = 'geschlossen' OnChange = CheckBox1Change - OnKeyDown = FormKeyDown PopupMenu = PopupMenu1 TabOrder = 9 end object Timer1: TTimer Interval = 100 OnTimer = Timer1Timer - top = 32 + Top = 32 end object OpenDialog1: TOpenDialog - left = 32 - top = 32 + Left = 32 + Top = 32 end object SaveDialog1: TSaveDialog - left = 64 - top = 32 + Left = 64 + Top = 32 end object PopupMenu1: TPopupMenu - left = 96 - top = 32 + Left = 96 + Top = 32 object MenuItem1: TMenuItem Caption = 'füllen' OnClick = MenuItem1Click diff --git a/unit1.pas b/unit1.pas index 72ec28c..766babc 100644 --- a/unit1.pas +++ b/unit1.pas @@ -42,7 +42,6 @@ type procedure FormActivate(Sender: TObject); procedure FormCreate(Sender: TObject); procedure FormDestroy(Sender: TObject); - procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); procedure FormResize(Sender: TObject); procedure MenuItem1Click(Sender: TObject); procedure MenuItem2Click(Sender: TObject); @@ -92,7 +91,9 @@ begin if Button1.Caption = 'erzeugen' then Feld.Erzeugen(Progressbar1) else Feld.LoadFromFeld(GenThread.Feld); Feld.Zeichnen; - if Assigned(GenThread) then GenThread.destroy; + if Assigned(GenThread) then + GenThread.Free; + GenThread:=nil; GenThread:=TGenerierungsThread.create(Spinedit1.Value,Spinedit2.Value,Progressbar1,nil,Checkbox1.Checked); Button1.Caption:='noch eins'; Button1.Enabled:=false; @@ -145,18 +146,6 @@ begin if assigned(GenThread) then GenThread.destroy; end; -procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState - ); -var C: Char; -begin - if Key in [ord('c'),ord('x'),ord('y')] then - begin - C:=char(Key); - Feld.OnKeyPress(Sender,C); - Key:=0; - end; -end; - procedure TForm1.FormResize(Sender: TObject); begin Progressbar1.Width:=Form1.ClientWidth-Progressbar1.Left; -- cgit v1.2.3-54-g00ecf