mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-26 15:53:52 +02:00
Fixes bug #20195: Removes LCLIntf.Frame in favor of a cross-platform implementation for TCanvas.Frame
git-svn-id: trunk@34379 -
This commit is contained in:
parent
21e55aba98
commit
89dd7c918b
@ -1015,10 +1015,15 @@ end;
|
||||
Drawing the border of a rectangle with the current pen
|
||||
------------------------------------------------------------------------------}
|
||||
procedure TCanvas.Frame(const ARect: TRect);
|
||||
var
|
||||
OldBrushStyle: TFPBrushStyle;
|
||||
begin
|
||||
Changing;
|
||||
RequiredState([csHandleValid, csPenValid]);
|
||||
LCLIntf.Frame(FHandle, ARect);
|
||||
OldBrushStyle := Brush.Style;
|
||||
Brush.Style := bsClear;
|
||||
Rectangle(ARect);
|
||||
Brush.Style := OldBrushStyle;
|
||||
Changed;
|
||||
end;
|
||||
|
||||
|
@ -344,11 +344,6 @@ begin
|
||||
Result:=false;
|
||||
end;
|
||||
|
||||
function TWidgetSet.Frame(DC: HDC; const ARect: TRect): integer;
|
||||
begin
|
||||
Result:= 0;
|
||||
end;
|
||||
|
||||
function TWidgetSet.Frame3d(DC: HDC; var ARect: TRect;
|
||||
const FrameWidth: integer; const Style: TGraphicsBevelCut): boolean;
|
||||
begin
|
||||
|
@ -200,11 +200,6 @@ begin
|
||||
Result := WidgetSet.FontIsMonoSpace(Font);
|
||||
end;
|
||||
|
||||
function Frame(DC: HDC; const ARect: TRect): Integer;
|
||||
begin
|
||||
Result := WidgetSet.Frame(DC, ARect);
|
||||
end;
|
||||
|
||||
function Frame3d(DC: HDC; var ARect: TRect; const FrameWidth: integer;
|
||||
const Style: TGraphicsBevelCut): boolean;
|
||||
begin
|
||||
|
@ -70,7 +70,6 @@ function ExtUTF8Out(DC: HDC; X, Y: Integer; Options: Longint; Rect: PRect; Str:
|
||||
|
||||
function FontCanUTF8(Font: HFont): boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF} deprecated;
|
||||
function FontIsMonoSpace(Font: HFont): boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||
function Frame(DC: HDC; const ARect: TRect): Integer; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||
function Frame3d(DC: HDC; var ARect: TRect; const FrameWidth : integer; const Style : TGraphicsBevelCut): Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||
|
||||
function GetAcceleratorString(const AVKey: Byte; const AShiftState: TShiftState): String; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||
|
@ -1024,29 +1024,6 @@ begin
|
||||
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Method: Frame
|
||||
Params: DC - Handle to device context
|
||||
ARect - Bounding box of frame
|
||||
Returns: > 0 if the function succeeds
|
||||
|
||||
Draws a border in Carbon native style
|
||||
------------------------------------------------------------------------------}
|
||||
function TCarbonWidgetSet.Frame(DC: HDC; const ARect: TRect): Integer;
|
||||
begin
|
||||
Result := 0;
|
||||
|
||||
{$IFDEF VerboseWinAPI}
|
||||
DebugLn('TCarbonWidgetSet.Frame DC: ' + DbgS(DC) + ' R: ' + DbgS(ARect));
|
||||
{$ENDIF}
|
||||
|
||||
if not CheckDC(DC, 'Frame') then Exit;
|
||||
|
||||
TCarbonDeviceContext(DC).Frame(ARect.Left, ARect.Top, ARect.Right, ARect.Bottom);
|
||||
|
||||
Result := 1;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Method: Frame3D
|
||||
Params: DC - Handle to device context
|
||||
|
@ -91,7 +91,6 @@ function FloodFill(DC: HDC; X, Y: Integer;
|
||||
Color: TGraphicsColor;
|
||||
FillStyle: TGraphicsFillStyle;
|
||||
Brush: HBRUSH): Boolean; override;
|
||||
function Frame(DC: HDC; const ARect: TRect): Integer; override;
|
||||
function Frame3d(DC: HDC; var ARect: TRect; const FrameWidth : integer; const Style : TBevelCut): Boolean; override;
|
||||
function FrameRect(DC: HDC; const ARect: TRect; hBr: HBRUSH): Integer; override;
|
||||
|
||||
|
@ -476,20 +476,6 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TCocoaWidgetSet.Frame(DC: HDC; const ARect: TRect): Integer;
|
||||
var
|
||||
ctx: TCocoaContext;
|
||||
begin
|
||||
ctx := CheckDC(DC);
|
||||
if Assigned(ctx) then
|
||||
begin
|
||||
ctx.Frame(ARect);
|
||||
Result := 1;
|
||||
end
|
||||
else
|
||||
Result := 0;
|
||||
end;
|
||||
|
||||
function TCocoaWidgetSet.Frame3d(DC: HDC; var ARect: TRect;
|
||||
const FrameWidth: integer; const Style: TBevelCut): Boolean;
|
||||
var
|
||||
|
@ -85,7 +85,6 @@ function ExtTextOut(DC: HDC; X, Y: Integer; Options: Longint; Rect: PRect; Str:
|
||||
|
||||
function FillRect(DC: HDC; const Rect: TRect; Brush: HBRUSH): Boolean; override;
|
||||
function FillRgn(DC: HDC; RegionHnd: HRGN; hbr: HBRUSH): Bool; override;
|
||||
function Frame(DC: HDC; const ARect: TRect): Integer; override;
|
||||
function Frame3d(DC: HDC; var ARect: TRect; const FrameWidth : integer; const Style : TBevelCut): Boolean; override;
|
||||
function FrameRect(DC: HDC; const ARect: TRect; hBr: HBRUSH): Integer; override;
|
||||
|
||||
|
@ -93,8 +93,7 @@ function ExtSelectClipRGN(dc: hdc; rgn : hrgn; Mode : Longint) : Integer; overr
|
||||
function ExtTextOut(DC: HDC; X, Y: Integer; Options: Longint; Rect: PRect; Str: PChar; Count: Longint; Dx: PInteger): Boolean; override;
|
||||
|
||||
function FillRect(DC: HDC; const Rect: TRect; Brush: HBRUSH): Boolean; override;
|
||||
(*function FillRgn(DC: HDC; RegionHnd: HRGN; hbr: HBRUSH): Bool; override;
|
||||
function Frame(DC: HDC; const ARect: TRect): Integer; override;*)
|
||||
//function FillRgn(DC: HDC; RegionHnd: HRGN; hbr: HBRUSH): Bool; override;
|
||||
function Frame3d(DC: HDC; var ARect: TRect; const FrameWidth : integer; const Style : TBevelCut): Boolean; override;
|
||||
(*function FrameRect(DC: HDC; const ARect: TRect; hBr: HBRUSH): Integer; override;
|
||||
|
||||
|
@ -85,7 +85,6 @@ function ExtTextOut(DC: HDC; X, Y: Integer; Options: Longint; Rect: PRect; Str:
|
||||
function ExtSelectClipRGN(dc: hdc; rgn : hrgn; Mode : Longint) : Integer; override;
|
||||
|
||||
function FillRect(DC: HDC; const Rect: TRect; Brush: HBRUSH): Boolean; override;
|
||||
function Frame(DC: HDC; const ARect: TRect): Integer; override;
|
||||
function Frame3d(DC: HDC; var ARect: TRect; const FrameWidth : integer; const Style : TBevelCut): Boolean; override;
|
||||
function FrameRect(DC: HDC; const ARect: TRect; hBr: HBRUSH): Integer; override;
|
||||
|
||||
|
@ -3716,41 +3716,6 @@ begin
|
||||
//DebugLn(Format('trace:< [TGtk2WidgetSet.FillRect] DC:0x%x; Rect: ((%d,%d)(%d,%d)); brush: %x', [Integer(DC), Rect.left, rect.top, rect.right, rect.bottom, brush]));
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
function Frame(DC: HDC; const ARect: TRect): Integer; override;
|
||||
|
||||
Draws the border of a rectangle.
|
||||
------------------------------------------------------------------------------}
|
||||
function TGtk2WidgetSet.Frame(DC: HDC; const ARect: TRect): Integer;
|
||||
var
|
||||
DCOrigin: TPoint;
|
||||
DevCtx: TGtkDeviceContext absolute DC;
|
||||
R: TRect;
|
||||
begin
|
||||
Result:=0;
|
||||
if not IsValidDC(DC) then exit;
|
||||
|
||||
// Draw outline
|
||||
DevCtx.SelectPenProps;
|
||||
if not (dcfPenSelected in DevCtx.Flags) then Exit;
|
||||
|
||||
Result := 1;
|
||||
if DevCtx.IsNullPen then Exit;
|
||||
|
||||
if DevCtx.HasTransf then
|
||||
begin
|
||||
R :=DevCtx.TransfRectIndirect(ARect);
|
||||
DevCtx.TransfNormalize(R.Left, R.Right);
|
||||
DevCtx.TransfNormalize(R.Top, R.Bottom);
|
||||
end else
|
||||
R := ARect;
|
||||
|
||||
DCOrigin := DevCtx.Offset;
|
||||
gdk_draw_rectangle(DevCtx.Drawable, DevCtx.GC, 0,
|
||||
R.Left+DCOrigin.X, R.Top+DCOrigin.Y,
|
||||
R.Right-R.Left, R.Bottom-R.Top);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Function: Frame3d
|
||||
Params: -
|
||||
|
@ -98,7 +98,6 @@ function ExtSelectClipRGN(dc: hdc; rgn : hrgn; Mode : Longint) : Integer; overr
|
||||
function ExtTextOut(DC: HDC; X, Y: Integer; Options: Longint; Rect: PRect; Str: PChar; Count: Longint; Dx: PInteger): Boolean; override;
|
||||
|
||||
function FillRect(DC: HDC; const Rect: TRect; Brush: HBRUSH): Boolean; override;
|
||||
function Frame(DC: HDC; const ARect: TRect): Integer; override;
|
||||
function Frame3d(DC: HDC; var ARect: TRect; const FrameWidth : integer; const Style : TBevelCut): Boolean; override;
|
||||
function FrameRect(DC: HDC; const ARect: TRect; hBr: HBRUSH): Integer; override;
|
||||
|
||||
|
@ -2294,25 +2294,6 @@ begin
|
||||
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Function: Frame
|
||||
Params: none
|
||||
Returns: Nothing
|
||||
|
||||
Draws the border of a rectangle.
|
||||
------------------------------------------------------------------------------}
|
||||
function TQtWidgetSet.Frame(DC: HDC; const ARect: TRect): Integer;
|
||||
begin
|
||||
Result := 0;
|
||||
|
||||
if not IsValidDC(DC) then Exit;
|
||||
|
||||
TQtDeviceContext(DC).drawRect(ARect.Left, ARect.Top,
|
||||
ARect.Right - ARect.Left, ARect.Bottom - ARect.Top);
|
||||
|
||||
Result := 1;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Function: Frame3D
|
||||
Params: none
|
||||
|
@ -88,7 +88,6 @@ function ExtTextOut(DC: HDC; X, Y: Integer; Options: Longint; Rect: PRect; Str:
|
||||
|
||||
function FillRect(DC: HDC; const Rect: TRect; Brush: HBRUSH): Boolean; override;
|
||||
function FillRgn(DC: HDC; RegionHnd: HRGN; hbr: HBRUSH): Bool; override;
|
||||
function Frame(DC: HDC; const ARect: TRect): Integer; override;
|
||||
function Frame3d(DC: HDC; var ARect: TRect; const FrameWidth : integer; const Style : TBevelCut): Boolean; override;
|
||||
function FrameRect(DC: HDC; const ARect: TRect; hBr: HBRUSH): Integer; override;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user