Changeset 133 for trunk/Forms


Ignore:
Timestamp:
Mar 4, 2022, 10:57:08 PM (3 years ago)
Author:
chronos
Message:
  • Added: Compile multiple action for compilation of code with mutliple compilers at once.
Location:
trunk/Forms
Files:
3 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMain.lfm

    r131 r133  
    11object FormMain: TFormMain
    22  Left = 430
    3   Height = 703
     3  Height = 732
    44  Top = 249
    5   Width = 1032
     5  Width = 1075
    66  Caption = 'LazFuck'
    7   ClientHeight = 669
    8   ClientWidth = 1032
    9   DesignTimePPI = 144
     7  ClientHeight = 697
     8  ClientWidth = 1075
     9  DesignTimePPI = 150
    1010  Menu = MainMenu1
    1111  OnClose = FormClose
     
    1818  object StatusBarMain: TStatusBar
    1919    Left = 0
    20     Height = 27
    21     Top = 642
    22     Width = 1032
     20    Height = 28
     21    Top = 669
     22    Width = 1075
    2323    Panels = <   
    2424      item
    25         Width = 84
     25        Width = 88
    2626      end   
    2727      item
    28         Width = 84
     28        Width = 88
    2929      end   
    3030      item
    31         Width = 96
     31        Width = 100
    3232      end>
    3333    ParentFont = False
     
    3636  object ToolBarMain: TToolBar
    3737    Left = 0
    38     Height = 33
     38    Height = 34
    3939    Top = 0
    40     Width = 1032
     40    Width = 1075
    4141    Images = Core.ImageListMain
    4242    ParentFont = False
     
    5050    end
    5151    object ToolButton2: TToolButton
    52       Left = 36
     52      Left = 37
    5353      Top = 2
    5454      Action = AProjectOpen
     
    5757    end
    5858    object ToolButton3: TToolButton
    59       Left = 89
     59      Left = 92
    6060      Top = 2
    6161      Action = AProjectSave
    6262    end
    6363    object ToolButton4: TToolButton
    64       Left = 124
     64      Left = 128
    6565      Top = 2
    6666      Action = AProjectClose
    6767    end
    6868    object ToolButton5: TToolButton
    69       Left = 194
    70       Height = 33
     69      Left = 200
     70      Height = 34
    7171      Top = 2
    7272      Style = tbsSeparator
    7373    end
    7474    object ToolButton6: TToolButton
    75       Left = 237
     75      Left = 244
    7676      Top = 2
    7777      Action = AProgramRun
    7878    end
    7979    object ToolButton7: TToolButton
    80       Left = 202
     80      Left = 208
    8181      Top = 2
    8282      Action = AProgramCompile
    8383    end
    8484    object ToolButton8: TToolButton
    85       Left = 159
     85      Left = 164
    8686      Top = 2
    8787      Action = AOptions
    8888    end
    8989    object ToolButton9: TToolButton
    90       Left = 342
     90      Left = 352
    9191      Top = 2
    9292      Action = ABreakpointToggle
    9393    end
    9494    object ToolButton10: TToolButton
    95       Left = 272
     95      Left = 280
    9696      Top = 2
    9797      Action = AProgramPause
    9898    end
    9999    object ToolButton11: TToolButton
    100       Left = 307
     100      Left = 316
    101101      Top = 2
    102102      Action = AProgramStop
    103103    end
    104104    object ToolButton12: TToolButton
    105       Left = 377
     105      Left = 388
    106106      Top = 2
    107107      Action = AProgramStepOver
    108108    end
    109109    object ToolButton13: TToolButton
    110       Left = 412
     110      Left = 424
    111111      Top = 2
    112112      Action = AProgramStepInto
    113113    end
    114114    object ToolButton14: TToolButton
    115       Left = 447
     115      Left = 460
    116116      Top = 2
    117117      Action = AProgramStepOut
    118118    end
    119119    object ToolButton15: TToolButton
    120       Left = 482
     120      Left = 496
    121121      Top = 2
    122122      Action = AProgramRunToCursor
    123123    end
    124124    object ToolButtonTarget: TToolButton
    125       Left = 517
     125      Left = 532
    126126      Hint = 'Target select'
    127127      Top = 2
     
    132132  end
    133133  object PageControlRight: TPageControl
    134     Left = 560
    135     Height = 609
    136     Top = 33
    137     Width = 472
     134    Left = 583
     135    Height = 635
     136    Top = 34
     137    Width = 492
    138138    ActivePage = TabSheetDebug
    139139    Align = alRight
     
    144144    object TabSheetDebug: TTabSheet
    145145      Caption = 'Debug'
    146       ClientHeight = 605
    147       ClientWidth = 390
     146      ClientHeight = 631
     147      ClientWidth = 405
    148148      ParentFont = False
    149149      object PanelInput: TPanel
    150150        Left = 0
    151         Height = 77
     151        Height = 80
    152152        Top = 0
    153         Width = 390
     153        Width = 405
    154154        Align = alTop
    155155        BevelOuter = bvNone
     
    161161        Left = 0
    162162        Height = 6
    163         Top = 77
    164         Width = 390
     163        Top = 80
     164        Width = 405
    165165        Align = alTop
    166166        ResizeAnchor = akTop
     
    168168      object PanelOutput: TPanel
    169169        Left = 0
    170         Height = 311
    171         Top = 83
    172         Width = 390
     170        Height = 324
     171        Top = 86
     172        Width = 405
    173173        Align = alTop
    174174        BevelOuter = bvNone
     
    180180        Left = 0
    181181        Height = 6
    182         Top = 394
    183         Width = 390
     182        Top = 410
     183        Width = 405
    184184        Align = alTop
    185185        ResizeAnchor = akTop
     
    187187      object PanelCPU: TPanel
    188188        Left = 0
    189         Height = 103
    190         Top = 400
    191         Width = 390
     189        Height = 107
     190        Top = 416
     191        Width = 405
    192192        Align = alTop
    193193        BevelOuter = bvNone
     
    199199        Left = 0
    200200        Height = 6
    201         Top = 503
    202         Width = 390
     201        Top = 523
     202        Width = 405
    203203        Align = alTop
    204204        ResizeAnchor = akTop
     
    206206      object PanelMemory: TPanel
    207207        Left = 0
    208         Height = 96
    209         Top = 509
    210         Width = 390
     208        Height = 102
     209        Top = 529
     210        Width = 405
    211211        Align = alClient
    212212        BevelOuter = bvNone
     
    217217  end
    218218  object Splitter1: TSplitter
    219     Left = 554
    220     Height = 609
    221     Top = 33
     219    Left = 577
     220    Height = 635
     221    Top = 34
    222222    Width = 6
    223223    Align = alRight
     
    226226  object PanelLeft: TPanel
    227227    Left = 0
    228     Height = 609
    229     Top = 33
    230     Width = 554
     228    Height = 635
     229    Top = 34
     230    Width = 577
    231231    Align = alClient
    232232    BevelOuter = bvNone
    233     ClientHeight = 609
    234     ClientWidth = 554
     233    ClientHeight = 635
     234    ClientWidth = 577
    235235    ParentFont = False
    236236    TabOrder = 4
    237237    object PageControlMain: TPageControl
    238238      Left = 0
    239       Height = 461
     239      Height = 481
    240240      Top = 0
    241       Width = 554
     241      Width = 577
    242242      ActivePage = TabSheetSource
    243243      Align = alClient
     
    256256    object PageControlBottom: TPageControl
    257257      Left = 0
    258       Height = 142
    259       Top = 467
    260       Width = 554
     258      Height = 148
     259      Top = 487
     260      Width = 577
    261261      ActivePage = TabSheetMessages
    262262      Align = alBottom
     
    274274      Left = 0
    275275      Height = 6
    276       Top = 461
    277       Width = 554
     276      Top = 481
     277      Width = 577
    278278      Align = alBottom
    279279      ResizeAnchor = akBottom
     
    282282  object MainMenu1: TMainMenu
    283283    Images = Core.ImageListMain
    284     Left = 259
    285     Top = 160
     284    Left = 270
     285    Top = 167
    286286    object MenuItem1: TMenuItem
    287       Caption = 'Project'
     287      Caption = 'File'
    288288      object MenuItem8: TMenuItem
    289289        Action = AProjectNew
     
    311311      end
    312312    end
     313    object MenuItem24: TMenuItem
     314      Caption = 'Edit'
     315      object MenuItem25: TMenuItem
     316        Action = FormSourceCode.AFormatSource
     317      end
     318      object MenuItem27: TMenuItem
     319        Action = FormSourceCode.AShrinkSource
     320      end
     321      object MenuItem28: TMenuItem
     322        Action = FormSourceCode.AGenerateNumber
     323      end
     324    end
    313325    object MenuItem9: TMenuItem
    314       Caption = 'Program'
     326      Caption = 'Run'
    315327      object MenuItem11: TMenuItem
    316328        Action = AProgramCompile
    317329      end
     330      object MenuItem20: TMenuItem
     331        Action = AProgramCompileMultiple
     332      end
    318333      object MenuItemTarget: TMenuItem
    319334        Caption = 'Target'
     
    347362      end
    348363    end
    349     object MenuItem24: TMenuItem
     364    object MenuItem18: TMenuItem
    350365      Caption = 'Tools'
    351       object MenuItem25: TMenuItem
    352         Action = FormSourceCode.AFormatSource
    353       end
    354       object MenuItem27: TMenuItem
    355         Action = FormSourceCode.AShrinkSource
    356       end
    357       object MenuItem28: TMenuItem
    358         Action = FormSourceCode.AGenerateNumber
    359       end
    360     end
    361     object MenuItem18: TMenuItem
    362       Caption = 'View'
    363366      object MenuItem22: TMenuItem
    364367        Action = AOptions
     
    383386  object ActionList1: TActionList
    384387    Images = Core.ImageListMain
    385     Left = 259
    386     Top = 230
     388    Left = 270
     389    Top = 240
    387390    object AProjectOpen: TAction
    388391      Category = 'Project'
     
    525528      OnExecute = AViewLogExecute
    526529    end
     530    object AProgramCompileMultiple: TAction
     531      Category = 'Program'
     532      Caption = 'Compile multiple...'
     533      OnExecute = AProgramCompileMultipleExecute
     534    end
    527535  end
    528536  object OpenDialog1: TOpenDialog
    529537    DefaultExt = '.b'
    530538    Filter = 'BrainFuck (*.b)|*.b|Any file (*.*)|*.*'
    531     Left = 67
    532     Top = 221
     539    Left = 70
     540    Top = 230
    533541  end
    534542  object SaveDialog1: TSaveDialog
    535543    DefaultExt = '.b'
    536544    Filter = 'BrainFuck (*.b)|*.b|Any file (*.*)|*.*'
    537     Left = 67
    538     Top = 288
     545    Left = 70
     546    Top = 300
    539547  end
    540548  object TimerRefresh: TTimer
    541549    OnTimer = TimerRefreshTimer
    542     Left = 67
    543     Top = 355
     550    Left = 70
     551    Top = 370
    544552  end
    545553  object PopupMenuRecentFiles: TPopupMenu
    546     Left = 67
    547     Top = 77
     554    Left = 70
     555    Top = 80
    548556  end
    549557  object PopupMenuTargets: TPopupMenu
    550     Left = 67
    551     Top = 143
     558    Images = Core.ImageListMain
     559    Left = 70
     560    Top = 149
    552561  end
    553562end
  • trunk/Forms/UFormMain.lrj

    r113 r133  
    77{"hash":205270389,"name":"tformmain.tabsheettarget.caption","sourcebytes":[84,97,114,103,101,116,32,99,111,100,101],"value":"Target code"},
    88{"hash":212433139,"name":"tformmain.tabsheetmessages.caption","sourcebytes":[77,101,115,115,97,103,101,115],"value":"Messages"},
    9 {"hash":127273972,"name":"tformmain.menuitem1.caption","sourcebytes":[80,114,111,106,101,99,116],"value":"Project"},
     9{"hash":315429,"name":"tformmain.menuitem1.caption","sourcebytes":[70,105,108,101],"value":"File"},
    1010{"hash":131987540,"name":"tformmain.menuitemopenrecent.caption","sourcebytes":[79,112,101,110,32,114,101,99,101,110,116],"value":"Open recent"},
    11 {"hash":127264813,"name":"tformmain.menuitem9.caption","sourcebytes":[80,114,111,103,114,97,109],"value":"Program"},
     11{"hash":310020,"name":"tformmain.menuitem24.caption","sourcebytes":[69,100,105,116],"value":"Edit"},
     12{"hash":22974,"name":"tformmain.menuitem9.caption","sourcebytes":[82,117,110],"value":"Run"},
    1213{"hash":94932420,"name":"tformmain.menuitemtarget.caption","sourcebytes":[84,97,114,103,101,116],"value":"Target"},
    13 {"hash":5989939,"name":"tformmain.menuitem24.caption","sourcebytes":[84,111,111,108,115],"value":"Tools"},
    14 {"hash":380871,"name":"tformmain.menuitem18.caption","sourcebytes":[86,105,101,119],"value":"View"},
     14{"hash":5989939,"name":"tformmain.menuitem18.caption","sourcebytes":[84,111,111,108,115],"value":"Tools"},
    1515{"hash":322608,"name":"tformmain.menuitem10.caption","sourcebytes":[72,101,108,112],"value":"Help"},
    1616{"hash":353982,"name":"tformmain.aprojectopen.caption","sourcebytes":[79,112,101,110],"value":"Open"},
     
    3636{"hash":248107685,"name":"tformmain.ashowsourceposition.caption","sourcebytes":[83,104,111,119,32,112,111,115,105,116,105,111,110,32,105,110,32,115,111,117,114,99,101],"value":"Show position in source"},
    3737{"hash":78944612,"name":"tformmain.aprogramshowexecutionpoint.caption","sourcebytes":[83,104,111,119,32,101,120,101,99,117,116,105,111,110,32,112,111,105,110,116],"value":"Show execution point"},
    38 {"hash":21335,"name":"tformmain.aviewlog.caption","sourcebytes":[76,111,103],"value":"Log"}
     38{"hash":21335,"name":"tformmain.aviewlog.caption","sourcebytes":[76,111,103],"value":"Log"},
     39{"hash":226669790,"name":"tformmain.aprogramcompilemultiple.caption","sourcebytes":[67,111,109,112,105,108,101,32,109,117,108,116,105,112,108,101,46,46,46],"value":"Compile multiple..."}
    3940]}
  • trunk/Forms/UFormMain.pas

    r128 r133  
    1515
    1616  TFormMain = class(TForm)
     17    AProgramCompileMultiple: TAction;
    1718    AViewLog: TAction;
    1819    AProgramShowExecutionPoint: TAction;
     
    5253    MenuItem19: TMenuItem;
    5354    MenuItem2: TMenuItem;
     55    MenuItem20: TMenuItem;
    5456    MenuItem22: TMenuItem;
    5557    MenuItem24: TMenuItem;
     
    117119    procedure AOptionsExecute(Sender: TObject);
    118120    procedure AProgramCompileExecute(Sender: TObject);
     121    procedure AProgramCompileMultipleExecute(Sender: TObject);
    119122    procedure AProgramPauseExecute(Sender: TObject);
    120123    procedure AProgramRunToCursorExecute(Sender: TObject);
     
    171174  UCore, UFormCPU, UFormOptions, UFormMessages, UFormTargets, UFormOutput, UFormInput,
    172175  UFormMemory, UFormSourceCode, UFormTargetCode, UTargetInterpretter, UFormLog,
    173   UBFTarget, UCommon;
     176  UBFTarget, UCommon, UFormCompileMultiple;
    174177
    175178resourcestring
     
    206209    FormSourceCode.UpdateTheme;
    207210  end;
     211  Core.Messages.OnChange := FormMain.MessagesChanged;
    208212end;
    209213
     
    227231    AProgramShowExecutionPoint.Execute;
    228232  if Core.CurrentTarget.State = rsStopped then
    229     Core.CurrentTarget.Messages.AddMessage(SProgramStopped);
     233    Core.Messages.AddMessage(SProgramStopped);
    230234end;
    231235
     
    405409  if not Core.CurrentTarget.Compiled then AProgramCompile.Execute;
    406410  Core.CurrentTarget.Run;
    407   Core.CurrentTarget.Messages.AddMessage(SProgramStarted);
     411  Core.Messages.AddMessage(SProgramStarted);
    408412end;
    409413
     
    432436procedure TFormMain.AViewCompilersExecute(Sender: TObject);
    433437begin
    434   if not Assigned(FormTargets) then FormTargets := TFormTargets.Create(Self);
    435   FormTargets.Show;
     438  with TFormTargets.Create(nil) do
     439  try
     440    ShowModal;
     441  finally
     442    Free;
     443  end;
    436444end;
    437445
     
    493501  with Core.CurrentTarget do
    494502  try
     503    Core.Messages.Clear;
    495504    AProgramStop.Execute;
    496505    SourceCode := FormSourceCode.SynEditSource.Text;
     
    499508    if Core.CurrentTarget is TBFTarget then
    500509      TBFTarget(Core.CurrentTarget).Optimizations := Core.Optimizations;
    501     Core.CurrentTarget.Messages.AddMessage(SCompileStart);
     510    DebugEnabled := Core.DebugEnabled;
     511    Core.Messages.AddMessage(SCompileStart);
    502512    Application.ProcessMessages;
    503513    Compile;
    504     Core.CurrentTarget.Messages.AppendMessage(SDone);
     514    Core.Messages.AppendMessage(SDone);
    505515    FormTargetCode.SynEditTarget.Text := TargetCode;
    506516    FormTargetCode.SetHighlighter(Core.CurrentTarget.SourceExtension);
     
    509519    on E: Exception do
    510520      MessageDlg(SError, E.Message, mtError, [mbOk], 0);
     521  end;
     522end;
     523
     524procedure TFormMain.AProgramCompileMultipleExecute(Sender: TObject);
     525var
     526  I: Integer;
     527begin
     528  AProgramStop.Execute;
     529  with TFormCompileMultiple.Create(nil) do
     530  try
     531    Targets := Core.Targets;
     532    if ShowModal = mrOk then begin
     533      Core.Messages.Clear;
     534      for I := 0 to Targets.Count - 1 do
     535      with Targets[I] do
     536      if Selected then
     537      try
     538        AProgramStop.Execute;
     539        SourceCode := FormSourceCode.SynEditSource.Text;
     540        ProjectFileName := Core.Project.FileName;
     541        ProgramName := ExtractFileNameOnly(Core.Project.FileName);
     542        if Targets[I] is TBFTarget then
     543          TBFTarget(Targets[I]).Optimizations := Core.Optimizations;
     544        DebugEnabled := Core.DebugEnabled;
     545        Core.Messages.AddMessage(Name + ' ' + SCompileStart);
     546        Application.ProcessMessages;
     547        Compile;
     548        Core.Messages.AppendMessage(SDone);
     549        FormTargetCode.SynEditTarget.Text := TargetCode;
     550        FormTargetCode.SetHighlighter(Core.CurrentTarget.SourceExtension);
     551        UpdateInterface;
     552      except
     553        on E: Exception do
     554          MessageDlg(SError, E.Message, mtError, [mbOk], 0);
     555      end;
     556    end;
     557  finally
     558    Free;
    511559  end;
    512560end;
  • trunk/Forms/UFormMessages.pas

    r131 r133  
    3737procedure TFormMessages.ListView1Data(Sender: TObject; Item: TListItem);
    3838begin
    39   with Core.CurrentTarget do
     39  with Core do
    4040  if (Item.Index >= 0) and (Item.Index < Messages.Count) then
    41   with TMessage(Messages[Item.Index]) do begin
     41  with Messages[Item.Index] do begin
    4242    Item.Caption := Text;
    4343    Item.Data := Messages[Item.Index];
     
    5151procedure TFormMessages.Reload;
    5252begin
    53   ListView1.Items.Count := Core.CurrentTarget.Messages.Count;
     53  ListView1.Items.Count := Core.Messages.Count;
    5454  ListView1.Refresh;
    5555end;
  • trunk/Forms/UFormSourceCode.lfm

    r128 r133  
    591591  object ActionList1: TActionList
    592592    Images = Core.ImageListMain
    593     Left = 154
     593    Left = 152
    594594    Top = 67
    595595    object AGenerateNumber: TAction
  • trunk/Forms/UFormTargets.lfm

    r103 r133  
    11object FormTargets: TFormTargets
    2   Left = 292
    3   Height = 413
    4   Top = 138
    5   Width = 689
     2  Left = 294
     3  Height = 430
     4  Top = 172
     5  Width = 718
    66  Caption = 'Compilers'
    7   ClientHeight = 413
    8   ClientWidth = 689
    9   DesignTimePPI = 144
     7  ClientHeight = 430
     8  ClientWidth = 718
     9  DesignTimePPI = 150
     10  OnClose = FormClose
    1011  OnCreate = FormCreate
    1112  OnShow = FormShow
    12   LCLVersion = '2.0.0.4'
     13  LCLVersion = '2.2.0.4'
    1314  object ListView1: TListView
    1415    Left = 10
    15     Height = 393
     16    Height = 410
    1617    Top = 10
    17     Width = 672
     18    Width = 701
    1819    Anchors = [akTop, akLeft, akRight, akBottom]
    1920    Columns = <   
    2021      item
    2122        Caption = 'Name'
    22         Width = 96
     23        Width = 100
    2324      end   
    2425      item
    2526        Caption = 'Execution path'
    26         Width = 240
     27        Width = 250
    2728      end   
    2829      item
    2930        Caption = 'Compiler path'
    30         Width = 313
     31        Width = 336
    3132      end>
    3233    OwnerData = True
  • trunk/Forms/UFormTargets.pas

    r115 r133  
    1414  TFormTargets = class(TForm)
    1515    ListView1: TListView;
     16    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    1617    procedure FormCreate(Sender: TObject);
    1718    procedure FormShow(Sender: TObject);
     
    3940procedure TFormTargets.FormShow(Sender: TObject);
    4041begin
     42  Core.PersistentForm1.Load(Self);
    4143  ReloadList;
    4244end;
     
    4648  Core.Translator.TranslateComponentRecursive(Self);
    4749  Core.ThemeManager.UseTheme(Self);
     50end;
     51
     52procedure TFormTargets.FormClose(Sender: TObject; var CloseAction: TCloseAction
     53  );
     54begin
     55  Core.PersistentForm1.Save(Self);
    4856end;
    4957
Note: See TracChangeset for help on using the changeset viewer.