Changeset 170 for trunk/Forms
- Timestamp:
- Nov 23, 2017, 5:02:49 PM (7 years ago)
- Location:
- trunk/Forms
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormCharts.lfm
r145 r170 9 9 OnClose = FormClose 10 10 OnShow = FormShow 11 LCLVersion = '1. 8.0.4'11 LCLVersion = '1.6.4.0' 12 12 object Chart1: TChart 13 13 Left = 8 … … 35 35 object ComboBox1: TComboBox 36 36 Left = 24 37 Height = 3637 Height = 28 38 38 Top = 8 39 39 Width = 392 40 ItemHeight = 040 ItemHeight = 20 41 41 ItemIndex = 0 42 42 Items.Strings = ( -
trunk/Forms/UFormMain.lfm
r157 r170 5 5 Width = 775 6 6 Caption = 'xTactics' 7 ClientHeight = 5 877 ClientHeight = 596 8 8 ClientWidth = 775 9 9 Menu = MainMenu1 … … 13 13 OnKeyUp = FormKeyUp 14 14 OnShow = FormShow 15 LCLVersion = '1. 8.0.4'15 LCLVersion = '1.6.4.0' 16 16 WindowState = wsMaximized 17 17 object StatusBar1: TStatusBar 18 18 Left = 0 19 Height = 3020 Top = 5 5719 Height = 28 20 Top = 568 21 21 Width = 775 22 22 Panels = < … … 34 34 object ToolBar1: TToolBar 35 35 Left = 0 36 Height = 5 5736 Height = 568 37 37 Top = 0 38 38 Width = 32 … … 72 72 object ToolButton6: TToolButton 73 73 Left = 1 74 Top = 1 7074 Top = 194 75 75 Action = AZoomIn 76 76 end 77 77 object ToolButton7: TToolButton 78 78 Left = 1 79 Top = 2 0279 Top = 226 80 80 Action = AZoomOut 81 81 end 82 82 object ToolButton8: TToolButton 83 83 Left = 1 84 Top = 2 3484 Top = 258 85 85 Action = AZoomAll 86 86 end 87 87 object ToolButton9: TToolButton 88 88 Left = 1 89 Height = 32 89 90 Top = 162 90 91 Width = 32 … … 93 94 object ToolButton10: TToolButton 94 95 Left = 1 95 Top = 266 96 Height = 32 97 Top = 290 96 98 Width = 32 97 99 Style = tbsSeparator … … 99 101 object ToolButton11: TToolButton 100 102 Left = 1 101 Top = 274103 Top = 322 102 104 Action = Core.AGameLoad 103 105 end 104 106 object ToolButton12: TToolButton 105 107 Left = 1 106 Top = 3 06108 Top = 354 107 109 Action = Core.AGameSave 108 110 end 109 111 object ToolButton13: TToolButton 110 112 Left = 1 111 Top = 3 38113 Top = 386 112 114 Action = Core.AExit 113 115 end … … 115 117 object PaintBox1: TPaintBox 116 118 Left = 32 117 Height = 5 57119 Height = 568 118 120 Top = 0 119 121 Width = 743 -
trunk/Forms/UFormMain.pas
r158 r170 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, 9 UGame, LCLType, Menus, ActnList, ComCtrls, types, dateutils, XMLConf, DOM; 9 UGame, LCLType, Menus, ActnList, ComCtrls, dateutils, XMLConf, DOM, 10 UGeometry; 10 11 11 12 const … … 137 138 if Assigned(Core.CurrentClient) then 138 139 with Core.CurrentClient do begin 139 View.DestRect := Bounds(0, 0, PaintBox1.Width, PaintBox1.Height);140 View.DestRect := TRect.CreateBounds(TPoint.Create(0, 0), TPoint.Create(PaintBox1.Width, PaintBox1.Height)); 140 141 if csOpaque in PaintBox1.ControlStyle then begin 141 142 TempBitmap.SetSize(PaintBox1.Width, PaintBox1.Height); … … 166 167 if Assigned(Core.CurrentClient) then 167 168 with Core.CurrentClient do 168 View.DestRect := Bounds(0, 0, PaintBox1.Width, PaintBox1.Height);169 View.DestRect := TRect.CreateBounds(TPoint.Create(0, 0), TPoint.Create(PaintBox1.Width, PaintBox1.Height)); 169 170 Redraw; 170 171 end; … … 252 253 with Core, Game, CurrentClient, View do begin 253 254 MapRect := Map.CalculatePixelRect; 254 Factor := FloatPoint( (DestRect.Right - DestRect.Left) / (MapRect.Right - MapRect.Left),255 (DestRect.Bottom - DestRect.Top) / (MapRect.Bottom - MapRect.Top));255 Factor := FloatPoint(DestRect.Size.X / MapRect.Size.X, 256 DestRect.Size.Y / MapRect.Size.Y); 256 257 if Factor.X < Factor.Y then NewZoom := Factor.X 257 258 else NewZoom := Factor.Y; … … 342 343 if Button = mbLeft then begin 343 344 if Assigned(Core.CurrentClient) then begin 344 StartMousePoint := Point(X, Y);345 StartViewPoint := Core.CurrentClient.View.SourceRect. TopLeft;345 StartMousePoint := TPoint.Create(X, Y); 346 StartViewPoint := Core.CurrentClient.View.SourceRect.P1; 346 347 MoveActive := True; 347 348 end; … … 366 367 (Abs(StartMousePoint.Y - Y) > Trunc(Screen.PixelsPerInch * MouseMinDiff)) then 367 368 with Core.Game.CurrentPlayer, Core.CurrentClient do begin 368 View.SourceRect := Bounds(Trunc(StartViewPoint.X + (StartMousePoint.X - X) / View.Zoom), 369 Trunc(StartViewPoint.Y + (StartMousePoint.Y - Y) / View.Zoom), 370 View.SourceRect.Right - View.SourceRect.Left, 371 View.SourceRect.Bottom - View.SourceRect.Top); 369 View.SourceRect := TRect.CreateBounds(TPoint.Create(Trunc(StartViewPoint.X + (StartMousePoint.X - X) / View.Zoom), 370 Trunc(StartViewPoint.Y + (StartMousePoint.Y - Y) / View.Zoom)), 371 View.SourceRect.Size); 372 372 Redraw; 373 373 end; … … 375 375 OldCell := Core.CurrentClient.View.FocusedCell; 376 376 with Core.Game do 377 Cell := Map.PosToCell(Core.CurrentClient.View.CanvasToCellPos( Point(X, Y)), Core.CurrentClient.View );377 Cell := Map.PosToCell(Core.CurrentClient.View.CanvasToCellPos(TPoint.Create(X, Y)), Core.CurrentClient.View ); 378 378 if Assigned(Cell) then begin 379 379 Core.CurrentClient.View.FocusedCell := Cell; … … 384 384 StatusBar1.Panels[0].Text := ''; 385 385 end; 386 CellPos := Core.CurrentClient.View.CanvasToCellPos( Point(X, Y));386 CellPos := Core.CurrentClient.View.CanvasToCellPos(TPoint.Create(X, Y)); 387 387 StatusBar1.Panels[2].Text := 'CellPos: ' + IntToStr(CellPos.X) + ', ' + IntToStr(CellPos.Y); 388 388 if Cell <> OldCell then Redraw; … … 396 396 (Abs(StartMousePoint.Y - Y) < Trunc(Screen.PixelsPerInch * MouseMinDiff)) then begin 397 397 if Core.Game.Running and (Core.Game.CurrentPlayer.Mode = pmHuman) then begin 398 Core.CurrentClient.View.SelectCell( Point(X, Y), Core.Game.CurrentPlayer, Shift);398 Core.CurrentClient.View.SelectCell(TPoint.Create(X, Y), Core.Game.CurrentPlayer, Shift); 399 399 Redraw; 400 400 end; -
trunk/Forms/UFormNew.pas
r167 r170 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 ComCtrls, Spin, ExtCtrls, ActnList, ExtDlgs, Menus, UGame ;9 ComCtrls, Spin, ExtCtrls, ActnList, ExtDlgs, Menus, UGame, UGeometry; 10 10 11 11 type … … 363 363 Game.CityEnabled := CheckBoxCity.Checked; 364 364 Game.CityPercentage := SpinEditCityPercent.Value; 365 Game.Map.Size := Point(SpinEditMapSizeX.Value, SpinEditMapSizeY.Value);365 Game.Map.Size := TPoint.Create(SpinEditMapSizeX.Value, SpinEditMapSizeY.Value); 366 366 Game.GrowAmount := TGrowAmount(RadioGroupGrowAmount.ItemIndex); 367 367 Game.GrowCells := TGrowCells(RadioGroupGrowCells.ItemIndex);
Note:
See TracChangeset
for help on using the changeset viewer.