source/uxx21main.pas | 6 +++--- source/uxx21presentation.lfm | 1 + source/uxx21presentation.pas | 21 ++++++++++++++++++--- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/source/uxx21main.pas b/source/uxx21main.pas index 6aa77b2..4d723a9 100644 --- a/source/uxx21main.pas +++ b/source/uxx21main.pas @@ -237,7 +237,7 @@ begin FSlides[i] := slide; end; {$IFDEF MSWINDOWS} - FAppDataFolder := IncludeTrailingPathDelimiter(GetWindowsSpecialDir(CSIDL_APPDATA))+'xx21\'; + FAppDataFolder := IncludeTrailingPathDelimiter(IncludeTrailingPathDelimiter(GetWindowsSpecialDir(CSIDL_APPDATA))+'xx21'); {$ELSE} FAppDataFolder := GetAppConfigDir(false); {$ENDIF} @@ -897,7 +897,7 @@ var begin OnActivate := Nil; // Nur einmal durchlaufen fnparm := ''; - apptmpdir := FAppDataFolder+'tmp\'; + apptmpdir := IncludeTrailingPathDelimiter(FAppDataFolder+'tmp'); sl := TStringList.Create; try FindFolders(apptmpdir,sl); @@ -922,7 +922,7 @@ begin end; RandSeed := GetTickCount; rnd := Random(65536); - FAppUserDataFolder := apptmpdir+UpperCase(Format('SESSION_%4.4x',[rnd]))+'\'; + FAppUserDataFolder := IncludeTrailingPathDelimiter(apptmpdir+UpperCase(Format('SESSION_%4.4x',[rnd]))); if not DirectoryExists(FAppUserDataFolder) then ForceDirectories(FAppUserDataFolder); end diff --git a/source/uxx21presentation.lfm b/source/uxx21presentation.lfm index 47dc599..994b05e 100644 --- a/source/uxx21presentation.lfm +++ b/source/uxx21presentation.lfm @@ -8,6 +8,7 @@ object FormPresentation: TFormPresentation ClientWidth = 800 OnActivate = FormActivate OnClose = FormClose + OnCreate = FormCreate OnKeyDown = FormKeyDown LCLVersion = '2.0.6.0' object pnlPicture: TPanel diff --git a/source/uxx21presentation.pas b/source/uxx21presentation.pas index 54d8427..68edc1d 100644 --- a/source/uxx21presentation.pas +++ b/source/uxx21presentation.pas @@ -5,7 +5,7 @@ unit uxx21Presentation; interface uses - Classes, SysUtils, LCLTYpe, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls; + Classes, SysUtils, LCLType, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls; type TPresentationWindowSize = (pwsUser, // Fenstergröße @@ -29,6 +29,7 @@ type pnlPicture: TPanel; procedure FormActivate(Sender: TObject); procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); + procedure FormCreate(Sender: TObject); procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); procedure pnlPictureResize(Sender: TObject); private @@ -215,6 +216,9 @@ var rect : TRect; w, h : Integer; l, t : Integer; + {$IFDEF LINUX} + tmpfrm: TForm; + {$ENDIF} begin if BorderStyle <> bsNone then begin @@ -254,6 +258,13 @@ begin else BoundsRect := FOriginalBounds; end; + //refresh window after border style change + {$IFDEF LINUX} + tmpfrm := TForm.Create(nil); + Parent := tmpfrm; + Parent := nil; + tmpfrm.Free; + {$ENDIF} end; procedure TFormPresentation.FormActivate(Sender: TObject); @@ -269,19 +280,23 @@ begin FFormCloseEvent(Self); end; +procedure TFormPresentation.FormCreate(Sender: TObject); +begin + KeyPreview := True; //capture keys +end; + procedure TFormPresentation.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); begin if Key = VK_F11 then begin SwitchFullScreen; - Key := 0; + //there is no need to reset “Key” in OnKeyDown, only in OnKeyPress end else if Key = VK_F5 then begin if Assigned(FF5DownEvent) then FF5DownEvent(Self); - Key := 0; end; end;