Changeset 277 for trunk/Forms


Ignore:
Timestamp:
Feb 5, 2019, 11:17:27 PM (6 years ago)
Author:
chronos
Message:
  • Added: Forms for list of unit kinds and unit kind.
Location:
trunk/Forms
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormGameSystem.lfm

    r276 r277  
    1010  OnClose = FormClose
    1111  OnCreate = FormCreate
     12  OnDestroy = FormDestroy
    1213  OnShow = FormShow
    1314  LCLVersion = '1.8.4.0'
     
    3738    Top = 528
    3839    Width = 113
    39     Anchors = [akRight]
     40    Anchors = [akRight, akBottom]
    4041    Caption = 'Cancel'
    4142    ModalResult = 2
     
    5758    Top = 16
    5859    Width = 744
    59     ActivePage = TabSheetGeneral
     60    ActivePage = TabSheetUnits
    6061    Anchors = [akTop, akLeft, akRight, akBottom]
    61     TabIndex = 0
     62    TabIndex = 1
    6263    TabOrder = 4
    6364    object TabSheetGeneral: TTabSheet
  • trunk/Forms/UFormGameSystem.pas

    r276 r277  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    9   ComCtrls, UGameSystem;
     9  ComCtrls, UGameSystem, UFormUnitKinds;
    1010
    1111type
     
    3030    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    3131    procedure FormCreate(Sender: TObject);
     32    procedure FormDestroy(Sender: TObject);
    3233    procedure FormShow(Sender: TObject);
    3334  private
    3435    FGameSystem: TGameSystem;
     36    FormUnitKinds: TFormUnitKinds;
    3537    procedure SetGameSystem(AValue: TGameSystem);
    36 
    3738  public
    3839    property GameSystem: TGameSystem read FGameSystem write SetGameSystem;
     
    8990  Core.ThemeManager1.UseTheme(Self);
    9091  Core.CoolTranslator1.TranslateComponentRecursive(Self);
     92  FormUnitKinds := TFormUnitKinds.Create(nil);
     93  FormUnitKinds.ManualDock(TabSheetUnits, nil, alClient);
     94  FormUnitKinds.Align := alClient;
     95  FormUnitKinds.Visible := True;
     96end;
     97
     98procedure TFormGameSystem.FormDestroy(Sender: TObject);
     99begin
     100  FormUnitKinds.Free;
    91101end;
    92102
     
    99109begin
    100110  if FGameSystem = AValue then Exit;
     111  if Assigned(FGameSystem) then FormUnitKinds.UnitKinds := nil;
    101112  FGameSystem := AValue;
     113  if Assigned(FGameSystem) then FormUnitKinds.UnitKinds := GameSystem.UnitKinds;
    102114end;
    103115
  • trunk/Forms/UFormGameSystems.pas

    r276 r277  
    124124    if FormGameSystem.ShowModal = mrOk then begin
    125125      FormGameSystem.SaveData(TempEntry);
    126       TGameSystem(ListView1.Selected.Data).Assign(TempEntry);
     126      GameSystems.Add(TempEntry);
     127      TempEntry := nil;
    127128      UpdateList;
    128129      UpdateInterface;
     
    197198  AModify.Enabled := Assigned(FGameSystems) and Assigned(ListView1.Selected);
    198199  AAdd.Enabled := Assigned(FGameSystems);
    199   ASelectAll.Enabled := True;
     200  ASelectAll.Enabled := ListView1.Items.Count > 0;
    200201end;
    201202
Note: See TracChangeset for help on using the changeset viewer.