Carbon intf: invalidate menu bar

git-svn-id: trunk@12915 -
This commit is contained in:
tombo 2007-11-18 14:34:24 +00:00
parent e8f4f6e240
commit ce971206a0
3 changed files with 18 additions and 28 deletions

View File

@ -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 }
{------------------------------------------------------------------------------

View File

@ -334,6 +334,8 @@ begin
FRoot := True;
OSError(SetRootMenu(Menu), Self, 'AttachToMenuBar', 'SetRootMenu');
InvalMenuBar;
end;
{------------------------------------------------------------------------------

View File

@ -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;