source: trunk/Packages/DpiControls/DpiControls.pas

Last change on this file was 468, checked in by chronos, 8 months ago
  • Added: High DPI support integrated into trunk branch. It can be enabled by adding DPI define to compiler parameters for main project and packages.
File size: 1.6 KB
Line 
1unit DpiControls;
2
3interface
4
5uses
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
11type
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
23var
24 DpiFormFileDesc: TDpiFormFileDesc;
25
26procedure Register;
27
28
29implementation
30
31uses
32 LCLStrConsts, Dpi.Common;
33
34resourcestring
35 SDpiFormTitle = 'DpiForm form';
36 SDpiFormDescription = 'DPI aware form';
37
38procedure Register;
39begin
40 FormEditingHook.RegisterDesignerBaseClass(TForm);
41 DpiFormFileDesc := TDpiFormFileDesc.Create;
42 RegisterProjectFileDescriptor(DpiFormFileDesc);
43end;
44
45{ TDpiFormFileDesc }
46
47constructor TDpiFormFileDesc.Create;
48begin
49 inherited Create;
50 Name := 'DpiForm form';
51 ResourceClass := TForm;
52 UseCreateFormStatements := False;
53end;
54
55function TDpiFormFileDesc.GetInterfaceUsesSection: string;
56begin
57 Result := inherited GetInterfaceUsesSection;
58 Result := Result + ', UDpiForm';
59end;
60
61function TDpiFormFileDesc.GetLocalizedName: string;
62begin
63 Result := SDpiFormTitle;
64end;
65
66function TDpiFormFileDesc.GetLocalizedDescription: string;
67begin
68 Result := SDpiFormDescription;
69end;
70
71initialization
72
73
74end.
75
Note: See TracBrowser for help on using the repository browser.