mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-10 10:36:20 +02:00
Carbon intf: invalidate menu bar
git-svn-id: trunk@12915 -
This commit is contained in:
parent
e8f4f6e240
commit
ce971206a0
@ -169,7 +169,6 @@ type
|
||||
function GetSize: TPoint; override;
|
||||
public
|
||||
constructor Create(AOwner: TCarbonWidget);
|
||||
procedure Reset; override;
|
||||
end;
|
||||
|
||||
{ TCarbonBitmapContext }
|
||||
@ -1465,30 +1464,6 @@ begin
|
||||
Reset;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Method: TCarbonControlContext.Reset
|
||||
|
||||
Resets the control context properties to defaults (pen, brush, ...)
|
||||
------------------------------------------------------------------------------}
|
||||
procedure TCarbonControlContext.Reset;
|
||||
begin
|
||||
inherited Reset;
|
||||
|
||||
if CGContext <> nil then
|
||||
if CurrentBrush <> nil then // apply control background color
|
||||
begin
|
||||
if FOwner.LCLObject.Color <> clBtnFace then
|
||||
CurrentBrush.SetColor(FOwner.LCLObject.Color, True)
|
||||
else
|
||||
CurrentBrush.SetColor(FOwner.LCLObject.Color, False);
|
||||
|
||||
CurrentBrush.Apply(Self, False);
|
||||
end;
|
||||
|
||||
if FOwner.LCLObject.Font.Handle <> 0 then
|
||||
CurrentFont := TCarbonFont(FOwner.LCLObject.Font.Handle);
|
||||
end;
|
||||
|
||||
{ TCarbonBitmapContext }
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
|
@ -334,6 +334,8 @@ begin
|
||||
FRoot := True;
|
||||
|
||||
OSError(SetRootMenu(Menu), Self, 'AttachToMenuBar', 'SetRootMenu');
|
||||
|
||||
InvalMenuBar;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
|
@ -743,10 +743,23 @@ end;
|
||||
procedure TCarbonCustomControl.Draw;
|
||||
begin
|
||||
if Context <> nil then
|
||||
with (Context as TCarbonDeviceContext) do
|
||||
begin
|
||||
(Context as TCarbonDeviceContext).TextFractional := TextFractional;
|
||||
if LCLObject.Color <> clBtnFace then
|
||||
with (Context as TCarbonDeviceContext) do FillRect(GetClipRect, CurrentBrush);
|
||||
if CGContext <> nil then
|
||||
begin
|
||||
if CurrentBrush <> nil then // apply control background color
|
||||
begin
|
||||
if LCLObject.Color <> clBtnFace then
|
||||
CurrentBrush.SetColor(LCLObject.Color, True)
|
||||
else
|
||||
CurrentBrush.SetColor(LCLObject.Color, False);
|
||||
|
||||
CurrentBrush.Apply(Context, False);
|
||||
if LCLObject.Color <> clBtnFace then FillRect(GetClipRect, CurrentBrush);
|
||||
end;
|
||||
end;
|
||||
|
||||
TextFractional := TextFractional;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user