Changeset 537 for DpiControls/Demo
- Timestamp:
- Jun 23, 2019, 12:36:19 AM (5 years ago)
- Location:
- DpiControls/Demo
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
DpiControls/Demo/DpiComponentsDemo.lpr
r534 r537 8 8 {$ENDIF}{$ENDIF} 9 9 Interfaces, // this includes the LCL widgetset 10 Forms, UFormMain, UDpiFormMain 10 Forms, UFormMain, UDpiFormMain, SysUtils 11 11 { you can add units after this }; 12 12 13 13 {$R *.res} 14 14 15 {$if declared(UseHeapTrace)} 16 const 17 HeapTraceLog = 'heaptrclog.trc'; 18 {$ENDIF} 19 15 20 begin 21 {$if declared(UseHeapTrace)} 22 // Heap trace 23 DeleteFile(ExtractFilePath(ParamStr(0)) + HeapTraceLog); 24 SetHeapTraceOutput(ExtractFilePath(ParamStr(0)) + HeapTraceLog); 25 {$ENDIF} 26 16 27 RequireDerivedFormResource:=True; 17 28 Application.Scaled:=True; -
DpiControls/Demo/UDpiFormMain.lfm
r535 r537 2 2 Top = 504 3 3 Left = 865 4 Width = 05 Height = 04 Width = 1 5 Height = 1 6 6 Visible = True 7 7 Enabled = True 8 8 ShowHint = False 9 Font.Color = clDefault 10 Font.PixelsPerInch = 144 11 Align = alNone 12 Color = clDefault 13 DesignTimePPI = 96 9 14 BorderStyle = Controls 15 BorderIcons = [biSystemMenu, biMinimize, biMaximize] 10 16 OnCreate = DpiFormMainCreate 17 OnDestroy = DpiFormMainDestroy 11 18 object DpiPaintBox1: TDpiPaintBox 12 Top = 16113 Left = 12419 Top = 248 20 Left = 88 14 21 Width = 100 15 22 Height = 100 … … 17 24 Enabled = True 18 25 ShowHint = False 19 OnPaint = DpiPaintBox1Paint 20 left = 88 21 top = 248 26 Font.Color = clDefault 27 Font.Name = 'jjjdefault' 28 Font.PixelsPerInch = 144 29 Align = alNone 30 Color = clDefault 22 31 end 23 32 end -
DpiControls/Demo/UDpiFormMain.pas
r535 r537 16 16 procedure DpiButton1Click(Sender: TObject); 17 17 procedure DpiFormMainCreate(Sender: TObject); 18 procedure DpiFormMainDestroy(Sender: TObject); 18 19 procedure DpiPaintBox1Paint(Sender: TObject); 19 20 private 21 Button: TDpiButton; 22 Image: TDpiImage; 23 ListBox: TDpiListBox; 24 PaintBox: TDpiPaintBox; 20 25 public 21 26 … … 33 38 procedure TDpiFormMain.DpiFormMainCreate(Sender: TObject); 34 39 var 35 Button: TDpiButton;36 Image: TDpiImage;37 ListBox: TDpiListBox;38 40 I: Integer; 39 PaintBox: TDpiPaintBox;40 41 begin 41 42 Button := TDpiButton.Create(DpiFormMain); … … 65 66 end; 66 67 68 procedure TDpiFormMain.DpiFormMainDestroy(Sender: TObject); 69 begin 70 FreeAndNil(Button); 71 FreeAndNil(Image); 72 FreeAndNil(ListBox); 73 end; 74 67 75 procedure TDpiFormMain.DpiPaintBox1Paint(Sender: TObject); 68 76 begin -
DpiControls/Demo/UFormMain.lfm
r535 r537 8 8 ClientWidth = 472 9 9 DesignTimePPI = 144 10 OnDestroy = FormDestroy 10 11 OnShow = FormShow 11 12 LCLVersion = '2.0.2.0' -
DpiControls/Demo/UFormMain.pas
r535 r537 19 19 TrackBar1: TTrackBar; 20 20 procedure ButtonNewDpiFormClick(Sender: TObject); 21 procedure FormDestroy(Sender: TObject); 21 22 procedure FormShow(Sender: TObject); 22 23 procedure Timer1Timer(Sender: TObject); 23 24 procedure TrackBar1Change(Sender: TObject); 24 25 private 25 26 DpiForm: TDpiForm; 26 27 public 27 28 Redraw: Boolean; … … 51 52 52 53 procedure TFormMain.ButtonNewDpiFormClick(Sender: TObject); 53 var54 DpiForm: TDpiForm;55 54 begin 56 55 DpiForm := TDpiFormMain.Create(nil); … … 59 58 DpiForm.Show; 60 59 DpiScreen.Forms.Add(DpiForm); 60 end; 61 62 procedure TFormMain.FormDestroy(Sender: TObject); 63 begin 64 FreeAndNil(DpiForm); 61 65 end; 62 66
Note:
See TracChangeset
for help on using the changeset viewer.