Changeset 533 for DpiControls/Demo


Ignore:
Timestamp:
May 26, 2019, 7:33:14 PM (5 years ago)
Author:
chronos
Message:
  • Added: TDpiImage control.
Location:
DpiControls
Files:
1 added
8 edited

Legend:

Unmodified
Added
Removed
  • DpiControls

    • Property svn:ignore set to
      lib
  • DpiControls/Demo

    • Property svn:ignore set to
      DpiComponentsDemo
      DpiComponentsDemo.lps
      DpiComponentsDemo.res
      lib
  • DpiControls/Demo/DpiComponentsDemo.lpi

    r532 r533  
    4343        <Filename Value="UFormMain.pas"/>
    4444        <IsPartOfProject Value="True"/>
    45         <ComponentName Value="Form1"/>
     45        <ComponentName Value="FormMain"/>
    4646        <HasResources Value="True"/>
    4747        <ResourceBaseClass Value="Form"/>
     
    6262    <SearchPaths>
    6363      <IncludeFiles Value="$(ProjOutDir)"/>
    64       <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
     64      <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)-${BuildMode}"/>
    6565    </SearchPaths>
    6666    <Linking>
  • DpiControls/Demo/DpiComponentsDemo.lpr

    r532 r533  
    1717  Application.Scaled:=True;
    1818  Application.Initialize;
    19   Application.CreateForm(TForm1, Form1);
     19  Application.CreateForm(TFormMain, FormMain);
    2020  Application.Run;
    2121end.
  • DpiControls/Demo/UDpiForm.lfm

    r532 r533  
    77  OnShow = DpiForm1Show
    88  object DpiButton1: TDpiButton
    9     Top = 104
    10     Left = 120
     9    Top = 154
     10    Left = 20
    1111    Width = 150
    1212    Height = 40
     
    1414    Caption = 'Test'
    1515    OnClick = DpiButton1Click
     16    left = 88
     17    top = 88
    1618  end
    1719end
  • DpiControls/Demo/UDpiForm.pas

    r532 r533  
    3434var
    3535  DpiButton: TDpiButton;
     36  DpiImage: TDpiImage;
    3637begin
    3738  DpiButton := TDpiButton.Create(DpiForm1);
     
    4142  DpiButton.Visible := True;
    4243  DpiButton1.Parent := Self;
     44
     45  DpiImage := TDpiImage.Create(DpiForm1);
     46  DpiImage.Parent := DpiForm1;
     47  DpiImage.SetBounds(150, 10, 100, 100);
     48  DpiImage.Visible := True;
     49  DpiImage.Stretch := True;
     50  DpiImage.VclImage.Picture.LoadFromFile('dance.jpg');
    4351end;
    4452
  • DpiControls/Demo/UFormMain.lfm

    r532 r533  
    1 object Form1: TForm1
    2   Left = 837
    3   Height = 360
    4   Top = 45
    5   Width = 480
    6   Caption = 'Form1'
    7   ClientHeight = 360
    8   ClientWidth = 480
     1object FormMain: TFormMain
     2  Left = 57
     3  Height = 126
     4  Top = 44
     5  Width = 472
     6  Caption = 'DpiControls demo'
     7  ClientHeight = 126
     8  ClientWidth = 472
    99  DesignTimePPI = 144
    1010  OnShow = FormShow
    1111  LCLVersion = '2.0.2.0'
    1212  object TrackBar1: TTrackBar
    13     Left = 24
     13    Left = 13
    1414    Height = 58
    15     Top = 102
    16     Width = 416
     15    Top = 40
     16    Width = 440
    1717    Max = 1000
    1818    Min = 96
     
    2121    TabOrder = 0
    2222  end
     23  object Label1: TLabel
     24    Left = 13
     25    Height = 26
     26    Top = 8
     27    Width = 35
     28    Caption = 'DPI:'
     29    ParentColor = False
     30  end
    2331end
  • DpiControls/Demo/UFormMain.pas

    r532 r533  
    66
    77uses
    8   Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ComCtrls, UDpiForm,
    9   UDpiControls;
     8  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ComCtrls, StdCtrls,
     9  ExtCtrls, UDpiForm, UDpiControls;
    1010
    1111type
    1212
    13   { TForm1 }
     13  { TFormMain }
    1414
    15   TForm1 = class(TForm)
     15  TFormMain = class(TForm)
     16    Label1: TLabel;
    1617    TrackBar1: TTrackBar;
    1718    procedure FormShow(Sender: TObject);
     
    2425
    2526var
    26   Form1: TForm1;
     27  FormMain: TFormMain;
    2728
    2829implementation
     
    3031{$R *.lfm}
    3132
    32 { TForm1 }
     33{ TFormMain }
    3334
    34 procedure TForm1.FormShow(Sender: TObject);
     35procedure TFormMain.FormShow(Sender: TObject);
    3536begin
    3637  DpiScreen.Dpi := 96 * 2;
     
    4546end;
    4647
    47 procedure TForm1.TrackBar1Change(Sender: TObject);
     48procedure TFormMain.TrackBar1Change(Sender: TObject);
    4849begin
    4950  DpiScreen.Dpi := TrackBar1.Position;
Note: See TracChangeset for help on using the changeset viewer.