Changeset 91 for trunk/Forms
- Timestamp:
- Jul 20, 2018, 9:41:37 AM (6 years ago)
- Location:
- trunk/Forms
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms
-
Property svn:ignore
set to
*.lrj
-
Property svn:ignore
set to
-
trunk/Forms/UFormMain.lfm
r88 r91 1 1 object FormMain: TFormMain 2 Left = 4 902 Left = 405 3 3 Height = 586 4 Top = 3154 Top = 226 5 5 Width = 860 6 6 Caption = 'LazFuck' 7 ClientHeight = 5 547 ClientHeight = 561 8 8 ClientWidth = 860 9 DesignTimePPI = 120 9 10 Menu = MainMenu1 10 11 OnClose = FormClose … … 13 14 OnDestroy = FormDestroy 14 15 OnShow = FormShow 15 LCLVersion = '1. 6.4.0'16 LCLVersion = '1.8.2.0' 16 17 WindowState = wsMaximized 17 18 object StatusBarMain: TStatusBar 18 19 Left = 0 19 20 Height = 28 20 Top = 5 2621 Top = 533 21 22 Width = 860 22 23 Panels = < … … 47 48 end 48 49 object ToolButton2: TToolButton 49 Left = 2450 Left = 30 50 51 Top = 2 51 52 Action = AProjectOpen … … 54 55 end 55 56 object ToolButton3: TToolButton 56 Left = 5957 Left = 74 57 58 Top = 2 58 59 Action = AProjectSave 59 60 end 60 61 object ToolButton4: TToolButton 61 Left = 8262 Left = 103 62 63 Top = 2 63 64 Action = AProjectClose 64 65 end 65 66 object ToolButton5: TToolButton 66 Left = 128 67 Height = 22 68 Top = 2 69 Width = 10 67 Left = 161 68 Height = 28 69 Top = 2 70 70 Style = tbsSeparator 71 71 end 72 72 object ToolButton6: TToolButton 73 Left = 1 6173 Left = 198 74 74 Top = 2 75 75 Action = AProgramRun 76 76 end 77 77 object ToolButton7: TToolButton 78 Left = 1 3878 Left = 169 79 79 Top = 2 80 80 Action = AProgramCompile 81 81 end 82 82 object ToolButton8: TToolButton 83 Left = 1 0583 Left = 132 84 84 Top = 2 85 85 Action = AOptions 86 86 end 87 87 object ToolButton9: TToolButton 88 Left = 2 3088 Left = 285 89 89 Top = 2 90 90 Action = ABreakpointToggle 91 91 end 92 92 object ToolButton10: TToolButton 93 Left = 18493 Left = 227 94 94 Top = 2 95 95 Action = AProgramPause 96 96 end 97 97 object ToolButton11: TToolButton 98 Left = 2 0798 Left = 256 99 99 Top = 2 100 100 Action = AProgramStop 101 101 end 102 102 object ToolButton12: TToolButton 103 Left = 253103 Left = 314 104 104 Top = 2 105 105 Action = AProgramStepOver 106 106 end 107 107 object ToolButton13: TToolButton 108 Left = 276108 Left = 343 109 109 Top = 2 110 110 Action = AProgramStepInto 111 111 end 112 112 object ToolButton14: TToolButton 113 Left = 299113 Left = 372 114 114 Top = 2 115 115 Action = AProgramStepOut 116 116 end 117 117 object ToolButton15: TToolButton 118 Left = 322118 Left = 401 119 119 Top = 2 120 120 Action = AProgramRunToCursor 121 121 end 122 122 object ToolButtonTarget: TToolButton 123 Left = 345123 Left = 430 124 124 Hint = 'Target select' 125 125 Top = 2 … … 131 131 object PageControlRight: TPageControl 132 132 Left = 467 133 Height = 50 0133 Height = 507 134 134 Top = 26 135 135 Width = 393 … … 141 141 object TabSheetDebug: TTabSheet 142 142 Caption = 'Debug' 143 ClientHeight = 49 4144 ClientWidth = 3 19143 ClientHeight = 499 144 ClientWidth = 359 145 145 object PanelInput: TPanel 146 146 Left = 0 147 147 Height = 64 148 148 Top = 0 149 Width = 3 19149 Width = 359 150 150 Align = alTop 151 151 BevelOuter = bvNone … … 157 157 Height = 5 158 158 Top = 64 159 Width = 3 19159 Width = 359 160 160 Align = alTop 161 161 ResizeAnchor = akTop … … 165 165 Height = 259 166 166 Top = 69 167 Width = 3 19167 Width = 359 168 168 Align = alTop 169 169 BevelOuter = bvNone … … 175 175 Height = 5 176 176 Top = 328 177 Width = 3 19177 Width = 359 178 178 Align = alTop 179 179 ResizeAnchor = akTop … … 183 183 Height = 86 184 184 Top = 333 185 Width = 3 19185 Width = 359 186 186 Align = alTop 187 187 BevelOuter = bvNone … … 193 193 Height = 5 194 194 Top = 419 195 Width = 3 19195 Width = 359 196 196 Align = alTop 197 197 ResizeAnchor = akTop … … 199 199 object PanelMemory: TPanel 200 200 Left = 0 201 Height = 7 0201 Height = 75 202 202 Top = 424 203 Width = 3 19203 Width = 359 204 204 Align = alClient 205 205 BevelOuter = bvNone … … 210 210 object Splitter1: TSplitter 211 211 Left = 462 212 Height = 50 0212 Height = 507 213 213 Top = 26 214 214 Width = 5 … … 218 218 object PanelLeft: TPanel 219 219 Left = 0 220 Height = 50 0220 Height = 507 221 221 Top = 26 222 222 Width = 462 223 223 Align = alClient 224 224 BevelOuter = bvNone 225 ClientHeight = 50 0225 ClientHeight = 507 226 226 ClientWidth = 462 227 227 TabOrder = 4 228 228 object PageControlMain: TPageControl 229 229 Left = 0 230 Height = 3 77230 Height = 384 231 231 Top = 0 232 232 Width = 462 … … 246 246 Left = 0 247 247 Height = 118 248 Top = 38 2248 Top = 389 249 249 Width = 462 250 250 ActivePage = TabSheetMessages … … 261 261 Left = 0 262 262 Height = 5 263 Top = 3 77263 Top = 384 264 264 Width = 462 265 265 Align = alBottom -
trunk/Forms/UFormMain.pas
r90 r91 7 7 uses 8 8 Classes, SysUtils, FileUtil, SynEdit, Forms, Controls, Graphics, Dialogs, 9 Menus, ActnList, ComCtrls, ExtCtrls, UTarget, Registry, URegistry, Process,9 Menus, ActnList, ComCtrls, ExtCtrls, UTarget, Registry, URegistry, 10 10 LazFileUtils; 11 11 … … 305 305 if not Assigned(Core.CurrentTarget) then 306 306 Core.CurrentTarget := TTarget(Core.Targets[0]); 307 Core.Optimizations.AddSub := ReadBoolWithDefault('OptimizationAddSubEnabled', True); 308 Core.Optimizations.Merge := ReadBoolWithDefault('OptimizationMerge', True); 309 Core.Optimizations.CopyMultiply := ReadBoolWithDefault('OptimizationCopyMultiplyEnabled', True); 310 Core.Optimizations.RelativeIndexes := ReadBoolWithDefault('OptimizationRelativeIndexesEnabled', True); 307 311 finally 308 312 Free; … … 317 321 OpenKey(Key, True); 318 322 WriteString('TargetName', Core.CurrentTarget.Name); 323 WriteBool('OptimizationAddSubEnabled', Core.Optimizations.AddSub); 324 WriteBool('OptimizationMerge', Core.Optimizations.Merge); 325 WriteBool('OptimizationCopyMultiplyEnabled', Core.Optimizations.CopyMultiply); 326 WriteBool('OptimizationRelativeIndexesEnabled', Core.Optimizations.RelativeIndexes); 319 327 finally 320 328 Free; … … 458 466 procedure TFormMain.AOptionsExecute(Sender: TObject); 459 467 begin 460 OptionsForm.Load; 461 if OptionsForm.ShowModal = mrOK then begin 462 OptionsForm.Save; 463 if Assigned(Core.CurrentTarget) then begin 464 Core.CurrentTarget.OptimizationLevel := Core.OptimizationLevel; 465 if Core.CurrentTarget is TBFTarget then begin 466 TBFTarget(Core.CurrentTarget).CellSize := Core.CellSize; 467 TBFTarget(Core.CurrentTarget).MemorySize := Core.MemorySize; 468 FormOptions := TFormOptions.Create(nil); 469 try 470 FormOptions.Load; 471 if FormOptions.ShowModal = mrOK then begin 472 FormOptions.Save; 473 if Assigned(Core.CurrentTarget) then begin 474 Core.CurrentTarget.OptimizationLevel := Core.OptimizationLevel; 475 if Core.CurrentTarget is TBFTarget then begin 476 TBFTarget(Core.CurrentTarget).CellSize := Core.CellSize; 477 TBFTarget(Core.CurrentTarget).MemorySize := Core.MemorySize; 478 end; 468 479 end; 469 480 end; 481 finally 482 FormOptions.Free; 470 483 end; 471 484 end; … … 479 492 ProjectFileName := Core.Project.FileName; 480 493 ProgramName := ExtractFileNameOnly(Core.Project.FileName); 494 if Core.CurrentTarget is TBFTarget then 495 TBFTarget(Core.CurrentTarget).Optimizations := Core.Optimizations; 481 496 Core.CurrentTarget.Messages.AddMessage(SCompileStart); 482 497 Application.ProcessMessages; -
trunk/Forms/UFormOptions.lfm
r70 r91 1 object OptionsForm: TOptionsForm2 Left = 6653 Height = 3394 Top = 3 705 Width = 4681 object FormOptions: TFormOptions 2 Left = 510 3 Height = 418 4 Top = 324 5 Width = 511 6 6 Caption = 'Options' 7 ClientHeight = 339 8 ClientWidth = 468 7 ClientHeight = 418 8 ClientWidth = 511 9 DesignTimePPI = 120 10 OnClose = FormClose 11 OnCreate = FormCreate 9 12 OnShow = FormShow 10 LCLVersion = '1. 5'13 LCLVersion = '1.8.2.0' 11 14 object ButtonOk: TButton 12 Left = 38915 Left = 422 13 16 Height = 25 14 Top = 3 0717 Top = 386 15 18 Width = 75 16 19 Anchors = [akRight, akBottom] … … 21 24 end 22 25 object ButtonCancel: TButton 23 Left = 3 0426 Left = 334 24 27 Height = 25 25 Top = 3 0728 Top = 386 26 29 Width = 75 27 30 Anchors = [akRight, akBottom] … … 32 35 object SpinEditCellSize: TSpinEdit 33 36 Left = 165 34 Height = 3537 Height = 28 35 38 Top = 40 36 39 Width = 130 … … 40 43 object SpinEditMemorySize: TSpinEdit 41 44 Left = 165 42 Height = 3545 Height = 28 43 46 Top = 6 44 47 Width = 130 … … 48 51 object Label1: TLabel 49 52 Left = 8 50 Height = 2 553 Height = 20 51 54 Top = 8 52 Width = 12355 Width = 87 53 56 Caption = 'Memory size:' 54 57 ParentColor = False … … 56 59 object Label2: TLabel 57 60 Left = 8 58 Height = 2 561 Height = 20 59 62 Top = 40 60 Width = 7963 Width = 57 61 64 Caption = 'Cell size:' 62 65 ParentColor = False … … 64 67 object Label3: TLabel 65 68 Left = 8 66 Height = 2 569 Height = 20 67 70 Top = 95 68 Width = 1 7971 Width = 127 69 72 Caption = 'Interface language:' 70 73 ParentColor = False … … 74 77 Height = 27 75 78 Top = 128 76 Width = 4 5679 Width = 499 77 80 Anchors = [akTop, akLeft, akRight] 78 81 AutoSize = False … … 82 85 object SpinEditDPIX: TSpinEdit 83 86 Left = 104 84 Height = 3587 Height = 28 85 88 Top = 193 86 89 Width = 80 … … 92 95 object LabelDPI: TLabel 93 96 Left = 24 94 Height = 2 597 Height = 20 95 98 Top = 201 96 Width = 3999 Width = 26 97 100 Caption = 'DPI:' 98 101 ParentColor = False … … 100 103 object SpinEditDPIY: TSpinEdit 101 104 Left = 208 102 Height = 35105 Height = 28 103 106 Top = 193 104 107 Width = 80 … … 110 113 object LabelX: TLabel 111 114 Left = 192 112 Height = 2 5115 Height = 20 113 116 Top = 201 114 Width = 10117 Width = 7 115 118 Caption = 'x' 116 119 ParentColor = False … … 120 123 Height = 27 121 124 Top = 168 122 Width = 4 48125 Width = 491 123 126 Anchors = [akTop, akLeft, akRight] 124 127 AutoSize = False … … 129 132 object Label4: TLabel 130 133 Left = 16 131 Height = 2 5134 Height = 20 132 135 Top = 248 133 Width = 221136 Width = 159 134 137 Caption = 'Compiler optimizations:' 135 138 ParentColor = False … … 137 140 object ComboBoxLanguage: TComboBox 138 141 Left = 248 139 Height = 37142 Height = 28 140 143 Top = 83 141 144 Width = 188 142 ItemHeight = 0145 ItemHeight = 20 143 146 Style = csDropDownList 144 147 TabOrder = 8 145 148 end 146 object ComboBoxOptimizatipn: TComboBox 149 object CheckBoxOptimizeAddSub: TCheckBox 150 Left = 39 151 Height = 24 152 Top = 280 153 Width = 189 154 Caption = 'Addition and subtraction' 155 TabOrder = 9 156 end 157 object CheckBoxOptimizeMerge: TCheckBox 158 Left = 39 159 Height = 24 160 Top = 304 161 Width = 181 162 Caption = 'Merge same operations' 163 TabOrder = 10 164 end 165 object CheckBoxOptimizeRelativeIndexes: TCheckBox 166 Left = 39 167 Height = 24 168 Top = 328 169 Width = 131 170 Caption = 'Relative indexes' 171 TabOrder = 11 172 end 173 object CheckBoxOptimizeCopyMultiply: TCheckBox 174 Left = 39 175 Height = 24 176 Top = 352 177 Width = 116 178 Caption = 'Copy multiply' 179 TabOrder = 12 180 end 181 object ComboBoxOptimization: TComboBox 147 182 Left = 256 148 Height = 37149 Top = 24 0183 Height = 28 184 Top = 248 150 185 Width = 188 151 ItemHeight = 0186 ItemHeight = 20 152 187 Items.Strings = ( 153 188 'None' 154 189 'Normal' 155 190 ) 191 OnSelect = CheckBoxDPIAutoChange 156 192 Style = csDropDownList 157 TabOrder = 9193 TabOrder = 13 158 194 end 159 195 end -
trunk/Forms/UFormOptions.pas
r88 r91 11 11 type 12 12 13 { T OptionsForm}13 { TFormOptions } 14 14 15 T OptionsForm= class(TForm)15 TFormOptions = class(TForm) 16 16 ButtonOk: TButton; 17 17 ButtonCancel: TButton; 18 18 CheckBox1: TCheckBox; 19 CheckBoxOptimizeAddSub: TCheckBox; 19 20 CheckBoxDPIAuto: TCheckBox; 21 CheckBoxOptimizeMerge: TCheckBox; 22 CheckBoxOptimizeRelativeIndexes: TCheckBox; 23 CheckBoxOptimizeCopyMultiply: TCheckBox; 20 24 ComboBoxLanguage: TComboBox; 21 ComboBoxOptimizati pn: TComboBox;25 ComboBoxOptimization: TComboBox; 22 26 Label1: TLabel; 23 27 Label2: TLabel; … … 32 36 procedure ButtonOkClick(Sender: TObject); 33 37 procedure CheckBoxDPIAutoChange(Sender: TObject); 38 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 39 procedure FormCreate(Sender: TObject); 34 40 procedure FormShow(Sender: TObject); 35 41 private … … 42 48 43 49 var 44 OptionsForm: TOptionsForm;50 FormOptions: TFormOptions; 45 51 46 52 implementation … … 51 57 UCore, ULanguages; 52 58 53 { T OptionsForm}59 { TFormOptions } 54 60 55 procedure T OptionsForm.FormShow(Sender: TObject);61 procedure TFormOptions.FormShow(Sender: TObject); 56 62 begin 63 Core.PersistentForm1.Load(Self); 64 57 65 Core.CoolTranslator1.LanguageListToStrings(ComboBoxLanguage.Items); 58 66 ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(Core.CoolTranslator1.Language); … … 61 69 end; 62 70 63 procedure T OptionsForm.UpdateInterface;71 procedure TFormOptions.UpdateInterface; 64 72 begin 65 73 SpinEditDPIX.Enabled := not CheckBoxDPIAuto.Checked; … … 71 79 SpinEditDPIY.Value := ScreenInfo.PixelsPerInchY; 72 80 end; 81 CheckBoxOptimizeAddSub.Enabled := ComboBoxOptimization.ItemIndex > 0; 82 CheckBoxOptimizeMerge.Enabled := ComboBoxOptimization.ItemIndex > 0; 83 CheckBoxOptimizeRelativeIndexes.Enabled := ComboBoxOptimization.ItemIndex > 0; 84 CheckBoxOptimizeCopyMultiply.Enabled := ComboBoxOptimization.ItemIndex > 0; 73 85 end; 74 86 75 procedure T OptionsForm.Load;87 procedure TFormOptions.Load; 76 88 begin 89 CheckBoxOptimizeAddSub.Checked := Core.Optimizations.AddSub; 90 CheckBoxOptimizeMerge.Checked := Core.Optimizations.Merge; 91 CheckBoxOptimizeRelativeIndexes.Checked := Core.Optimizations.RelativeIndexes; 92 CheckBoxOptimizeCopyMultiply.Checked := Core.Optimizations.CopyMultiply; 77 93 SpinEditDPIX.Value := Core.ScaleDPI1.DPI.X; 78 94 SpinEditDPIY.Value := Core.ScaleDPI1.DPI.Y; 79 95 CheckBoxDPIAuto.Checked := Core.ScaleDPI1.AutoDetect; 80 ComboBoxOptimizati pn.ItemIndex := Integer(Core.OptimizationLevel);96 ComboBoxOptimization.ItemIndex := Integer(Core.OptimizationLevel); 81 97 SpinEditCellSize.Value := Core.CellSize; 82 98 SpinEditMemorySize.Value := Core.MemorySize; … … 84 100 end; 85 101 86 procedure T OptionsForm.Save;102 procedure TFormOptions.Save; 87 103 begin 88 104 Core.ScaleDPI1.DPI := Point(SpinEditDPIX.Value, SpinEditDPIY.Value); 89 105 Core.ScaleDPI1.AutoDetect := CheckBoxDPIAuto.Checked; 90 Core.OptimizationLevel := TCompilerOptimization(ComboBoxOptimizati pn.ItemIndex);106 Core.OptimizationLevel := TCompilerOptimization(ComboBoxOptimization.ItemIndex); 91 107 Core.CellSize := SpinEditCellSize.Value; 92 108 Core.MemorySize := SpinEditMemorySize.Value; 109 Core.Optimizations.AddSub := CheckBoxOptimizeAddSub.Checked; 110 Core.Optimizations.Merge := CheckBoxOptimizeMerge.Checked; 111 Core.Optimizations.RelativeIndexes := CheckBoxOptimizeRelativeIndexes.Checked; 112 Core.Optimizations.CopyMultiply := CheckBoxOptimizeCopyMultiply.Checked; 93 113 end; 94 114 95 procedure T OptionsForm.ButtonOkClick(Sender: TObject);115 procedure TFormOptions.ButtonOkClick(Sender: TObject); 96 116 begin 97 117 if ComboBoxLanguage.ItemIndex <> -1 then … … 100 120 end; 101 121 102 procedure T OptionsForm.CheckBoxDPIAutoChange(Sender: TObject);122 procedure TFormOptions.CheckBoxDPIAutoChange(Sender: TObject); 103 123 begin 104 124 UpdateInterface; 105 125 end; 106 126 127 procedure TFormOptions.FormClose(Sender: TObject; var CloseAction: TCloseAction 128 ); 129 begin 130 Core.PersistentForm1.Save(Self); 131 end; 132 133 procedure TFormOptions.FormCreate(Sender: TObject); 134 begin 135 Core.CoolTranslator1.TranslateComponentRecursive(Self); 136 end; 137 107 138 end. 108 139 -
trunk/Forms/UFormTargetCode.lfm
r64 r91 1 1 object FormTargetCode: TFormTargetCode 2 Left = 3062 Left = 682 3 3 Height = 240 4 Top = 754 Top = 485 5 5 Width = 320 6 6 Caption = 'Target code' 7 7 ClientHeight = 240 8 8 ClientWidth = 320 9 LCLVersion = '1.3' 9 DesignTimePPI = 120 10 LCLVersion = '1.8.2.0' 10 11 object MemoTarget: TMemo 11 12 Left = 0 … … 22 23 end 23 24 object PopupMenuTarget: TPopupMenu 24 Images = MainForm.ImageListMain25 Images = Core.ImageListMain 25 26 left = 84 26 27 top = 100 27 28 object MenuItem20: TMenuItem 28 Action = MainForm.AShowSourcePosition 29 Action = AFormatCode 30 end 31 object MenuItem1: TMenuItem 32 Action = AShrinkCode 33 end 34 end 35 object ActionList1: TActionList 36 Images = Core.ImageListMain 37 left = 199 38 top = 39 39 object AFormatCode: TAction 40 Caption = 'Format code' 41 OnExecute = AFormatCodeExecute 42 end 43 object AShrinkCode: TAction 44 Caption = 'Shrink code' 45 OnExecute = AShrinkCodeExecute 29 46 end 30 47 end -
trunk/Forms/UFormTargetCode.pas
r46 r91 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 Menus ;9 Menus, ActnList, strutils; 10 10 11 11 type … … 14 14 15 15 TFormTargetCode = class(TForm) 16 AShrinkCode: TAction; 17 AFormatCode: TAction; 18 ActionList1: TActionList; 16 19 MemoTarget: TMemo; 20 MenuItem1: TMenuItem; 17 21 MenuItem20: TMenuItem; 18 22 PopupMenuTarget: TPopupMenu; 23 procedure AFormatCodeExecute(Sender: TObject); 24 procedure AShrinkCodeExecute(Sender: TObject); 19 25 private 20 26 { private declarations } … … 30 36 {$R *.lfm} 31 37 38 { TFormTargetCode } 39 40 procedure TFormTargetCode.AFormatCodeExecute(Sender: TObject); 41 var 42 Source: string; 43 NewSource: string; 44 Indent: Integer; 45 I: Integer; 46 const 47 IndentText = ' '; 48 begin 49 Source := MemoTarget.Text; 50 NewSource := ''; 51 Indent := 0; 52 for I := 1 to Length(Source) do begin 53 if Source[I] = '[' then begin 54 NewSource := NewSource + LineEnding + DupeString(IndentText, Indent) + Source[I] + LineEnding ; 55 Inc(Indent); 56 NewSource := NewSource + DupeString(IndentText, Indent); 57 end 58 else if Source[I] = ']' then begin 59 Dec(Indent); 60 NewSource := NewSource + LineEnding + DupeString(IndentText, Indent) + Source[I] + LineEnding + DupeString(IndentText, Indent); 61 end 62 else if Ord(Source[I]) > $20 then 63 NewSource := NewSource + Source[I]; 64 end; 65 MemoTarget.Text := NewSource; 66 end; 67 68 procedure TFormTargetCode.AShrinkCodeExecute(Sender: TObject); 69 var 70 Source: string; 71 Pos: Integer; 72 I: Integer; 73 begin 74 Source := MemoTarget.Text; 75 Pos := 1; 76 for I := 1 to Length(Source) do begin 77 if Source[I] > ' ' then begin 78 Source[Pos] := Source[I]; 79 Inc(Pos); 80 end; 81 end; 82 SetLength(Source, Pos - 1); 83 MemoTarget.Text := Source; 84 end; 85 32 86 end. 33 87
Note:
See TracChangeset
for help on using the changeset viewer.