Recent

Author Topic: [Solved] Fullscreen event?  (Read 927 times)

Espectr0

  • Full Member
  • ***
  • Posts: 217
[Solved] Fullscreen event?
« on: March 29, 2023, 09:40:52 pm »
Hola,

In my App, how can I detect when it enters or leaves fullscreen mode?


Thanks!
« Last Edit: April 15, 2023, 12:42:21 pm by Espectr0 »

KodeZwerg

  • Hero Member
  • *****
  • Posts: 2007
  • Fifty shades of code.
    • Delphi & FreePascal
Re: Fullscreen event?
« Reply #1 on: March 29, 2023, 10:33:58 pm »
By setting for form a OnWindowStateChange Handler and determine current status?
Code: Pascal  [Select][+][-]
  1. procedure TForm1.FormWindowStateChange(Sender: TObject);
  2. begin
  3.   if WindowState in [wsFullScreen,wsMaximized] then
  4.     Self.Caption := 'Full'
  5.     else
  6.     Self.Caption := 'Basic';
  7. end;
« Last Edit: Tomorrow at 31:76:97 xm by KodeZwerg »

KodeZwerg

  • Hero Member
  • *****
  • Posts: 2007
  • Fifty shades of code.
    • Delphi & FreePascal
Re: Fullscreen event?
« Reply #2 on: March 31, 2023, 12:17:27 am »
Is it solved?
« Last Edit: Tomorrow at 31:76:97 xm by KodeZwerg »

Espectr0

  • Full Member
  • ***
  • Posts: 217
Re: Fullscreen event?
« Reply #3 on: March 31, 2023, 11:12:47 am »
@KodeZwerg Sorry for the delay, I haven't tried it yet, this weekend I'll try and comment here...
but just in case I ask you: is the "windowstatechange" event executed before the switch or after (talking of macos)?

Thanks

KodeZwerg

  • Hero Member
  • *****
  • Posts: 2007
  • Fifty shades of code.
    • Delphi & FreePascal
Re: Fullscreen event?
« Reply #4 on: March 31, 2023, 01:45:21 pm »
It is triggered when the WindowState change. (eg: User maximize the form)
I have to admit that I do not use MacOS, I am on Windows, but the way about "how-to" should be the same.
« Last Edit: Tomorrow at 31:76:97 xm by KodeZwerg »

 

TinyPortal © 2005-2018