mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 07:19:18 +02:00
cocoa: set initial title for groupbox, implement SetAlphaBlend for TCustomForm
git-svn-id: trunk@34623 -
This commit is contained in:
parent
108c6e003a
commit
c4f0d1a633
@ -100,12 +100,13 @@ type
|
|||||||
// class procedure CloseModal(const ACustomForm: TCustomForm); override;
|
// class procedure CloseModal(const ACustomForm: TCustomForm); override;
|
||||||
// class procedure ShowModal(const ACustomForm: TCustomForm); override;
|
// class procedure ShowModal(const ACustomForm: TCustomForm); override;
|
||||||
|
|
||||||
|
class procedure SetAlphaBlend(const ACustomForm: TCustomForm; const AlphaBlend: Boolean; const Alpha: Byte); override;
|
||||||
class procedure SetBorderIcons(const AForm: TCustomForm; const ABorderIcons: TBorderIcons); override;
|
class procedure SetBorderIcons(const AForm: TCustomForm; const ABorderIcons: TBorderIcons); override;
|
||||||
class procedure SetFormBorderStyle(const AForm: TCustomForm; const AFormBorderStyle: TFormBorderStyle); override;
|
class procedure SetFormBorderStyle(const AForm: TCustomForm; const AFormBorderStyle: TFormBorderStyle); override;
|
||||||
|
|
||||||
{need to override these }
|
{need to override these }
|
||||||
class function GetClientBounds(const AWincontrol: TWinControl; var ARect: TRect): Boolean; override;
|
class function GetClientBounds(const AWincontrol: TWinControl; var ARect: TRect): Boolean; override;
|
||||||
class function GetClientRect(const AWincontrol: TWinControl; var ARect: TRect): Boolean; override;
|
class function GetClientRect(const AWincontrol: TWinControl; var ARect: TRect): Boolean; override;
|
||||||
class procedure SetBounds(const AWinControl: TWinControl; const ALeft, ATop, AWidth, AHeight: Integer); override;
|
class procedure SetBounds(const AWinControl: TWinControl; const ALeft, ATop, AWidth, AHeight: Integer); override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -290,17 +291,26 @@ begin
|
|||||||
ns.release;
|
ns.release;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
class procedure TCocoaWSCustomForm.SetAlphaBlend(const ACustomForm: TCustomForm; const AlphaBlend: Boolean; const Alpha: Byte);
|
||||||
|
begin
|
||||||
|
if ACustomForm.HandleAllocated then
|
||||||
|
if AlphaBlend then
|
||||||
|
NSWindow(ACustomForm.Handle).setAlphaValue(Alpha / 255)
|
||||||
|
else
|
||||||
|
NSWindow(ACustomForm.Handle).setAlphaValue(1);
|
||||||
|
end;
|
||||||
|
|
||||||
class procedure TCocoaWSCustomForm.SetBorderIcons(const AForm: TCustomForm;
|
class procedure TCocoaWSCustomForm.SetBorderIcons(const AForm: TCustomForm;
|
||||||
const ABorderIcons: TBorderIcons);
|
const ABorderIcons: TBorderIcons);
|
||||||
begin
|
begin
|
||||||
if NSObject(AForm.Handle).isKindOfClass(NSWindow) then
|
if AForm.HandleAllocated then
|
||||||
SetStyleMaskFor(NSWindow(AForm.Handle), AForm.BorderStyle, ABorderIcons, csDesigning in AForm.ComponentState);
|
SetStyleMaskFor(NSWindow(AForm.Handle), AForm.BorderStyle, ABorderIcons, csDesigning in AForm.ComponentState);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class procedure TCocoaWSCustomForm.SetFormBorderStyle(const AForm: TCustomForm;
|
class procedure TCocoaWSCustomForm.SetFormBorderStyle(const AForm: TCustomForm;
|
||||||
const AFormBorderStyle: TFormBorderStyle);
|
const AFormBorderStyle: TFormBorderStyle);
|
||||||
begin
|
begin
|
||||||
if NSObject(AForm.Handle).isKindOfClass(NSWindow) then
|
if AForm.HandleAllocated then
|
||||||
SetStyleMaskFor(NSWindow(AForm.Handle), AFormBorderStyle, AForm.BorderIcons, csDesigning in AForm.ComponentState);
|
SetStyleMaskFor(NSWindow(AForm.Handle), AFormBorderStyle, AForm.BorderIcons, csDesigning in AForm.ComponentState);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ type
|
|||||||
|
|
||||||
TCocoaWSScrollBar = class(TWSScrollBar)
|
TCocoaWSScrollBar = class(TWSScrollBar)
|
||||||
published
|
published
|
||||||
class function CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): TLCLIntfHandle; override;
|
class function CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): TLCLIntfHandle; override;
|
||||||
class procedure SetParams(const AScrollBar: TCustomScrollBar); override;
|
class procedure SetParams(const AScrollBar: TCustomScrollBar); override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -794,14 +794,21 @@ end;
|
|||||||
|
|
||||||
{ TCocoaWSCustomGroupBox }
|
{ TCocoaWSCustomGroupBox }
|
||||||
|
|
||||||
class function TCocoaWSCustomGroupBox.CreateHandle(const AWinControl:TWinControl;
|
class function TCocoaWSCustomGroupBox.CreateHandle(const AWinControl: TWinControl;
|
||||||
const AParams:TCreateParams):TLCLIntfHandle;
|
const AParams: TCreateParams): TLCLIntfHandle;
|
||||||
var
|
var
|
||||||
box : TCocoaGroupBox;
|
box: TCocoaGroupBox;
|
||||||
|
cap: NSString;
|
||||||
begin
|
begin
|
||||||
box := NSView(TCocoaGroupBox.alloc).lclInitWithCreateParams(AParams);
|
box := NSView(TCocoaGroupBox.alloc).lclInitWithCreateParams(AParams);
|
||||||
box.callback:=TLCLCommonCallback.Create(box, AWinControl);
|
if Assigned(box) then
|
||||||
Result:=TLCLIntfHandle(box);
|
begin
|
||||||
|
box.callback := TLCLCommonCallback.Create(box, AWinControl);
|
||||||
|
cap := NSStringUTF8(AParams.Caption);
|
||||||
|
box.setTitle(cap);
|
||||||
|
cap.release;
|
||||||
|
end;
|
||||||
|
Result := TLCLIntfHandle(box);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TCocoaWSCustomListBox }
|
{ TCocoaWSCustomListBox }
|
||||||
@ -809,9 +816,9 @@ end;
|
|||||||
function GetListView(AWinControl: TWinControl): TCocoaListView;
|
function GetListView(AWinControl: TWinControl): TCocoaListView;
|
||||||
begin
|
begin
|
||||||
if not Assigned(AWinControl) or (AWinControl.Handle=0) then
|
if not Assigned(AWinControl) or (AWinControl.Handle=0) then
|
||||||
Result:=nil
|
Result := nil
|
||||||
else
|
else
|
||||||
Result:=TCocoaListView(TCocoaScrollView(AWinControl.Handle).documentView);
|
Result := TCocoaListView(TCocoaScrollView(AWinControl.Handle).documentView);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class function TCocoaWSCustomListBox.CreateHandle(const AWinControl:TWinControl;
|
class function TCocoaWSCustomListBox.CreateHandle(const AWinControl:TWinControl;
|
||||||
|
Loading…
Reference in New Issue
Block a user