lcl: add delphi compatible DrawPanel method to the TStatusBar to allow component descendants override it without hooking to event

git-svn-id: trunk@18319 -
This commit is contained in:
paul 2009-01-17 10:56:29 +00:00
parent f71d89b2b3
commit 545a71f8fa
2 changed files with 12 additions and 6 deletions

View File

@ -155,6 +155,7 @@ type
function DoSetApplicationHint(AHintStr: String): Boolean; virtual;
function DoHint: Boolean; virtual;
procedure DrawPanel(Panel: TStatusPanel; const Rect: TRect); dynamic;
procedure LMDrawItem(var Message: TLMDrawItems); message LM_DRAWITEM;
public
constructor Create(TheOwner: TComponent); override;

View File

@ -86,14 +86,19 @@ begin
OnHint(Self);
end;
procedure TStatusBar.LMDrawItem(var Message: TLMDrawItems);
procedure TStatusBar.DrawPanel(Panel: TStatusPanel; const Rect: TRect);
begin
if Assigned(FOnDrawPanel) then
with Message.DrawItemStruct^ do
begin
Canvas.Handle := _hDC;
FOnDrawPanel(Self, Panels[itemID], rcItem);
end;
FOnDrawPanel(Self, Panel, Rect);
end;
procedure TStatusBar.LMDrawItem(var Message: TLMDrawItems);
begin
with Message.DrawItemStruct^ do
begin
Canvas.Handle := _hDC;
DrawPanel(Panels[itemID], rcItem);
end;
end;
procedure TStatusBar.BoundsChanged;