Ignore:
Timestamp:
Nov 29, 2023, 2:35:44 PM (12 months ago)
Author:
chronos
Message:
  • Modified: HighDpi branch updated to trunk version.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/highdpi/Packages/DpiControls/UDpiControls.pas

    r412 r463  
    175175    function GetShowHint: Boolean;
    176176    function GetVisible: Boolean;
     177    function GetWindowProc: TWndMethod;
    177178    function IsAnchorsStored: Boolean;
    178179    procedure SetAlign(AValue: TAlign);
     
    207208    procedure MouseLeaveHandler(Sender: TObject); virtual;
    208209    procedure MouseEnterHandler(Sender: TObject); virtual;
     210    procedure SetWindowProc(AValue: TWndMethod);
    209211  protected
    210212    procedure DoBorderSpacingChange(Sender: TObject; InnerSpaceChanged: Boolean); virtual;
     
    255257    property Anchors: TAnchors read GetAnchors write SetAnchors stored IsAnchorsStored default [akLeft, akTop];
    256258    property BorderSpacing: TDpiControlBorderSpacing read FBorderSpacing write SetBorderSpacing;
     259    property WindowProc: TWndMethod read GetWindowProc write SetWindowProc;
    257260  published
    258261    property AutoSize: Boolean read GetAutoSize write SetAutoSize default False;
     
    373376    destructor Destroy; override;
    374377    function GetNativePen: TPen;
     378    procedure Assign(Source: TDpiPen);
    375379    property NativePen: TPen read FNativePen write SetNativePen;
    376380  published
     
    395399    constructor Create;
    396400    destructor Destroy; override;
     401    procedure Assign(Source: TDpiBrush);
    397402    property NativeBrush: TBrush read FNativeBrush write SetNativeBrush;
    398403  published
     
    422427    procedure SetNativeCanvas(AValue: TCanvas);
    423428  protected
     429    procedure DoLine(X1, Y1, X2, Y2: Integer); virtual;
     430    procedure DoTextOut(X, Y: Integer; Text: string); virtual;
     431    procedure DoRectangle(const Bounds: TRect); virtual;
     432    procedure DoRectangleFill(const Bounds: TRect); virtual;
     433    procedure DoPolygon(const Points: array of TPoint); virtual;
     434    procedure CreateHandle; virtual;
     435    procedure DoEllipse(const Bounds: TRect); virtual;
     436    procedure DoMoveTo(X, Y: Integer); virtual;
     437    procedure DoLineTo(X, Y: Integer); virtual;
     438    procedure DoPolyline(const Points: array of TPoint); virtual;
     439    procedure DoPolyBezier(Points: PPoint; NumPts: Integer;
     440      Filled: Boolean = False; Continuous: Boolean = False); virtual;
    424441    procedure SetHeight(AValue: Integer); virtual;
    425442    procedure SetWidth(AValue: Integer); virtual;
     
    429446  public
    430447    property NativeCanvas: TCanvas read FNativeCanvas write SetNativeCanvas;
     448    procedure RoundRect(const Rect: TRect; RX, RY: Integer);
     449    procedure RoundRect(X1, Y1, X2, Y2: Integer; RX,RY: Integer); overload; virtual;
     450    procedure Polygon(const Points: array of TPoint; Winding: Boolean;
     451      StartIndex: Integer = 0; NumPts: Integer = -1);
     452    procedure Polygon(Points: PPoint; NumPts: Integer; Winding: Boolean = False); virtual;
     453    procedure Polygon(const Points: array of TPoint);
     454    procedure PolyBezier(const Points: array of TPoint;
     455      Filled: Boolean = False; Continuous: boolean = True);
     456    procedure PolyBezier(Points: PPoint; NumPts: Integer;
     457      Filled: Boolean = False; Continuous: Boolean = True); virtual;
     458    procedure Polyline(const Points: array of TPoint);
     459    procedure Polyline(Points: PPoint; NumPts: Integer); virtual;
     460    procedure Ellipse(x1, y1, x2, y2: Integer); virtual;
     461    procedure Ellipse(const ARect: TRect); virtual;
     462    procedure StretchDraw(const DestRect: TRect; SrcGraphic: TGraphic); virtual;
     463    procedure Pie(EllipseX1, EllipseY1, EllipseX2, EllipseY2,
     464      StartX, StartY, EndX, EndY: Integer); virtual;
    431465    procedure StretchDraw(const DestRect: TRect; SrcGraphic: TDpiGraphic); virtual;
    432466    procedure FrameRect(Rect: TRect);
    433467    procedure Rectangle(X1, Y1, X2, Y2: Integer); overload;
    434468    procedure Rectangle(const ARect: TRect); overload;
    435     function TextWidth(Text: string): Integer;
    436     function TextHeight(Text: string): Integer;
    437     function TextExtent(Text: string): TSize;
     469    function TextWidth(const Text: string): Integer;
     470    function TextHeight(const Text: string): Integer;
     471    function TextExtent(const Text: string): TSize; virtual;
    438472    procedure TextOut(X, Y: Integer; const Text: string); virtual;
    439473    procedure TextRect(ARect: TRect; X, Y: Integer; Text: string);
    440474    procedure MoveTo(X, Y: Integer);
    441475    procedure LineTo(X, Y: Integer);
     476    procedure Line(const p1, p2: TPoint);
    442477    procedure FillRect(const ARect: TRect); virtual;
    443478    procedure FillRect(X1, Y1, X2, Y2: Integer);
     
    598633    function GetRestoredTop: Integer;
    599634    function GetRestoredWidth: Integer;
     635    function GetShowInTaskbar: TShowInTaskbar;
    600636    function GetWindowState: TWindowState;
    601637    procedure SetBorderIcons(AValue: TBorderIcons);
     
    615651    procedure FormMessageHandler(var TheMessage: TLMessage);
    616652    procedure SetPosition(AValue: TPosition);
     653    procedure SetShowInTaskBar(AValue: TShowInTaskbar);
    617654    procedure SetWindowState(AValue: TWindowState);
    618655    procedure ActivateHandler(Sender: TObject);
     
    667704    property OnMouseDown;
    668705    property OnMouseMove;
     706    property ShowInTaskBar: TShowInTaskbar read GetShowInTaskbar write SetShowInTaskBar
     707                                        default stDefault;
    669708  end;
    670709
     
    873912  end;
    874913
     914  TDpiCustomListView = class(TDpiWinControl)
     915
     916  end;
     917
     918  TDpiLVCustomDrawItemEvent = procedure(Sender: TDpiCustomListView; Item: TListItem;
     919    State: TCustomDrawState; var DefaultDraw: Boolean) of object;
     920
    875921  { TDpiListView }
    876922
    877   TDpiListView = class(TDpiWinControl)
     923  TDpiListView = class(TDpiCustomListView)
    878924  private
     925    FOnCustomDrawItem: TDpiLVCustomDrawItemEvent;
    879926    NativeListView: TListView;
     927    function GetCanvas: TCanvas;
    880928    function GetColumns: TListColumns;
    881929    function GetItems: TListItems;
     930    function GetOnChange: TLVChangeEvent;
     931    function GetOnColumnClick: TLVColumnClickEvent;
     932    function GetOnCustomDrawItem: TDpiLVCustomDrawItemEvent;
     933    function GetProperty(AIndex: Integer): Boolean;
     934    function GetViewStyle: TViewStyle;
    882935    procedure SetColumns(AValue: TListColumns);
    883936    procedure SetItems(AValue: TListItems);
     937    procedure SetOnChange(AValue: TLVChangeEvent);
     938    procedure SetOnColumnClick(AValue: TLVColumnClickEvent);
     939    procedure SetOnCustomDrawItem(AValue: TDpiLVCustomDrawItemEvent);
     940    procedure SetProperty(AIndex: Integer; AValue: Boolean);
     941    procedure SetViewStyle(AValue: TViewStyle);
     942    procedure DoCustomDrawItem(Sender: TCustomListView; Item: TListItem;
     943      State: TCustomDrawState; var DefaultDraw: Boolean);
    884944  public
     945    function GetItemAt(x,y: integer): TListItem;
    885946    function GetNativeListView: TListView;
    886947    constructor Create(TheOwner: TComponent); override;
     
    888949    property Columns: TListColumns read GetColumns write SetColumns;
    889950    property Items: TListItems read GetItems write SetItems;
     951    property Canvas: TCanvas read GetCanvas;
     952    property Checkboxes: Boolean index Ord(lvpCheckboxes) read GetProperty write SetProperty default False;
    890953  published
     954    property OnColumnClick: TLVColumnClickEvent read GetOnColumnClick
     955      write SetOnColumnClick;
     956    property OnCustomDrawItem: TDpiLVCustomDrawItemEvent read GetOnCustomDrawItem
     957      write SetOnCustomDrawItem;
     958    property ViewStyle: TViewStyle read GetViewStyle write SetViewStyle default vsList;
     959    property OnChange: TLVChangeEvent read GetOnChange write SetOnChange;
    891960  end;
    892961
     
    11001169    NativeStringGrid: TStringGrid;
    11011170    function DefaultRowHeightIsStored: Boolean;
     1171    function GetCells(ACol, ARow: Integer): string;
     1172    function GetColCount: Integer;
     1173    function GetColumns: TGridColumns;
    11021174    function GetDefRowHeight: Integer;
     1175    function GetEditor: TWinControl;
     1176    function GetFixedCols: Integer;
     1177    function GetFixedRows: Integer;
     1178    function GetOptions: TGridOptions;
     1179    function GetRowCount: Integer;
     1180    function GetScrollBars: TScrollStyle;
     1181    function GetSelection: TGridRect;
     1182    function IsColumnsStored: Boolean;
     1183    procedure SetCells(ACol, ARow: Integer; AValue: string);
     1184    procedure SetColCount(AValue: Integer);
     1185    procedure SetColumns(AValue: TGridColumns);
    11031186    procedure SetDefRowHeight(AValue: Integer);
     1187    procedure SetEditor(AValue: TWinControl);
     1188    procedure SetFixedCols(AValue: Integer);
     1189    procedure SetFixedRows(AValue: Integer);
     1190    procedure SetOptions(AValue: TGridOptions);
     1191    procedure SetRowCount(AValue: Integer);
     1192    procedure SetScrollBars(AValue: TScrollStyle);
     1193    procedure SetSelection(AValue: TGridRect);
    11041194  public
    11051195    function GetNativeStringGrid: TStringGrid;
     1196    function CellRect(ACol, ARow: Integer): TRect;
    11061197    constructor Create(TheOwner: TComponent); override;
    11071198    destructor Destroy; override;
     1199    property Selection: TGridRect read GetSelection write SetSelection;
     1200    property Cells[ACol, ARow: Integer]: string read GetCells write SetCells;
    11081201  published
    11091202    property DefaultRowHeight: Integer read GetDefRowHeight write SetDefRowHeight stored DefaultRowHeightIsStored;
     1203    property ScrollBars: TScrollStyle read GetScrollBars write SetScrollBars default ssAutoBoth;
     1204    property FixedCols: Integer read GetFixedCols write SetFixedCols default 1;
     1205    property FixedRows: Integer read GetFixedRows write SetFixedRows default 1;
     1206    property RowCount: Integer read GetRowCount write SetRowCount default 5;
     1207    property ColCount: Integer read GetColCount write SetColCount default 5;
     1208    property Options: TGridOptions read GetOptions write SetOptions default DefaultGridOptions;
     1209    property Columns: TGridColumns read GetColumns write SetColumns stored IsColumnsStored;
     1210    property Editor: TWinControl read GetEditor write SetEditor;
    11101211  end;
    11111212
     
    11931294    function GetExeName: string;
    11941295    function GetShowMainForm: Boolean;
     1296    function GetTaskBarBehavior: TTaskBarBehavior;
    11951297    function GetTitle: string;
    11961298    procedure SetMainForm(AValue: TDpiForm);
    11971299    function GetMainForm: TDpiForm;
    11981300    procedure SetShowMainForm(AValue: Boolean);
     1301    procedure SetTaskBarBehavior(AValue: TTaskBarBehavior);
    11991302    procedure SetTitle(AValue: string);
    12001303  protected
     
    12161319    property Active: Boolean read GetActive;
    12171320    property ExeName: string read GetExeName;
     1321    property TaskBarBehavior: TTaskBarBehavior read GetTaskBarBehavior write SetTaskBarBehavior;
    12181322  end;
    12191323
     
    12761380    property Count: Integer read GetCount;
    12771381    procedure Clear;
     1382    procedure Click; virtual;
    12781383  published
    12791384    property RadioItem: Boolean read GetRadioItem write SetRadioItem default False;
     
    13561461  SDpiFormTitle = 'DpiForm form';
    13571462  SDpiFormDescription = 'DPI aware form';
     1463  SNotImplemented = 'Not implemented';
    13581464
    13591465procedure Register;
     
    19712077function TDpiStringGrid.DefaultRowHeightIsStored: Boolean;
    19722078begin
    1973   Result := GetDefRowHeight>=0;
     2079  Result := GetDefRowHeight >= 0;
     2080end;
     2081
     2082function TDpiStringGrid.GetCells(ACol, ARow: Integer): string;
     2083begin
     2084  Result := GetNativeStringGrid.Cells[ACol, ARow];
     2085end;
     2086
     2087function TDpiStringGrid.GetColCount: Integer;
     2088begin
     2089  Result := GetNativeStringGrid.ColCount;
     2090end;
     2091
     2092function TDpiStringGrid.GetColumns: TGridColumns;
     2093begin
     2094  Result := GetNativeStringGrid.Columns;
    19742095end;
    19752096
     
    19792100end;
    19802101
     2102function TDpiStringGrid.GetEditor: TWinControl;
     2103begin
     2104  Result := GetNativeStringGrid.Editor;
     2105end;
     2106
     2107function TDpiStringGrid.GetFixedCols: Integer;
     2108begin
     2109  Result := GetNativeStringGrid.FixedCols;
     2110end;
     2111
     2112function TDpiStringGrid.GetFixedRows: Integer;
     2113begin
     2114  Result := GetNativeStringGrid.FixedRows;
     2115end;
     2116
     2117function TDpiStringGrid.GetOptions: TGridOptions;
     2118begin
     2119  Result := GetNativeStringGrid.Options;
     2120end;
     2121
     2122function TDpiStringGrid.GetRowCount: Integer;
     2123begin
     2124  Result := GetNativeStringGrid.RowCount;
     2125end;
     2126
     2127function TDpiStringGrid.GetScrollBars: TScrollStyle;
     2128begin
     2129  Result := GetNativeStringGrid.ScrollBars;
     2130end;
     2131
     2132function TDpiStringGrid.GetSelection: TGridRect;
     2133begin
     2134  Result := GetNativeStringGrid.Selection;
     2135end;
     2136
     2137function TDpiStringGrid.IsColumnsStored: Boolean;
     2138begin
     2139  Result := GetNativeStringGrid.Columns.Enabled;
     2140end;
     2141
     2142procedure TDpiStringGrid.SetCells(ACol, ARow: Integer; AValue: string);
     2143begin
     2144  GetNativeStringGrid.Cells[ACol, ARow] := AValue;
     2145end;
     2146
     2147procedure TDpiStringGrid.SetColCount(AValue: Integer);
     2148begin
     2149  GetNativeStringGrid.ColCount := AValue;
     2150end;
     2151
     2152procedure TDpiStringGrid.SetColumns(AValue: TGridColumns);
     2153begin
     2154  GetNativeStringGrid.Columns := AValue;
     2155end;
     2156
    19812157procedure TDpiStringGrid.SetDefRowHeight(AValue: Integer);
    19822158begin
    19832159  GetNativeStringGrid.DefaultRowHeight := AValue;
     2160end;
     2161
     2162procedure TDpiStringGrid.SetEditor(AValue: TWinControl);
     2163begin
     2164  GetNativeStringGrid.Editor := AValue;
     2165end;
     2166
     2167procedure TDpiStringGrid.SetFixedCols(AValue: Integer);
     2168begin
     2169  GetNativeStringGrid.FixedCols := AValue;
     2170end;
     2171
     2172procedure TDpiStringGrid.SetFixedRows(AValue: Integer);
     2173begin
     2174  GetNativeStringGrid.FixedRows := AValue;
     2175end;
     2176
     2177procedure TDpiStringGrid.SetOptions(AValue: TGridOptions);
     2178begin
     2179  GetNativeStringGrid.Options := AValue;
     2180end;
     2181
     2182procedure TDpiStringGrid.SetRowCount(AValue: Integer);
     2183begin
     2184  GetNativeStringGrid.RowCount := AValue;
     2185end;
     2186
     2187procedure TDpiStringGrid.SetScrollBars(AValue: TScrollStyle);
     2188begin
     2189  GetNativeStringGrid.ScrollBars := AValue;
     2190end;
     2191
     2192procedure TDpiStringGrid.SetSelection(AValue: TGridRect);
     2193begin
     2194  GetNativeStringGrid.Selection := AValue;
    19842195end;
    19852196
     
    19902201end;
    19912202
     2203function TDpiStringGrid.CellRect(ACol, ARow: Integer): TRect;
     2204begin
     2205  Result := GetNativeStringGrid.CellRect(ACol, ARow);
     2206end;
     2207
    19922208constructor TDpiStringGrid.Create(TheOwner: TComponent);
    19932209begin
     
    20082224end;
    20092225
     2226function TDpiListView.GetOnChange: TLVChangeEvent;
     2227begin
     2228  Result := GetNativeListView.OnChange;
     2229end;
     2230
     2231function TDpiListView.GetOnColumnClick: TLVColumnClickEvent;
     2232begin
     2233  Result := GetNativeListView.OnColumnClick;
     2234end;
     2235
     2236function TDpiListView.GetOnCustomDrawItem: TDpiLVCustomDrawItemEvent;
     2237begin
     2238  Result := FOnCustomDrawItem;
     2239end;
     2240
     2241function TDpiListView.GetProperty(AIndex: Integer): Boolean;
     2242begin
     2243  Result := GetNativeListView.Checkboxes;
     2244end;
     2245
     2246function TDpiListView.GetViewStyle: TViewStyle;
     2247begin
     2248  Result := GetNativeListView.ViewStyle;
     2249end;
     2250
    20102251function TDpiListView.GetColumns: TListColumns;
    20112252begin
    2012   Result := NativeListView.Columns;
     2253  Result := GetNativeListView.Columns;
     2254end;
     2255
     2256function TDpiListView.GetCanvas: TCanvas;
     2257begin
     2258  Result := GetNativeListView.Canvas;
    20132259end;
    20142260
    20152261procedure TDpiListView.SetColumns(AValue: TListColumns);
    20162262begin
    2017   NativeListView.Columns := AValue;
     2263  GetNativeListView.Columns := AValue;
    20182264end;
    20192265
     
    20232269end;
    20242270
     2271procedure TDpiListView.SetOnChange(AValue: TLVChangeEvent);
     2272begin
     2273  GetNativeListView.OnChange := AValue;
     2274end;
     2275
     2276procedure TDpiListView.SetOnColumnClick(AValue: TLVColumnClickEvent);
     2277begin
     2278  GetNativeListView.OnColumnClick := AValue;
     2279end;
     2280
     2281procedure TDpiListView.SetOnCustomDrawItem(AValue: TDpiLVCustomDrawItemEvent);
     2282begin
     2283  FOnCustomDrawItem := AValue;
     2284end;
     2285
     2286procedure TDpiListView.SetProperty(AIndex: Integer; AValue: Boolean);
     2287begin
     2288  GetNativeListView.Checkboxes := AValue;
     2289end;
     2290
     2291procedure TDpiListView.SetViewStyle(AValue: TViewStyle);
     2292begin
     2293  GetNativeListView.ViewStyle := AValue;
     2294end;
     2295
     2296procedure TDpiListView.DoCustomDrawItem(Sender: TCustomListView; Item: TListItem;
     2297  State: TCustomDrawState; var DefaultDraw: Boolean);
     2298begin
     2299  if Assigned(FOnCustomDrawItem) then
     2300    FOnCustomDrawItem(Self, Item, State, DefaultDraw);
     2301end;
     2302
     2303function TDpiListView.GetItemAt(x, y: integer): TListItem;
     2304begin
     2305  Result := GetNativeListView.GetItemAt(X, Y);
     2306end;
     2307
    20252308function TDpiListView.GetNativeListView: TListView;
    20262309begin
    2027   if not Assigned(NativeListView) then NativeListView := TListView.Create(nil);
    2028     Result := NativeListView;
     2310  if not Assigned(NativeListView) then begin
     2311    NativeListView := TListView.Create(nil);
     2312    NativeListView.OnCustomDrawItem := @DoCustomDrawItem;
     2313  end;
     2314  Result := NativeListView;
    20292315end;
    20302316
     
    21012387end;
    21022388
     2389procedure TDpiPen.Assign(Source: TDpiPen);
     2390begin
     2391  FWidth := Source.FWidth;
     2392  GetNativePen.Assign(Source.GetNativePen);
     2393end;
     2394
    21032395{ TDpiBrush }
    21042396
     
    21462438  if FNativeBrushFree then FreeAndNil(FNativeBrush);
    21472439  inherited;
     2440end;
     2441
     2442procedure TDpiBrush.Assign(Source: TDpiBrush);
     2443begin
     2444  GetNativeBrush.Assign(Source.GetNativeBrush);
    21482445end;
    21492446
     
    24722769begin
    24732770  GetNativeMenuItem.Clear;
     2771end;
     2772
     2773procedure TDpiMenuItem.Click;
     2774begin
     2775  GetNativeMenuItem.Click;
    24742776end;
    24752777
     
    26792981end;
    26802982
     2983function TDpiApplication.GetTaskBarBehavior: TTaskBarBehavior;
     2984begin
     2985  Result := GetNativeApplication.TaskBarBehavior;
     2986end;
     2987
    26812988function TDpiApplication.GetActive: Boolean;
    26822989begin
    2683   Result := Application.Active;
     2990  Result := GetNativeApplication.Active;
    26842991end;
    26852992
     
    26973004begin
    26983005  GetNativeApplication.ShowMainForm := AValue;
     3006end;
     3007
     3008procedure TDpiApplication.SetTaskBarBehavior(AValue: TTaskBarBehavior);
     3009begin
     3010  GetNativeApplication.TaskBarBehavior := AValue;
    26993011end;
    27003012
     
    35263838end;
    35273839
     3840procedure TDpiCanvas.DoLine(X1, Y1, X2, Y2: Integer);
     3841begin
     3842  raise ENotImplemented.Create(SNotImplemented);
     3843end;
     3844
     3845procedure TDpiCanvas.DoTextOut(X, Y: Integer; Text: string);
     3846begin
     3847  raise ENotImplemented.Create(SNotImplemented);
     3848end;
     3849
     3850procedure TDpiCanvas.DoRectangle(const Bounds: TRect);
     3851begin
     3852  raise ENotImplemented.Create(SNotImplemented);
     3853end;
     3854
     3855procedure TDpiCanvas.DoRectangleFill(const Bounds: TRect);
     3856begin
     3857  raise ENotImplemented.Create(SNotImplemented);
     3858end;
     3859
     3860procedure TDpiCanvas.DoPolygon(const Points: array of TPoint);
     3861begin
     3862  raise ENotImplemented.Create(SNotImplemented);
     3863end;
     3864
     3865procedure TDpiCanvas.CreateHandle;
     3866begin
     3867  raise ENotImplemented.Create(SNotImplemented);
     3868end;
     3869
     3870procedure TDpiCanvas.DoEllipse(const Bounds: TRect);
     3871begin
     3872  raise ENotImplemented.Create(SNotImplemented);
     3873end;
     3874
     3875procedure TDpiCanvas.DoMoveTo(X, Y: Integer);
     3876begin
     3877  raise ENotImplemented.Create(SNotImplemented);
     3878end;
     3879
     3880procedure TDpiCanvas.DoLineTo(X, Y: Integer);
     3881begin
     3882  raise ENotImplemented.Create(SNotImplemented);
     3883end;
     3884
     3885procedure TDpiCanvas.DoPolyline(const Points: array of TPoint);
     3886begin
     3887  raise ENotImplemented.Create(SNotImplemented);
     3888end;
     3889
     3890procedure TDpiCanvas.DoPolyBezier(Points: PPoint; NumPts: Integer;
     3891  Filled: Boolean; Continuous: Boolean);
     3892begin
     3893  raise ENotImplemented.Create(SNotImplemented);
     3894end;
     3895
    35283896function TDpiCanvas.GetNativeCanvas: TCanvas;
    35293897begin
    35303898  Result := NativeCanvas;
     3899end;
     3900
     3901procedure TDpiCanvas.RoundRect(const Rect: TRect; RX, RY: Integer);
     3902begin
     3903  GetNativeCanvas.RoundRect(Rect, RX, RY);
     3904end;
     3905
     3906procedure TDpiCanvas.RoundRect(X1, Y1, X2, Y2: Integer; RX, RY: Integer);
     3907begin
     3908  GetNativeCanvas.RoundRect(X1, Y1, X2, Y2, RX, RY);
     3909end;
     3910
     3911procedure TDpiCanvas.Polygon(const Points: array of TPoint; Winding: Boolean;
     3912  StartIndex: Integer; NumPts: Integer);
     3913begin
     3914  GetNativeCanvas.Polygon(Points, Winding, StartIndex, NumPts);
     3915end;
     3916
     3917procedure TDpiCanvas.Polygon(Points: PPoint; NumPts: Integer; Winding: Boolean);
     3918begin
     3919  GetNativeCanvas.Polygon(Points, NumPts, Winding);
     3920end;
     3921
     3922procedure TDpiCanvas.Polygon(const Points: array of TPoint);
     3923begin
     3924  GetNativeCanvas.Polygon(Points);
     3925end;
     3926
     3927procedure TDpiCanvas.PolyBezier(const Points: array of TPoint; Filled: Boolean;
     3928  Continuous: boolean);
     3929begin
     3930  GetNativeCanvas.Polyline(Points);
     3931end;
     3932
     3933procedure TDpiCanvas.PolyBezier(Points: PPoint; NumPts: Integer;
     3934  Filled: Boolean; Continuous: Boolean);
     3935begin
     3936  GetNativeCanvas.PolyBezier(Points, NumPts, Filled, Continuous);
     3937end;
     3938
     3939procedure TDpiCanvas.Polyline(const Points: array of TPoint);
     3940begin
     3941  GetNativeCanvas.Polyline(Points);
     3942end;
     3943
     3944procedure TDpiCanvas.Polyline(Points: PPoint; NumPts: Integer);
     3945begin
     3946  GetNativeCanvas.Polyline(Points, NumPts);
     3947end;
     3948
     3949procedure TDpiCanvas.Ellipse(x1, y1, x2, y2: Integer);
     3950begin
     3951  GetNativeCanvas.Ellipse(X1, Y1, X2, Y2);
     3952end;
     3953
     3954procedure TDpiCanvas.Ellipse(const ARect: TRect);
     3955begin
     3956  Ellipse(ARect.Left, ARect.Top, ARect.Right, ARect.Bottom);
     3957end;
     3958
     3959procedure TDpiCanvas.StretchDraw(const DestRect: TRect; SrcGraphic: TGraphic);
     3960begin
     3961  GetNativeCanvas.StretchDraw(DestRect, SrcGraphic);
     3962end;
     3963
     3964procedure TDpiCanvas.Pie(EllipseX1, EllipseY1, EllipseX2, EllipseY2, StartX,
     3965  StartY, EndX, EndY: Integer);
     3966begin
     3967  GetNativeCanvas.Pie(EllipseX1, EllipseY1, EllipseX2, EllipseY2, StartX, StartY,
     3968    EndX, EndY);
    35313969end;
    35323970
     
    35523990end;
    35533991
    3554 function TDpiCanvas.TextWidth(Text: string): Integer;
     3992function TDpiCanvas.TextWidth(const Text: string): Integer;
    35553993begin
    35563994  Result := ScaleFromNative(GetNativeCanvas.TextWidth(Text));
    35573995end;
    35583996
    3559 function TDpiCanvas.TextHeight(Text: string): Integer;
     3997function TDpiCanvas.TextHeight(const Text: string): Integer;
    35603998begin
    35613999  Result := ScaleFromNative(GetNativeCanvas.TextHeight(Text));
    35624000end;
    35634001
    3564 function TDpiCanvas.TextExtent(Text: string): TSize;
     4002function TDpiCanvas.TextExtent(const Text: string): TSize;
    35654003begin
    35664004  Result := ScaleSizeFromNative(GetNativeCanvas.TextExtent(Text));
     
    35854023begin
    35864024  GetNativeCanvas.LineTo(ScaleToNative(X), ScaleToNative(Y));
     4025end;
     4026
     4027procedure TDpiCanvas.Line(const p1, p2: TPoint);
     4028begin
     4029  GetNativeCanvas.Line(P1, P2);
    35874030end;
    35884031
     
    41394582  FreeAndNil(FForms);
    41404583  FreeAndNil(FPrevActiveForms);
    4141   inherited Destroy;
     4584  inherited;
    41424585end;
    41434586
     
    42564699  MouseEnter;
    42574700  if Assigned(FOnMouseEnter) then FOnMouseEnter(Self);
     4701end;
     4702
     4703procedure TDpiControl.SetWindowProc(AValue: TWndMethod);
     4704begin
     4705  GetNativeControl.WindowProc := AValue;
    42584706end;
    42594707
     
    45224970end;
    45234971
     4972function TDpiControl.GetWindowProc: TWndMethod;
     4973begin
     4974  Result := GetNativeControl.WindowProc;
     4975end;
     4976
    45244977function TDpiControl.IsAnchorsStored: Boolean;
    45254978begin
     
    47915244end;
    47925245
     5246function TDpiForm.GetShowInTaskbar: TShowInTaskbar;
     5247begin
     5248  Result := GetNativeForm.ShowInTaskBar;
     5249end;
     5250
    47935251function TDpiForm.GetWindowState: TWindowState;
    47945252begin
     
    48755333begin
    48765334  GetNativeForm.Position := AValue;
     5335end;
     5336
     5337procedure TDpiForm.SetShowInTaskBar(AValue: TShowInTaskbar);
     5338begin
     5339  GetNativeForm.ShowInTaskBar := AValue;
    48775340end;
    48785341
Note: See TracChangeset for help on using the changeset viewer.