Changeset 534 for DpiControls/Demo
- Timestamp:
- May 26, 2019, 8:29:38 PM (5 years ago)
- Location:
- DpiControls/Demo
- Files:
-
- 4 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
DpiControls/Demo/DpiComponentsDemo.lpi
r533 r534 48 48 </Unit1> 49 49 <Unit2> 50 <Filename Value="UDpiForm .pas"/>50 <Filename Value="UDpiFormMain.pas"/> 51 51 <IsPartOfProject Value="True"/> 52 <ComponentName Value="DpiForm 1"/>52 <ComponentName Value="DpiFormMain"/> 53 53 <HasResources Value="True"/> 54 54 </Unit2> -
DpiControls/Demo/DpiComponentsDemo.lpr
r533 r534 8 8 {$ENDIF}{$ENDIF} 9 9 Interfaces, // this includes the LCL widgetset 10 Forms, UFormMain, UDpiForm 10 Forms, UFormMain, UDpiFormMain 11 11 { you can add units after this }; 12 12 -
DpiControls/Demo/UDpiFormMain.lfm
r533 r534 1 object DpiForm 1: TDpiForm11 object DpiFormMain: TDpiFormMain 2 2 Top = 504 3 3 Left = 865 4 4 Width = 0 5 5 Height = 0 6 Visible = False7 On Show = DpiForm1Show6 Visible = True 7 OnCreate = DpiFormMainCreate 8 8 object DpiButton1: TDpiButton 9 Top = 1 5410 Left = 209 Top = 128 10 Left = 8 11 11 Width = 150 12 12 Height = 40 … … 14 14 Caption = 'Test' 15 15 OnClick = DpiButton1Click 16 left = 8817 top = 8818 16 end 19 17 end -
DpiControls/Demo/UDpiFormMain.pas
r533 r534 1 unit UDpiForm ;1 unit UDpiFormMain; 2 2 3 3 {$mode objfpc}{$H+} … … 10 10 type 11 11 12 { TDpiForm 1}12 { TDpiFormMain } 13 13 14 TDpiForm 1= class(TDpiForm)14 TDpiFormMain = class(TDpiForm) 15 15 DpiButton1: TDpiButton; 16 16 procedure DpiButton1Click(Sender: TObject); 17 procedure DpiForm 1Show(Sender: TObject);17 procedure DpiFormMainCreate(Sender: TObject); 18 18 private 19 19 … … 23 23 24 24 var 25 DpiForm 1: TDpiForm1;25 DpiFormMain: TDpiFormMain; 26 26 27 27 implementation … … 29 29 {$R *.lfm} 30 30 31 { TDpiForm 1}31 { TDpiFormMain } 32 32 33 procedure TDpiForm 1.DpiForm1Show(Sender: TObject);33 procedure TDpiFormMain.DpiFormMainCreate(Sender: TObject); 34 34 var 35 35 DpiButton: TDpiButton; 36 36 DpiImage: TDpiImage; 37 37 begin 38 DpiButton := TDpiButton.Create(DpiForm 1);39 DpiButton.Parent := DpiForm1;38 DpiButton := TDpiButton.Create(DpiFormMain); 39 DpiButton.Parent := Self; 40 40 DpiButton.SetBounds(10, 10, 100, 30); 41 41 DpiButton.Caption := 'Click me'; … … 43 43 DpiButton1.Parent := Self; 44 44 45 DpiImage := TDpiImage.Create(DpiForm 1);46 DpiImage.Parent := DpiForm1;45 DpiImage := TDpiImage.Create(DpiFormMain); 46 DpiImage.Parent := Self; 47 47 DpiImage.SetBounds(150, 10, 100, 100); 48 48 DpiImage.Visible := True; … … 51 51 end; 52 52 53 procedure TDpiForm 1.DpiButton1Click(Sender: TObject);53 procedure TDpiFormMain.DpiButton1Click(Sender: TObject); 54 54 begin 55 55 ShowMessage('Hello'); -
DpiControls/Demo/UFormMain.lfm
r533 r534 1 1 object FormMain: TFormMain 2 Left = 573 Height = 1 264 Top = 442 Left = 127 3 Height = 168 4 Top = 66 5 5 Width = 472 6 6 Caption = 'DpiControls demo' 7 ClientHeight = 1 267 ClientHeight = 168 8 8 ClientWidth = 472 9 9 DesignTimePPI = 144 … … 29 29 ParentColor = False 30 30 end 31 object ButtonNewDpiForm: TButton 32 Left = 19 33 Height = 38 34 Top = 117 35 Width = 193 36 Caption = 'New DpiForm' 37 OnClick = ButtonNewDpiFormClick 38 TabOrder = 1 39 end 31 40 end -
DpiControls/Demo/UFormMain.pas
r533 r534 7 7 uses 8 8 Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ComCtrls, StdCtrls, 9 ExtCtrls, UDpi Form, UDpiControls;9 ExtCtrls, UDpiControls, UDpiFormMain; 10 10 11 11 type … … 14 14 15 15 TFormMain = class(TForm) 16 ButtonNewDpiForm: TButton; 16 17 Label1: TLabel; 17 18 TrackBar1: TTrackBar; 19 procedure ButtonNewDpiFormClick(Sender: TObject); 18 20 procedure FormShow(Sender: TObject); 19 21 procedure TrackBar1Change(Sender: TObject); … … 37 39 DpiScreen.Dpi := 96 * 2; 38 40 TrackBar1.Position := DpiScreen.Dpi; 41 ButtonNewDpiFormClick(nil); 42 end; 39 43 40 DpiForm1 := TDpiForm1.Create(nil); 41 DpiForm1.Caption := DpiForm1.Name; 42 DpiForm1.SetBounds(100, 100, 400, 200); 43 DpiForm1.Show; 44 45 DpiScreen.Forms.Add(DpiForm1); 44 procedure TFormMain.ButtonNewDpiFormClick(Sender: TObject); 45 var 46 DpiForm: TDpiForm; 47 begin 48 DpiForm := TDpiFormMain.Create(nil); 49 DpiForm.Caption := DpiForm.Name; 50 DpiForm.SetBounds(100, 100, 400, 200); 51 DpiForm.Show; 52 DpiScreen.Forms.Add(DpiForm); 46 53 end; 47 54
Note:
See TracChangeset
for help on using the changeset viewer.