| 1 | unit DpiControls;
|
|---|
| 2 |
|
|---|
| 3 | interface
|
|---|
| 4 |
|
|---|
| 5 | uses
|
|---|
| 6 | {$IFDEF WINDOWS}Windows, {$ENDIF}Classes, SysUtils, LCLProc, LResources, Forms,
|
|---|
| 7 | Generics.Collections, FormEditingIntf, ProjectIntf, Controls, StdCtrls, Graphics,
|
|---|
| 8 | ComCtrls, ExtCtrls, LCLType, GraphType, Types, CustApp, LMessages, LCLIntf,
|
|---|
| 9 | Menus, Math, Dpi.PixelPointer, Grids, Spin, Dpi.Forms, Dpi.Controls, Dpi.Graphics;
|
|---|
| 10 |
|
|---|
| 11 | type
|
|---|
| 12 |
|
|---|
| 13 | { TDpiFormFileDesc }
|
|---|
| 14 |
|
|---|
| 15 | TDpiFormFileDesc = class(TFileDescPascalUnitWithResource)
|
|---|
| 16 | public
|
|---|
| 17 | constructor Create; override;
|
|---|
| 18 | function GetInterfaceUsesSection: string; override;
|
|---|
| 19 | function GetLocalizedName: string; override;
|
|---|
| 20 | function GetLocalizedDescription: string; override;
|
|---|
| 21 | end;
|
|---|
| 22 |
|
|---|
| 23 | var
|
|---|
| 24 | DpiFormFileDesc: TDpiFormFileDesc;
|
|---|
| 25 |
|
|---|
| 26 | procedure Register;
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 | implementation
|
|---|
| 30 |
|
|---|
| 31 | uses
|
|---|
| 32 | LCLStrConsts, Dpi.Common;
|
|---|
| 33 |
|
|---|
| 34 | resourcestring
|
|---|
| 35 | SDpiFormTitle = 'DpiForm form';
|
|---|
| 36 | SDpiFormDescription = 'DPI aware form';
|
|---|
| 37 |
|
|---|
| 38 | procedure Register;
|
|---|
| 39 | begin
|
|---|
| 40 | FormEditingHook.RegisterDesignerBaseClass(TForm);
|
|---|
| 41 | DpiFormFileDesc := TDpiFormFileDesc.Create;
|
|---|
| 42 | RegisterProjectFileDescriptor(DpiFormFileDesc);
|
|---|
| 43 | end;
|
|---|
| 44 |
|
|---|
| 45 | { TDpiFormFileDesc }
|
|---|
| 46 |
|
|---|
| 47 | constructor TDpiFormFileDesc.Create;
|
|---|
| 48 | begin
|
|---|
| 49 | inherited Create;
|
|---|
| 50 | Name := 'DpiForm form';
|
|---|
| 51 | ResourceClass := TForm;
|
|---|
| 52 | UseCreateFormStatements := False;
|
|---|
| 53 | end;
|
|---|
| 54 |
|
|---|
| 55 | function TDpiFormFileDesc.GetInterfaceUsesSection: string;
|
|---|
| 56 | begin
|
|---|
| 57 | Result := inherited GetInterfaceUsesSection;
|
|---|
| 58 | Result := Result + ', UDpiForm';
|
|---|
| 59 | end;
|
|---|
| 60 |
|
|---|
| 61 | function TDpiFormFileDesc.GetLocalizedName: string;
|
|---|
| 62 | begin
|
|---|
| 63 | Result := SDpiFormTitle;
|
|---|
| 64 | end;
|
|---|
| 65 |
|
|---|
| 66 | function TDpiFormFileDesc.GetLocalizedDescription: string;
|
|---|
| 67 | begin
|
|---|
| 68 | Result := SDpiFormDescription;
|
|---|
| 69 | end;
|
|---|
| 70 |
|
|---|
| 71 | initialization
|
|---|
| 72 |
|
|---|
| 73 |
|
|---|
| 74 | end.
|
|---|
| 75 |
|
|---|