Changeset 463 for branches/highdpi/Packages/DpiControls/UDpiControls.pas
- Timestamp:
- Nov 29, 2023, 2:35:44 PM (12 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/highdpi/Packages/DpiControls/UDpiControls.pas
r412 r463 175 175 function GetShowHint: Boolean; 176 176 function GetVisible: Boolean; 177 function GetWindowProc: TWndMethod; 177 178 function IsAnchorsStored: Boolean; 178 179 procedure SetAlign(AValue: TAlign); … … 207 208 procedure MouseLeaveHandler(Sender: TObject); virtual; 208 209 procedure MouseEnterHandler(Sender: TObject); virtual; 210 procedure SetWindowProc(AValue: TWndMethod); 209 211 protected 210 212 procedure DoBorderSpacingChange(Sender: TObject; InnerSpaceChanged: Boolean); virtual; … … 255 257 property Anchors: TAnchors read GetAnchors write SetAnchors stored IsAnchorsStored default [akLeft, akTop]; 256 258 property BorderSpacing: TDpiControlBorderSpacing read FBorderSpacing write SetBorderSpacing; 259 property WindowProc: TWndMethod read GetWindowProc write SetWindowProc; 257 260 published 258 261 property AutoSize: Boolean read GetAutoSize write SetAutoSize default False; … … 373 376 destructor Destroy; override; 374 377 function GetNativePen: TPen; 378 procedure Assign(Source: TDpiPen); 375 379 property NativePen: TPen read FNativePen write SetNativePen; 376 380 published … … 395 399 constructor Create; 396 400 destructor Destroy; override; 401 procedure Assign(Source: TDpiBrush); 397 402 property NativeBrush: TBrush read FNativeBrush write SetNativeBrush; 398 403 published … … 422 427 procedure SetNativeCanvas(AValue: TCanvas); 423 428 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; 424 441 procedure SetHeight(AValue: Integer); virtual; 425 442 procedure SetWidth(AValue: Integer); virtual; … … 429 446 public 430 447 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; 431 465 procedure StretchDraw(const DestRect: TRect; SrcGraphic: TDpiGraphic); virtual; 432 466 procedure FrameRect(Rect: TRect); 433 467 procedure Rectangle(X1, Y1, X2, Y2: Integer); overload; 434 468 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; 438 472 procedure TextOut(X, Y: Integer; const Text: string); virtual; 439 473 procedure TextRect(ARect: TRect; X, Y: Integer; Text: string); 440 474 procedure MoveTo(X, Y: Integer); 441 475 procedure LineTo(X, Y: Integer); 476 procedure Line(const p1, p2: TPoint); 442 477 procedure FillRect(const ARect: TRect); virtual; 443 478 procedure FillRect(X1, Y1, X2, Y2: Integer); … … 598 633 function GetRestoredTop: Integer; 599 634 function GetRestoredWidth: Integer; 635 function GetShowInTaskbar: TShowInTaskbar; 600 636 function GetWindowState: TWindowState; 601 637 procedure SetBorderIcons(AValue: TBorderIcons); … … 615 651 procedure FormMessageHandler(var TheMessage: TLMessage); 616 652 procedure SetPosition(AValue: TPosition); 653 procedure SetShowInTaskBar(AValue: TShowInTaskbar); 617 654 procedure SetWindowState(AValue: TWindowState); 618 655 procedure ActivateHandler(Sender: TObject); … … 667 704 property OnMouseDown; 668 705 property OnMouseMove; 706 property ShowInTaskBar: TShowInTaskbar read GetShowInTaskbar write SetShowInTaskBar 707 default stDefault; 669 708 end; 670 709 … … 873 912 end; 874 913 914 TDpiCustomListView = class(TDpiWinControl) 915 916 end; 917 918 TDpiLVCustomDrawItemEvent = procedure(Sender: TDpiCustomListView; Item: TListItem; 919 State: TCustomDrawState; var DefaultDraw: Boolean) of object; 920 875 921 { TDpiListView } 876 922 877 TDpiListView = class(TDpi WinControl)923 TDpiListView = class(TDpiCustomListView) 878 924 private 925 FOnCustomDrawItem: TDpiLVCustomDrawItemEvent; 879 926 NativeListView: TListView; 927 function GetCanvas: TCanvas; 880 928 function GetColumns: TListColumns; 881 929 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; 882 935 procedure SetColumns(AValue: TListColumns); 883 936 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); 884 944 public 945 function GetItemAt(x,y: integer): TListItem; 885 946 function GetNativeListView: TListView; 886 947 constructor Create(TheOwner: TComponent); override; … … 888 949 property Columns: TListColumns read GetColumns write SetColumns; 889 950 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; 890 953 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; 891 960 end; 892 961 … … 1100 1169 NativeStringGrid: TStringGrid; 1101 1170 function DefaultRowHeightIsStored: Boolean; 1171 function GetCells(ACol, ARow: Integer): string; 1172 function GetColCount: Integer; 1173 function GetColumns: TGridColumns; 1102 1174 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); 1103 1186 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); 1104 1194 public 1105 1195 function GetNativeStringGrid: TStringGrid; 1196 function CellRect(ACol, ARow: Integer): TRect; 1106 1197 constructor Create(TheOwner: TComponent); override; 1107 1198 destructor Destroy; override; 1199 property Selection: TGridRect read GetSelection write SetSelection; 1200 property Cells[ACol, ARow: Integer]: string read GetCells write SetCells; 1108 1201 published 1109 1202 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; 1110 1211 end; 1111 1212 … … 1193 1294 function GetExeName: string; 1194 1295 function GetShowMainForm: Boolean; 1296 function GetTaskBarBehavior: TTaskBarBehavior; 1195 1297 function GetTitle: string; 1196 1298 procedure SetMainForm(AValue: TDpiForm); 1197 1299 function GetMainForm: TDpiForm; 1198 1300 procedure SetShowMainForm(AValue: Boolean); 1301 procedure SetTaskBarBehavior(AValue: TTaskBarBehavior); 1199 1302 procedure SetTitle(AValue: string); 1200 1303 protected … … 1216 1319 property Active: Boolean read GetActive; 1217 1320 property ExeName: string read GetExeName; 1321 property TaskBarBehavior: TTaskBarBehavior read GetTaskBarBehavior write SetTaskBarBehavior; 1218 1322 end; 1219 1323 … … 1276 1380 property Count: Integer read GetCount; 1277 1381 procedure Clear; 1382 procedure Click; virtual; 1278 1383 published 1279 1384 property RadioItem: Boolean read GetRadioItem write SetRadioItem default False; … … 1356 1461 SDpiFormTitle = 'DpiForm form'; 1357 1462 SDpiFormDescription = 'DPI aware form'; 1463 SNotImplemented = 'Not implemented'; 1358 1464 1359 1465 procedure Register; … … 1971 2077 function TDpiStringGrid.DefaultRowHeightIsStored: Boolean; 1972 2078 begin 1973 Result := GetDefRowHeight>=0; 2079 Result := GetDefRowHeight >= 0; 2080 end; 2081 2082 function TDpiStringGrid.GetCells(ACol, ARow: Integer): string; 2083 begin 2084 Result := GetNativeStringGrid.Cells[ACol, ARow]; 2085 end; 2086 2087 function TDpiStringGrid.GetColCount: Integer; 2088 begin 2089 Result := GetNativeStringGrid.ColCount; 2090 end; 2091 2092 function TDpiStringGrid.GetColumns: TGridColumns; 2093 begin 2094 Result := GetNativeStringGrid.Columns; 1974 2095 end; 1975 2096 … … 1979 2100 end; 1980 2101 2102 function TDpiStringGrid.GetEditor: TWinControl; 2103 begin 2104 Result := GetNativeStringGrid.Editor; 2105 end; 2106 2107 function TDpiStringGrid.GetFixedCols: Integer; 2108 begin 2109 Result := GetNativeStringGrid.FixedCols; 2110 end; 2111 2112 function TDpiStringGrid.GetFixedRows: Integer; 2113 begin 2114 Result := GetNativeStringGrid.FixedRows; 2115 end; 2116 2117 function TDpiStringGrid.GetOptions: TGridOptions; 2118 begin 2119 Result := GetNativeStringGrid.Options; 2120 end; 2121 2122 function TDpiStringGrid.GetRowCount: Integer; 2123 begin 2124 Result := GetNativeStringGrid.RowCount; 2125 end; 2126 2127 function TDpiStringGrid.GetScrollBars: TScrollStyle; 2128 begin 2129 Result := GetNativeStringGrid.ScrollBars; 2130 end; 2131 2132 function TDpiStringGrid.GetSelection: TGridRect; 2133 begin 2134 Result := GetNativeStringGrid.Selection; 2135 end; 2136 2137 function TDpiStringGrid.IsColumnsStored: Boolean; 2138 begin 2139 Result := GetNativeStringGrid.Columns.Enabled; 2140 end; 2141 2142 procedure TDpiStringGrid.SetCells(ACol, ARow: Integer; AValue: string); 2143 begin 2144 GetNativeStringGrid.Cells[ACol, ARow] := AValue; 2145 end; 2146 2147 procedure TDpiStringGrid.SetColCount(AValue: Integer); 2148 begin 2149 GetNativeStringGrid.ColCount := AValue; 2150 end; 2151 2152 procedure TDpiStringGrid.SetColumns(AValue: TGridColumns); 2153 begin 2154 GetNativeStringGrid.Columns := AValue; 2155 end; 2156 1981 2157 procedure TDpiStringGrid.SetDefRowHeight(AValue: Integer); 1982 2158 begin 1983 2159 GetNativeStringGrid.DefaultRowHeight := AValue; 2160 end; 2161 2162 procedure TDpiStringGrid.SetEditor(AValue: TWinControl); 2163 begin 2164 GetNativeStringGrid.Editor := AValue; 2165 end; 2166 2167 procedure TDpiStringGrid.SetFixedCols(AValue: Integer); 2168 begin 2169 GetNativeStringGrid.FixedCols := AValue; 2170 end; 2171 2172 procedure TDpiStringGrid.SetFixedRows(AValue: Integer); 2173 begin 2174 GetNativeStringGrid.FixedRows := AValue; 2175 end; 2176 2177 procedure TDpiStringGrid.SetOptions(AValue: TGridOptions); 2178 begin 2179 GetNativeStringGrid.Options := AValue; 2180 end; 2181 2182 procedure TDpiStringGrid.SetRowCount(AValue: Integer); 2183 begin 2184 GetNativeStringGrid.RowCount := AValue; 2185 end; 2186 2187 procedure TDpiStringGrid.SetScrollBars(AValue: TScrollStyle); 2188 begin 2189 GetNativeStringGrid.ScrollBars := AValue; 2190 end; 2191 2192 procedure TDpiStringGrid.SetSelection(AValue: TGridRect); 2193 begin 2194 GetNativeStringGrid.Selection := AValue; 1984 2195 end; 1985 2196 … … 1990 2201 end; 1991 2202 2203 function TDpiStringGrid.CellRect(ACol, ARow: Integer): TRect; 2204 begin 2205 Result := GetNativeStringGrid.CellRect(ACol, ARow); 2206 end; 2207 1992 2208 constructor TDpiStringGrid.Create(TheOwner: TComponent); 1993 2209 begin … … 2008 2224 end; 2009 2225 2226 function TDpiListView.GetOnChange: TLVChangeEvent; 2227 begin 2228 Result := GetNativeListView.OnChange; 2229 end; 2230 2231 function TDpiListView.GetOnColumnClick: TLVColumnClickEvent; 2232 begin 2233 Result := GetNativeListView.OnColumnClick; 2234 end; 2235 2236 function TDpiListView.GetOnCustomDrawItem: TDpiLVCustomDrawItemEvent; 2237 begin 2238 Result := FOnCustomDrawItem; 2239 end; 2240 2241 function TDpiListView.GetProperty(AIndex: Integer): Boolean; 2242 begin 2243 Result := GetNativeListView.Checkboxes; 2244 end; 2245 2246 function TDpiListView.GetViewStyle: TViewStyle; 2247 begin 2248 Result := GetNativeListView.ViewStyle; 2249 end; 2250 2010 2251 function TDpiListView.GetColumns: TListColumns; 2011 2252 begin 2012 Result := NativeListView.Columns; 2253 Result := GetNativeListView.Columns; 2254 end; 2255 2256 function TDpiListView.GetCanvas: TCanvas; 2257 begin 2258 Result := GetNativeListView.Canvas; 2013 2259 end; 2014 2260 2015 2261 procedure TDpiListView.SetColumns(AValue: TListColumns); 2016 2262 begin 2017 NativeListView.Columns := AValue;2263 GetNativeListView.Columns := AValue; 2018 2264 end; 2019 2265 … … 2023 2269 end; 2024 2270 2271 procedure TDpiListView.SetOnChange(AValue: TLVChangeEvent); 2272 begin 2273 GetNativeListView.OnChange := AValue; 2274 end; 2275 2276 procedure TDpiListView.SetOnColumnClick(AValue: TLVColumnClickEvent); 2277 begin 2278 GetNativeListView.OnColumnClick := AValue; 2279 end; 2280 2281 procedure TDpiListView.SetOnCustomDrawItem(AValue: TDpiLVCustomDrawItemEvent); 2282 begin 2283 FOnCustomDrawItem := AValue; 2284 end; 2285 2286 procedure TDpiListView.SetProperty(AIndex: Integer; AValue: Boolean); 2287 begin 2288 GetNativeListView.Checkboxes := AValue; 2289 end; 2290 2291 procedure TDpiListView.SetViewStyle(AValue: TViewStyle); 2292 begin 2293 GetNativeListView.ViewStyle := AValue; 2294 end; 2295 2296 procedure TDpiListView.DoCustomDrawItem(Sender: TCustomListView; Item: TListItem; 2297 State: TCustomDrawState; var DefaultDraw: Boolean); 2298 begin 2299 if Assigned(FOnCustomDrawItem) then 2300 FOnCustomDrawItem(Self, Item, State, DefaultDraw); 2301 end; 2302 2303 function TDpiListView.GetItemAt(x, y: integer): TListItem; 2304 begin 2305 Result := GetNativeListView.GetItemAt(X, Y); 2306 end; 2307 2025 2308 function TDpiListView.GetNativeListView: TListView; 2026 2309 begin 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; 2029 2315 end; 2030 2316 … … 2101 2387 end; 2102 2388 2389 procedure TDpiPen.Assign(Source: TDpiPen); 2390 begin 2391 FWidth := Source.FWidth; 2392 GetNativePen.Assign(Source.GetNativePen); 2393 end; 2394 2103 2395 { TDpiBrush } 2104 2396 … … 2146 2438 if FNativeBrushFree then FreeAndNil(FNativeBrush); 2147 2439 inherited; 2440 end; 2441 2442 procedure TDpiBrush.Assign(Source: TDpiBrush); 2443 begin 2444 GetNativeBrush.Assign(Source.GetNativeBrush); 2148 2445 end; 2149 2446 … … 2472 2769 begin 2473 2770 GetNativeMenuItem.Clear; 2771 end; 2772 2773 procedure TDpiMenuItem.Click; 2774 begin 2775 GetNativeMenuItem.Click; 2474 2776 end; 2475 2777 … … 2679 2981 end; 2680 2982 2983 function TDpiApplication.GetTaskBarBehavior: TTaskBarBehavior; 2984 begin 2985 Result := GetNativeApplication.TaskBarBehavior; 2986 end; 2987 2681 2988 function TDpiApplication.GetActive: Boolean; 2682 2989 begin 2683 Result := Application.Active;2990 Result := GetNativeApplication.Active; 2684 2991 end; 2685 2992 … … 2697 3004 begin 2698 3005 GetNativeApplication.ShowMainForm := AValue; 3006 end; 3007 3008 procedure TDpiApplication.SetTaskBarBehavior(AValue: TTaskBarBehavior); 3009 begin 3010 GetNativeApplication.TaskBarBehavior := AValue; 2699 3011 end; 2700 3012 … … 3526 3838 end; 3527 3839 3840 procedure TDpiCanvas.DoLine(X1, Y1, X2, Y2: Integer); 3841 begin 3842 raise ENotImplemented.Create(SNotImplemented); 3843 end; 3844 3845 procedure TDpiCanvas.DoTextOut(X, Y: Integer; Text: string); 3846 begin 3847 raise ENotImplemented.Create(SNotImplemented); 3848 end; 3849 3850 procedure TDpiCanvas.DoRectangle(const Bounds: TRect); 3851 begin 3852 raise ENotImplemented.Create(SNotImplemented); 3853 end; 3854 3855 procedure TDpiCanvas.DoRectangleFill(const Bounds: TRect); 3856 begin 3857 raise ENotImplemented.Create(SNotImplemented); 3858 end; 3859 3860 procedure TDpiCanvas.DoPolygon(const Points: array of TPoint); 3861 begin 3862 raise ENotImplemented.Create(SNotImplemented); 3863 end; 3864 3865 procedure TDpiCanvas.CreateHandle; 3866 begin 3867 raise ENotImplemented.Create(SNotImplemented); 3868 end; 3869 3870 procedure TDpiCanvas.DoEllipse(const Bounds: TRect); 3871 begin 3872 raise ENotImplemented.Create(SNotImplemented); 3873 end; 3874 3875 procedure TDpiCanvas.DoMoveTo(X, Y: Integer); 3876 begin 3877 raise ENotImplemented.Create(SNotImplemented); 3878 end; 3879 3880 procedure TDpiCanvas.DoLineTo(X, Y: Integer); 3881 begin 3882 raise ENotImplemented.Create(SNotImplemented); 3883 end; 3884 3885 procedure TDpiCanvas.DoPolyline(const Points: array of TPoint); 3886 begin 3887 raise ENotImplemented.Create(SNotImplemented); 3888 end; 3889 3890 procedure TDpiCanvas.DoPolyBezier(Points: PPoint; NumPts: Integer; 3891 Filled: Boolean; Continuous: Boolean); 3892 begin 3893 raise ENotImplemented.Create(SNotImplemented); 3894 end; 3895 3528 3896 function TDpiCanvas.GetNativeCanvas: TCanvas; 3529 3897 begin 3530 3898 Result := NativeCanvas; 3899 end; 3900 3901 procedure TDpiCanvas.RoundRect(const Rect: TRect; RX, RY: Integer); 3902 begin 3903 GetNativeCanvas.RoundRect(Rect, RX, RY); 3904 end; 3905 3906 procedure TDpiCanvas.RoundRect(X1, Y1, X2, Y2: Integer; RX, RY: Integer); 3907 begin 3908 GetNativeCanvas.RoundRect(X1, Y1, X2, Y2, RX, RY); 3909 end; 3910 3911 procedure TDpiCanvas.Polygon(const Points: array of TPoint; Winding: Boolean; 3912 StartIndex: Integer; NumPts: Integer); 3913 begin 3914 GetNativeCanvas.Polygon(Points, Winding, StartIndex, NumPts); 3915 end; 3916 3917 procedure TDpiCanvas.Polygon(Points: PPoint; NumPts: Integer; Winding: Boolean); 3918 begin 3919 GetNativeCanvas.Polygon(Points, NumPts, Winding); 3920 end; 3921 3922 procedure TDpiCanvas.Polygon(const Points: array of TPoint); 3923 begin 3924 GetNativeCanvas.Polygon(Points); 3925 end; 3926 3927 procedure TDpiCanvas.PolyBezier(const Points: array of TPoint; Filled: Boolean; 3928 Continuous: boolean); 3929 begin 3930 GetNativeCanvas.Polyline(Points); 3931 end; 3932 3933 procedure TDpiCanvas.PolyBezier(Points: PPoint; NumPts: Integer; 3934 Filled: Boolean; Continuous: Boolean); 3935 begin 3936 GetNativeCanvas.PolyBezier(Points, NumPts, Filled, Continuous); 3937 end; 3938 3939 procedure TDpiCanvas.Polyline(const Points: array of TPoint); 3940 begin 3941 GetNativeCanvas.Polyline(Points); 3942 end; 3943 3944 procedure TDpiCanvas.Polyline(Points: PPoint; NumPts: Integer); 3945 begin 3946 GetNativeCanvas.Polyline(Points, NumPts); 3947 end; 3948 3949 procedure TDpiCanvas.Ellipse(x1, y1, x2, y2: Integer); 3950 begin 3951 GetNativeCanvas.Ellipse(X1, Y1, X2, Y2); 3952 end; 3953 3954 procedure TDpiCanvas.Ellipse(const ARect: TRect); 3955 begin 3956 Ellipse(ARect.Left, ARect.Top, ARect.Right, ARect.Bottom); 3957 end; 3958 3959 procedure TDpiCanvas.StretchDraw(const DestRect: TRect; SrcGraphic: TGraphic); 3960 begin 3961 GetNativeCanvas.StretchDraw(DestRect, SrcGraphic); 3962 end; 3963 3964 procedure TDpiCanvas.Pie(EllipseX1, EllipseY1, EllipseX2, EllipseY2, StartX, 3965 StartY, EndX, EndY: Integer); 3966 begin 3967 GetNativeCanvas.Pie(EllipseX1, EllipseY1, EllipseX2, EllipseY2, StartX, StartY, 3968 EndX, EndY); 3531 3969 end; 3532 3970 … … 3552 3990 end; 3553 3991 3554 function TDpiCanvas.TextWidth( Text: string): Integer;3992 function TDpiCanvas.TextWidth(const Text: string): Integer; 3555 3993 begin 3556 3994 Result := ScaleFromNative(GetNativeCanvas.TextWidth(Text)); 3557 3995 end; 3558 3996 3559 function TDpiCanvas.TextHeight( Text: string): Integer;3997 function TDpiCanvas.TextHeight(const Text: string): Integer; 3560 3998 begin 3561 3999 Result := ScaleFromNative(GetNativeCanvas.TextHeight(Text)); 3562 4000 end; 3563 4001 3564 function TDpiCanvas.TextExtent( Text: string): TSize;4002 function TDpiCanvas.TextExtent(const Text: string): TSize; 3565 4003 begin 3566 4004 Result := ScaleSizeFromNative(GetNativeCanvas.TextExtent(Text)); … … 3585 4023 begin 3586 4024 GetNativeCanvas.LineTo(ScaleToNative(X), ScaleToNative(Y)); 4025 end; 4026 4027 procedure TDpiCanvas.Line(const p1, p2: TPoint); 4028 begin 4029 GetNativeCanvas.Line(P1, P2); 3587 4030 end; 3588 4031 … … 4139 4582 FreeAndNil(FForms); 4140 4583 FreeAndNil(FPrevActiveForms); 4141 inherited Destroy;4584 inherited; 4142 4585 end; 4143 4586 … … 4256 4699 MouseEnter; 4257 4700 if Assigned(FOnMouseEnter) then FOnMouseEnter(Self); 4701 end; 4702 4703 procedure TDpiControl.SetWindowProc(AValue: TWndMethod); 4704 begin 4705 GetNativeControl.WindowProc := AValue; 4258 4706 end; 4259 4707 … … 4522 4970 end; 4523 4971 4972 function TDpiControl.GetWindowProc: TWndMethod; 4973 begin 4974 Result := GetNativeControl.WindowProc; 4975 end; 4976 4524 4977 function TDpiControl.IsAnchorsStored: Boolean; 4525 4978 begin … … 4791 5244 end; 4792 5245 5246 function TDpiForm.GetShowInTaskbar: TShowInTaskbar; 5247 begin 5248 Result := GetNativeForm.ShowInTaskBar; 5249 end; 5250 4793 5251 function TDpiForm.GetWindowState: TWindowState; 4794 5252 begin … … 4875 5333 begin 4876 5334 GetNativeForm.Position := AValue; 5335 end; 5336 5337 procedure TDpiForm.SetShowInTaskBar(AValue: TShowInTaskbar); 5338 begin 5339 GetNativeForm.ShowInTaskBar := AValue; 4877 5340 end; 4878 5341
Note:
See TracChangeset
for help on using the changeset viewer.