use obj.Reference.Handle instead of obj.Handle in lcl since obj.Handle is deprecated now (for converted gdi objects)

git-svn-id: trunk@13307 -
This commit is contained in:
paul 2007-12-13 02:01:24 +00:00
parent afe2d66374
commit 2e413c5941
6 changed files with 20 additions and 20 deletions

View File

@ -8198,9 +8198,8 @@ end;
procedure TGridColumnTitle.SetFont(const AValue: TFont);
begin
if AValue.Handle<>FFont.Handle then begin
if not FFont.IsEqual(AValue) then
FFont.Assign(AValue);
end;
end;
procedure TGridColumnTitle.SetLayout(const AValue: TTextLayout);
@ -8467,9 +8466,8 @@ end;
procedure TGridColumn.SetFont(const AValue: TFont);
begin
if AValue.Handle<>FFont.Handle then begin
if not FFont.IsEqual(AValue) then
FFont.Assign(AValue);
end;
end;
procedure TGridColumn.SetLayout(const AValue: TTextLayout);

View File

@ -36,19 +36,19 @@ var
OldFont: HGDIOBJ;
LabelText: string;
begin
if (Parent=nil) or (not Parent.HandleAllocated) then exit;
if (Parent=nil) or (not Parent.HandleAllocated) then Exit;
DC := GetDC(Parent.Handle);
try
R := Rect(0,0, Width, Height);
OldFont:=SelectObject(DC, Font.Handle);
Flags:=DT_CalcRect;
R := Rect(0, 0, Width, Height);
OldFont := SelectObject(DC, Font.Reference.Handle);
Flags := DT_CalcRect;
if WordWrap then
inc(Flags, DT_WordBreak)
else
if not HasMultiLine then
inc(Flags, DT_SingleLine);
LabelText:=GetLabelText;
LabelText := GetLabelText;
DrawText(DC, PChar(LabelText), Length(LabelText), R, Flags);
SelectObject(DC, OldFont);
// add one to be able to display disabled label
@ -338,7 +338,7 @@ begin
and (CurFontHeight<=MaxFontHeight) do begin
AFont.Height:=CurFontHeight; // NOTE: some TFont do not allow any integer
//debugln('TCustomLabel.CalcFittingFontHeight A ',dbgs(MinFontHeight),'<=',dbgs(AFont.Height),'<=',dbgs(MaxFontHeight));
OldFont:=SelectObject(DC, AFont.Handle);
OldFont := SelectObject(DC, AFont.Reference.Handle);
DrawText(DC, PChar(TheText), Length(TheText), R, Flags);
SelectObject(DC, OldFont);
NeededWidth := R.Right - R.Left;

View File

@ -4343,9 +4343,9 @@ procedure TWinControl.EraseBackground(DC: HDC);
var
ARect: TRect;
begin
if DC=0 then exit;
ARect:=Rect(0,0,Width,Height);
FillRect(DC,ARect,Brush.Handle)
if DC = 0 then Exit;
ARect := Rect(0, 0, Width, Height);
FillRect(DC, ARect, Brush.Reference.Handle)
end;
{------------------------------------------------------------------------------

View File

@ -165,7 +165,7 @@ var
// fill with background color
OldBitmapHandle := SelectObject(hdcNewBitmap, NewBitmap);
Windows.FillRect(hdcNewBitmap, BitmapRect, BitBtn.Brush.Handle);
Windows.FillRect(hdcNewBitmap, BitmapRect, BitBtn.Brush.Reference.Handle);
if AState <> bsDisabled then
begin
if (srcWidth <> 0) and (srcHeight <> 0) then
@ -237,7 +237,7 @@ begin
BitBtnLayout := BitBtn.Layout;
BitBtnDC := GetDC(BitBtnHandle);
hdcNewBitmap := CreateCompatibleDC(BitBtnDC);
OldFontHandle := SelectObject(hdcNewBitmap, BitBtn.Font.Handle);
OldFontHandle := SelectObject(hdcNewBitmap, BitBtn.Font.Reference.Handle);
{$IFDEF WindowsUnicodeSupport}
if UnicodeEnabledOS then
begin

View File

@ -259,7 +259,7 @@ begin
if AWinControl.Font.IsDefault then
lhFont := GetStockObject(DEFAULT_GUI_FONT)
else
lhFont := AWinControl.Font.Handle;
lhFont := AWinControl.Font.Reference.Handle;
Windows.SendMessage(Window, WM_SETFONT, WPARAM(lhFont), 0)
end;
end;
@ -280,7 +280,7 @@ begin
if AWinControl.Font.IsDefault then
lhFont := GetStockObject(DEFAULT_GUI_FONT)
else
lhFont := AWinControl.Font.Handle;
lhFont := AWinControl.Font.Reference.Handle;
Windows.SendMessage(Buddy, WM_SETFONT, lhFont, 0);
end
else
@ -467,7 +467,7 @@ class procedure TWin32WSWinControl.SetFont(const AWinControl: TWinControl; const
begin
if not WSCheckHandleAllocated(AWinControl, 'SetFont')
then Exit;
Windows.SendMessage(AWinControl.Handle, WM_SETFONT, Windows.WParam(AFont.Handle), 1);
Windows.SendMessage(AWinControl.Handle, WM_SETFONT, Windows.WParam(AFont.Reference.Handle), 1);
end;
class procedure TWin32WSWinControl.SetText(const AWinControl: TWinControl; const AText: string);

View File

@ -80,7 +80,7 @@ type
TWSBitmapReference = object(TWSGDIObjReference)
property Handle: THandle read FRef.Handle;
end;
TWSBrushReference = object(TWSGDIObjReference)
property _lclHandle: THandle write FRef.Handle;
property Handle: THandle read FRef.Handle;
@ -105,7 +105,9 @@ type
property Handle: THandle read FRef.Handle;
end;
TWSIconReference = object(TWSReference)
property Handle: THandle read FRef.Handle;
end;
implementation