mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-19 07:59:32 +02:00
carbon: using WindowGroups instead of WindowClass for switching between FormStyles
git-svn-id: trunk@25744 -
This commit is contained in:
parent
a02a463fb7
commit
f3c468d0f5
@ -1128,6 +1128,7 @@ procedure TCarbonWindow.CreateWindow(const AParams: TCreateParams);
|
||||
var
|
||||
AWindow: WindowRef;
|
||||
NewWindowClass: Integer;
|
||||
GroupClass: Integer;
|
||||
MinSize, MaxSize: HISize;
|
||||
Attributes: WindowAttributes;
|
||||
begin
|
||||
@ -1135,7 +1136,7 @@ begin
|
||||
|
||||
if csDesigning in LCLObject.ComponentState then
|
||||
begin
|
||||
NewWindowClass := kDocumentWindowClass;
|
||||
GroupClass := kDocumentWindowClass;
|
||||
Attributes := kWindowInWindowMenuAttribute or
|
||||
GetBorderWindowAttrs(bsSizeable, [biMaximize, biMinimize, biSystemMenu]);
|
||||
end
|
||||
@ -1144,24 +1145,27 @@ begin
|
||||
Attributes := 0;
|
||||
case (LCLObject as TCustomForm).FormStyle of
|
||||
fsStayOnTop, fsSplash:
|
||||
NewWindowClass := kFloatingWindowClass;
|
||||
GroupClass := kFloatingWindowClass;
|
||||
fsSystemStayOnTop:
|
||||
GroupClass := kUtilityWindowClass;
|
||||
else
|
||||
NewWindowClass := kDocumentWindowClass;
|
||||
GroupClass := kDocumentWindowClass;
|
||||
Attributes := kWindowInWindowMenuAttribute;
|
||||
end;
|
||||
Attributes := Attributes or
|
||||
GetBorderWindowAttrs((LCLObject as TCustomForm).BorderStyle,
|
||||
(LCLObject as TCustomForm).BorderIcons);
|
||||
case NewWindowClass of
|
||||
{case NewWindowClass of
|
||||
kMovableModalWindowClass:
|
||||
Attributes := Attributes and (not kWindowInWindowMenuAttribute);
|
||||
kFloatingWindowClass:
|
||||
Attributes := Attributes and (not (kWindowInWindowMenuAttribute or kWindowCollapseBoxAttribute));
|
||||
end;
|
||||
end;}
|
||||
end;
|
||||
|
||||
//DebugLn('TCarbonWindow.CreateWidget ' + DbgS(ParamsToCarbonRect(AParams)));
|
||||
|
||||
NewWindowClass:=kDocumentWindowClass;
|
||||
if OSError(
|
||||
CreateNewWindow(NewWindowClass,
|
||||
Attributes or kWindowCompositingAttribute or kWindowStandardHandlerAttribute
|
||||
@ -1177,6 +1181,10 @@ begin
|
||||
|
||||
fWindowRef := AWindow;
|
||||
|
||||
OSError(
|
||||
SetWindowGroup(fWindowRef, GetWindowGroupOfClass(GroupClass)), Self,
|
||||
SCreateWidget, 'SetWindowGroup');
|
||||
|
||||
// creating wrapped views
|
||||
if OSError(
|
||||
HIViewFindByID(HIViewGetRoot(fWindowRef), kHIViewWindowContentID, fWinContent),
|
||||
|
@ -234,18 +234,19 @@ end;
|
||||
class procedure TCarbonWSCustomForm.SetFormStyle(const ACustomForm:TCustomForm;
|
||||
const ANewFormStyle,AOldFormStyle:TFormStyle);
|
||||
var
|
||||
newClass : WindowClass;
|
||||
newClass : WindowClass;
|
||||
begin
|
||||
if not CheckHandle(ACustomForm, Self, 'SetFormStyle') then Exit;
|
||||
|
||||
case ANewFormStyle of
|
||||
fsStayOnTop: newClass:=kFloatingWindowClass;
|
||||
fsSplash: newClass:=kUtilityWindowClass;
|
||||
fsStayOnTop, fsSplash: newClass:=kFloatingWindowClass;
|
||||
fsSystemStayOnTop: newClass:=kUtilityWindowClass;
|
||||
else
|
||||
newClass:=kDocumentWindowClass;
|
||||
end;
|
||||
HIWindowChangeClass( TCarbonWindow(ACustomForm.Handle).Window, newClass);
|
||||
OSError(
|
||||
SetWindowGroup( TCarbonWindow(ACustomForm.Handle).Window, GetWindowGroupOfClass(newClass)),
|
||||
Self, 'SetFormStyle', 'SetWindowGroup');
|
||||
end;
|
||||
|
||||
{ TCarbonWSHintWindow }
|
||||
|
Loading…
Reference in New Issue
Block a user