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 DoSetApplicationHint(AHintStr: String): Boolean; virtual;
function DoHint: Boolean; virtual; function DoHint: Boolean; virtual;
procedure DrawPanel(Panel: TStatusPanel; const Rect: TRect); dynamic;
procedure LMDrawItem(var Message: TLMDrawItems); message LM_DRAWITEM; procedure LMDrawItem(var Message: TLMDrawItems); message LM_DRAWITEM;
public public
constructor Create(TheOwner: TComponent); override; constructor Create(TheOwner: TComponent); override;

View File

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