From 6d93bd06bbfdae1e22b27ffb4c908c113974e987 Mon Sep 17 00:00:00 2001 From: zeljko Date: Mon, 4 Jul 2011 10:28:06 +0000 Subject: [PATCH] Carbon: implemented wsFullScreen. issue #19522 git-svn-id: trunk@31554 - --- lcl/interfaces/carbon/carbonprivatewindow.inc | 25 ++++++++++++++++--- lcl/interfaces/carbon/carbonwsforms.pp | 1 + 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/lcl/interfaces/carbon/carbonprivatewindow.inc b/lcl/interfaces/carbon/carbonprivatewindow.inc index edfaf087c0..4c17c7eddd 100644 --- a/lcl/interfaces/carbon/carbonprivatewindow.inc +++ b/lcl/interfaces/carbon/carbonprivatewindow.inc @@ -1846,6 +1846,9 @@ function TCarbonWindow.Show(AShow: Integer): Boolean; var P: MacOSAll.Point; Maximized: Boolean; + FullScreen: Boolean; + UIMode: SystemUIMode; + UIOptions: SystemUIOptions; const SName = 'Show'; SCollapse = 'CollapseWindow'; @@ -1857,7 +1860,7 @@ begin //DebugLn('TCarbonWindow.Show ' + DbgS(AShow)); case AShow of - SW_SHOWNORMAL, SW_SHOWMAXIMIZED: + SW_SHOWNORMAL, SW_SHOWMAXIMIZED, SW_SHOWFULLSCREEN: begin if IsWindowCollapsed(fWindowRef) then if OSError(CollapseWindow(fWindowRef, False), @@ -1865,22 +1868,36 @@ begin // for checking if any change is necessary Maximized := IsWindowInStandardState(fWindowRef, nil, nil); + GetSystemUIMode(@UIMode, @UIOptions); + FullScreen := (UIMode = kuiModeAllHidden) and (UIOptions = kUIOptionAutoShowMenuBar); - if AShow = SW_SHOWNORMAL then + if FullScreen then + begin + SetSystemUIMode(kuiModeNormal, 0); + if OSError(ZoomWindowIdeal(fWindowRef, inZoomIn, P), + Self, SName, SZoomIdeal, 'inZoomIn') then Exit; + exit(True); + end; + + if (AShow = SW_SHOWNORMAL) then begin if Maximized then if OSError(ZoomWindowIdeal(fWindowRef, inZoomIn, P), Self, SName, SZoomIdeal, 'inZoomIn') then Exit; end else - if not Maximized then + begin + if AShow = SW_SHOWFULLSCREEN then + SetSystemUIMode(kuiModeAllHidden, kUIOptionAutoShowMenuBar); + + if not Maximized or (AShow = SW_SHOWFULLSCREEN) then begin P.v := $3FFF; P.h := $3FFF; if OSError(ZoomWindowIdeal(fWindowRef, inZoomOut, P), Self, SName, SZoomIdeal, 'inZoomOut') then Exit; end; - + end; SetForeground; end; SW_MINIMIZE: diff --git a/lcl/interfaces/carbon/carbonwsforms.pp b/lcl/interfaces/carbon/carbonwsforms.pp index 0b1c381a6e..2354ea8565 100644 --- a/lcl/interfaces/carbon/carbonwsforms.pp +++ b/lcl/interfaces/carbon/carbonwsforms.pp @@ -214,6 +214,7 @@ begin if AWinControl.HandleObjectShouldBeVisible then begin case TCustomForm(AWinControl).WindowState of + wsFullScreen: nCmdShow := SW_SHOWFULLSCREEN; wsMaximized: nCmdShow := SW_SHOWMAXIMIZED; wsMinimized: nCmdShow := SW_SHOWMINIMIZED; else