From 22a0a9ed48095c4da42d3d20b5d80ffe16aab30b Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 26 Nov 2015 21:01:16 +0100 Subject: Esc versteckt jetzt das Fenster --- unit1.lfm | 1 + unit1.pas | 8 ++++++ wetter.lps | 94 ++++++++++++++++++++++++++++++++------------------------------ 3 files changed, 57 insertions(+), 46 deletions(-) diff --git a/unit1.lfm b/unit1.lfm index 0f071c4..efb3921 100644 --- a/unit1.lfm +++ b/unit1.lfm @@ -10,6 +10,7 @@ object Form1: TForm1 OnClose = FormClose OnCreate = FormCreate OnDestroy = FormDestroy + OnKeyDown = FormKeyDown OnShow = FormShow LCLVersion = '1.4.4.0' object Image1: TImage diff --git a/unit1.pas b/unit1.pas index 66d910e..64f5f3c 100644 --- a/unit1.pas +++ b/unit1.pas @@ -21,6 +21,7 @@ type procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); procedure FormCreate(Sender: TObject); procedure FormDestroy(Sender: TObject); + procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); procedure FormShow(Sender: TObject); procedure TrayIcon1Click(Sender: TObject); procedure TrayIcon1DblClick(Sender: TObject); @@ -193,6 +194,13 @@ begin wetter.free; end; +procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState + ); +begin + if key=27 then + form1.visible:=false; +end; + procedure TForm1.FormShow(Sender: TObject); begin form1.top:= screen.monitors[0].top +screen.monitors[0].height-form1.height-24; diff --git a/wetter.lps b/wetter.lps index ca74f5d..01cb752 100644 --- a/wetter.lps +++ b/wetter.lps @@ -19,8 +19,8 @@ - - + + @@ -34,7 +34,7 @@ - + @@ -43,7 +43,7 @@ - + @@ -58,7 +58,7 @@ - + @@ -73,7 +73,7 @@ - + @@ -132,130 +132,132 @@ - - + + + + - + - + - + - + - + - - + + - - + + - - + + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - - + + - - + - - + + - + + - + - - + + -- cgit v1.2.3-70-g09d2