mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 14:59:30 +02:00
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:
parent
f71d89b2b3
commit
545a71f8fa
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user