Changeset 193 for branches/highdpi/LocalPlayer
- Timestamp:
- May 7, 2020, 7:05:57 PM (5 years ago)
- Location:
- branches/highdpi/LocalPlayer
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/highdpi/LocalPlayer/Battle.pas
r179 r193 212 212 OKBtn.Visible := true; 213 213 CancelBtn.Visible := true; 214 Left := ( Screen.Width - ClientWidth) div 2; // center on screen215 Top := ( Screen.Height - ClientHeight) div 2;214 Left := (DpiScreen.Width - ClientWidth) div 2; // center on screen 215 Top := (DpiScreen.Height - ClientHeight) div 2; 216 216 end 217 217 else -
branches/highdpi/LocalPlayer/CityScreen.pas
r179 r193 1106 1106 if WindowMode = wmModal then 1107 1107 begin { center on screen } 1108 Left := ( Screen.Width - Width) div 2;1109 Top := ( Screen.Height - Height) div 2;1108 Left := (DpiScreen.Width - Width) div 2; 1109 Top := (DpiScreen.Height - Height) div 2; 1110 1110 end; 1111 1111 -
branches/highdpi/LocalPlayer/Diagram.pas
r178 r193 293 293 if WindowMode = wmModal then 294 294 begin { center on screen } 295 Left := ( Screen.Width - Width) div 2;296 Top := ( Screen.Height - Height) div 2;295 Left := (DpiScreen.Width - Width) div 2; 296 Top := (DpiScreen.Height - Height) div 2; 297 297 end; 298 298 OffscreenPaint; -
branches/highdpi/LocalPlayer/Draft.pas
r179 r193 488 488 if WindowMode = wmModal then 489 489 begin { center on screen } 490 Left := ( Screen.Width - Template.Width) div 2;491 Top := ( Screen.Height - (Template.Height - Cut)) div 2;490 Left := (DpiScreen.Width - Template.Width) div 2; 491 Top := (DpiScreen.Height - (Template.Height - Cut)) div 2; 492 492 end; 493 493 -
branches/highdpi/LocalPlayer/Help.lfm
r69 r193 1 1 object HelpDlg: THelpDlg 2 2 Left = 394 3 Height = 718 3 4 Top = 180 5 Width = 840 4 6 BorderIcons = [] 5 7 BorderStyle = bsNone 6 ClientHeight = 4797 ClientWidth = 5608 ClientHeight = 718 9 ClientWidth = 840 8 10 Color = clBtnFace 9 Font.Charset = DEFAULT_CHARSET11 DesignTimePPI = 144 10 12 Font.Color = clWindowText 11 Font.Height = - 1313 Font.Height = -20 12 14 Font.Name = 'MS Sans Serif' 13 Font.Style = []14 15 FormStyle = fsStayOnTop 15 16 OnClose = FormClose … … 17 18 OnDestroy = FormDestroy 18 19 OnKeyDown = FormKeyDown 19 OnMouseWheel = FormMouseWheel20 20 OnMouseDown = PaintBox1MouseDown 21 21 OnMouseMove = PaintBox1MouseMove 22 OnMouseWheel = FormMouseWheel 22 23 OnPaint = FormPaint 23 PixelsPerInch = 9624 LCLVersion = '2.0.8.0' 24 25 object CloseBtn: TButtonB 25 Left = 52226 Top = 627 Width = 2528 Height = 2526 Left = 783 27 Height = 38 28 Top = 9 29 Width = 38 29 30 Down = False 30 31 Permanent = False … … 33 34 end 34 35 object BackBtn: TButtonB 35 Left = 4236 Top = 637 Width = 2538 Height = 2536 Left = 63 37 Height = 38 38 Top = 9 39 Width = 38 39 40 Down = False 40 41 Permanent = False … … 43 44 end 44 45 object TopBtn: TButtonB 45 Left = 1346 Top = 647 Width = 2548 Height = 2546 Left = 20 47 Height = 38 48 Top = 9 49 Width = 38 49 50 Down = False 50 51 Permanent = False … … 53 54 end 54 55 object SearchBtn: TButtonB 55 Left = 49356 Top = 657 Width = 2558 Height = 2556 Left = 740 57 Height = 38 58 Top = 9 59 Width = 38 59 60 Down = False 60 61 Permanent = False -
branches/highdpi/LocalPlayer/Help.pas
r179 r193 367 367 ImpPtr: array [-1 .. 1] of TPixelPointer; 368 368 begin 369 { TODO 369 370 // assume eiffel tower has free common heaven 370 371 for dy := 0 to nHeaven - 1 do … … 376 377 xSrc := iix mod 7 * xSizeBig; 377 378 ySrc := (iix div 7 + 1) * ySizeBig; 378 for y := 0 to ySizeBig * 2- 1 do379 for y := 0 to ScaleToVcl(ySizeBig * 2) - 1 do 379 380 if ((y0 + y) >= 0) and ((y0 + y) < InnerHeight) then begin 380 PaintPtr.Init(OffScreen, 0, y0 + y);381 CoalPtr.Init(Templates, 0, yCoal + y);381 PaintPtr.Init(OffScreen, 0, ScaleToVcl(y0 + y)); 382 CoalPtr.Init(Templates, 0, ScaleToVcl(yCoal + y)); 382 383 for dy := -1 to 1 do 383 384 if ((Max(y + dy, 0) shr 1) >= 0) and ((Max(y + dy, 0) shr 1) < ySizeBig) then 384 ImpPtr[dy].Init(BigImp, 0, ySrc + (Max(y + dy, 0) shr 1));385 for x := 0 to xSizeBig * 2- 1 do begin385 ImpPtr[dy].Init(BigImp, 0, ScaleToVcl(ySrc + (Max(y + dy, 0) shr 1))); 386 for x := 0 to ScaleToVcl(xSizeBig * 2) - 1 do begin 386 387 sum := 0; 387 388 for dx := -1 to 1 do begin … … 412 413 Offscreen.EndUpdate; 413 414 BigImp.EndUpdate; 415 } 414 416 end; 415 417 -
branches/highdpi/LocalPlayer/MessgEx.pas
r179 r193 177 177 0: 178 178 begin 179 Left := ( Screen.Width - ClientWidth) div 2;180 Top := ( Screen.Height - ClientHeight) div 2 - MapCenterUp;179 Left := (DpiScreen.Width - ClientWidth) div 2; 180 Top := (DpiScreen.Height - ClientHeight) div 2 - MapCenterUp; 181 181 end; 182 182 1: 183 183 begin 184 Left := ( Screen.Width - ClientWidth) div 4;185 Top := ( Screen.Height - ClientHeight) * 2 div 3 - MapCenterUp;184 Left := (DpiScreen.Width - ClientWidth) div 4; 185 Top := (DpiScreen.Height - ClientHeight) * 2 div 3 - MapCenterUp; 186 186 end; 187 187 -1: 188 188 begin 189 Left := ( Screen.Width - ClientWidth) div 4;190 Top := ( Screen.Height - ClientHeight) div 3 - MapCenterUp;189 Left := (DpiScreen.Width - ClientWidth) div 4; 190 Top := (DpiScreen.Height - ClientHeight) div 3 - MapCenterUp; 191 191 end; 192 192 end; -
branches/highdpi/LocalPlayer/Rates.pas
r179 r193 42 42 procedure TRatesDlg.FormCreate(Sender: TObject); 43 43 begin 44 TitleHeight := Screen.Height;44 TitleHeight := DpiScreen.Height; 45 45 InitButtons(); 46 46 end; -
branches/highdpi/LocalPlayer/Select.pas
r179 r193 1609 1609 begin { center on screen } 1610 1610 if Kind = kTribe then 1611 Left := ( Screen.Width - 800) * 3 div 8 + 1301611 Left := (DpiScreen.Width - 800) * 3 div 8 + 130 1612 1612 else 1613 Left := ( Screen.Width - Width) div 2;1614 Top := ( Screen.Height - Height) div 2;1613 Left := (DpiScreen.Width - Width) div 2; 1614 Top := (DpiScreen.Height - Height) div 2; 1615 1615 if Kind = kProject then 1616 1616 Top := Top + 48; -
branches/highdpi/LocalPlayer/TechTree.pas
r179 r193 183 183 184 184 // fit window to image, center image in window, center window to screen 185 width := min( Screen.width - 40, Image.width + LeftBorder + RightBorder + 2 *185 width := min(DpiScreen.width - 40, Image.width + LeftBorder + RightBorder + 2 * 186 186 BlackBorder); 187 height := min( Screen.height - 40, Image.height + TopBorder + BottomBorder + 2187 height := min(DpiScreen.height - 40, Image.height + TopBorder + BottomBorder + 2 188 188 * BlackBorder); 189 Left := ( Screen.width - width) div 2;190 Top := ( Screen.height - height) div 2;189 Left := (DpiScreen.width - width) div 2; 190 Top := (DpiScreen.height - height) div 2; 191 191 CloseBtn.Left := width - CloseBtn.width - BlackBorder - 8; 192 192 CloseBtn.Top := BlackBorder + 8; -
branches/highdpi/LocalPlayer/Term.pas
r179 r193 2503 2503 SetMainTextureByAge(-1); 2504 2504 Tribes.Init; 2505 HelpDlg.UserLeft := ( Screen.width - HelpDlg.width) div 2;2506 HelpDlg.UserTop := ( Screen.height - HelpDlg.height) div 2;2505 HelpDlg.UserLeft := (DpiScreen.width - HelpDlg.width) div 2; 2506 HelpDlg.UserTop := (DpiScreen.height - HelpDlg.height) div 2; 2507 2507 HelpDlg.Difficulty := 0; 2508 2508 if Command = cStartCredits then … … 2566 2566 ListDlg.UserLeft := 8; 2567 2567 ListDlg.UserTop := TopBarHeight + 8; 2568 HelpDlg.UserLeft := Screen.width - HelpDlg.width - 8;2568 HelpDlg.UserLeft := DpiScreen.width - HelpDlg.width - 8; 2569 2569 HelpDlg.UserTop := TopBarHeight + 8; 2570 2570 UnitStatDlg.UserLeft := 397; 2571 2571 UnitStatDlg.UserTop := TopBarHeight + 64; 2572 DiaDlg.UserLeft := ( Screen.width - DiaDlg.width) div 2;2573 DiaDlg.UserTop := ( Screen.height - DiaDlg.height) div 2;2574 NatStatDlg.UserLeft := Screen.width - NatStatDlg.width - 8;2575 NatStatDlg.UserTop := Screen.height - PanelHeight -2572 DiaDlg.UserLeft := (DpiScreen.width - DiaDlg.width) div 2; 2573 DiaDlg.UserTop := (DpiScreen.height - DiaDlg.height) div 2; 2574 NatStatDlg.UserLeft := DpiScreen.width - NatStatDlg.width - 8; 2575 NatStatDlg.UserTop := DpiScreen.height - PanelHeight - 2576 2576 NatStatDlg.height - 8; 2577 2577 if NatStatDlg.UserTop < 8 then … … 3908 3908 UnitStatDlg.Close; 3909 3909 end; 3910 for i := 0 to Screen.FormCount - 1 do3910 for i := 0 to DpiScreen.FormCount - 1 do 3911 3911 if DpiScreen.Forms[i].Visible and (DpiScreen.Forms[i] is TBufferedDrawDlg) then 3912 3912 DpiScreen.Forms[i].Enabled := false; … … 5102 5102 dx := 0; 5103 5103 dy := 0; 5104 if Mouse.CursorPos.y < Screen.height - PanelHeight then5104 if Mouse.CursorPos.y < DpiScreen.height - PanelHeight then 5105 5105 if Mouse.CursorPos.x = 0 then 5106 5106 dx := -speed // scroll left 5107 else if Mouse.CursorPos.x = Screen.width - 1 then5107 else if Mouse.CursorPos.x = DpiScreen.width - 1 then 5108 5108 dx := speed; // scroll right 5109 5109 if Mouse.CursorPos.y = 0 then 5110 5110 dy := -speed // scroll up 5111 else if (Mouse.CursorPos.y = Screen.height - 1) and5111 else if (Mouse.CursorPos.y = DpiScreen.height - 1) and 5112 5112 (Mouse.CursorPos.x >= TerrainBtn.Left + TerrainBtn.width) and 5113 5113 (Mouse.CursorPos.x < xRightPanel + 10 - 8) then … … 5469 5469 if BattleDlg.Left < 0 then 5470 5470 BattleDlg.Left := 0 5471 else if BattleDlg.Left + BattleDlg.width > Screen.width then5472 BattleDlg.Left := Screen.width - BattleDlg.width;5471 else if BattleDlg.Left + BattleDlg.width > DpiScreen.width then 5472 BattleDlg.Left := DpiScreen.width - BattleDlg.width; 5473 5473 BattleDlg.Top := y - BattleDlg.height div 2; 5474 5474 if BattleDlg.Top < 0 then 5475 5475 BattleDlg.Top := 0 5476 else if BattleDlg.Top + BattleDlg.height > Screen.height then5477 BattleDlg.Top := Screen.height - BattleDlg.height;5476 else if BattleDlg.Top + BattleDlg.height > DpiScreen.height then 5477 BattleDlg.Top := DpiScreen.height - BattleDlg.height; 5478 5478 BattleDlg.IsSuicideQuery := false; 5479 5479 BattleDlg.Show; -
branches/highdpi/LocalPlayer/UnitStat.pas
r179 r193 74 74 inherited; 75 75 AgePrepared := -2; 76 TitleHeight := Screen.Height;76 TitleHeight := DpiScreen.Height; 77 77 InitButtons(); 78 78 … … 171 171 else 172 172 begin 173 Left := ( Screen.Width - Width) div 2;174 Top := ( Screen.Height - Height) div 2;173 Left := (DpiScreen.Width - Width) div 2; 174 Top := (DpiScreen.Height - Height) div 2; 175 175 end; 176 176
Note:
See TracChangeset
for help on using the changeset viewer.