Changeset 60


Ignore:
Timestamp:
Jul 17, 2012, 7:25:56 AM (12 years ago)
Author:
chronos
Message:
  • Added: Target celection combobox on main toolbar.
  • Added: Options of available targets allow to change producer and executor path if available.
Location:
trunk
Files:
4 added
4 deleted
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Compiler/UExecutor.pas

    r50 r60  
    1818    procedure SetRunState(AValue: TRunState);
    1919  public
     20    ExecutorPath: string;
    2021    Target: TObject; // TTarget;
    2122    procedure Run; virtual; abstract;
  • trunk/Compiler/UTarget.pas

    r50 r60  
    2626  TListTarget = class(TListObject)
    2727    function SearchBySysName(Name: string): TTarget;
     28    procedure LoadToStrings(Strings: TStrings);
    2829  end;
    2930
     
    5758end;
    5859
     60procedure TListTarget.LoadToStrings(Strings: TStrings);
     61var
     62  I: Integer;
     63begin
     64  try
     65    Strings.BeginUpdate;
     66    Strings.Clear;
     67    for I := 0 to Count - 1 do
     68      Strings.AddObject(TTarget(Items[I]).Name, Items[I]);
     69  finally
     70    Strings.EndUpdate;
     71  end;
     72end;
     73
    5974end.
    6075
  • trunk/IDE/Forms/UFormMain.lfm

    r57 r60  
    8686      Top = 2
    8787      Action = AStop
     88    end
     89    object ComboBoxTarget: TComboBox
     90      Left = 230
     91      Height = 21
     92      Top = 2
     93      Width = 100
     94      ItemHeight = 13
     95      OnChange = ComboBoxTargetChange
     96      Style = csDropDownList
     97      TabOrder = 0
     98    end
     99    object ToolButton11: TToolButton
     100      Left = 330
     101      Top = 2
     102      Action = AViewTargets
    88103    end
    89104  end
     
    808823      Category = 'View'
    809824      Caption = 'Targets'
     825      ImageIndex = 14
    810826      OnExecute = AViewTargetsExecute
    811827    end
     
    874890    top = 272
    875891    Bitmap = {
    876       4C690E0000001000000010000000000000000000000000000000000000000000
     892      4C690F0000001000000010000000000000000000000000000000000000000000
    877893      0000000000000000000000000000000000000000000000000000000000000000
    878894      0000000000000000000000000000000000000000000000000000000000000000
     
    13221338      0000000000000000000000000000000000000000000000000000000000000000
    13231339      0000000000000000000000000000000000000000000000000000000000000000
     1340      0000000000000000000000000000000000000000000000000000000000000000
     1341      0000000000000000000000000000000000000000000000000000000000000000
     1342      0000000000000000000000000000000000000000000000000000000000000000
     1343      000000000000000000003131312F313131FF3030301F00000000000000000000
     1344      0000000000000000000000000000000000000000000000000000000000000000
     1345      000000000000000000002E2E2E3F2E2E2EFF2E2E2E3F00000000000000000000
     1346      0000000000000000000000000000000000000000000000000000000000000000
     1347      00002A2A2A7F2A2A2ADF2B2B2BFF2B2B2BFF2B2B2BFF2A2A2ADF2A2A2A7F0000
     1348      0000000000000000000000000000000000000000000000000000000000002727
     1349      279F272727FF282828AF2828284F272727FF2828284F282828AF272727FF2727
     1350      279F0000000000000000000000000000000000000000000000002424247F2424
     1351      24FF2424245F0000000000000000242424FF00000000000000002424245F2424
     1352      24FF2424247F0000000000000000000000000000000000000000202020DF2020
     1353      20AF000000000000000000000000202020FF0000000000000000000000002020
     1354      20AF202020DF0000000000000000000000001C1C1C1F1C1C1C3F1D1D1DFF1D1D
     1355      1D4F0000000000000000000000001D1D1DFF0000000000000000000000001D1D
     1356      1D4F1D1D1DFF1C1C1C3F1C1C1C1F1A1A1A1F1A1A1AFF1A1A1AFF1A1A1AFF1A1A
     1357      1AFF1A1A1AFF1A1A1AFF1A1A1AFF1A1A1ABF1A1A1AFF1A1A1AFF1A1A1AFF1A1A
     1358      1AFF1A1A1AFF1A1A1AFF1A1A1AFF000000001818182F1818183F161616FF1616
     1359      167F1818183F1818183F1818183F161616FF1818183F1818183F1818183F1616
     1360      167F161616FF1818183F1818181F000000000000000000000000131313DF1313
     1361      13AF000000000000000000000000131313FF0000000000000000000000001313
     1362      13AF131313DF00000000000000000000000000000000000000000F0F0F7F0F0F
     1363      0FFF0E0E0E5F00000000000000000F0F0FFF00000000000000000E0E0E5F0F0F
     1364      0FFF1010106F0000000000000000000000000000000000000000000000000D0D
     1365      0D9F0C0C0CFF0C0C0CAF0B0B0B4F0C0C0CFF0B0B0B4F0C0C0CAF0C0C0CFF0D0D
     1366      0D9F000000000000000000000000000000000000000000000000000000000000
     1367      00000909097F090909DF090909FF090909FF090909FF090909DF0909096F0000
     1368      0000000000000000000000000000000000000000000000000000000000000000
     1369      000000000000000000000505053F050505FF0505053F00000000000000000000
     1370      0000000000000000000000000000000000000000000000000000000000000000
     1371      000000000000000000000202022F020202FF0303031F00000000000000000000
    13241372      0000000000000000000000000000
    13251373    }
  • trunk/IDE/Forms/UFormMain.pas

    r59 r60  
    4343    AProjectClose: TAction;
    4444    ActionList1: TActionList;
     45    ComboBoxTarget: TComboBox;
    4546    ImageList1: TImageList;
    4647    MainMenu: TMainMenu;
     
    99100    ToolButton1: TToolButton;
    100101    ToolButton10: TToolButton;
     102    ToolButton11: TToolButton;
    101103    ToolButton2: TToolButton;
    102104    ToolButton3: TToolButton;
     
    131133    procedure AViewProjectExecute(Sender: TObject);
    132134    procedure AViewSourceEditorExecute(Sender: TObject);
    133     procedure ComboBox1Change(Sender: TObject);
    134     procedure ComboBoxProducerChange(Sender: TObject);
     135    procedure ComboBoxTargetChange(Sender: TObject);
    135136    procedure FormShow(Sender: TObject);
    136137    procedure FormClose(Sender: TObject; var Action: TCloseAction);
     
    313314
    314315  UpdateMenu;
     316  Core.Compiler.Targets.LoadToStrings(ComboBoxTarget.Items);
     317  ComboBoxTarget.ItemIndex := Core.Compiler.Targets.IndexOf(Core.Compiler.Target);
    315318  FormSourceCode.UpdateInterface;
    316319  FormTargetCode.UpdateInterface;
     
    476479end;
    477480
    478 procedure TFormMain.ComboBox1Change(Sender: TObject);
    479 begin
    480   ABuildExecute(Self);
    481 end;
    482 
    483481procedure TFormMain.AProjectOpenExecute(Sender: TObject);
    484482begin
     
    545543end;
    546544
    547 procedure TFormMain.ComboBoxProducerChange(Sender: TObject);
    548 begin
    549   ABuildExecute(Self);
     545procedure TFormMain.ComboBoxTargetChange(Sender: TObject);
     546begin
     547  with TMenuItem(Sender) do begin
     548    Core.Compiler.Target := TTarget(Core.Compiler.Targets[ComboBoxTarget.ItemIndex]);
     549    UpdateInterface;
     550  end;
    550551end;
    551552
  • trunk/IDE/Forms/UFormTargets.lfm

    r42 r60  
    11object FormTargets: TFormTargets
    22  Left = 292
    3   Height = 264
     3  Height = 343
    44  Top = 138
    5   Width = 360
     5  Width = 522
    66  Caption = 'Targets'
    7   ClientHeight = 264
    8   ClientWidth = 360
     7  ClientHeight = 343
     8  ClientWidth = 522
    99  OnShow = FormShow
    10   LCLVersion = '0.9.31'
     10  LCLVersion = '1.1'
    1111  object ListView1: TListView
    1212    Left = 8
    13     Height = 248
     13    Height = 327
    1414    Top = 8
    15     Width = 346
     15    Width = 508
    1616    Anchors = [akTop, akLeft, akRight, akBottom]
    1717    Columns = <   
     
    2121      end   
    2222      item
    23         Caption = 'Execution path'
    24         Width = 247
     23        Caption = 'Compiler path'
     24        Width = 200
     25      end   
     26      item
     27        Caption = 'Executor path'
     28        Width = 200
    2529      end>
    2630    OwnerData = True
     31    PopupMenu = PopupMenu1
    2732    ReadOnly = True
    2833    RowSelect = True
     
    3035    ViewStyle = vsReport
    3136    OnData = ListView1Data
    32     OnDblClick = ListView1DblClick
     37    OnDblClick = ATargetOptionsExecute
     38  end
     39  object PopupMenu1: TPopupMenu
     40    Images = FormMain.ImageList1
     41    left = 124
     42    top = 69
     43  end
     44  object ActionList1: TActionList
     45    left = 200
     46    top = 72
     47    object ATargetOptions: TAction
     48      Caption = 'Options'
     49      Hint = 'Target options'
     50      OnExecute = ATargetOptionsExecute
     51    end
    3352  end
    3453end
  • trunk/IDE/Forms/UFormTargets.lrt

    r42 r60  
    11TFORMTARGETS.CAPTION=Targets
    22TFORMTARGETS.LISTVIEW1.COLUMNS[0].CAPTION=Name
    3 TFORMTARGETS.LISTVIEW1.COLUMNS[1].CAPTION=Execution path
     3TFORMTARGETS.LISTVIEW1.COLUMNS[1].CAPTION=Compiler path
     4TFORMTARGETS.LISTVIEW1.COLUMNS[2].CAPTION=Executor path
     5TFORMTARGETS.ATARGETOPTIONS.CAPTION=Options
     6TFORMTARGETS.ATARGETOPTIONS.HINT=Target options
  • trunk/IDE/Forms/UFormTargets.pas

    r53 r60  
    66
    77uses
    8   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls;
     8  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
     9  Menus, ActnList;
    910
    1011type
     
    1314
    1415  TFormTargets = class(TForm)
     16    ATargetOptions: TAction;
     17    ActionList1: TActionList;
    1518    ListView1: TListView;
     19    PopupMenu1: TPopupMenu;
     20    procedure ATargetOptionsExecute(Sender: TObject);
    1621    procedure FormShow(Sender: TObject);
    1722    procedure ListView1Data(Sender: TObject; Item: TListItem);
    18     procedure ListView1DblClick(Sender: TObject);
    1923  private
    2024    { private declarations }
     
    3135
    3236uses
    33   UCore, UFormMain, UCompiler, UFormCompilerSettings, UProducer, UTarget;
     37  UCore, UFormMain, UCompiler, UProducer, UTarget,
     38  UFormTargetOptions;
    3439
    3540resourcestring
     
    4449end;
    4550
     51procedure TFormTargets.ATargetOptionsExecute(Sender: TObject);
     52begin
     53  if Assigned(ListView1.Selected) then begin
     54    FormTargetOptions.LoadControls(TTarget(ListView1.Selected.Data));
     55    if FormTargetOptions.ShowModal = mrOk then begin
     56      FormTargetOptions.SaveControls(TTarget(ListView1.Selected.Data));
     57      ReloadList;
     58    end;
     59  end;
     60end;
     61
    4662procedure TFormTargets.ListView1Data(Sender: TObject; Item: TListItem);
    4763begin
     
    5167    Item.Data := Core.Compiler.Targets[Item.Index];
    5268    //Item.SubItems.Add(Producer.CompilerPath);
    53   end;
    54 end;
    55 
    56 procedure TFormTargets.ListView1DblClick(Sender: TObject);
    57 begin
    58   if Assigned(ListView1.Selected) then begin
    59     FormCompilerSettings.LoadFromProducer(TProducer(ListView1.Selected.Data));
    60     if FormCompilerSettings.ShowModal = mrOk then
    61       FormCompilerSettings.SaveToProducer(TProducer(ListView1.Selected.Data));
    62     ReloadList;
    6369  end;
    6470end;
  • trunk/IDE/Languages/Transpascal.cs.po

    r55 r60  
    447447msgstr "Cílový kód"
    448448
     449#: tformtargetoptions.button1.caption
     450msgctxt "tformtargetoptions.button1.caption"
     451msgid "Ok"
     452msgstr "Ok"
     453
     454#: tformtargetoptions.button2.caption
     455msgctxt "tformtargetoptions.button2.caption"
     456msgid "Cancel"
     457msgstr "Zrušit"
     458
     459#: tformtargetoptions.buttonexecutorselect.caption
     460msgctxt "tformtargetoptions.buttonexecutorselect.caption"
     461msgid "Select..."
     462msgstr ""
     463
     464#: tformtargetoptions.buttonproducerselect.caption
     465msgctxt "tformtargetoptions.buttonproducerselect.caption"
     466msgid "Select..."
     467msgstr ""
     468
     469#: tformtargetoptions.caption
     470msgctxt "tformtargetoptions.caption"
     471msgid "Target options"
     472msgstr ""
     473
     474#: tformtargetoptions.label1.caption
     475msgid "Name:"
     476msgstr ""
     477
     478#: tformtargetoptions.label2.caption
     479msgctxt "tformtargetoptions.label2.caption"
     480msgid "Compiler path:"
     481msgstr "Cesta překladače:"
     482
     483#: tformtargetoptions.label3.caption
     484msgid "Executor path:"
     485msgstr ""
     486
     487#: tformtargetoptions.labelname.caption
     488msgid "    "
     489msgstr ""
     490
    449491#: tformtargetproject.caption
    450492msgid "FormTargetProject"
     493msgstr ""
     494
     495#: tformtargets.atargetoptions.caption
     496msgctxt "tformtargets.atargetoptions.caption"
     497msgid "Options"
     498msgstr "Volby"
     499
     500#: tformtargets.atargetoptions.hint
     501msgctxt "tformtargets.atargetoptions.hint"
     502msgid "Target options"
    451503msgstr ""
    452504
     
    462514
    463515#: tformtargets.listview1.columns[1].caption
     516#, fuzzy
     517#| msgid "Execution path"
    464518msgctxt "tformtargets.listview1.columns[1].caption"
    465 msgid "Execution path"
     519msgid "Compiler path"
    466520msgstr "Cesta vykonání"
     521
     522#: tformtargets.listview1.columns[2].caption
     523msgid "Executor path"
     524msgstr ""
    467525
    468526#: tmainform.aabout.caption
  • trunk/IDE/Languages/Transpascal.po

    r55 r60  
    438438msgstr ""
    439439
     440#: tformtargetoptions.button1.caption
     441msgctxt "TFORMTARGETOPTIONS.BUTTON1.CAPTION"
     442msgid "Ok"
     443msgstr ""
     444
     445#: tformtargetoptions.button2.caption
     446msgctxt "TFORMTARGETOPTIONS.BUTTON2.CAPTION"
     447msgid "Cancel"
     448msgstr ""
     449
     450#: tformtargetoptions.buttonexecutorselect.caption
     451msgctxt "TFORMTARGETOPTIONS.BUTTONEXECUTORSELECT.CAPTION"
     452msgid "Select..."
     453msgstr ""
     454
     455#: tformtargetoptions.buttonproducerselect.caption
     456msgctxt "TFORMTARGETOPTIONS.BUTTONPRODUCERSELECT.CAPTION"
     457msgid "Select..."
     458msgstr ""
     459
     460#: tformtargetoptions.caption
     461msgctxt "tformtargetoptions.caption"
     462msgid "Target options"
     463msgstr ""
     464
     465#: tformtargetoptions.label1.caption
     466msgid "Name:"
     467msgstr ""
     468
     469#: tformtargetoptions.label2.caption
     470msgctxt "TFORMTARGETOPTIONS.LABEL2.CAPTION"
     471msgid "Compiler path:"
     472msgstr ""
     473
     474#: tformtargetoptions.label3.caption
     475msgid "Executor path:"
     476msgstr ""
     477
     478#: tformtargetoptions.labelname.caption
     479msgid "    "
     480msgstr ""
     481
    440482#: tformtargetproject.caption
    441483msgid "FormTargetProject"
     484msgstr ""
     485
     486#: tformtargets.atargetoptions.caption
     487msgctxt "TFORMTARGETS.ATARGETOPTIONS.CAPTION"
     488msgid "Options"
     489msgstr ""
     490
     491#: tformtargets.atargetoptions.hint
     492msgctxt "TFORMTARGETS.ATARGETOPTIONS.HINT"
     493msgid "Target options"
    442494msgstr ""
    443495
     
    454506#: tformtargets.listview1.columns[1].caption
    455507msgctxt "TFORMTARGETS.LISTVIEW1.COLUMNS[1].CAPTION"
    456 msgid "Execution path"
     508msgid "Compiler path"
     509msgstr ""
     510
     511#: tformtargets.listview1.columns[2].caption
     512msgid "Executor path"
    457513msgstr ""
    458514
  • trunk/IDE/Transpascal.lpi

    r57 r60  
    193193      </Unit11>
    194194      <Unit12>
    195         <Filename Value="Forms\UFormCompilerSettings.pas"/>
    196         <IsPartOfProject Value="True"/>
    197         <ComponentName Value="FormCompilerSettings"/>
    198         <ResourceBaseClass Value="Form"/>
    199         <UnitName Value="UFormCompilerSettings"/>
     195        <Filename Value="Forms\UFormProjectNew.pas"/>
     196        <IsPartOfProject Value="True"/>
     197        <ComponentName Value="FormProjectNew"/>
     198        <HasResources Value="True"/>
     199        <ResourceBaseClass Value="Form"/>
     200        <UnitName Value="UFormProjectNew"/>
    200201      </Unit12>
    201202      <Unit13>
    202         <Filename Value="Forms\UFormProjectNew.pas"/>
    203         <IsPartOfProject Value="True"/>
    204         <ComponentName Value="FormProjectNew"/>
    205         <HasResources Value="True"/>
    206         <ResourceBaseClass Value="Form"/>
    207         <UnitName Value="UFormProjectNew"/>
     203        <Filename Value="UProjectTemplates.pas"/>
     204        <IsPartOfProject Value="True"/>
     205        <UnitName Value="UProjectTemplates"/>
    208206      </Unit13>
    209207      <Unit14>
    210         <Filename Value="UProjectTemplates.pas"/>
    211         <IsPartOfProject Value="True"/>
    212         <UnitName Value="UProjectTemplates"/>
     208        <Filename Value="Forms\UFormTargetProject.pas"/>
     209        <IsPartOfProject Value="True"/>
     210        <ComponentName Value="FormTargetProject"/>
     211        <HasResources Value="True"/>
     212        <ResourceBaseClass Value="Form"/>
     213        <UnitName Value="UFormTargetProject"/>
    213214      </Unit14>
    214215      <Unit15>
    215         <Filename Value="Forms\UFormTargetProject.pas"/>
    216         <IsPartOfProject Value="True"/>
    217         <ComponentName Value="FormTargetProject"/>
    218         <HasResources Value="True"/>
    219         <ResourceBaseClass Value="Form"/>
    220         <UnitName Value="UFormTargetProject"/>
     216        <Filename Value="UCore.pas"/>
     217        <IsPartOfProject Value="True"/>
     218        <ComponentName Value="Core"/>
     219        <HasResources Value="True"/>
     220        <ResourceBaseClass Value="DataModule"/>
     221        <UnitName Value="UCore"/>
    221222      </Unit15>
    222223      <Unit16>
    223         <Filename Value="UCore.pas"/>
    224         <IsPartOfProject Value="True"/>
    225         <ComponentName Value="Core"/>
    226         <HasResources Value="True"/>
    227         <ResourceBaseClass Value="DataModule"/>
    228         <UnitName Value="UCore"/>
     224        <Filename Value="Forms\UFormTargetOptions.pas"/>
     225        <IsPartOfProject Value="True"/>
     226        <ComponentName Value="FormTargetOptions"/>
     227        <ResourceBaseClass Value="Form"/>
     228        <UnitName Value="UFormTargetOptions"/>
    229229      </Unit16>
    230230    </Units>
  • trunk/IDE/Transpascal.lpr

    r55 r60  
    1212UFormSourceCode, UFormMessages,
    1313  UFormTargetCode, UFormCodeTree, TemplateGenerics, CoolTranslator, Common,
    14   UFormAbout, UFormOptions, UFormTargets, UFormCompilerSettings,
    15 UFormProjectNew, UProjectTemplates, UFormTargetProject, UCore;
     14  UFormAbout, UFormOptions, UFormTargets,
     15UFormProjectNew, UProjectTemplates, UFormTargetProject, UCore,
     16UFormTargetOptions;
    1617
    1718{$R *.res}
     
    3940  Application.CreateForm(TFormAbout, FormAbout);
    4041  Application.CreateForm(TFormOptions, FormOptions);
    41   Application.CreateForm(TFormCompilerSettings, FormCompilerSettings);
    4242  Application.CreateForm(TFormTargets, FormTargets);
    4343  Application.CreateForm(TFormProjectNew, FormProjectNew);
    4444  Application.CreateForm(TFormTargetProject, FormTargetProject);
    4545  Application.CreateForm(TCore, Core);
     46  Application.CreateForm(TFormTargetOptions, FormTargetOptions);
    4647  Application.Run;
    4748end.
Note: See TracChangeset for help on using the changeset viewer.