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

View File

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

View File

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