Changeset 134 for trunk/Forms
- Timestamp:
- Jul 5, 2017, 6:24:55 PM (7 years ago)
- Location:
- trunk/Forms
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormNew.lfm
r130 r134 39 39 Top = 4 40 40 Width = 669 41 ActivePage = TabSheet 241 ActivePage = TabSheet1 42 42 Align = alTop 43 43 Anchors = [akTop, akLeft, akRight, akBottom] 44 44 BorderSpacing.Around = 4 45 TabIndex = 145 TabIndex = 0 46 46 TabOrder = 2 47 47 object TabSheet1: TTabSheet … … 192 192 object ComboBoxGridType: TComboBox 193 193 Left = 146 194 Height = 3 4194 Height = 38 195 195 Top = 104 196 196 Width = 208 … … 206 206 object ComboBoxMapShape: TComboBox 207 207 Left = 146 208 Height = 3 4208 Height = 38 209 209 Top = 144 210 210 Width = 208 -
trunk/Forms/UFormPlayer.lfm
r107 r134 1 1 object FormPlayer: TFormPlayer 2 2 Left = 470 3 Height = 2793 Height = 344 4 4 Top = 219 5 5 Width = 522 6 6 Caption = 'Player' 7 ClientHeight = 2797 ClientHeight = 344 8 8 ClientWidth = 522 9 Constraints.MinHeight = 2799 Constraints.MinHeight = 344 10 10 Constraints.MinWidth = 522 11 OnShow = FormShow 11 12 Position = poMainFormCenter 12 LCLVersion = '1. 4.4.0'13 LCLVersion = '1.6.4.0' 13 14 object Label1: TLabel 14 Left = 2 815 Height = 2 515 Left = 24 16 Height = 24 16 17 Top = 27 17 Width = 5 118 Width = 56 18 19 Caption = 'Name:' 19 20 ParentColor = False 20 21 end 21 22 object EditName: TEdit 22 Left = 1 3923 Height = 3 323 Left = 168 24 Height = 34 24 25 Top = 27 25 Width = 3 6826 Width = 339 26 27 Anchors = [akTop, akLeft, akRight] 27 28 TabOrder = 0 … … 30 31 Left = 278 31 32 Height = 25 32 Top = 24233 Top = 307 33 34 Width = 75 34 35 Anchors = [akRight, akBottom] … … 40 41 Left = 403 41 42 Height = 25 42 Top = 24243 Top = 307 43 44 Width = 75 44 45 Anchors = [akRight, akBottom] … … 48 49 TabOrder = 2 49 50 end 50 object ComboBox 1: TComboBox51 Left = 1 3952 Height = 3 351 object ComboBoxMode: TComboBox 52 Left = 168 53 Height = 34 53 54 Top = 72 54 Width = 3 6855 Width = 339 55 56 Anchors = [akTop, akLeft, akRight] 56 ItemHeight = 2557 ItemHeight = 0 57 58 ItemIndex = 0 58 59 Items.Strings = ( … … 60 61 'Computer' 61 62 ) 63 OnChange = ComboBoxModeChange 62 64 Style = csDropDownList 63 65 TabOrder = 3 … … 66 68 object Label2: TLabel 67 69 Left = 24 68 Height = 2 570 Height = 24 69 71 Top = 72 70 Width = 5 172 Width = 53 71 73 Caption = 'Mode:' 72 74 ParentColor = False … … 74 76 object Label3: TLabel 75 77 Left = 24 76 Height = 2 578 Height = 24 77 79 Top = 128 78 Width = 4780 Width = 50 79 81 Caption = 'Color:' 80 82 ParentColor = False 81 83 end 82 84 object ColorBox1: TColorBox 83 Left = 1 3984 Height = 2885 Left = 168 86 Height = 38 85 87 Top = 120 86 Width = 3 6888 Width = 339 87 89 Style = [cbStandardColors, cbExtendedColors, cbCustomColor, cbPrettyNames] 88 90 Anchors = [akTop, akLeft, akRight] … … 92 94 object Label4: TLabel 93 95 Left = 24 94 Height = 2 596 Height = 24 95 97 Top = 168 96 Width = 9 098 Width = 98 97 99 Caption = 'Agressivity:' 98 100 ParentColor = False 99 101 end 100 102 object ComboBoxAgressivity: TComboBox 101 Left = 1 39102 Height = 3 3103 Left = 168 104 Height = 34 103 105 Top = 168 104 Width = 3 68106 Width = 339 105 107 Anchors = [akTop, akLeft, akRight] 106 ItemHeight = 25108 ItemHeight = 0 107 109 Items.Strings = ( 108 110 'Low' … … 116 118 object CheckBoxDefensive: TCheckBox 117 119 Left = 24 118 Height = 2 9120 Height = 28 119 121 Top = 208 120 122 Width = 107 … … 122 124 TabOrder = 6 123 125 end 126 object Label5: TLabel 127 Left = 24 128 Height = 24 129 Top = 248 130 Width = 94 131 Caption = 'Start units:' 132 ParentColor = False 133 end 134 object SpinEditStartUnits: TSpinEdit 135 Left = 224 136 Height = 34 137 Top = 240 138 Width = 112 139 MaxValue = 99 140 TabOrder = 7 141 end 124 142 end -
trunk/Forms/UFormPlayer.lrt
r107 r134 3 3 TFORMPLAYER.BUTTONCANCEL.CAPTION=Cancel 4 4 TFORMPLAYER.BUTTONOK.CAPTION=Ok 5 TFORMPLAYER.COMBOBOX 1.TEXT=Human5 TFORMPLAYER.COMBOBOXMODE.TEXT=Human 6 6 TFORMPLAYER.LABEL2.CAPTION=Mode: 7 7 TFORMPLAYER.LABEL3.CAPTION=Color: 8 8 TFORMPLAYER.LABEL4.CAPTION=Agressivity: 9 9 TFORMPLAYER.CHECKBOXDEFENSIVE.CAPTION=Defensive 10 TFORMPLAYER.LABEL5.CAPTION=Start units: -
trunk/Forms/UFormPlayer.pas
r90 r134 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 ColorBox, UGame;9 ColorBox, Menus, Spin, UGame; 10 10 11 11 type … … 18 18 CheckBoxDefensive: TCheckBox; 19 19 ColorBox1: TColorBox; 20 ComboBox 1: TComboBox;20 ComboBoxMode: TComboBox; 21 21 ComboBoxAgressivity: TComboBox; 22 22 EditName: TEdit; … … 25 25 Label3: TLabel; 26 26 Label4: TLabel; 27 Label5: TLabel; 28 SpinEditStartUnits: TSpinEdit; 29 procedure ComboBoxModeChange(Sender: TObject); 30 procedure FormShow(Sender: TObject); 27 31 private 28 32 { private declarations } 29 33 public 30 34 procedure Translate; 35 procedure UpdateInterface; 31 36 procedure Load(Player: TPlayer); 32 37 procedure Save(Player: TPlayer); … … 43 48 SHuman = 'Human'; 44 49 SComputer = 'Computer'; 45 SAgroNotAttacking = 'Not attacking';46 50 SAgroLow = 'Low'; 47 51 SAgroMedium = 'Medium'; … … 50 54 { TFormPlayer } 51 55 56 procedure TFormPlayer.ComboBoxModeChange(Sender: TObject); 57 begin 58 UpdateInterface; 59 end; 60 61 procedure TFormPlayer.FormShow(Sender: TObject); 62 begin 63 UpdateInterface; 64 end; 65 52 66 procedure TFormPlayer.Translate; 53 67 var 54 68 LastIndex: Integer; 55 69 begin 56 with ComboBox 1do begin70 with ComboBoxMode do begin 57 71 LastIndex := ItemIndex; 58 72 Clear; … … 71 85 end; 72 86 87 procedure TFormPlayer.UpdateInterface; 88 begin 89 ComboBoxAgressivity.Visible := ComboBoxMode.ItemIndex = 1; 90 CheckBoxDefensive.Visible := ComboBoxMode.ItemIndex = 1; 91 Label4.Visible := ComboBoxMode.ItemIndex = 1; 92 end; 93 73 94 procedure TFormPlayer.Load(Player: TPlayer); 74 95 begin 75 96 EditName.Text := Player.Name; 76 ComboBox 1.ItemIndex := Integer(Player.Mode);97 ComboBoxMode.ItemIndex := Integer(Player.Mode); 77 98 ColorBox1.Selected := Player.Color; 78 Label4.Visible := Player.Mode = pmComputer;79 ComboBoxAgressivity.Visible := Player.Mode = pmComputer;80 99 ComboBoxAgressivity.ItemIndex := Integer(Player.Agressivity); 81 CheckBoxDefensive.Visible := Player.Mode = pmComputer;82 100 CheckBoxDefensive.Checked := Player.Defensive; 101 SpinEditStartUnits.Value := Player.StartUnits; 102 UpdateInterface; 83 103 end; 84 104 … … 86 106 begin 87 107 Player.Name := EditName.Text; 88 Player.Mode := TPlayerMode(ComboBox 1.ItemIndex);108 Player.Mode := TPlayerMode(ComboBoxMode.ItemIndex); 89 109 Player.Color := ColorBox1.Selected; 90 110 Player.Agressivity := TComputerAgressivity(ComboBoxAgressivity.ItemIndex); 91 111 Player.Defensive := CheckBoxDefensive.Checked; 112 Player.StartUnits := SpinEditStartUnits.Value; 92 113 end; 93 114
Note:
See TracChangeset
for help on using the changeset viewer.