IDE: designer: fixed painting of designer items for TControl paint messages

git-svn-id: trunk@39624 -
This commit is contained in:
mattias 2012-12-22 21:44:08 +00:00
parent d77eab95a9
commit 73d6a41ca5
3 changed files with 10 additions and 10 deletions

View File

@ -28,15 +28,12 @@
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<RequiredPackages Count="1">
<Item1>
<PackageName Value="AnchorDocking"/>
<MinVersion Valid="True"/>
<DefaultFilename Value="../anchordocking.lpk"/>
</Item1>
<Item2>
<PackageName Value="LCL"/>
</Item2>
</RequiredPackages>
<Units Count="3">
<Unit0>

View File

@ -1493,15 +1493,15 @@ begin
if TheMessage.DC <> 0 then begin
Include(FFlags,dfNeedPainting);
if Sender is TWinControl then
DDC.SetDC(Form, TWinControl(Sender), TheMessage.DC)
if Sender is TControl then
DDC.SetDC(Form, TControl(Sender), TheMessage.DC)
else
if Sender <> nil then
DDC.SetDC(Form, Sender.Parent, TheMessage.DC)
else
DDC.SetDC(Form, nil, TheMessage.DC);
{$IFDEF VerboseDesignerDraw}
writeln('TDesigner.PaintControl D ',Sender.Name,':',Sender.ClassName,
writeln('TDesigner.PaintControl D ',dbgsname(Sender),
' DC=',DbgS(DDC.DC,8),
{' FormOrigin=',DDC.FormOrigin.X,',',DDC.FormOrigin.Y,}
' DCOrigin=',DDC.DCOrigin.X,',',DDC.DCOrigin.Y,

View File

@ -45,11 +45,13 @@ type
);
TDesignerDCFlags = set of TDesignerDCFlag;
{ TDesignerDeviceContext }
TDesignerDeviceContext = class
private
FCanvas: TCanvas;
FDC: HDC;
FDCControl: TWinControl;
FDCControl: TControl;
FDCOrigin: TPoint; // DC origin on desktop
FFlags: TDesignerDCFlags;
FFormClientOrigin: TPoint; // Form client origin on desktop
@ -65,7 +67,7 @@ type
public
constructor Create;
destructor Destroy; override;
procedure SetDC(AForm: TCustomForm; ADCControl: TWinControl; ADC: HDC);
procedure SetDC(AForm: TCustomForm; ADCControl: TControl; ADC: HDC);
procedure Clear;
procedure BeginPainting;
procedure EndPainting;
@ -446,7 +448,8 @@ begin
inherited Destroy;
end;
procedure TDesignerDeviceContext.SetDC(AForm: TCustomForm; ADCControl: TWinControl; ADC: HDC);
procedure TDesignerDeviceContext.SetDC(AForm: TCustomForm;
ADCControl: TControl; ADC: HDC);
begin
Clear;
FDC := ADC;