Changeset 507 for trunk/LocalPlayer


Ignore:
Timestamp:
Dec 25, 2023, 12:01:22 PM (12 months ago)
Author:
chronos
Message:
  • Fixed: Range check error on main form minimization.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/Term.pas

    r502 r507  
    41974197  MiniFrame, MaxMapWidth: Integer;
    41984198begin
    4199   SmallScreen := ClientWidth < 1024;
     4199  SmallScreen := Width < 1024;
    42004200  with MainMap do begin
    42014201    MaxMapWidth := (G.lx * 2 - 3) * xxt;
    42024202    // avoide the same tile being visible left and right
    4203     if ClientWidth <= MaxMapWidth then begin
    4204       MapWidth := ClientWidth;
     4203    if Width <= MaxMapWidth then begin
     4204      MapWidth := Width;
    42054205      MapOffset := 0;
    42064206    end else begin
    42074207      MapWidth := MaxMapWidth;
    4208       MapOffset := (ClientWidth - MapWidth) div 2;
    4209     end;
    4210     MapHeight := ClientHeight - TopBarHeight - PanelHeight + Overlap;
    4211     Panel.SetSize(ClientWidth, PanelHeight);
    4212     TopBar.SetSize(ClientWidth, TopBarHeight);
     4208      MapOffset := (Width - MapWidth) div 2;
     4209    end;
     4210    MapHeight := Height - TopBarHeight - PanelHeight + Overlap;
     4211    Panel.SetSize(Width, PanelHeight);
     4212    TopBar.SetSize(Width, TopBarHeight);
    42134213    MiniFrame := (lxmax_xxx - G.ly) div 2;
    42144214    xMidPanel := (G.lx + MiniFrame) * 2 + 1;
    4215     xRightPanel := ClientWidth - LeftPanelWidth - 10;
     4215    xRightPanel := Width - LeftPanelWidth - 10;
    42164216    if ClientMode = cEditMap then
    42174217      TrPitch := 2 * xxt
     
    42304230  else if yw > ywmax then
    42314231    yw := ywmax;
    4232   UnitInfoBtn.Top := ClientHeight - 29;
     4232  UnitInfoBtn.Top := Height - 29;
    42334233  UnitInfoBtn.Left := xMidPanel + 7 + 99;
    4234   UnitBtn.Top := ClientHeight - 29;
     4234  UnitBtn.Top := Height - 29;
    42354235  UnitBtn.Left := xMidPanel + 7 + 99 + 31;
    4236   TerrainBtn.Top := ClientHeight - 29;
     4236  TerrainBtn.Top := Height - 29;
    42374237  TerrainBtn.Left := xMidPanel + 7 + 99 + 62;
    4238   MovieSpeed1Btn.Top := ClientHeight - 91;
    4239   MovieSpeed1Btn.Left := ClientWidth div 2 - 62;
    4240   MovieSpeed2Btn.Top := ClientHeight - 91;
    4241   MovieSpeed2Btn.Left := ClientWidth div 2 - 62 + 29;
    4242   MovieSpeed3Btn.Top := ClientHeight - 91;
    4243   MovieSpeed3Btn.Left := ClientWidth div 2 - 62 + 2 * 29;
    4244   MovieSpeed4Btn.Top := ClientHeight - 91;
    4245   MovieSpeed4Btn.Left := ClientWidth div 2 - 62 + 3 * 29 + 12;
    4246   EOT.Top := ClientHeight - 64;
    4247   EOT.Left := ClientWidth - 62;
    4248   sb.SetBorderSpacing(ClientHeight - yTroop - 24, ClientWidth - xRightPanel + 8, 8);
     4238  MovieSpeed1Btn.Top := Height - 91;
     4239  MovieSpeed1Btn.Left := Width div 2 - 62;
     4240  MovieSpeed2Btn.Top := Height - 91;
     4241  MovieSpeed2Btn.Left := Width div 2 - 62 + 29;
     4242  MovieSpeed3Btn.Top := Height - 91;
     4243  MovieSpeed3Btn.Left := Width div 2 - 62 + 2 * 29;
     4244  MovieSpeed4Btn.Top := Height - 91;
     4245  MovieSpeed4Btn.Left := Width div 2 - 62 + 3 * 29 + 12;
     4246  EOT.Top := Height - 64;
     4247  EOT.Left := Width - 62;
     4248  sb.SetBorderSpacing(Height - yTroop - 24, Width - xRightPanel + 8, 8);
    42494249  {TODO:
    42504250  SetWindowPos(sb.ScrollBar.Handle, 0, xRightPanel + 10 - 14 - GetSystemMetrics(SM_CXVSCROLL),
    4251     ClientHeight - MidPanelHeight + 8, 0, 0, SWP_NOSIZE or SWP_NOZORDER);
     4251    Height - MidPanelHeight + 8, 0, 0, SWP_NOSIZE or SWP_NOZORDER);
    42524252    }
    42534253  MapBtn0.Left := xMini + G.lx - 44;
    4254   MapBtn0.Top := ClientHeight - 15;
     4254  MapBtn0.Top := Height - 15;
    42554255  MapBtn1.Left := xMini + G.lx - 28;
    4256   MapBtn1.Top := ClientHeight - 15;
    4257   { MapBtn2.Left:=xMini+G.lx-20;
    4258     MapBtn2.Top:=ClientHeight-15;
    4259     MapBtn3.Left:=xMini+G.lx-4;
    4260     MapBtn3.Top:=ClientHeight-15; }
     4256  MapBtn1.Top := Height - 15;
     4257  { MapBtn2.Left := xMini + G.lx - 20;
     4258    MapBtn2.Top := Height - 15;
     4259    MapBtn3.Left := xMini + G.lx - 4;
     4260    MapBtn3.Top := Height - 15; }
    42614261  MapBtn5.Left := xMini + G.lx - 12;
    4262   MapBtn5.Top := ClientHeight - 15;
     4262  MapBtn5.Top := Height - 15;
    42634263  MapBtn4.Left := xMini + G.lx + 20;
    4264   MapBtn4.Top := ClientHeight - 15;
     4264  MapBtn4.Top := Height - 15;
    42654265  MapBtn6.Left := xMini + G.lx + 36;
    4266   MapBtn6.Top := ClientHeight - 15;
    4267   TreasuryArea.Left := ClientWidth div 2 - 172;
    4268   ResearchArea.Left := ClientWidth div 2;
    4269   ManagementArea.Left := ClientWidth - xPalace;
     4266  MapBtn6.Top := Height - 15;
     4267  TreasuryArea.Left := Width div 2 - 172;
     4268  ResearchArea.Left := Width div 2;
     4269  ManagementArea.Left := Width - xPalace;
    42704270  ManagementArea.Top := TopBarHeight + MapHeight - Overlap + yPalace;
    42714271  ArrangeMidPanel;
    42724272  if RepaintOnResize then
    42734273  begin
    4274     RectInvalidate(0, TopBarHeight, ClientWidth, TopBarHeight + MapHeight);
     4274    RectInvalidate(0, TopBarHeight, Width, TopBarHeight + MapHeight);
    42754275    MapValid := False;
    42764276    PaintAll;
Note: See TracChangeset for help on using the changeset viewer.