Changeset 74 for trunk/Forms


Ignore:
Timestamp:
Oct 4, 2014, 9:19:27 PM (10 years ago)
Author:
chronos
Message:
  • Added: Show player color in player list.
  • Added: Confirmation dialog for game restart action.
Location:
trunk/Forms
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMain.lfm

    r73 r74  
    8989      Top = 162
    9090      Width = 32
    91       Caption = 'ToolButton9'
    9291      Style = tbsSeparator
    9392    end
  • trunk/Forms/UFormMain.lrt

    r58 r74  
    11TFORMMAIN.CAPTION=xTactics
    2 TFORMMAIN.TOOLBUTTON9.CAPTION=ToolButton9
    32TFORMMAIN.MENUITEM1.CAPTION=Game
    43TFORMMAIN.MENUITEM5.CAPTION=-
  • trunk/Forms/UFormNew.lfm

    r70 r74  
    4949      TabOrder = 0
    5050      ViewStyle = vsReport
     51      OnCustomDrawSubItem = ListView1CustomDrawSubItem
    5152      OnData = ListView1Data
    5253      OnDblClick = ListView1DblClick
     
    127128    object CheckBoxVoid: TCheckBox
    128129      Left = 8
    129       Height = 24
     130      Height = 27
    130131      Top = 101
    131       Width = 175
     132      Width = 198
    132133      Caption = 'Inaccessible places'
    133134      OnChange = CheckBoxVoidChange
     
    136137    object Label1: TLabel
    137138      Left = 8
    138       Height = 22
     139      Height = 25
    139140      Top = 9
    140       Width = 88
     141      Width = 104
    141142      Caption = 'Map width:'
    142143      ParentColor = False
     
    144145    object SpinEditMapSizeX: TSpinEdit
    145146      Left = 128
    146       Height = 32
     147      Height = 35
    147148      Top = 4
    148149      Width = 98
     
    154155    object SpinEditMapSizeY: TSpinEdit
    155156      Left = 128
    156       Height = 32
     157      Height = 35
    157158      Top = 55
    158159      Width = 98
     
    164165    object SpinEditVoidPercent: TSpinEdit
    165166      Left = 216
    166       Height = 32
     167      Height = 35
    167168      Top = 97
    168169      Width = 106
     
    173174    object Label3: TLabel
    174175      Left = 331
    175       Height = 22
     176      Height = 25
    176177      Top = 102
    177       Width = 15
     178      Width = 17
    178179      Caption = '%'
    179180      ParentColor = False
     
    207208    object Label2: TLabel
    208209      Left = 8
    209       Height = 22
     210      Height = 25
    210211      Top = 57
    211       Width = 94
     212      Width = 110
    212213      Caption = 'Map height:'
    213214      ParentColor = False
     
    215216    object CheckBoxCity: TCheckBox
    216217      Left = 8
    217       Height = 24
     218      Height = 27
    218219      Top = 141
    219       Width = 68
     220      Width = 73
    220221      Caption = 'Cities'
    221222      OnChange = CheckBoxCityChange
     
    224225    object SpinEditCityPercent: TSpinEdit
    225226      Left = 216
    226       Height = 32
     227      Height = 35
    227228      Top = 137
    228229      Width = 106
     
    233234    object Label4: TLabel
    234235      Left = 331
    235       Height = 22
     236      Height = 25
    236237      Top = 142
    237       Width = 15
     238      Width = 17
    238239      Caption = '%'
    239240      ParentColor = False
     
    253254      ChildSizing.Layout = cclLeftToRightThenTopToBottom
    254255      ChildSizing.ControlsPerLine = 1
    255       ClientHeight = 52
     256      ClientHeight = 49
    256257      ClientWidth = 301
    257258      Items.Strings = (
     
    275276      ChildSizing.Layout = cclLeftToRightThenTopToBottom
    276277      ChildSizing.ControlsPerLine = 1
    277       ClientHeight = 81
     278      ClientHeight = 78
    278279      ClientWidth = 308
    279280      Items.Strings = (
     
    286287    object ComboBoxGridType: TComboBox
    287288      Left = 473
    288       Height = 30
     289      Height = 37
    289290      Top = 201
    290291      Width = 208
     
    300301    object Label5: TLabel
    301302      Left = 336
    302       Height = 22
     303      Height = 25
    303304      Top = 201
    304       Width = 79
     305      Width = 90
    305306      Caption = 'Grid type:'
    306307      ParentColor = False
     
    308309    object Label6: TLabel
    309310      Left = 8
    310       Height = 22
     311      Height = 25
    311312      Top = 313
    312       Width = 114
     313      Width = 129
    313314      Caption = 'Win objective:'
    314315      ParentColor = False
     
    316317    object ComboBoxWinObjective: TComboBox
    317318      Left = 232
    318       Height = 30
     319      Height = 37
    319320      Top = 305
    320321      Width = 328
     
    331332    object Label7: TLabel
    332333      Left = 8
    333       Height = 22
     334      Height = 25
    334335      Top = 348
    335       Width = 211
     336      Width = 245
    336337      Caption = 'Max random neutral units:'
    337338      ParentColor = False
     
    339340    object SpinEditNeutralUnits: TSpinEdit
    340341      Left = 384
    341       Height = 32
     342      Height = 35
    342343      Top = 344
    343344      Width = 98
     
    349350    object CheckBoxSymetricMap: TCheckBox
    350351      Left = 334
    351       Height = 24
     352      Height = 27
    352353      Top = 238
    353       Width = 133
     354      Width = 151
    354355      Caption = 'Symetric map'
    355356      TabOrder = 15
  • trunk/Forms/UFormNew.pas

    r70 r74  
    5656    procedure FormDestroy(Sender: TObject);
    5757    procedure FormShow(Sender: TObject);
     58    procedure ListView1CustomDrawSubItem(Sender: TCustomListView;
     59      Item: TListItem; SubItem: Integer; State: TCustomDrawState;
     60      var DefaultDraw: Boolean);
    5861    procedure ListView1Data(Sender: TObject; Item: TListItem);
    5962    procedure ListView1DblClick(Sender: TObject);
     
    111114    Item.Data := Players[Item.Index];
    112115    Item.SubItems.Add(PlayerModeText[Mode]);
    113     Item.SubItems.Add(IntToStr(Color));
     116    Item.SubItems.Add(''); // Do not show color text
    114117    Item.SubItems.Add(IntToStr(StartUnits));
    115118  end;
     
    212215begin
    213216  ReloadView;
     217end;
     218
     219procedure TFormNew.ListView1CustomDrawSubItem(Sender: TCustomListView;
     220  Item: TListItem; SubItem: Integer; State: TCustomDrawState;
     221  var DefaultDraw: Boolean);
     222begin
     223  if SubItem = 2 then
     224  with ListView1.Canvas do begin
     225    Brush.Color := TPlayer(Item.Data).Color;
     226    Brush.Style := bsSolid;
     227    FillRect(Item.DisplayRectSubItem(2, drBounds));
     228  end;
    214229end;
    215230
Note: See TracChangeset for help on using the changeset viewer.