Changeset 300
- Timestamp:
- Jul 10, 2019, 10:46:20 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormItem.lfm
r299 r300 1 1 object FormItem: TFormItem 2 2 Left = 570 3 Height = 3 003 Height = 360 4 4 Top = 429 5 Width = 4 005 Width = 480 6 6 Caption = 'Item' 7 ClientHeight = 3 008 ClientWidth = 4 009 DesignTimePPI = 1 207 ClientHeight = 360 8 ClientWidth = 480 9 DesignTimePPI = 144 10 10 OnClose = FormClose 11 11 OnCreate = FormCreate … … 14 14 LCLVersion = '2.0.2.0' 15 15 object ButtonOk: TButton 16 Left = 7417 Height = 3 218 Top = 26019 Width = 9416 Left = 89 17 Height = 38 18 Top = 312 19 Width = 113 20 20 Anchors = [akLeft, akBottom] 21 21 Caption = 'OK' … … 26 26 end 27 27 object ButtonCancel: TButton 28 Left = 2 2029 Height = 3 230 Top = 26031 Width = 9428 Left = 264 29 Height = 38 30 Top = 312 31 Width = 113 32 32 Anchors = [akLeft, akBottom] 33 33 Caption = 'Cancel' -
trunk/Forms/UFormItem.pas
r298 r300 24 24 FItem: TItem; 25 25 DataControls: TFPGObjectList<TControl>; 26 DataLabels: TFPGObjectList<TLabel>; 27 procedure ControlChangeExecute(Sender: TObject); 26 28 procedure SetItem(AValue: TItem); 27 29 procedure LoadData(Item: TItem); virtual; … … 29 31 procedure InitControls; 30 32 public 33 procedure UpdateInterface; 31 34 property Item: TItem read FItem write SetItem; 32 35 end; … … 60 63 Core.ThemeManager1.UseTheme(Self); 61 64 DataControls := TFPGObjectList<TControl>.Create; 65 DataLabels := TFPGObjectList<TLabel>.Create; 62 66 end; 63 67 64 68 procedure TFormItem.FormDestroy(Sender: TObject); 65 69 begin 70 DataLabels.Free; 66 71 DataControls.Free; 67 72 end; … … 70 75 begin 71 76 Core.PersistentForm.Load(Self); 77 end; 78 79 procedure TFormItem.ControlChangeExecute(Sender: TObject); 80 begin 81 UpdateInterface; 72 82 end; 73 83 … … 130 140 end; 131 141 Fields.Free; 142 UpdateInterface; 132 143 end; 133 144 … … 165 176 Y: Integer; 166 177 begin 167 Y := 8; 178 DataControls.Clear; 179 DataLabels.Clear; 180 Y := Scale96ToScreen(8); 168 181 Fields := Item.GetFields; 169 182 for I := 0 to Fields.Count - 1 do 170 183 with TItemField(Fields[I]) do begin 171 184 NewLabel := TLabel.Create(Self); 172 NewLabel.Left := 8;185 NewLabel.Left := Scale96ToScreen(8); 173 186 NewLabel.Top := Y; 174 187 NewLabel.Parent := Self; 175 188 NewLabel.Caption := Name + ':'; 176 189 NewLabel.Visible := True; 190 DataLabels.Add(NewLabel); 177 191 178 192 if DataType = dtInteger then begin 179 193 NewControl := TSpinEdit.Create(nil); 180 NewControl.Width := 100;194 NewControl.Width := Scale96ToScreen(100); 181 195 TSpinEdit(NewControl).MaxValue := High(Integer); 182 196 end else 183 197 if DataType = dtString then begin 184 198 NewControl := TEdit.Create(nil); 185 NewControl.Width := 300;199 NewControl.Width := Scale96ToScreen(300); 186 200 end else 187 201 if DataType = dtColor then begin 188 202 NewControl := TColorBox.Create(nil); 189 NewControl.Width := 200; 203 NewControl.Width := Scale96ToScreen(200); 204 TColorBox(NewControl).Style := [cbStandardColors, cbExtendedColors, 205 cbCustomColor, cbPrettyNames]; 190 206 end else 191 207 if DataType = dtEnumeration then begin 192 208 NewControl := TComboBox.Create(nil); 193 NewControl.Width := 200;209 NewControl.Width := Scale96ToScreen(200); 194 210 TComboBox(NewControl).Style := csDropDownList; 211 TComboBox(NewControl).OnChange := ControlChangeExecute; 195 212 end else 196 213 if DataType = dtReference then begin 197 214 NewControl := TComboBox.Create(nil); 198 NewControl.Width := 200;215 NewControl.Width := Scale96ToScreen(200); 199 216 TComboBox(NewControl).Style := csDropDownList; 200 217 end else … … 203 220 end else 204 221 raise Exception.Create(Format(SUnsupportedDataType, [DataTypeStr[DataType]])); 205 NewControl.Left := 150;222 NewControl.Left := Scale96ToScreen(150); 206 223 NewControl.Top := Y; 207 224 NewControl.Parent := Self; … … 210 227 NewControl.Visible := True; 211 228 DataControls.Add(NewControl); 212 Y := Y + 40;229 Y := Y + Scale96ToScreen(30); 213 230 end; 214 231 Fields.Free; 215 232 end; 216 233 234 procedure TFormItem.UpdateInterface; 235 var 236 I: Integer; 237 Fields: TItemFields; 238 Condition: Boolean; 239 begin 240 Fields := Item.GetFields; 241 try 242 for I := 0 to Fields.Count - 1 do 243 with TItemField(Fields[I]) do begin 244 if VisibleIfIndex > 0 then begin 245 if TItemField(Fields[VisibleIfIndex]).DataType = dtEnumeration then begin 246 Condition := TComboBox(DataControls[VisibleIfIndex]).ItemIndex > 0; 247 end else Condition := False; 248 end; 249 DataControls[I].Visible := (VisibleIfIndex = 0) or ((VisibleIfIndex > 0) and Condition); 250 DataLabels[I].Visible := DataControls[I].Visible; 251 end; 252 finally 253 Fields.Free; 254 end; 255 end; 256 217 257 end. 218 258 -
trunk/Forms/UFormList.lfm
r298 r300 1 1 object FormList: TFormList 2 2 Left = 779 3 Height = 3 003 Height = 360 4 4 Top = 236 5 Width = 4 005 Width = 480 6 6 Caption = 'List' 7 ClientHeight = 3 008 ClientWidth = 4 009 DesignTimePPI = 1 207 ClientHeight = 360 8 ClientWidth = 480 9 DesignTimePPI = 144 10 10 OnClose = FormClose 11 11 OnCreate = FormCreate … … 14 14 object ListView1: TListView 15 15 Left = 0 16 Height = 26816 Height = 322 17 17 Top = 0 18 Width = 4 0018 Width = 480 19 19 Align = alClient 20 20 Columns = < 21 21 item 22 22 Caption = 'Name' 23 Width = 38823 Width = 466 24 24 end> 25 25 MultiSelect = True … … 39 39 object ToolBar1: TToolBar 40 40 Left = 0 41 Top = 268 42 Width = 400 41 Height = 38 42 Top = 322 43 Width = 480 43 44 Align = alBottom 44 Images = Core.ImageListSmall45 45 ParentFont = False 46 46 TabOrder = 1 … … 51 51 end 52 52 object ToolButton2: TToolButton 53 Left = 3 053 Left = 36 54 54 Top = 2 55 55 Action = AModify 56 56 end 57 57 object ToolButton3: TToolButton 58 Left = 5958 Left = 71 59 59 Top = 2 60 60 Action = ARemove 61 61 end 62 62 object ToolButton4: TToolButton 63 Left = 8863 Left = 106 64 64 Top = 2 65 65 Action = AClone … … 67 67 end 68 68 object ActionList1: TActionList 69 Images = Core.ImageListSmall 70 left = 173 71 top = 136 69 left = 208 70 top = 163 72 71 object AAdd: TAction 73 72 Caption = 'Add' … … 97 96 end 98 97 object PopupMenu1: TPopupMenu 99 Images = Core.ImageListSmall 100 left = 293 101 top = 133 98 left = 352 99 top = 160 102 100 object MenuItem1: TMenuItem 103 101 Action = AAdd -
trunk/Forms/UFormList.pas
r298 r300 276 276 for I := 0 to ListView1.Columns.Count - 1 do begin 277 277 ListView1.Columns[I].Caption := Fields[I].Name; 278 ListView1.Columns[I].Width := 100;278 ListView1.Columns[I].Width := Scale96ToScreen(100); 279 279 end; 280 280 finally -
trunk/Languages/xtactics.cs.po
r298 r300 9 9 "MIME-Version: 1.0\n" 10 10 "Content-Transfer-Encoding: 8bit\n" 11 "X-Generator: Poedit 2.2 \n"11 "X-Generator: Poedit 2.2.1\n" 12 12 "Language: cs\n" 13 13 … … 1222 1222 msgstr "Zůstat naživu určený počet tahů" 1223 1223 1224 #: uformplayer.sagrohigh 1225 msgctxt "uformplayer.sagrohigh" 1226 msgid "High" 1227 msgstr "Vysoká" 1228 1229 #: uformplayer.sagrolow 1230 msgctxt "uformplayer.sagrolow" 1231 msgid "Low" 1232 msgstr "Nízká" 1233 1234 #: uformplayer.sagromedium 1235 msgctxt "uformplayer.sagromedium" 1236 msgid "Medium" 1237 msgstr "Střední" 1238 1239 #: uformplayer.scomputer 1240 msgctxt "uformplayer.scomputer" 1241 msgid "Computer" 1242 msgstr "Počítač" 1243 1244 #: uformplayer.shuman 1245 msgctxt "uformplayer.shuman" 1246 msgid "Human" 1247 msgstr "Člověk" 1248 1249 #: uformplayers.sremoveitems 1250 msgctxt "uformplayers.sremoveitems" 1251 msgid "Remove items" 1252 msgstr "Odstranit položky" 1253 1254 #: uformplayers.sremoveitemsquery 1255 msgctxt "uformplayers.sremoveitemsquery" 1256 msgid "Do you want to remove selected items?" 1257 msgstr "Opravdu chcete odstranit vybrané položky?" 1258 1224 1259 #: ugame.scomputer 1225 1260 msgctxt "ugame.scomputer" … … 1436 1471 msgid "View range" 1437 1472 msgstr "Dohled" 1438 -
trunk/Languages/xtactics.po
r298 r300 1200 1200 msgstr "" 1201 1201 1202 #: uformplayer.sagrohigh 1203 msgctxt "uformplayer.sagrohigh" 1204 msgid "High" 1205 msgstr "" 1206 1207 #: uformplayer.sagrolow 1208 msgctxt "uformplayer.sagrolow" 1209 msgid "Low" 1210 msgstr "" 1211 1212 #: uformplayer.sagromedium 1213 msgctxt "uformplayer.sagromedium" 1214 msgid "Medium" 1215 msgstr "" 1216 1217 #: uformplayer.scomputer 1218 msgctxt "uformplayer.scomputer" 1219 msgid "Computer" 1220 msgstr "" 1221 1222 #: uformplayer.shuman 1223 msgctxt "uformplayer.shuman" 1224 msgid "Human" 1225 msgstr "" 1226 1227 #: uformplayers.sremoveitems 1228 msgctxt "uformplayers.sremoveitems" 1229 msgid "Remove items" 1230 msgstr "" 1231 1232 #: uformplayers.sremoveitemsquery 1233 msgctxt "uformplayers.sremoveitemsquery" 1234 msgid "Do you want to remove selected items?" 1235 msgstr "" 1236 1202 1237 #: ugame.scomputer 1203 1238 msgctxt "ugame.scomputer" -
trunk/UItemList.pas
r298 r300 25 25 Size: TPoint; 26 26 EnumStates: TStringList; 27 VisibleIfIndex: Integer; 27 28 constructor Create; 28 29 destructor Destroy; override; -
trunk/UPlayer.pas
r298 r300 1207 1207 Field.EnumStates.Add(SMedium); 1208 1208 Field.EnumStates.Add(SHigh); 1209 Result.AddField(6, 'Defensive', SDefensive, dtBoolean); 1209 Field.VisibleIfIndex := 2; 1210 Field := Result.AddField(6, 'Defensive', SDefensive, dtBoolean); 1211 Field.VisibleIfIndex := 2; 1210 1212 Result.AddField(7, 'StartUnits', SStartUnits, dtInteger); 1211 1213 end; -
trunk/xtactics.lpi
r295 r300 7 7 <MainUnit Value="0"/> 8 8 <Title Value="xtactics"/> 9 <Scaled Value="True"/> 9 10 <ResourceType Value="res"/> 10 11 <UseXPManifest Value="True"/> -
trunk/xtactics.lpr
r279 r300 29 29 30 30 RequireDerivedFormResource := True; 31 Application.Scaled:=True; 31 32 Application.Initialize; 32 33 Application.CreateForm(TCore, Core);
Note:
See TracChangeset
for help on using the changeset viewer.