mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-07-23 21:26:14 +02:00
IDEIntf: designer mediator: fixed example invalidaterect
git-svn-id: trunk@21645 -
This commit is contained in:
parent
de3d5fa347
commit
4b39cfdce1
@ -90,9 +90,13 @@ end;
|
||||
|
||||
class function TMyWidgetMediator.CreateMediator(TheOwner, aForm: TComponent
|
||||
): TDesignerMediator;
|
||||
var
|
||||
Mediator: TMyWidgetMediator;
|
||||
begin
|
||||
Result:=inherited CreateMediator(TheOwner,aForm);
|
||||
TMyWidgetMediator(Result).FMyForm:=aForm as TMyForm;
|
||||
Mediator:=TMyWidgetMediator(Result);
|
||||
Mediator.FMyForm:=aForm as TMyForm;
|
||||
Mediator.FMyForm.Designer:=Mediator;
|
||||
end;
|
||||
|
||||
class function TMyWidgetMediator.FormClass: TComponentClass;
|
||||
@ -165,9 +169,9 @@ procedure TMyWidgetMediator.Paint;
|
||||
// inner frame
|
||||
if AWidget.AcceptChildsAtDesignTime then begin
|
||||
Pen.Color:=clMaroon;
|
||||
Rectangle(AWidget.BorderLeft,AWidget.BorderTop,
|
||||
AWidget.Width-AWidget.BorderRight,
|
||||
AWidget.Height-AWidget.BorderBottom);
|
||||
Rectangle(AWidget.BorderLeft-1,AWidget.BorderTop-1,
|
||||
AWidget.Width-AWidget.BorderRight+1,
|
||||
AWidget.Height-AWidget.BorderBottom+1);
|
||||
end;
|
||||
// caption
|
||||
TextOut(5,2,AWidget.Caption);
|
||||
|
@ -292,6 +292,7 @@ end;
|
||||
|
||||
procedure TMyWidget.InvalidateRect(ARect: TRect; Erase: boolean);
|
||||
begin
|
||||
//writeln('TMyWidget.InvalidateRect ',Name,' ',ARect.Left,',',ARect.Top);
|
||||
ARect.Left:=Max(0,ARect.Left);
|
||||
ARect.Top:=Max(0,ARect.Top);
|
||||
ARect.Right:=Min(Width,ARect.Right);
|
||||
|
Loading…
Reference in New Issue
Block a user