Changeset 92 for trunk/Forms


Ignore:
Timestamp:
Jul 20, 2018, 9:48:47 AM (6 years ago)
Author:
chronos
Message:
Location:
trunk/Forms
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMain.pas

    r91 r92  
    433433procedure TFormMain.AViewCompilersExecute(Sender: TObject);
    434434begin
    435   FormCompilers.Show;
     435  FormTargets.Show;
    436436end;
    437437
  • trunk/Forms/UFormTargetOptions.lfm

    r50 r92  
    11object FormTargetOptions: TFormTargetOptions
    22  Left = 429
    3   Height = 240
     3  Height = 206
    44  Top = 228
    5   Width = 369
     5  Width = 422
    66  Caption = 'Target options'
    7   ClientHeight = 240
    8   ClientWidth = 369
    9   LCLVersion = '1.1'
     7  ClientHeight = 206
     8  ClientWidth = 422
     9  DesignTimePPI = 120
     10  OnClose = FormClose
     11  OnCreate = FormCreate
     12  OnShow = FormShow
     13  LCLVersion = '1.8.2.0'
    1014  object Edit1: TEdit
    1115    Left = 8
    12     Height = 21
    13     Top = 24
    14     Width = 272
     16    Height = 28
     17    Top = 32
     18    Width = 325
    1519    Anchors = [akTop, akLeft, akRight]
    1620    TabOrder = 0
     
    1822  object Label1: TLabel
    1923    Left = 8
    20     Height = 14
     24    Height = 20
    2125    Top = 7
    22     Width = 86
     26    Width = 122
    2327    Caption = 'Compiler location:'
    2428    ParentColor = False
    2529  end
    2630  object ButtonCompiler: TButton
    27     Left = 288
    28     Height = 25
    29     Top = 24
     31    Left = 341
     32    Height = 31
     33    Top = 35
    3034    Width = 75
    3135    Anchors = [akTop, akRight]
     
    3539  end
    3640  object ButtonExecute: TButton
    37     Left = 288
    38     Height = 25
    39     Top = 80
     41    Left = 341
     42    Height = 31
     43    Top = 96
    4044    Width = 75
    4145    Anchors = [akTop, akRight]
     
    4650  object Edit2: TEdit
    4751    Left = 8
    48     Height = 21
    49     Top = 81
    50     Width = 272
     52    Height = 28
     53    Top = 96
     54    Width = 325
    5155    Anchors = [akTop, akLeft, akRight]
    5256    TabOrder = 3
     
    5458  object Label2: TLabel
    5559    Left = 8
    56     Height = 14
    57     Top = 64
    58     Width = 88
     60    Height = 20
     61    Top = 72
     62    Width = 118
    5963    Caption = 'Executor location:'
    6064    ParentColor = False
    6165  end
    6266  object ButtonOk: TButton
    63     Left = 288
    64     Height = 25
    65     Top = 208
    66     Width = 75
     67    Left = 319
     68    Height = 31
     69    Top = 163
     70    Width = 91
    6771    Anchors = [akRight, akBottom]
    6872    Caption = 'Ok'
     
    7175  end
    7276  object ButtonCancel: TButton
    73     Left = 200
    74     Height = 25
    75     Top = 208
    76     Width = 75
     77    Left = 207
     78    Height = 31
     79    Top = 163
     80    Width = 91
    7781    Anchors = [akRight, akBottom]
    7882    Caption = 'Cancel'
  • trunk/Forms/UFormTargetOptions.pas

    r72 r92  
    2525    procedure ButtonCompilerClick(Sender: TObject);
    2626    procedure ButtonExecuteClick(Sender: TObject);
     27    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
     28    procedure FormCreate(Sender: TObject);
     29    procedure FormShow(Sender: TObject);
    2730  private
    2831    { private declarations }
     
    3538  FormTargetOptions: TFormTargetOptions;
    3639
     40
    3741implementation
    3842
    3943{$R *.lfm}
     44
     45uses
     46  UCore;
    4047
    4148{ TFormTargetOptions }
     
    5158  OpenDialog1.FileName := Edit2.Text;
    5259  if OpenDialog1.Execute then Edit2.Text := OpenDialog1.FileName;
     60end;
     61
     62procedure TFormTargetOptions.FormClose(Sender: TObject;
     63  var CloseAction: TCloseAction);
     64begin
     65  Core.PersistentForm1.Save(Self);
     66end;
     67
     68procedure TFormTargetOptions.FormCreate(Sender: TObject);
     69begin
     70  Core.CoolTranslator1.TranslateComponentRecursive(Self);
     71end;
     72
     73procedure TFormTargetOptions.FormShow(Sender: TObject);
     74begin
     75  Core.PersistentForm1.Load(Self);
    5376end;
    5477
  • trunk/Forms/UFormTargets.lfm

    r50 r92  
    1 object FormCompilers: TFormCompilers
     1object FormTargets: TFormTargets
    22  Left = 292
    33  Height = 344
     
    77  ClientHeight = 344
    88  ClientWidth = 574
     9  DesignTimePPI = 120
    910  OnShow = FormShow
    10   LCLVersion = '1.1'
     11  LCLVersion = '1.8.2.0'
    1112  object ListView1: TListView
    1213    Left = 8
     
    3536    OnData = ListView1Data
    3637    OnDblClick = ListView1DblClick
     38    OnKeyPress = ListView1KeyPress
    3739  end
    3840end
  • trunk/Forms/UFormTargets.pas

    r51 r92  
    1010type
    1111
    12   { TFormCompilers }
     12  { TFormTargets }
    1313
    14   TFormCompilers = class(TForm)
     14  TFormTargets = class(TForm)
    1515    ListView1: TListView;
    1616    procedure FormShow(Sender: TObject);
    1717    procedure ListView1Data(Sender: TObject; Item: TListItem);
    1818    procedure ListView1DblClick(Sender: TObject);
     19    procedure ListView1KeyPress(Sender: TObject; var Key: char);
    1920  private
    2021    { private declarations }
     
    2425
    2526var
    26   FormCompilers: TFormCompilers;
     27  FormTargets: TFormTargets;
    2728
    2829implementation
     
    3334  UCore, UTarget, UFormTargetOptions;
    3435
    35 { TFormCompilers }
     36{ TFormTargets }
    3637
    37 procedure TFormCompilers.FormShow(Sender: TObject);
     38procedure TFormTargets.FormShow(Sender: TObject);
    3839begin
    3940  ReloadList;
    4041end;
    4142
    42 procedure TFormCompilers.ListView1Data(Sender: TObject; Item: TListItem);
     43procedure TFormTargets.ListView1Data(Sender: TObject; Item: TListItem);
    4344begin
    4445  if (Item.Index >= 0) and (Item.Index < Core.Targets.Count) then
     
    5152end;
    5253
    53 procedure TFormCompilers.ListView1DblClick(Sender: TObject);
     54procedure TFormTargets.ListView1DblClick(Sender: TObject);
    5455begin
    55   FormTargetOptions.LoadControls(TTarget(ListView1.Selected.Data));
    56   if FormTargetOptions.ShowModal = mrOk then begin
    57     FormTargetOptions.SaveControls(TTarget(ListView1.Selected.Data));
    58     ReloadList;
     56  FormTargetOptions := TFormTargetOptions.Create(nil);
     57  try
     58    FormTargetOptions.LoadControls(TTarget(ListView1.Selected.Data));
     59    if FormTargetOptions.ShowModal = mrOk then begin
     60      FormTargetOptions.SaveControls(TTarget(ListView1.Selected.Data));
     61      ReloadList;
     62    end;
     63  finally
     64    FormTargetOptions.Free;
    5965  end;
    6066end;
    6167
    62 procedure TFormCompilers.ReloadList;
     68procedure TFormTargets.ListView1KeyPress(Sender: TObject; var Key: char);
     69begin
     70  if Key = #13 then ListView1DblClick(nil);
     71end;
     72
     73procedure TFormTargets.ReloadList;
    6374begin
    6475  ListView1.Items.Count := Core.Targets.Count;
Note: See TracChangeset for help on using the changeset viewer.