- Timestamp:
- Dec 4, 2014, 10:18:13 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 11 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.lfm
r87 r91 5 5 Width = 775 6 6 Caption = 'xTactics' 7 ClientHeight = 59 57 ClientHeight = 592 8 8 ClientWidth = 775 9 9 Menu = MainMenu1 … … 18 18 object StatusBar1: TStatusBar 19 19 Left = 0 20 Height = 2 621 Top = 56 920 Height = 29 21 Top = 563 22 22 Width = 775 23 23 Panels = < … … 35 35 object ToolBar1: TToolBar 36 36 Left = 0 37 Height = 56 937 Height = 563 38 38 Top = 0 39 39 Width = 40 … … 116 116 object PaintBox1: TPaintBox 117 117 Left = 40 118 Height = 56 9118 Height = 563 119 119 Top = 0 120 120 Width = 735 121 121 Align = alClient 122 122 OnMouseDown = PaintBox1MouseDown 123 OnMouseLeave = PaintBox1MouseLeave124 123 OnMouseMove = PaintBox1MouseMove 125 124 OnMouseUp = PaintBox1MouseUp 125 OnMouseLeave = PaintBox1MouseLeave 126 126 OnMouseWheelDown = PaintBox1MouseWheelDown 127 127 OnMouseWheelUp = PaintBox1MouseWheelUp -
trunk/Forms/UFormMain.pas
r90 r91 73 73 procedure AZoomOutExecute(Sender: TObject); 74 74 procedure FormActivate(Sender: TObject); 75 procedure FormShow(Sender: TObject); 75 76 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 76 77 procedure FormCreate(Sender: TObject); 77 78 procedure FormDestroy(Sender: TObject); 78 79 procedure FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); 79 procedure FormShow(Sender: TObject);80 procedure MenuItem19Click(Sender: TObject);81 80 procedure PaintBox1MouseDown(Sender: TObject; Button: TMouseButton; 82 81 Shift: TShiftState; X, Y: Integer); … … 244 243 Factor: TFloatPoint; 245 244 MapRect: TRect; 245 NewZoom: Single; 246 246 begin 247 247 with Core, Game, Player, View do begin … … 249 249 Factor := FloatPoint((DestRect.Right - DestRect.Left) / (MapRect.Right - MapRect.Left), 250 250 (DestRect.Bottom - DestRect.Top) / (MapRect.Bottom - MapRect.Top)); 251 if Factor.X < Factor.Y then Zoom := Factor.X 252 else Zoom := Factor.Y; 251 if Factor.X < Factor.Y then NewZoom := Factor.X 252 else NewZoom := Factor.Y; 253 //if NewZoom <> 0 then 254 Zoom := NewZoom; 253 255 CenterMap; 254 256 end; … … 326 328 ReloadView; 327 329 Redraw; 328 end;329 330 procedure TFormMain.MenuItem19Click(Sender: TObject);331 begin332 333 330 end; 334 331 -
trunk/Forms/UFormNew.lfm
r87 r91 1 1 object FormNew: TFormNew 2 2 Left = 624 3 Height = 5 283 Height = 519 4 4 Top = 313 5 Width = 7455 Width = 1229 6 6 Caption = 'New game' 7 ClientHeight = 5 288 ClientWidth = 7457 ClientHeight = 519 8 ClientWidth = 1229 9 9 OnCreate = FormCreate 10 10 OnDestroy = FormDestroy 11 11 OnShow = FormShow 12 12 LCLVersion = '1.3' 13 object Splitter1: TSplitter14 Cursor = crVSplit15 Left = 016 Height = 517 Top = 018 Width = 74519 Align = alTop20 ResizeAnchor = akTop21 end22 13 object ButtonCancel: TButton 23 Left = 52214 Left = 1006 24 15 Height = 25 25 Top = 4 8616 Top = 477 26 17 Width = 75 27 Anchors = [ak Bottom]18 Anchors = [akRight, akBottom] 28 19 Caption = 'Cancel' 29 20 ModalResult = 2 30 TabOrder = 121 TabOrder = 0 31 22 end 32 23 object ButtonOk: TButton 33 Left = 62624 Left = 1110 34 25 Height = 25 35 Top = 4 8626 Top = 477 36 27 Width = 75 37 28 Anchors = [akRight, akBottom] 38 29 Caption = 'Ok' 39 30 ModalResult = 1 40 TabOrder = 231 TabOrder = 1 41 32 end 42 33 object PageControl1: TPageControl 43 Left = 044 Height = 4 6545 Top = 546 Width = 74547 ActivePage = TabSheet 334 Left = 4 35 Height = 457 36 Top = 4 37 Width = 1221 38 ActivePage = TabSheet2 48 39 Align = alTop 49 40 Anchors = [akTop, akLeft, akRight, akBottom] 50 TabIndex = 2 51 TabOrder = 3 41 BorderSpacing.Around = 4 42 TabIndex = 1 43 TabOrder = 2 52 44 object TabSheet1: TTabSheet 53 45 Caption = 'Players' 54 ClientHeight = 4 2555 ClientWidth = 73946 ClientHeight = 414 47 ClientWidth = 1215 56 48 object ListView1: TListView 57 Left = 8 58 Height = 368 59 Top = 8 60 Width = 713 49 Left = 4 50 Height = 364 51 Top = 4 52 Width = 1207 53 Align = alTop 61 54 Anchors = [akTop, akLeft, akRight, akBottom] 55 BorderSpacing.Around = 4 62 56 Columns = < 63 57 item … … 75 69 item 76 70 Caption = 'Start units' 77 Width = 29671 Width = 790 78 72 end> 79 73 OwnerData = True … … 91 85 end 92 86 object ButtonPlayerRemove: TButton 93 Left = 2 4094 Height = 25 95 Top = 3 8487 Left = 224 88 Height = 25 89 Top = 376 96 90 Width = 83 97 91 Action = APlayerRemove 98 Anchors = [ak Right, akBottom]92 Anchors = [akLeft, akBottom] 99 93 TabOrder = 1 100 94 end 101 95 object ButtonPlayerAdd: TButton 102 Left = 32103 Height = 25 104 Top = 3 8496 Left = 16 97 Height = 25 98 Top = 376 105 99 Width = 83 106 100 Action = APlayerAdd 107 Anchors = [ak Right, akBottom]101 Anchors = [akLeft, akBottom] 108 102 TabOrder = 2 109 103 end 110 104 object ButtonPlayerModify: TButton 111 Left = 1 36112 Height = 25 113 Top = 3 84105 Left = 120 106 Height = 25 107 Top = 376 114 108 Width = 83 115 109 Action = APlayerModify 116 Anchors = [ak Right, akBottom]110 Anchors = [akLeft, akBottom] 117 111 Caption = 'Modify' 118 112 TabOrder = 3 … … 121 115 object TabSheet2: TTabSheet 122 116 Caption = 'Map' 123 ClientHeight = 4 25124 ClientWidth = 739117 ClientHeight = 414 118 ClientWidth = 1215 125 119 object Label1: TLabel 126 120 Left = 8 … … 163 157 Height = 46 164 158 Top = 8 165 Width = 488159 Width = 964 166 160 Max = 100 167 161 Min = 2 … … 176 170 Height = 46 177 171 Top = 49 178 Width = 488172 Width = 964 179 173 Max = 100 180 174 Min = 2 … … 234 228 Height = 27 235 229 Top = 110 236 Width = 151 230 Width = 727 231 Anchors = [akTop, akLeft, akRight] 232 AutoSize = False 237 233 Caption = 'Symetric map' 238 234 TabOrder = 6 … … 312 308 Height = 35 313 309 Top = 184 314 Width = 472310 Width = 948 315 311 Anchors = [akTop, akLeft, akRight] 316 312 TabOrder = 12 317 313 end 318 314 object ButtonImageBrowse: TButton 319 Left = 624315 Left = 1100 320 316 Height = 25 321 317 Top = 192 … … 337 333 object TabSheet3: TTabSheet 338 334 Caption = 'Rules' 339 ClientHeight = 4 25340 ClientWidth = 739335 ClientHeight = 414 336 ClientWidth = 1215 341 337 object RadioGroupGrowCells: TRadioGroup 342 Left = 8338 Left = 15 343 339 Height = 105 344 340 Top = 104 … … 353 349 ChildSizing.Layout = cclLeftToRightThenTopToBottom 354 350 ChildSizing.ControlsPerLine = 1 355 ClientHeight = 81351 ClientHeight = 78 356 352 ClientWidth = 308 357 353 Items.Strings = ( … … 364 360 object Label6: TLabel 365 361 Left = 8 366 Height = 2 2362 Height = 25 367 363 Top = 248 368 Width = 1 14364 Width = 129 369 365 Caption = 'Win objective:' 370 366 ParentColor = False … … 372 368 object ComboBoxWinObjective: TComboBox 373 369 Left = 232 374 Height = 3 4370 Height = 33 375 371 Top = 240 376 372 Width = 328 … … 399 395 ChildSizing.Layout = cclLeftToRightThenTopToBottom 400 396 ChildSizing.ControlsPerLine = 1 401 ClientHeight = 52397 ClientHeight = 49 402 398 ClientWidth = 301 403 399 Items.Strings = ( … … 409 405 object CheckBoxFogOfWar: TCheckBox 410 406 Left = 336 411 Height = 2 4407 Height = 27 412 408 Top = 24 413 Width = 106 409 Width = 864 410 Anchors = [akTop, akLeft, akRight] 411 AutoSize = False 414 412 Caption = 'Fog of war' 415 413 TabOrder = 3 … … 435 433 end 436 434 object OpenPictureDialog1: TOpenPictureDialog 437 left = 616438 top = 280435 left = 424 436 top = 440 439 437 end 440 438 object PopupMenu1: TPopupMenu 441 439 left = 128 442 top = 143440 top = 440 443 441 object MenuItem1: TMenuItem 444 442 Action = APlayerAdd -
trunk/Forms/UFormNew.pas
r90 r91 55 55 SpinEditNeutralUnits: TSpinEdit; 56 56 SpinEditVoidPercent: TSpinEdit; 57 Splitter1: TSplitter;58 57 TabSheet1: TTabSheet; 59 58 TabSheet2: TTabSheet; … … 240 239 begin 241 240 ReloadView; 241 //Height := Trunc(1.5 * Height); 242 242 end; 243 243 -
trunk/Forms/UFormSettings.lfm
r77 r91 48 48 Height = 27 49 49 Top = 80 50 Width = 176 50 Width = 752 51 Anchors = [akTop, akLeft, akRight] 52 AutoSize = False 51 53 Caption = 'Developer mode' 52 54 TabOrder = 3 53 55 end 54 56 object SpinEditAnimSpeed: TSpinEdit 55 Left = 18457 Left = 224 56 58 Height = 35 57 59 Top = 120 … … 68 70 end 69 71 object Label3: TLabel 70 Left = 3 1172 Left = 360 71 73 Height = 25 72 Top = 1 2874 Top = 130 73 75 Width = 17 74 76 Caption = '%' … … 79 81 Height = 27 80 82 Top = 160 81 Width = 287 83 Width = 752 84 Anchors = [akTop, akLeft, akRight] 85 AutoSize = False 82 86 Caption = 'Autosave game on each turn' 83 87 TabOrder = 5 -
trunk/Languages/xtactics.cs.po
r90 r91 79 79 msgstr "Nastavení aplikace" 80 80 81 #: tform1.button1.caption 82 msgid "Button1" 83 msgstr "" 84 85 #: tform1.caption 86 msgid "Form1" 87 msgstr "" 88 89 #: tform1.groupbox1.caption 90 msgid "GroupBox1" 91 msgstr "" 92 93 #: tform1.tabsheet1.caption 94 msgid "TabSheet1" 95 msgstr "" 96 97 #: tform1.tabsheet2.caption 98 msgid "TabSheet2" 99 msgstr "" 100 101 #: tform1.tabsheet3.caption 102 msgid "TabSheet3" 103 msgstr "" 104 81 105 #: tformabout.caption 82 106 msgctxt "tformabout.caption" … … 569 593 msgid "Wrong file format" 570 594 msgstr "Chybný formát souboru" 595 596 #: ugame.szerozoomnotalowed 597 msgid "Zero zoom not allowed" 598 msgstr "" 599 -
trunk/Languages/xtactics.po
r90 r91 70 70 msgstr "" 71 71 72 #: tform1.button1.caption 73 msgid "Button1" 74 msgstr "" 75 76 #: tform1.caption 77 msgid "Form1" 78 msgstr "" 79 80 #: tform1.groupbox1.caption 81 msgid "GroupBox1" 82 msgstr "" 83 84 #: tform1.tabsheet1.caption 85 msgid "TabSheet1" 86 msgstr "" 87 88 #: tform1.tabsheet2.caption 89 msgid "TabSheet2" 90 msgstr "" 91 92 #: tform1.tabsheet3.caption 93 msgid "TabSheet3" 94 msgstr "" 95 72 96 #: tformabout.caption 73 97 msgctxt "tformabout.caption" … … 556 580 msgstr "" 557 581 582 #: ugame.szerozoomnotalowed 583 msgid "Zero zoom not allowed" 584 msgstr "" 585 -
trunk/Packages/Common/Common.lpk
r43 r91 12 12 <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> 13 13 </SearchPaths> 14 <Other>15 <CompilerMessages>16 <UseMsgFile Value="True"/>17 </CompilerMessages>18 <CompilerPath Value="$(CompPath)"/>19 </Other>20 14 </CompilerOptions> 21 15 <Description Value="Various libraries"/> 22 16 <License Value="GNU/GPL"/> 23 17 <Version Minor="7"/> 24 <Files Count=" 19">18 <Files Count="20"> 25 19 <Item1> 26 20 <Filename Value="StopWatch.pas"/> … … 106 100 <UnitName Value="UFindFile"/> 107 101 </Item19> 102 <Item20> 103 <Filename Value="UScaleDPI.pas"/> 104 <HasRegisterProc Value="True"/> 105 <UnitName Value="UScaleDPI"/> 106 </Item20> 108 107 </Files> 109 108 <i18n> -
trunk/Packages/Common/Common.pas
r43 r91 11 11 UMemory, UResetableThread, UPool, ULastOpenedList, URegistry, 12 12 UJobProgressView, UXMLUtils, UApplicationInfo, USyncCounter, UListViewSort, 13 UPersistentForm, UFindFile, LazarusPackageIntf;13 UPersistentForm, UFindFile, UScaleDPI, LazarusPackageIntf; 14 14 15 15 implementation … … 24 24 RegisterUnit('UPersistentForm', @UPersistentForm.Register); 25 25 RegisterUnit('UFindFile', @UFindFile.Register); 26 RegisterUnit('UScaleDPI', @UScaleDPI.Register); 26 27 end; 27 28 -
trunk/Packages/Common/ULastOpenedList.pas
r43 r91 6 6 7 7 uses 8 Classes, SysUtils, Registry, URegistry, Menus ;8 Classes, SysUtils, Registry, URegistry, Menus, XMLConf; 9 9 10 10 type … … 27 27 procedure LoadFromRegistry(Context: TRegistryContext); 28 28 procedure SaveToRegistry(Context: TRegistryContext); 29 procedure LoadFromXMLConfig(XMLConfig: TXMLConfig; Path: string); 30 procedure SaveToXMLConfig(XMLConfig: TXMLConfig; Path: string); 29 31 procedure AddItem(FileName: string); 30 32 published … … 143 145 end; 144 146 147 procedure TLastOpenedList.LoadFromXMLConfig(XMLConfig: TXMLConfig; Path: string 148 ); 149 var 150 I: Integer; 151 Value: string; 152 Count: Integer; 153 begin 154 with XMLConfig do begin 155 Count := GetValue(Path + '/Count', 0); 156 if Count > MaxCount then Count := MaxCount; 157 Items.Clear; 158 for I := 0 to Count - 1 do begin 159 Value := GetValue(Path + '/File' + IntToStr(I), ''); 160 if Trim(Value) <> '' then Items.Add(Value); 161 end; 162 if Assigned(FOnChange) then 163 FOnChange(Self); 164 end; 165 end; 166 167 procedure TLastOpenedList.SaveToXMLConfig(XMLConfig: TXMLConfig; Path: string); 168 var 169 I: Integer; 170 begin 171 with XMLConfig do begin 172 SetValue(Path + '/Count', Items.Count); 173 for I := 0 to Items.Count - 1 do 174 SetValue(Path + '/File' + IntToStr(I), Items[I]); 175 Flush; 176 end; 177 end; 178 145 179 procedure TLastOpenedList.AddItem(FileName:string); 146 180 begin -
trunk/UCore.lfm
r79 r91 2053 2053 top = 320 2054 2054 end 2055 object ScaleDPI1: TScaleDPI 2056 left = 245 2057 top = 54 2058 end 2055 2059 end -
trunk/UCore.pas
r83 r91 7 7 uses 8 8 Classes, SysUtils, XMLConf, FileUtil, ActnList, Controls, Dialogs, Forms, 9 UGame, UApplicationInfo, UPersistentForm, U CoolTranslator;9 UGame, UApplicationInfo, UPersistentForm, UScaleDPI, UCoolTranslator; 10 10 11 11 type … … 31 31 PersistentForm: TPersistentForm; 32 32 SaveDialog1: TSaveDialog; 33 ScaleDPI1: TScaleDPI; 33 34 XMLConfig1: TXMLConfig; 34 35 procedure AAboutExecute(Sender: TObject); … … 46 47 private 47 48 FInitialized: Boolean; 49 StoredDimension: TControlDimension; 48 50 procedure DoOnMove(CellFrom, CellTo: TCell; var CountOnce, 49 51 CountRepeat: Integer; Update: Boolean; var Confirm: Boolean); … … 157 159 AutoSaveEnabled := XMLConfig1.GetValue('AutoSave', True); 158 160 CoolTranslator1.Language := CoolTranslator1.Languages.SearchByCode(XMLConfig1.GetValue('Language', '')); 161 ScaleDPI1.DPI := Point(XMLConfig1.GetValue('DPIX', 96), XMLConfig1.GetValue('DPIY', 96)); 162 ScaleDPI1.AutoDetect := XMLConfig1.GetValue('DPIAuto', True); 159 163 end; 160 164 … … 166 170 XMLConfig1.SetValue('AnimationSpeed', AnimationSpeed); 167 171 XMLConfig1.SetValue('AutoSave', AutoSaveEnabled); 172 XMLConfig1.SetValue('DPIX', ScaleDPI1.DPI.X); 173 XMLConfig1.SetValue('DPIY', ScaleDPI1.DPI.Y); 174 XMLConfig1.SetValue('DPIAuto', ScaleDPI1.AutoDetect); 168 175 end; 169 176 … … 291 298 Game.OnWin := DoOnWin; 292 299 Game.OnNewTurn := GameNewTurnExecute; 300 StoredDimension := TControlDimension.Create; 293 301 end; 294 302 295 303 procedure TCore.DataModuleDestroy(Sender: TObject); 296 304 begin 305 StoredDimension.Free;; 297 306 Game.SaveConfig(XMLConfig1, 'Game'); 298 307 SaveConfig; … … 314 323 Game.Running := True; 315 324 FormMain.AZoomAll.Execute; 325 {with Core.ScaleDPI1 do begin 326 //ApplyToAll(DesignDPI); 327 FormNew.Show; 328 for I := 0 to Screen.FormCount - 1 do begin 329 StoreDimensions(Screen.Forms[I], StoredDimension); 330 ScaleDimensions(Screen.Forms[I], StoredDimension); 331 end; 332 FormNew.Hide; 333 ScaleImageList(Core.ImageListSmall, DesignDPI); 334 ScaleImageList(Core.ImageListLarge, DesignDPI); 335 end;} 316 336 end; 317 337 -
trunk/UGame.pas
r90 r91 426 426 SUnfinishedBattle = 'Unfinished battle'; 427 427 SNewGameFile = 'New game.xtg'; 428 SZeroZoomNotAlowed = 'Zero zoom not allowed'; 428 429 429 430 procedure InitStrings; … … 1429 1430 begin 1430 1431 if FZoom = AValue then Exit; 1432 if AValue = 0 then 1433 raise Exception.Create(SZeroZoomNotAlowed); 1431 1434 FZoom := AValue; 1432 1435 SourceRect := Bounds(Trunc(SourceRect.Left + (SourceRect.Right - SourceRect.Left) div 2 - (DestRect.Right - DestRect.Left) / Zoom / 2), -
trunk/xtactics.lpi
r90 r91 95 95 <Filename Value="UGame.pas"/> 96 96 <IsPartOfProject Value="True"/> 97 <UnitName Value="UGame"/>98 97 </Unit1> 99 98 <Unit2> … … 111 110 <HasResources Value="True"/> 112 111 <ResourceBaseClass Value="Form"/> 113 <UnitName Value="UFormPlayer"/>114 112 </Unit3> 115 113 <Unit4> … … 119 117 <HasResources Value="True"/> 120 118 <ResourceBaseClass Value="Form"/> 121 <UnitName Value="UFormSettings"/>122 119 </Unit4> 123 120 <Unit5> … … 127 124 <HasResources Value="True"/> 128 125 <ResourceBaseClass Value="Form"/> 129 <UnitName Value="UFormMain"/>130 126 </Unit5> 131 127 <Unit6> … … 135 131 <HasResources Value="True"/> 136 132 <ResourceBaseClass Value="Form"/> 137 <UnitName Value="UFormMove"/>138 133 </Unit6> 139 134 <Unit7> … … 143 138 <HasResources Value="True"/> 144 139 <ResourceBaseClass Value="Form"/> 145 <UnitName Value="UFormNew"/>146 140 </Unit7> 147 141 <Unit8>
Note:
See TracChangeset
for help on using the changeset viewer.