Changeset 535 for DpiControls/Demo
- Timestamp:
- May 27, 2019, 12:06:17 AM (5 years ago)
- Location:
- DpiControls/Demo
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
DpiControls/Demo/DpiComponentsDemo.lpi
r534 r535 15 15 <Icon Value="0"/> 16 16 </General> 17 <BuildModes Count="1"> 18 <Item1 Name="Default" Default="True"/> 17 <BuildModes Count="2"> 18 <Item1 Name="Debug" Default="True"/> 19 <Item2 Name="Release"> 20 <CompilerOptions> 21 <Version Value="11"/> 22 <Target> 23 <Filename Value="DpiComponentsDemo"/> 24 </Target> 25 <SearchPaths> 26 <IncludeFiles Value="$(ProjOutDir)"/> 27 <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)-${BuildMode}"/> 28 </SearchPaths> 29 <Parsing> 30 <SyntaxOptions> 31 <CStyleOperator Value="False"/> 32 <AllowLabel Value="False"/> 33 <CPPInline Value="False"/> 34 </SyntaxOptions> 35 </Parsing> 36 <CodeGeneration> 37 <Optimizations> 38 <OptimizationLevel Value="3"/> 39 </Optimizations> 40 </CodeGeneration> 41 <Linking> 42 <Debugging> 43 <GenerateDebugInfo Value="False"/> 44 </Debugging> 45 <Options> 46 <Win32> 47 <GraphicApplication Value="True"/> 48 </Win32> 49 </Options> 50 </Linking> 51 <Other> 52 <CompilerMessages> 53 <IgnoredMessages idx5024="True"/> 54 </CompilerMessages> 55 </Other> 56 </CompilerOptions> 57 </Item2> 19 58 </BuildModes> 20 59 <PublishOptions> … … 64 103 <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)-${BuildMode}"/> 65 104 </SearchPaths> 105 <Parsing> 106 <SyntaxOptions> 107 <CStyleOperator Value="False"/> 108 <IncludeAssertionCode Value="True"/> 109 <AllowLabel Value="False"/> 110 <CPPInline Value="False"/> 111 </SyntaxOptions> 112 </Parsing> 113 <CodeGeneration> 114 <Checks> 115 <IOChecks Value="True"/> 116 <RangeChecks Value="True"/> 117 <OverflowChecks Value="True"/> 118 <StackChecks Value="True"/> 119 </Checks> 120 <VerifyObjMethodCallValidity Value="True"/> 121 </CodeGeneration> 66 122 <Linking> 123 <Debugging> 124 <UseHeaptrc Value="True"/> 125 </Debugging> 67 126 <Options> 68 127 <Win32> … … 71 130 </Options> 72 131 </Linking> 132 <Other> 133 <CompilerMessages> 134 <IgnoredMessages idx5024="True"/> 135 </CompilerMessages> 136 </Other> 73 137 </CompilerOptions> 74 138 <Debugging> -
DpiControls/Demo/UDpiFormMain.lfm
r534 r535 5 5 Height = 0 6 6 Visible = True 7 Enabled = True 8 ShowHint = False 9 BorderStyle = Controls 7 10 OnCreate = DpiFormMainCreate 8 object Dpi Button1: TDpiButton9 Top = 1 2810 Left = 811 Width = 1 5012 Height = 4011 object DpiPaintBox1: TDpiPaintBox 12 Top = 161 13 Left = 124 14 Width = 100 15 Height = 100 13 16 Visible = True 14 Caption = 'Test' 15 OnClick = DpiButton1Click 17 Enabled = True 18 ShowHint = False 19 OnPaint = DpiPaintBox1Paint 20 left = 88 21 top = 248 16 22 end 17 23 end -
DpiControls/Demo/UDpiFormMain.pas
r534 r535 6 6 7 7 uses 8 Classes, SysUtils, UDpiControls, Dialogs ;8 Classes, SysUtils, UDpiControls, Dialogs, Graphics; 9 9 10 10 type … … 13 13 14 14 TDpiFormMain = class(TDpiForm) 15 Dpi Button1: TDpiButton;15 DpiPaintBox1: TDpiPaintBox; 16 16 procedure DpiButton1Click(Sender: TObject); 17 17 procedure DpiFormMainCreate(Sender: TObject); 18 procedure DpiPaintBox1Paint(Sender: TObject); 18 19 private 19 20 20 public 21 21 … … 33 33 procedure TDpiFormMain.DpiFormMainCreate(Sender: TObject); 34 34 var 35 DpiButton: TDpiButton; 36 DpiImage: TDpiImage; 35 Button: TDpiButton; 36 Image: TDpiImage; 37 ListBox: TDpiListBox; 38 I: Integer; 39 PaintBox: TDpiPaintBox; 37 40 begin 38 DpiButton := TDpiButton.Create(DpiFormMain); 39 DpiButton.Parent := Self; 40 DpiButton.SetBounds(10, 10, 100, 30); 41 DpiButton.Caption := 'Click me'; 42 DpiButton.Visible := True; 43 DpiButton1.Parent := Self; 41 Button := TDpiButton.Create(DpiFormMain); 42 Button.Parent := Self; 43 Button.SetBounds(10, 10, 100, 30); 44 Button.Caption := 'Click me'; 45 Button.Visible := True; 44 46 45 DpiImage := TDpiImage.Create(DpiFormMain); 46 DpiImage.Parent := Self; 47 DpiImage.SetBounds(150, 10, 100, 100); 48 DpiImage.Visible := True; 49 DpiImage.Stretch := True; 50 DpiImage.VclImage.Picture.LoadFromFile('dance.jpg'); 47 Image := TDpiImage.Create(DpiFormMain); 48 Image.Parent := Self; 49 Image.SetBounds(150, 10, 100, 100); 50 Image.Visible := True; 51 Image.Stretch := True; 52 Image.VclImage.Picture.LoadFromFile('dance.jpg'); 53 //Image.Picture.LoadFromFile('dance.jpg'); 54 55 ListBox := TDpiListBox.Create(DpiFormMain); 56 for I := 0 to 10 do 57 ListBox.VclListBox.Items.Add('Item ' + IntToStr(I)); 58 ListBox.Parent := Self; 59 ListBox.SetBounds(250, 10, 100, 100); 60 ListBox.Visible := True; 61 62 DpiPaintBox1.BoundsRect := Rect(0, 0, 100, 100); 63 DpiPaintBox1.VclPaintBox.Parent := VclForm; 64 DpiPaintBox1.Repaint; 65 end; 66 67 procedure TDpiFormMain.DpiPaintBox1Paint(Sender: TObject); 68 begin 69 with DpiPaintBox1.Canvas do begin 70 Brush.Color := clWhite; 71 Brush.Style := bsSolid; 72 FillRect(Rect(0, 0, 100, 100)); 73 Caption := IntToStr(Width); 74 Pen.Color := clGreen; 75 Pen.Style := psSolid; 76 MoveTo(0, 0); 77 LineTo(100, 100); 78 Font.Color := clRed; 79 TextOut(40, 10, 'Scaled text'); 80 end; 51 81 end; 52 82 -
DpiControls/Demo/UFormMain.lfm
r534 r535 38 38 TabOrder = 1 39 39 end 40 object Timer1: TTimer 41 Interval = 100 42 OnTimer = Timer1Timer 43 left = 256 44 top = 40 45 end 40 46 end -
DpiControls/Demo/UFormMain.pas
r534 r535 16 16 ButtonNewDpiForm: TButton; 17 17 Label1: TLabel; 18 Timer1: TTimer; 18 19 TrackBar1: TTrackBar; 19 20 procedure ButtonNewDpiFormClick(Sender: TObject); 20 21 procedure FormShow(Sender: TObject); 22 procedure Timer1Timer(Sender: TObject); 21 23 procedure TrackBar1Change(Sender: TObject); 22 24 private 23 25 24 26 public 25 27 Redraw: Boolean; 26 28 end; 27 29 … … 42 44 end; 43 45 46 procedure TFormMain.Timer1Timer(Sender: TObject); 47 begin 48 Redraw := False; 49 DpiScreen.Dpi := TrackBar1.Position; 50 end; 51 44 52 procedure TFormMain.ButtonNewDpiFormClick(Sender: TObject); 45 53 var … … 55 63 procedure TFormMain.TrackBar1Change(Sender: TObject); 56 64 begin 57 DpiScreen.Dpi := TrackBar1.Position;65 Redraw := True; 58 66 end; 59 67
Note:
See TracChangeset
for help on using the changeset viewer.