mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-06 03:46:01 +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
|
class function TMyWidgetMediator.CreateMediator(TheOwner, aForm: TComponent
|
||||||
): TDesignerMediator;
|
): TDesignerMediator;
|
||||||
|
var
|
||||||
|
Mediator: TMyWidgetMediator;
|
||||||
begin
|
begin
|
||||||
Result:=inherited CreateMediator(TheOwner,aForm);
|
Result:=inherited CreateMediator(TheOwner,aForm);
|
||||||
TMyWidgetMediator(Result).FMyForm:=aForm as TMyForm;
|
Mediator:=TMyWidgetMediator(Result);
|
||||||
|
Mediator.FMyForm:=aForm as TMyForm;
|
||||||
|
Mediator.FMyForm.Designer:=Mediator;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class function TMyWidgetMediator.FormClass: TComponentClass;
|
class function TMyWidgetMediator.FormClass: TComponentClass;
|
||||||
@ -165,9 +169,9 @@ procedure TMyWidgetMediator.Paint;
|
|||||||
// inner frame
|
// inner frame
|
||||||
if AWidget.AcceptChildsAtDesignTime then begin
|
if AWidget.AcceptChildsAtDesignTime then begin
|
||||||
Pen.Color:=clMaroon;
|
Pen.Color:=clMaroon;
|
||||||
Rectangle(AWidget.BorderLeft,AWidget.BorderTop,
|
Rectangle(AWidget.BorderLeft-1,AWidget.BorderTop-1,
|
||||||
AWidget.Width-AWidget.BorderRight,
|
AWidget.Width-AWidget.BorderRight+1,
|
||||||
AWidget.Height-AWidget.BorderBottom);
|
AWidget.Height-AWidget.BorderBottom+1);
|
||||||
end;
|
end;
|
||||||
// caption
|
// caption
|
||||||
TextOut(5,2,AWidget.Caption);
|
TextOut(5,2,AWidget.Caption);
|
||||||
|
@ -292,6 +292,7 @@ end;
|
|||||||
|
|
||||||
procedure TMyWidget.InvalidateRect(ARect: TRect; Erase: boolean);
|
procedure TMyWidget.InvalidateRect(ARect: TRect; Erase: boolean);
|
||||||
begin
|
begin
|
||||||
|
//writeln('TMyWidget.InvalidateRect ',Name,' ',ARect.Left,',',ARect.Top);
|
||||||
ARect.Left:=Max(0,ARect.Left);
|
ARect.Left:=Max(0,ARect.Left);
|
||||||
ARect.Top:=Max(0,ARect.Top);
|
ARect.Top:=Max(0,ARect.Top);
|
||||||
ARect.Right:=Min(Width,ARect.Right);
|
ARect.Right:=Min(Width,ARect.Right);
|
||||||
|
Loading…
Reference in New Issue
Block a user