- Timestamp:
- Oct 11, 2016, 9:49:16 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormAcronyms.lfm
r100 r104 12 12 LCLVersion = '1.6.0.4' 13 13 object ListViewAcronyms: TListView 14 Left = 8 15 Height = 456 16 Top = 40 17 Width = 725 18 Anchors = [akTop, akLeft, akRight, akBottom] 14 Left = 4 15 Height = 466 16 Top = 34 17 Width = 732 18 Align = alClient 19 BorderSpacing.Left = 4 20 BorderSpacing.Right = 4 21 BorderSpacing.Bottom = 4 19 22 Columns = < 20 23 item … … 44 47 end 45 48 object ListViewFilter1: TListViewFilter 46 Left = 849 Left = 4 47 50 Height = 30 48 Top = 849 Width = 7 2551 Top = 4 52 Width = 732 50 53 OnChange = ListViewFilter1Change 51 Anchors = [akTop, akLeft, akRight] 54 Align = alTop 55 BorderSpacing.Left = 4 56 BorderSpacing.Top = 4 57 BorderSpacing.Right = 4 52 58 end 53 59 object StatusBar1: TStatusBar 54 60 Left = 0 55 Height = 2 456 Top = 53 461 Height = 28 62 Top = 530 57 63 Width = 740 58 64 Panels = < … … 68 74 Left = 0 69 75 Height = 26 70 Top = 50 876 Top = 504 71 77 Width = 740 72 78 Align = alBottom -
trunk/Forms/UFormAcronyms.pas
r100 r104 112 112 ListViewFilter1.UpdateFromListView(ListViewAcronyms); 113 113 UpdateAcronymsList; 114 Core.ScaleDPI1.ScaleControl(ToolBar1, Core.ScaleDPI1.DesignDPI); 114 115 end; 115 116 -
trunk/Forms/UFormCategories.lfm
r97 r104 12 12 LCLVersion = '1.6.0.4' 13 13 object ListViewCategories: TListView 14 Left = 9 15 Height = 374 16 Top = 8 17 Width = 767 18 Anchors = [akTop, akLeft, akRight, akBottom] 14 Left = 4 15 Height = 395 16 Top = 4 17 Width = 776 18 Align = alClient 19 BorderSpacing.Around = 4 19 20 Columns = < 20 21 item -
trunk/Forms/UFormCategories.pas
r97 r104 70 70 begin 71 71 UpdateList; 72 Core.ScaleDPI1.ScaleControl(ToolBar1, Core.ScaleDPI1.DesignDPI); 72 73 end; 73 74 -
trunk/Forms/UFormCategorySelect.lfm
r96 r104 1 1 object FormCategorySelect: TFormCategorySelect 2 2 Left = 500 3 Height = 6023 Height = 584 4 4 Top = 253 5 Width = 79 45 Width = 791 6 6 Caption = 'Select categories' 7 ClientHeight = 6028 ClientWidth = 79 47 ClientHeight = 584 8 ClientWidth = 791 9 9 OnCreate = FormCreate 10 10 OnShow = FormShow … … 13 13 object ListBox1: TListBox 14 14 Left = 16 15 Height = 5 3615 Height = 518 16 16 Top = 8 17 Width = 76 417 Width = 761 18 18 Anchors = [akTop, akLeft, akRight, akBottom] 19 19 ItemHeight = 0 … … 25 25 end 26 26 object ButtonOk: TButton 27 Left = 70 427 Left = 701 28 28 Height = 25 29 Top = 5 5929 Top = 541 30 30 Width = 75 31 31 Anchors = [akRight, akBottom] … … 35 35 end 36 36 object ButtonCancel: TButton 37 Left = 60 837 Left = 605 38 38 Height = 25 39 Top = 5 6039 Top = 542 40 40 Width = 75 41 41 Anchors = [akRight, akBottom] -
trunk/Forms/UFormImportFormat.lfm
r96 r104 1 1 object FormImportFormat: TFormImportFormat 2 2 Left = 462 3 Height = 43 33 Height = 439 4 4 Top = 322 5 Width = 6 645 Width = 629 6 6 Caption = 'Import format' 7 ClientHeight = 43 38 ClientWidth = 6 647 ClientHeight = 439 8 ClientWidth = 629 9 9 OnCreate = FormCreate 10 10 OnShow = FormShow … … 12 12 LCLVersion = '1.6.0.4' 13 13 object ButtonOk: TButton 14 Left = 5 6014 Left = 525 15 15 Height = 25 16 Top = 3 8416 Top = 390 17 17 Width = 75 18 18 Anchors = [akRight, akBottom] … … 22 22 end 23 23 object ButtonCancel: TButton 24 Left = 4 6424 Left = 429 25 25 Height = 25 26 Top = 3 8426 Top = 390 27 27 Width = 75 28 28 Anchors = [akRight, akBottom] … … 43 43 Height = 28 44 44 Top = 48 45 Width = 4 6145 Width = 426 46 46 Anchors = [akTop, akLeft, akRight] 47 47 TabOrder = 1 … … 59 59 Height = 28 60 60 Top = 85 61 Width = 4 6161 Width = 426 62 62 Anchors = [akTop, akLeft, akRight] 63 63 TabOrder = 2 … … 75 75 Height = 28 76 76 Top = 125 77 Width = 4 6177 Width = 426 78 78 Anchors = [akTop, akLeft, akRight] 79 79 TabOrder = 3 … … 81 81 object ListViewItemRules: TListView 82 82 Left = 20 83 Height = 19 283 Height = 198 84 84 Top = 181 85 Width = 62085 Width = 585 86 86 Anchors = [akTop, akLeft, akRight, akBottom] 87 87 Columns = < -
trunk/Forms/UFormImportFormats.lfm
r85 r104 12 12 LCLVersion = '1.6.0.4' 13 13 object ListView1: TListView 14 Left = 8 15 Height = 368 16 Top = 8 17 Width = 577 18 Anchors = [akTop, akLeft, akRight, akBottom] 14 Left = 4 15 Height = 380 16 Top = 4 17 Width = 583 18 Align = alClient 19 BorderSpacing.Around = 4 19 20 Columns = < 20 21 item -
trunk/Forms/UFormImportFormats.pas
r96 r104 104 104 begin 105 105 UpdateList; 106 Core.ScaleDPI1.ScaleControl(ToolBar1, Core.ScaleDPI1.DesignDPI); 106 107 end; 107 108 -
trunk/Forms/UFormImportSource.lfm
r96 r104 1 1 object FormImportSource: TFormImportSource 2 2 Left = 493 3 Height = 4 443 Height = 459 4 4 Top = 315 5 Width = 6 305 Width = 620 6 6 Caption = 'Import source' 7 ClientHeight = 4 448 ClientWidth = 6 307 ClientHeight = 459 8 ClientWidth = 620 9 9 OnCreate = FormCreate 10 10 OnShow = FormShow … … 15 15 Height = 28 16 16 Top = 10 17 Width = 4 8117 Width = 471 18 18 Anchors = [akTop, akLeft, akRight] 19 19 TabOrder = 0 … … 39 39 Height = 28 40 40 Top = 49 41 Width = 3 6041 Width = 350 42 42 Anchors = [akTop, akLeft, akRight] 43 43 TabOrder = 1 44 44 end 45 45 object ButtonOk: TButton 46 Left = 5 4147 Height = 25 48 Top = 4 0646 Left = 531 47 Height = 25 48 Top = 421 49 49 Width = 75 50 50 Anchors = [akRight, akBottom] … … 54 54 end 55 55 object ButtonCancel: TButton 56 Left = 4 3957 Height = 25 58 Top = 4 0656 Left = 429 57 Height = 25 58 Top = 421 59 59 Width = 75 60 60 Anchors = [akRight, akBottom] … … 75 75 Height = 28 76 76 Top = 91 77 Width = 3 6077 Width = 350 78 78 Anchors = [akTop, akLeft, akRight] 79 79 ItemHeight = 20 … … 82 82 end 83 83 object ButtonShowFormat: TButton 84 Left = 50384 Left = 493 85 85 Height = 25 86 86 Top = 91 … … 111 111 Height = 141 112 112 Top = 160 113 Width = 4 81113 Width = 471 114 114 Anchors = [akTop, akLeft, akRight] 115 115 ItemHeight = 0 … … 138 138 Left = 10 139 139 Height = 2 140 Top = 393141 Width = 5 80142 Anchors = [akLeft, ak Bottom]140 Top = 408 141 Width = 597 142 Anchors = [akLeft, akRight, akBottom] 143 143 end 144 144 object Label5: TLabel … … 175 175 end 176 176 object ButtonOpenURL: TButton 177 Left = 503177 Left = 493 178 178 Height = 25 179 179 Top = 52 -
trunk/Forms/UFormImportSources.lfm
r100 r104 44 44 end 45 45 object ListView1: TListView 46 Left = 8 47 Height = 340 48 Top = 44 49 Width = 798 50 Anchors = [akTop, akLeft, akRight, akBottom] 46 Left = 4 47 Height = 351 48 Top = 33 49 Width = 804 50 Align = alClient 51 BorderSpacing.Left = 4 52 BorderSpacing.Right = 4 53 BorderSpacing.Bottom = 4 51 54 Checkboxes = True 52 55 Columns = < … … 86 89 end 87 90 object ListViewFilter1: TListViewFilter 88 Left = 891 Left = 4 89 92 Height = 29 90 Top = 1191 Width = 79893 Top = 4 94 Width = 804 92 95 OnChange = ListViewFilter1Change 93 Anchors = [akTop, akLeft, akRight] 96 Align = alTop 97 BorderSpacing.Left = 4 98 BorderSpacing.Top = 4 99 BorderSpacing.Right = 4 94 100 end 95 101 object ActionList1: TActionList -
trunk/Forms/UFormImportSources.pas
r100 r104 172 172 begin 173 173 UpdateList; 174 Core.ScaleDPI1.ScaleControl(ToolBar1, Core.ScaleDPI1.DesignDPI); 174 175 end; 175 176 -
trunk/Forms/UFormMain.lfm
r102 r104 710 710 object MenuItem28: TMenuItem 711 711 Action = AProcessImports 712 Bitmap.Data = { 713 36040000424D3604000000000000360000002800000010000000100000000100 714 2000000000000004000064000000640000000000000000000000000000000000 715 0000000000000000000000000000000000000000000000000000000000000000 716 0000000000000000000000000000000000000000000000000000000000000000 717 000000000000303030FF303030FF303030FF303030FF00000000000000000000 718 0000000000000000000000000000000000000000000000000000000000000000 719 0000000000000000000000000000303030FF303030FF00000000000000000000 720 0000000000000000000000000000303030FF0000000000000000000000000000 721 0000000000000000000000000000303030FF303030FF00000000000000000000 722 0000000000000000000000000000303030FF0000000000000000000000000000 723 0000000000000000000000000000303030FF303030FF00000000000000003030 724 30FF303030FF303030FF303030FF303030FF0000000000000000000000000000 725 0000000000000000000000000000303030FF303030FF303030FF303030FF3030 726 30FF303030FF303030FF303030FF303030FF0000000000000000000000000000 727 000000000000000000000000000000000000303030FF303030FF303030FF3030 728 30FF000000000000000000000000000000000000000000000000000000000000 729 00000000000000000000000000000000000000000000303030FF303030FF0000 730 0000000000000000000000000000000000000000000000000000000000000000 731 00000000000000000000303030FF0000000000000000303030FF303030FF0000 732 000000000000303030FF00000000000000000000000000000000000000000000 733 000000000000303030FF303030FF303030FF303030FF303030FF303030FF0000 734 000000000000303030FF00000000000000000000000000000000000000000000 735 0000303030FF303030FF00000000303030FF303030FF303030FF303030FF0000 736 000000000000303030FF00000000000000000000000000000000000000000000 737 0000303030FF00000000000000000000000000000000303030FF303030FF3030 738 30FF303030FF303030FF00000000000000000000000000000000000000000000 739 000000000000000000000000000000000000303030FF303030FF000000000000 740 0000000000000000000000000000000000000000000000000000000000000000 741 0000000000000000000000000000303030FF303030FF303030FF303030FF0000 742 0000000000000000000000000000000000000000000000000000000000000000 743 0000000000000000000000000000303030FF303030FF303030FF303030FF0000 744 0000000000000000000000000000000000000000000000000000000000000000 745 000000000000000000000000000000000000303030FF303030FF000000000000 746 0000000000000000000000000000000000000000000000000000 747 } 712 748 end 713 749 object MenuItem19: TMenuItem -
trunk/Forms/UFormMain.pas
r102 r104 166 166 ProjectExt = '.adp'; 167 167 DefaultFileName = 'Acronyms' + ProjectExt; 168 DefaultRegKey = '\Software\Chronosoft\Acronym Decoder';169 168 RegistryRunKey = '\Software\Microsoft\Windows\CurrentVersion\Run'; 170 169 … … 431 430 ListViewFilter1.StringGrid.SetFocus; 432 431 end; 432 Core.ScaleDPI1.ScaleImageList(ImageList1, Core.ScaleDPI1.DesignDPI); 433 Core.ScaleDPI1.ScaleControl(ToolBar1, Core.ScaleDPI1.DesignDPI); 433 434 end; 434 435 -
trunk/Packages/Common/UListViewSort.pas
r103 r104 95 95 property Align; 96 96 property Anchors; 97 property BorderSpacing; 97 98 end; 98 99 -
trunk/Packages/Common/UScaleDPI.pas
r3 r104 190 190 Temp[I] := TBitmap.Create; 191 191 Temp[I].SetSize(NewWidth, NewHeight); 192 Temp[I].TransparentColor := TempBmp.TransparentColor;192 Temp[I].TransparentColor := clFuchsia;// TempBmp.TransparentColor; 193 193 //Temp[I].TransparentMode := TempBmp.TransparentMode; 194 194 Temp[I].Transparent := True; … … 247 247 WinControl: TWinControl; 248 248 ToolBarControl: TToolBar; 249 OldAnchors: TAnchors; 250 OldAutoSize: Boolean; 251 begin 252 //if Control is TMemo then Exit; 253 //if Control is TForm then 254 // Control.DisableAutoSizing; 255 with Control do begin 256 //OldAutoSize := AutoSize; 257 //AutoSize := False; 258 //Anchors := []; 259 Left := ScaleX(Left, FromDPI.X); 260 Top := ScaleY(Top, FromDPI.Y); 261 //if not (akRight in Anchors) then 262 Width := ScaleX(Width, FromDPI.X); 263 //if not (akBottom in Anchors) then 264 Height := ScaleY(Height, FromDPI.Y); 265 {$IFDEF LCL Qt} 266 Font.Size := 0; 267 {$ELSE} 268 Font.Height := ScaleY(Font.GetTextHeight('Hg'), FromDPI.Y); 269 {$ENDIF} 270 //Anchors := OldAnchors; 271 //AutoSize := OldAutoSize; 272 end; 273 274 249 begin 250 Control.BoundsRect := ScaleRect(Control.BoundsRect, DesignDPI); 251 Control.Font.Height := ScaleY(Control.Font.Height, DesignDPI.Y); 275 252 276 253 if Control is TToolBar then begin -
trunk/UCore.lfm
r97 r104 26 26 top = 272 27 27 end 28 object ScaleDPI1: TScaleDPI 29 AutoDetect = False 30 left = 156 31 top = 272 32 end 28 33 end -
trunk/UCore.pas
r99 r104 7 7 uses 8 8 Classes, SysUtils, FileUtil, UAcronym, UCoolTranslator, UPersistentForm, 9 UJobProgressView, Forms, Controls, LazFileUtils; 9 UJobProgressView, UScaleDPI, Forms, Controls, LazFileUtils, URegistry, 10 Registry; 10 11 11 12 type … … 17 18 JobProgressView1: TJobProgressView; 18 19 PersistentForm1: TPersistentForm; 20 ScaleDPI1: TScaleDPI; 19 21 procedure CoolTranslator1Translate(Sender: TObject); 20 22 procedure DataModuleCreate(Sender: TObject); … … 22 24 private 23 25 FAlwaysOnTop: Boolean; 26 StoredDimension: TControlDimension; 24 27 procedure SetAlwaysOnTop(AValue: Boolean); 25 28 function FindFirstNonOption: string; … … 33 36 procedure LoadConfig; 34 37 procedure SaveConfig; 38 procedure ScaleDPI; 35 39 property AlwaysOnTop: Boolean read FAlwaysOnTop write SetAlwaysOnTop; 36 40 end; … … 38 42 var 39 43 Core: TCore; 44 45 const 46 DefaultRegKey = '\Software\Chronosoft\Acronym Decoder'; 47 40 48 41 49 implementation … … 55 63 InitializeStarted := False; 56 64 InitializeFinished := False; 65 StoredDimension := TControlDimension.Create; 57 66 end; 58 67 59 68 procedure TCore.DataModuleDestroy(Sender: TObject); 60 69 begin 70 FreeAndNil(StoredDimension); 61 71 FreeAndNil(AcronymDb); 62 72 end; … … 116 126 FormMain.ProjectOpen(FileNameOption); 117 127 end; 128 ScaleDPI; 118 129 FormMain.UpdateAcronymsList; 119 130 FormMain.ListViewFilter1.UpdateFromListView(FormMain.ListViewAcronyms); … … 125 136 begin 126 137 FormMain.LoadConfig; 138 139 with TRegistryEx.Create do 140 try 141 RootKey := HKEY_CURRENT_USER; 142 OpenKey(DefaultRegKey, True); 143 ScaleDPI1.DPI := Point(ReadIntegerWithDefault('DPIX', 96), ReadIntegerWithDefault('DPIY', 96)); 144 ScaleDPI1.AutoDetect := ReadBoolWithDefault('DPIAuto', True); 145 finally 146 Free; 147 end; 127 148 end; 128 149 … … 130 151 begin 131 152 FormMain.SaveConfig; 153 154 with TRegistryEx.Create do 155 try 156 RootKey := HKEY_CURRENT_USER; 157 OpenKey(DefaultRegKey, True); 158 WriteInteger('DPIX', ScaleDPI1.DPI.X); 159 WriteInteger('DPIY', ScaleDPI1.DPI.Y); 160 WriteBool('DPIAuto', ScaleDPI1.AutoDetect); 161 finally 162 Free; 163 end; 164 end; 165 166 procedure TCore.ScaleDPI; 167 var 168 I: Integer; 169 begin 170 //ScaleDPI1.DPI := Point(150, 150); 171 with ScaleDPI1 do 172 if (DesignDPI.X <> DPI.X) or (DesignDPI.Y <> DPI.Y) then begin 173 for I := 0 to Screen.FormCount - 1 do begin 174 //StoreDimensions(Screen.Forms[I], StoredDimension); 175 //ScaleDimensions(Screen.Forms[I], StoredDimension); 176 end; 177 end; 132 178 end; 133 179
Note:
See TracChangeset
for help on using the changeset viewer.