Changeset 537 for DpiControls/Demo


Ignore:
Timestamp:
Jun 23, 2019, 12:36:19 AM (5 years ago)
Author:
chronos
Message:
Location:
DpiControls/Demo
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • DpiControls/Demo/DpiComponentsDemo.lpr

    r534 r537  
    88  {$ENDIF}{$ENDIF}
    99  Interfaces, // this includes the LCL widgetset
    10   Forms, UFormMain, UDpiFormMain
     10  Forms, UFormMain, UDpiFormMain, SysUtils
    1111  { you can add units after this };
    1212
    1313{$R *.res}
    1414
     15{$if declared(UseHeapTrace)}
     16const
     17  HeapTraceLog = 'heaptrclog.trc';
     18{$ENDIF}
     19
    1520begin
     21    {$if declared(UseHeapTrace)}
     22  // Heap trace
     23  DeleteFile(ExtractFilePath(ParamStr(0)) + HeapTraceLog);
     24  SetHeapTraceOutput(ExtractFilePath(ParamStr(0)) + HeapTraceLog);
     25  {$ENDIF}
     26
    1627  RequireDerivedFormResource:=True;
    1728  Application.Scaled:=True;
  • DpiControls/Demo/UDpiFormMain.lfm

    r535 r537  
    22  Top = 504
    33  Left = 865
    4   Width = 0
    5   Height = 0
     4  Width = 1
     5  Height = 1
    66  Visible = True
    77  Enabled = True
    88  ShowHint = False
     9  Font.Color = clDefault
     10  Font.PixelsPerInch = 144
     11  Align = alNone
     12  Color = clDefault
     13  DesignTimePPI = 96
    914  BorderStyle = Controls
     15  BorderIcons = [biSystemMenu, biMinimize, biMaximize]
    1016  OnCreate = DpiFormMainCreate
     17  OnDestroy = DpiFormMainDestroy
    1118  object DpiPaintBox1: TDpiPaintBox
    12     Top = 161
    13     Left = 124
     19    Top = 248
     20    Left = 88
    1421    Width = 100
    1522    Height = 100
     
    1724    Enabled = True
    1825    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
    2231  end
    2332end
  • DpiControls/Demo/UDpiFormMain.pas

    r535 r537  
    1616    procedure DpiButton1Click(Sender: TObject);
    1717    procedure DpiFormMainCreate(Sender: TObject);
     18    procedure DpiFormMainDestroy(Sender: TObject);
    1819    procedure DpiPaintBox1Paint(Sender: TObject);
    1920  private
     21    Button: TDpiButton;
     22    Image: TDpiImage;
     23    ListBox: TDpiListBox;
     24    PaintBox: TDpiPaintBox;
    2025  public
    2126
     
    3338procedure TDpiFormMain.DpiFormMainCreate(Sender: TObject);
    3439var
    35   Button: TDpiButton;
    36   Image: TDpiImage;
    37   ListBox: TDpiListBox;
    3840  I: Integer;
    39   PaintBox: TDpiPaintBox;
    4041begin
    4142  Button := TDpiButton.Create(DpiFormMain);
     
    6566end;
    6667
     68procedure TDpiFormMain.DpiFormMainDestroy(Sender: TObject);
     69begin
     70  FreeAndNil(Button);
     71  FreeAndNil(Image);
     72  FreeAndNil(ListBox);
     73end;
     74
    6775procedure TDpiFormMain.DpiPaintBox1Paint(Sender: TObject);
    6876begin
  • DpiControls/Demo/UFormMain.lfm

    r535 r537  
    88  ClientWidth = 472
    99  DesignTimePPI = 144
     10  OnDestroy = FormDestroy
    1011  OnShow = FormShow
    1112  LCLVersion = '2.0.2.0'
  • DpiControls/Demo/UFormMain.pas

    r535 r537  
    1919    TrackBar1: TTrackBar;
    2020    procedure ButtonNewDpiFormClick(Sender: TObject);
     21    procedure FormDestroy(Sender: TObject);
    2122    procedure FormShow(Sender: TObject);
    2223    procedure Timer1Timer(Sender: TObject);
    2324    procedure TrackBar1Change(Sender: TObject);
    2425  private
    25 
     26    DpiForm: TDpiForm;
    2627  public
    2728    Redraw: Boolean;
     
    5152
    5253procedure TFormMain.ButtonNewDpiFormClick(Sender: TObject);
    53 var
    54   DpiForm: TDpiForm;
    5554begin
    5655  DpiForm := TDpiFormMain.Create(nil);
     
    5958  DpiForm.Show;
    6059  DpiScreen.Forms.Add(DpiForm);
     60end;
     61
     62procedure TFormMain.FormDestroy(Sender: TObject);
     63begin
     64  FreeAndNil(DpiForm);
    6165end;
    6266
Note: See TracChangeset for help on using the changeset viewer.