- Timestamp:
- Nov 3, 2021, 11:22:02 AM (3 years ago)
- Location:
- branches/highdpi
- Files:
-
- 54 added
- 5 deleted
- 41 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/highdpi/Direct.pas
r378 r405 194 194 195 195 procedure TDirectDlg.FormShow(Sender: TObject); 196 var197 I: Integer;198 196 begin 199 197 if not Gone then -
branches/highdpi/GameServer.pas
r378 r405 8 8 uses 9 9 Protocol, Database, dynlibs, Platform, dateutils, fgl, LazFileUtils, 10 Graphics, UBrain ;10 Graphics, UBrain, Global; 11 11 12 12 const 13 Version = $010300;14 13 FirstAICompatibleVersion = $000D00; 15 14 FirstBookCompatibleVersion = $010103; … … 224 223 BrainNetworkClient.Flags := fMultiple; 225 224 BrainNetworkClient.Initialized := False; 226 BrainNetworkClient.ServerVersion := Version;225 BrainNetworkClient.ServerVersion := CevoVersion; 227 226 BrainNetworkClient.Kind := btNetworkClient; 228 227 end; … … 231 230 BrainTerm.Flags := fMultiple; 232 231 BrainTerm.Initialized := False; 233 BrainTerm.ServerVersion := Version;232 BrainTerm.ServerVersion := CevoVersion; 234 233 BrainTerm.Kind := btTerm; 235 234 BrainRandom := Brains.AddNew; … … 243 242 BrainNetworkServer.Flags := fMultiple; 244 243 BrainNetworkServer.Initialized := False; 245 BrainNetworkServer.ServerVersion := Version;244 BrainNetworkServer.ServerVersion := CevoVersion; 246 245 BrainNetworkServer.Kind := btNetworkServer; 247 246 end; … … 255 254 NewBrain.LoadFromFile(BasePath + DirectorySeparator + F.Name + '.ai.txt'); 256 255 if (NewBrain.ServerVersion >= FirstAICompatibleVersion) and 257 (NewBrain.ServerVersion <= Version) and256 (NewBrain.ServerVersion <= CevoVersion) and 258 257 ((NewBrain.Flags and fDotNet = 0) or (@DotNetClient <> nil)) then begin 259 258 end else Brains.Delete(Brains.Count - 1); … … 405 404 begin 406 405 CL.Put(sIntSetUnitStatus, p, ix, @Status); 407 SavedStatus := Status 406 SavedStatus := Status; 408 407 end; 409 408 // log city status changes … … 413 412 begin 414 413 CL.Put(sIntSetCityStatus, p, ix, @Status); 415 SavedStatus := Status 414 SavedStatus := Status; 416 415 end; 417 416 // log model status changes … … 421 420 begin 422 421 CL.Put(sIntSetModelStatus, p, ix, @Status); 423 SavedStatus := Status 422 SavedStatus := Status; 424 423 end; 425 424 // log enemy city status changes … … 429 428 begin 430 429 CL.Put(sIntSetECityStatus, p, ix, @Status); 431 SavedStatus := Status 430 SavedStatus := Status; 432 431 end; 433 432 // log data changes … … 436 435 CL.PutDataChanges(sIntDataChange, p, SavedData[p], RW[p].Data, 437 436 bix[p].DataSize); 438 move(RW[p].Data^, SavedData[p]^, bix[p].DataSize * 4);439 end 437 Move(RW[p].Data^, SavedData[p]^, bix[p].DataSize * 4); 438 end; 440 439 end; 441 440 end; … … 461 460 SavedStatus := Status; 462 461 if bix[p].DataSize > 0 then 463 move(RW[p].Data^, SavedData[p]^, bix[p].DataSize * 4);462 Move(RW[p].Data^, SavedData[p]^, bix[p].DataSize * 4); 464 463 end; 465 464 end; … … 472 471 ix: integer; 473 472 begin 474 result := false;473 Result := False; 475 474 for ix := 0 to RW[p].nUn - 1 do 476 475 with RW[p].Un[ix] do 477 476 if (Loc >= 0) and (SavedStatus <> Status) then 478 result := true;477 Result := True; 479 478 for ix := 0 to RW[p].nCity - 1 do 480 479 with RW[p].City[ix] do 481 480 if (Loc >= 0) and (SavedStatus <> Status) then 482 result := true;481 Result := True; 483 482 for ix := 0 to RW[p].nModel - 1 do 484 483 with RW[p].Model[ix] do 485 484 if SavedStatus <> Status then 486 result := true;485 Result := True; 487 486 for ix := 0 to RW[p].nEnemyCity - 1 do 488 487 with RW[p].EnemyCity[ix] do 489 488 if (Loc >= 0) and (SavedStatus <> Status) then 490 result := true;489 Result := True; 491 490 if RW[p].Data <> nil then 492 491 for ix := 0 to bix[p].DataSize - 1 do 493 492 if PDWortList(SavedData[p])[ix] <> PDWortList(RW[p].Data)[ix] then 494 result := true493 Result := True; 495 494 end; 496 495 … … 643 642 s := 'cEvoBook'; 644 643 LogFile.write(s[1], 8); { file id } 645 i := Version;644 i := CevoVersion; 646 645 LogFile.write(i, 4); { c-evo version } 647 646 LogFile.write(ExeInfo.Time, 4); … … 688 687 begin 689 688 AutoSaveState := CL.State; 690 AutoSaveExists := true 689 AutoSaveExists := true; 691 690 end 692 691 end; … … 1096 1095 begin 1097 1096 GiveCivilReport(pTurn, p1); 1098 GiveMilReport(pTurn, p1) 1097 GiveMilReport(pTurn, p1); 1099 1098 end; 1100 1099 end; … … 1126 1125 LogFile.Read(J, 4); { exe time } 1127 1126 1128 if (i >= FirstBookCompatibleVersion) and (i <= Version) then1127 if (i >= FirstBookCompatibleVersion) and (i <= CevoVersion) then 1129 1128 begin 1130 1129 result := true; … … 1223 1222 begin 1224 1223 GenerateStat(pTurn); 1225 StatRequest := false 1224 StatRequest := false; 1226 1225 end; 1227 1226 // complete all internal commands following an sTurn before generating statistics … … 1293 1292 begin 1294 1293 Delete(LogFileName, 1, 1); 1295 nLogOpened := -1 1294 nLogOpened := -1; 1296 1295 end 1297 1296 else … … 1434 1433 Game.RO[0] := @RW[0]; 1435 1434 Game.Difficulty[0] := 0; 1436 for p1 := 1 to nPl - 1 do 1437 begin 1435 for p1 := 1 to nPl - 1 do begin 1438 1436 Game.RO[p1] := nil; 1439 Game.Difficulty[p1] := -1 1437 Game.Difficulty[p1] := -1; 1440 1438 end; 1441 1439 BrainTerm.Client(cNewMap, -1, Game); … … 1445 1443 bix[0].Client(cShowGame, 0, nil^); 1446 1444 Notify(ntBackOff); 1447 ChangeClientWhenDone(cEditMap, 0, nil^, 0) 1445 ChangeClientWhenDone(cEditMap, 0, nil^, 0); 1448 1446 end; 1449 1447 … … 1464 1462 Prod0 := 0; 1465 1463 Project := cpImp + imTrGoods; 1466 Project0 := cpImp + imTrGoods 1464 Project0 := cpImp + imTrGoods; 1467 1465 end; 1468 1466 … … 1619 1617 Flags := Flags or unWithdrawn; 1620 1618 Happened := Happened or phPeaceEvacuation; 1621 end 1619 end; 1622 1620 end; 1623 1621 … … 1688 1686 inc(ShowShipChange.Ship1Change[Project0 and cpIndex - 1689 1687 imShipComp]); 1690 end 1691 end 1688 end; 1689 end; 1692 1690 end; { city loop 1 } 1693 1691 if nUpdateLoc > 0 then … … 1715 1713 begin 1716 1714 Movement := 0; 1717 Flags := Flags and not unMountainDelay 1715 Flags := Flags and not unMountainDelay; 1718 1716 end 1719 1717 else … … 1745 1743 if (Health <= 0) or TribeExtinct then 1746 1744 RemoveUnit_UpdateMap(pTurn, uix); 1747 end 1745 end; 1748 1746 end; 1749 1747 … … 1770 1768 (ObserveLevel[Loc1] and (3 shl (2 * p1)) > 0) then 1771 1769 CallPlayer(cShowCityChanged, p1, Loc1); 1772 end 1770 end; 1773 1771 end; 1774 1772 … … 1808 1806 begin 1809 1807 Territory[Loc1] := -1; 1810 Map[Loc1] := Map[Loc1] and not fPeace 1811 end 1808 Map[Loc1] := Map[Loc1] and not fPeace; 1809 end; 1812 1810 end; 1813 1811 end; … … 1833 1831 begin 1834 1832 Happened := Happened or phTech; 1835 ResearchTech := -1 1833 ResearchTech := -1; 1836 1834 end; 1837 1835 … … 1842 1840 begin 1843 1841 inc(Credibility); 1844 Break 1842 Break; 1845 1843 end; 1846 1844 … … 1900 1898 if (bix[pTurn].Kind <> btNoTerm) and 1901 1899 ((Difficulty[pTurn] > 0) or (Mode > moLoading_Fast)) then 1902 DiscoverAll(pTurn, lObserveSuper) 1900 DiscoverAll(pTurn, lObserveSuper); 1903 1901 end 1904 1902 else … … 1906 1904 DiscoverViewAreas(pTurn); 1907 1905 if MirBuilt then 1908 DiscoverAll(pTurn, lObserveUnhidden) 1909 end 1906 DiscoverAll(pTurn, lObserveUnhidden); 1907 end; 1910 1908 end; 1911 1909 // CheckContact; … … 1970 1968 (ObserveLevel[Loc1] and (3 shl (2 * p1)) > 0) then 1971 1969 CallPlayer(cShowCityChanged, p1, Loc1); 1972 end 1970 end; 1973 1971 end; 1974 1972 end; … … 1983 1981 begin 1984 1982 Fuel := Model[mix].Cap[mcFuel]; 1985 Flags := Flags or unBombsLoaded 1983 Flags := Flags or unBombsLoaded; 1986 1984 end 1987 1985 else if Model[mix].Kind = mkSpecial_Glider then { glider } … … 1990 1988 begin 1991 1989 RemoveUnit_UpdateMap(pTurn, uix); // unit lost 1992 Happened := Happened or phGliderLost 1993 end 1990 Happened := Happened or phGliderLost; 1991 end; 1994 1992 end 1995 1993 else … … 1999 1997 begin 2000 1998 RemoveUnit_UpdateMap(pTurn, uix); // unit lost 2001 Happened := Happened or phPlaneLost 1999 Happened := Happened or phPlaneLost; 2002 2000 end 2003 2001 end … … 2007 2005 if Health < 0 then 2008 2006 RemoveUnit_UpdateMap(pTurn, uix); 2009 end 2007 end; 2010 2008 end; { unit loop 1 } 2011 2009 … … 2142 2140 begin 2143 2141 UpdateLoc[nUpdateLoc] := Loc; 2144 inc(nUpdateLoc) 2142 inc(nUpdateLoc); 2145 2143 end; 2146 2144 // unit will be removed -- remember position and update for all players … … 2170 2168 Happened := Happened or phStealTech; 2171 2169 GStealFrom := MoveInfo.Defender; 2172 Break 2173 end 2170 Break; 2171 end; 2174 2172 end; 2175 2173 if Mode = moPlaying then … … 2856 2854 2857 2855 sGetVersion: 2858 integer(Data) := Version;2856 integer(Data) := CevoVersion; 2859 2857 2860 2858 sGetGameChanged: … … 3666 3664 begin 3667 3665 if Tech[Subject] >= MaxFutureTech_Computing then 3668 result := eInvalid 3666 result := eInvalid; 3669 3667 end 3670 3668 else if Subject in FutureTech then 3671 3669 begin 3672 3670 if Tech[Subject] >= MaxFutureTech then 3673 result := eInvalid 3671 result := eInvalid; 3674 3672 end 3675 3673 else if Tech[Subject] >= tsApplicable then … … 3683 3681 inc(i); 3684 3682 if i < 2 then 3685 result := eNoPreq 3683 result := eNoPreq; 3686 3684 end 3687 3685 else if (AdvPreq[Subject, 0] <> preNone) and … … 3689 3687 (AdvPreq[Subject, 1] <> preNone) and 3690 3688 (Tech[AdvPreq[Subject, 1]] < tsApplicable) then 3691 result := eNoPreq 3689 result := eNoPreq; 3692 3690 end; 3693 3691 if (result = eOK) and (Command >= sExecute) then … … 3697 3695 // save DevModel, because sctModel commands are not logged 3698 3696 ResearchTech := Subject; 3699 end 3697 end; 3700 3698 end 3701 3699 else … … 3717 3715 SeeTech(Player, Subject); 3718 3716 dec(RW[Player].Happened, phStealTech); 3719 end 3717 end; 3720 3718 end; 3721 3719 … … 3736 3734 RW[Player].Attitude[p1] := Subject; 3737 3735 RW[p1].EnemyReport[Player].Attitude := Subject; 3738 end 3736 end; 3739 3737 end; 3740 3738 … … 3870 3868 MaxCap := 3; 3871 3869 if RW[Player].Tech[adSteel] >= tsApplicable then 3872 inc(MaxCap) 3870 inc(MaxCap); 3873 3871 end 3874 3872 else … … 3894 3892 Cap[mcCarrier] := 0; 3895 3893 if Cap[mcDefense] > 2 then 3896 Cap[mcDefense] := 2 3894 Cap[mcDefense] := 2; 3897 3895 end; 3898 3896 mcSeaTrans: … … 3919 3917 3920 3918 CalculateModel(RW[Player].DevModel); 3921 end 3919 end; 3922 3920 end; 3923 3921 end … … 3997 3995 result := eViolation 3998 3996 else if Command >= sExecute then 3999 RW[Player].Un[Subject].Home := cix1 4000 end 4001 end 3997 RW[Player].Un[Subject].Home := cix1; 3998 end; 3999 end; 4002 4000 end; 4003 4001 … … 4023 4021 result := eInvalid 4024 4022 else 4025 result := UnloadUnit(Player, Subject, Command < sExecute) 4023 result := UnloadUnit(Player, Subject, Command < sExecute); 4026 4024 end; 4027 4025 … … 4058 4056 PlaceUnit(p1, RW[p1].nUn - 1); 4059 4057 UpdateUnitMap(integer(Data)); 4060 end 4058 end; 4061 4059 end 4062 4060 else … … 4117 4115 CityGrowth(Player, cix1); 4118 4116 RemoveUnit_UpdateMap(Player, Subject); 4119 end 4120 end 4121 end 4117 end; 4118 end; 4119 end; 4122 4120 end; 4123 4121 … … 4150 4148 (ObserveLevel[Loc0] and (3 shl (2 * p1)) > 0) then 4151 4149 CallPlayer(cShowCityChanged, p1, Loc0); 4152 end 4150 end; 4153 4151 end; 4154 4152 end; … … 4275 4273 if Preq = 0 then 4276 4274 result := eNoPreq; 4277 end 4275 end; 4278 4276 end; 4279 4277 … … 4290 4288 Prod := 0; 4291 4289 Prod0 := 0; 4292 Project0 := cpImp + imTrGoods 4290 Project0 := cpImp + imTrGoods; 4293 4291 end 4294 4292 else 4295 4293 Prod := Prod0 * 2 div 3; 4296 4294 Project := NewProject 4297 end 4298 end 4299 end 4295 end; 4296 end; 4297 end; 4300 4298 end; 4301 4299 … … 4386 4384 imSpacePort: 4387 4385 DestroySpacePort_TellPlayers(Player, -1); 4388 end 4386 end; 4389 4387 end; 4390 4388 inc(Flags, chImprovementSold); 4391 end 4389 end; 4392 4390 end; 4393 4391 … … 4432 4430 imSpacePort: 4433 4431 DestroySpacePort_TellPlayers(Player, -1); 4434 end 4432 end; 4435 4433 end; 4436 4434 inc(Flags, chImprovementSold); 4437 end 4438 end 4435 end; 4436 end; 4439 4437 end; 4440 4438 -
branches/highdpi/Global.pas
r378 r405 6 6 CevoExt = '.cevo'; 7 7 CevoMapExt = '.cevomap'; 8 CevoMapPictureExt = '.png'; 8 9 CevoTribeExt = '.tribe.txt'; 9 10 CevoHomepageShort = 'app.zdechov.net/c-evo'; … … 16 17 AITemplateManual = 'AI development manual'; 17 18 AITemplateFileName = 'AI Template' + DirectorySeparator + AITemplateManual + '.html'; 19 CevoVersionMajor = 1; 20 CevoVersionMinor = 4; 21 CevoVersionBugFix = 0; 22 CevoVersion = ((CevoVersionMajor and $ff) shl 16) or 23 ((CevoVersionMinor and $ff) shl 8) or 24 ((CevoVersionBugFix and $ff) shl 0); 18 25 19 26 -
branches/highdpi/Help/help.txt
r11 r405 1441 1441 Unit attacks at full strength even if it has less than 1 MP left. 1442 1442 2 tiles observation range. Unit fortifies if it has at least half of its initial MP left. 1443 The unit s production cost is halved when the same type of unit was produced immediately before, but doubled otherwise.1443 The unit's production cost is halved when the same type of unit was produced immediately before, but doubled otherwise. 1444 1444 1445 1445 #GOVHELP -
branches/highdpi/Install/deb/debian/changelog
r349 r405 1 c-evo (1. 3.0-0) precise; urgency=low1 c-evo (1.4.0-0) precise; urgency=low 2 2 3 * Original version 1. 3.0 packaged with lazdebian3 * Original version 1.4.0 packaged with lazdebian 4 4 5 5 -- Chronos <robie@centrum.cz> Sun, 17 Dec 2016 00:51:08 +0100 -
branches/highdpi/Install/deb/debian/control
r349 r405 3 3 Section: games 4 4 Priority: optional 5 Standards-Version: 1. 3.05 Standards-Version: 1.4.0 6 6 Build-Depends: fpc, lazarus, lcl, lcl-utils, debhelper (>= 8) 7 7 -
branches/highdpi/Install/rpm/c-evo.spec
r349 r405 1 1 Name: c-evo 2 Version: 1. 3.02 Version: 1.4.0 3 3 Release: 1%{?dist} 4 4 Summary: Empire building game … … 55 55 install -d -m 755 $RPM_BUILD_ROOT/usr/share/c-evo/Saved 56 56 install -D -m 644 Saved/* $RPM_BUILD_ROOT/usr/share/c-evo/Saved 57 #install -d -m 755 $RPM_BUILD_ROOT/usr/share/c-evo/AI\ Template58 #install -D -m 644 AI\ Template/* $RPM_BUILD_ROOT/usr/share/c-evo/AI\ Template 57 install -d -m 755 $RPM_BUILD_ROOT/usr/share/c-evo/AI\ Template 58 cp -R AI\ Template $RPM_BUILD_ROOT/usr/share/c-evo 59 59 install -d -m 755 $RPM_BUILD_ROOT/usr/share/c-evo/Localization 60 60 cp -R Localization $RPM_BUILD_ROOT/usr/share/c-evo -
branches/highdpi/Install/snap/local/build.sh
r378 r405 4 4 5 5 pushd ../../.. 6 snapcraft --debug 6 snapcraft --debug --use-lxd 7 7 popd 8 8 -
branches/highdpi/Install/snap/snapcraft.yaml
r378 r405 1 1 name: c-evo 2 2 title: "C-evo: New Horizons" 3 version: '1. 3.0'3 version: '1.4.0' 4 4 summary: A turn-based empire building game inspired by Civilization II game. 5 5 description: | 6 This is a fork and Lazarus port of the original game which can be 7 found at www.c-evo.org. 8 confinement: devmode 6 This is a fork and Lazarus/FPC port of the original C-evo 1.2.0 game. 7 Now it is finally possible to play C-evo natively on Linux. 8 * Zoomable map by mouse wheel with three tile sizes 9 * Many sample maps included 10 * All available localizations include 11 * Many other small improvements 12 confinement: strict 9 13 base: core20 10 #base: core18 11 grade: devel 14 grade: stable 12 15 icon: Graphics/c-evo_64x64.png 16 license: NLPL 13 17 18 environment: 19 LD_LIBRARY_PATH: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio 20 PULSE_SERVER: unix:/run/user/1000/pulse/native 21 22 layout: 23 /usr/lib/$SNAPCRAFT_ARCH_TRIPLET/sox: 24 bind: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/sox 25 14 26 parts: 15 27 c-evo: … … 23 35 - lcl-utils 24 36 stage-packages: 37 - sox 38 - libsox-fmt-mp3 39 - libsox-fmt-pulse 40 - libpulse0 41 # Autodetected dependencies 25 42 - libatk1.0-0 26 43 - libcairo2 … … 53 70 - libxrandr2 54 71 - libxrender1 55 #- sox56 #- libsox-fmt-mp357 72 override-build: | 73 snapcraftctl build 58 74 (cd AI/StdAI &&lazbuild --build-mode=Release StdAI.lpi) 59 75 mv AI/StdAI/libstdai.so AI/StdAI/libstdai-amd64.so … … 62 78 install -d -m 755 $ROOT/usr/share/c-evo 63 79 install -s -m 755 c-evo $ROOT/usr/share/c-evo 64 install -m 755 Install/snap/local/command-c-evo-gtk.wrapper $ROOT/usr/share/c-evo65 80 install -m 644 Language.txt $ROOT/usr/share/c-evo 66 81 install -m 644 Language2.txt $ROOT/usr/share/c-evo 67 82 install -m 644 Fonts.txt $ROOT/usr/share/c-evo 68 #install -d -m 755 $ROOT/bin69 #install -m 755 Install/snap/local/desktop-launch $ROOT/bin70 #install -m 755 Install/snap/local/c-evo $ROOT/bin/c-evo71 #install -d -m 755 $ROOT/usr/bin72 83 install -d -m 755 $ROOT/usr/share/applications 73 84 install -m 755 Install/deb/c-evo.desktop $ROOT/usr/share/applications … … 91 102 cp -r "AI Template" $ROOT/usr/share/c-evo 92 103 stage: 93 - bin94 - lib95 104 - etc 96 105 - usr … … 101 110 apps: 102 111 c-evo: 103 #command: desktop-launch $SNAP/c-evo-snap104 112 command: usr/share/c-evo/c-evo 105 #command: usr/share/c-evo/command-c-evo-gtk.wrapper106 113 desktop: usr/share/applications/c-evo.desktop 107 #extensions: [gnome-3-28]108 114 plugs: 109 - home 110 - pulseaudio115 - home 116 - audio-playback 111 117 - desktop 112 - desktop-legacy113 118 - x11 114 -
branches/highdpi/Install/win/C-evo.iss
r246 r405 24 24 25 25 [Files] 26 Source: "{#MyAppSubDir}\lib\x86_64-win64-Release\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion; Components: main; Check: not Is64BitInstallMode 27 Source: "{#MyAppSubDir}\lib\i386-win32-Release\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion; Components: main; Check: Is64BitInstallMode 26 Source: "{#MyAppSubDir}\lib\x86_64-win64-Release\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion; Components: main; Check: Is64BitInstallMode 27 Source: "{#MyAppSubDir}\lib\i386-win32-Release\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion; Components: main; Check: not Is64BitInstallMode 28 Source: "{#MyAppSubDir}\AI\StdAI\lib\x86_64-win64-Release\StdAI.dll"; DestDir: "{app}\AI\StdAI"; DestName: "StdAI-win64.dll"; Flags: ignoreversion; Components: ai\stdai; Check: Is64BitInstallMode 28 29 Source: "{#MyAppSubDir}\AI\StdAI\lib\i386-win32-Release\StdAI.dll"; DestDir: "{app}\AI\StdAI"; DestName: "StdAI-win32.dll"; Flags: ignoreversion; Components: ai\stdai; Check: not Is64BitInstallMode 29 Source: "{#MyAppSubDir}\AI\StdAI\lib\x86_64-win64-Release\StdAI.dll"; DestDir: "{app}\AI\StdAI"; DestName: "StdAI-win64.dll"; Flags: ignoreversion; Components: ai\stdai; Check: Is64BitInstallMode30 30 Source: "{#MyAppSubDir}\AI\AI_UO\*.*"; DestDir: "{app}\AI\AI_UO"; Flags: ignoreversion; Components: ai\ai_uo; Check: not Is64BitInstallMode 31 31 Source: "{#MyAppSubDir}\AI\AIAS\*.*"; DestDir: "{app}\AI\AIAS"; Flags: ignoreversion; Components: ai\aias; Check: not Is64BitInstallMode -
branches/highdpi/Integrated.lpi
r378 r405 76 76 </Item2> 77 77 <SharedMatrixOptions Count="2"> 78 <Item1 ID="151739052537" Targets="CevoComponents " Modes="Debug" Value="-g -gl -gh -CirotR -O1"/>79 <Item2 ID="186701832267" Targets="CevoComponents " Modes="Release" Value="-CX -XX -O3"/>78 <Item1 ID="151739052537" Targets="CevoComponents,Common" Modes="Debug" Value="-g -gl -gh -CirotR -O1"/> 79 <Item2 ID="186701832267" Targets="CevoComponents,Common" Modes="Release" Value="-CX -XX -O3"/> 80 80 </SharedMatrixOptions> 81 81 </BuildModes> … … 89 89 </Modes> 90 90 </RunParams> 91 <RequiredPackages Count=" 3">91 <RequiredPackages Count="4"> 92 92 <Item1> 93 <PackageName Value="Common"/> 94 <DefaultFilename Value="Packages\Common\Common.lpk" Prefer="True"/> 95 </Item1> 96 <Item2> 93 97 <PackageName Value="DpiControls"/> 94 98 <DefaultFilename Value="Packages\DpiControls\DpiControls.lpk" Prefer="True"/> 95 </Item 1>96 <Item 2>99 </Item2> 100 <Item3> 97 101 <PackageName Value="CevoComponents"/> 98 102 <DefaultFilename Value="Packages\CevoComponents\CevoComponents.lpk" Prefer="True"/> 99 </Item 2>100 <Item 3>103 </Item3> 104 <Item4> 101 105 <PackageName Value="LCL"/> 102 </Item 3>106 </Item4> 103 107 </RequiredPackages> 104 <Units Count="4 7">108 <Units Count="48"> 105 109 <Unit0> 106 110 <Filename Value="Integrated.lpr"/> … … 363 367 <IsPartOfProject Value="True"/> 364 368 </Unit46> 369 <Unit47> 370 <Filename Value="ULanguages.pas"/> 371 <IsPartOfProject Value="True"/> 372 </Unit47> 365 373 </Units> 366 374 </ProjectOptions> … … 396 404 <Linking> 397 405 <Debugging> 398 <UseHeaptrc Value="True"/>399 406 <UseExternalDbgSyms Value="True"/> 400 407 </Debugging> -
branches/highdpi/Integrated.lpr
r378 r405 3 3 4 4 uses 5 UDpiControls, {$IFDEF UNIX} 6 //cthreads, 7 clocale, 5 {$IFDEF UNIX} 6 cthreads, clocale, 8 7 {$ENDIF} 9 Forms, Interfaces, SysUtils, Protocol, GameServer, Direct, Start, Messg, Inp,8 UDpiControls, Forms, Interfaces, SysUtils, Protocol, GameServer, Direct, Start, Messg, Inp, 10 9 Back, Log, LocalPlayer, ClientTools, Tribes, IsoEngine, Term, CityScreen, Nego, 11 10 NoTerm, ScreenTools, Directories; -
branches/highdpi/Language.txt
r378 r405 341 341 #BTN_NO No 342 342 #BTN_INFO Info 343 #BTN_RESET Reset 343 344 344 345 'Button Tooltips … … 547 548 Medium 548 549 Big 550 Previous Unit 551 Next Unit 549 552 550 553 #ADVANCES … … 952 955 Gamma 953 956 Restart is needed to apply changes 957 Primary 958 Secondary 959 Languages 960 Key bindings -
branches/highdpi/LocalPlayer/CityScreen.pas
r378 r405 8 8 Protocol, ClientTools, Term, ScreenTools, IsoEngine, BaseWin, 9 9 LCLIntf, LCLType, Messages, SysUtils, Classes, Graphics, Controls, Forms, ExtCtrls, 10 ButtonA, ButtonC, Area, GraphType ;10 ButtonA, ButtonC, Area, GraphType, UTexture; 11 11 12 12 const -
branches/highdpi/LocalPlayer/ClientTools.pas
r361 r405 636 636 procedure CityOptimizer_CityChange(cix: integer); 637 637 begin 638 if (MyRO.Government <> gAnarchy) and ( MyCity[cix].Flags and638 if (MyRO.Government <> gAnarchy) and (cix <> -1) and (MyCity[cix].Flags and 639 639 chCaptured = 0) then 640 640 begin … … 756 756 initialization 757 757 758 759 758 Assert(nImp < 128); 759 CalculateAdvValues; 760 760 761 761 end. -
branches/highdpi/LocalPlayer/IsoEngine.pas
r349 r405 1007 1007 end; 1008 1008 1009 if ShowObjects then 1010 begin 1011 if (Tile and fCanal <> 0) or (Tile and fCity <> 0) then 1012 begin // paint canal connections 1009 if ShowObjects then begin 1010 // Paint canal connections 1011 if (Tile and fCanal <> 0) or (Tile and fCity <> 0) then begin 1013 1012 Conn := Connection8(Loc, fCanal or fCity); 1014 1013 if Tile and fCanal <> 0 then 1015 1014 Conn := Conn or ($FF - OceanConnection(Loc)); 1016 if Conn = 0 then 1017 begin 1015 if Conn = 0 then begin 1018 1016 if Tile and fCanal <> 0 then 1019 TSprite(x, y, spCanal) 1017 TSprite(x, y, spCanal); 1020 1018 end 1021 1019 else … … 1024 1022 TSprite(x, y, spCanal + 1 + Dir); 1025 1023 end; 1024 1026 1025 if Tile and (fRR or fCity) <> 0 then 1027 1026 RRConn := Connection8(Loc, fRR or fCity) 1028 1027 else 1029 1028 RRConn := 0; 1030 if Tile and (fRoad or fRR or fCity) <> 0 then 1031 begin // paint road connections 1029 1030 // Paint road connections 1031 if Tile and (fRoad or fRR or fCity) <> 0 then begin 1032 1032 Conn := Connection8(Loc, fRoad or fRR or fCity) and not RRConn; 1033 1033 if (Conn = 0) and (Tile and (fRR or fCity) = 0) then … … 1038 1038 TSprite(x, y, spRoad + 1 + Dir); 1039 1039 end; 1040 // paint railroad connections 1040 1041 // Paint railroad connections 1041 1042 if (Tile and fRR <> 0) and (RRConn = 0) then 1042 1043 TSprite(x, y, spRailRoad) 1043 else if RRConn > 0 then 1044 else if RRConn > 0 then begin 1044 1045 for Dir := 0 to 7 do 1045 1046 if (1 shl Dir) and RRConn <> 0 then 1046 1047 TSprite(x, y, spRailRoad + 1 + Dir); 1048 end; 1047 1049 end; 1048 1050 end; -
branches/highdpi/LocalPlayer/MessgEx.pas
r361 r405 543 543 end; 544 544 545 546 initialization547 548 545 end. -
branches/highdpi/LocalPlayer/Term.lfm
r349 r405 1 1 object MainScreen: TMainScreen 2 Left = 1692 Left = 516 3 3 Height = 480 4 Top = 5964 Top = 834 5 5 Width = 800 6 6 HorzScrollBar.Visible = False … … 667 667 OnClick = MenuClick 668 668 end 669 object N13: TDpiMenuItem 670 Caption = '-' 671 end 672 object mPrevUnit: TDpiMenuItem 673 Tag = 100 674 ShortCut = 46 675 OnClick = MenuClick 676 end 677 object mNextUnit: TDpiMenuItem 678 Tag = 101 679 ShortCut = 45 680 OnClick = MenuClick 681 end 669 682 end 670 683 object StatPopup: TDpiPopupMenu -
branches/highdpi/LocalPlayer/Term.pas
r378 r405 29 29 TMainScreen = class(TDrawDlg) 30 30 mBigTiles: TDpiMenuItem; 31 mNextUnit: TDpiMenuItem; 32 N13: TDpiMenuItem; 33 mPrevUnit: TDpiMenuItem; 31 34 Timer1: TTimer; 32 35 GamePopup: TDpiPopupMenu; … … 286 289 procedure CopyMiniToPanel; 287 290 procedure PanelPaint; 288 procedure NextUnit(NearLoc: integer; AutoTurn: boolean); 291 procedure FocusNextUnit(Dir: Integer = 1); 292 procedure NextUnit(NearLoc: Integer; AutoTurn: Boolean); 289 293 procedure Scroll(dx, dy: integer); 290 294 procedure SetMapPos(Loc: integer; MapPos: TPoint); … … 2433 2437 begin 2434 2438 SetTroopLoc(-1); 2435 PaintAll 2439 PaintAll; 2436 2440 end { supervisor } 2437 2441 { else if (ClientMode=cTurn) and (MyRO.Turn=0) then … … 2455 2459 FocusOnLoc(G.lx * G.ly div 2); 2456 2460 SetTroopLoc(-1); 2457 PanelPaint 2461 PanelPaint; 2458 2462 end; 2459 2463 if ShowCityList then … … 3446 3450 NoMapPanel := TIsoMap.Create; 3447 3451 3448 KeyBindings.LoadFromRegistry(HKEY_CURRENT_USER, AppRegistryKey + '\KeyBindings');3449 3452 UpdateKeyShortcuts; 3450 3453 … … 3545 3548 I: Integer; 3546 3549 begin 3547 KeyBindings.SaveToRegistry(HKEY_CURRENT_USER, AppRegistryKey + '\KeyBindings');3548 3550 MainFormKeyDown := nil; 3549 3551 FreeAndNil(sb); … … 4904 4906 end; 4905 4907 4908 procedure TMainScreen.FocusNextUnit(Dir: Integer); 4909 var 4910 i, uix, NewFocus: Integer; 4911 begin 4912 if ClientMode >= scContact then 4913 Exit; 4914 DestinationMarkON := False; 4915 PaintDestination; 4916 NewFocus := -1; 4917 for i := 1 to MyRO.nUn do begin 4918 uix := (UnFocus + i * Dir + MyRO.nUn) mod MyRO.nUn; 4919 if (MyUn[uix].Loc >= 0) and (MyUn[uix].Status and usStay = 0) then begin 4920 NewFocus := uix; 4921 Break; 4922 end; 4923 end; 4924 if NewFocus >= 0 then begin 4925 SetUnFocus(NewFocus); 4926 SetTroopLoc(MyUn[NewFocus].Loc); 4927 FocusOnLoc(TroopLoc, flRepaintPanel); 4928 end; 4929 end; 4930 4906 4931 procedure TMainScreen.FocusOnLoc(Loc: integer; Options: integer = 0); 4907 4932 var … … 4930 4955 end; 4931 4956 4932 procedure TMainScreen.NextUnit(NearLoc: integer; AutoTurn: boolean);4957 procedure TMainScreen.NextUnit(NearLoc: Integer; AutoTurn: Boolean); 4933 4958 var 4934 Dist, TestDist: single;4935 i, uix, NewFocus: integer;4936 GotoOnly: boolean;4959 Dist, TestDist: Single; 4960 i, uix, NewFocus: Integer; 4961 GotoOnly: Boolean; 4937 4962 begin 4938 4963 Dist := 0; 4939 4964 if ClientMode >= scContact then 4940 exit;4941 DestinationMarkON := false;4965 Exit; 4966 DestinationMarkON := False; 4942 4967 PaintDestination; 4943 for GotoOnly := GoOnPhase downto false do 4944 begin 4968 for GotoOnly := GoOnPhase downto False do begin 4945 4969 NewFocus := -1; 4946 for i := 1 to MyRO.nUn do 4947 begin 4970 for i := 1 to MyRO.nUn do begin 4948 4971 uix := (UnFocus + i) mod MyRO.nUn; 4949 4972 if (MyUn[uix].Loc >= 0) and (MyUn[uix].Job = jNone) and 4950 4973 (MyUn[uix].Status and (usStay or usRecover or usWaiting) = usWaiting) 4951 4974 and (not GotoOnly or (MyUn[uix].Status and usGoto <> 0)) then 4952 if NearLoc < 0 then 4953 begin 4975 if NearLoc < 0 then begin 4954 4976 NewFocus := uix; 4955 4977 Break; 4956 end 4957 else 4958 begin 4978 end else begin 4959 4979 TestDist := Distance(NearLoc, MyUn[uix].Loc); 4960 if (NewFocus < 0) or (TestDist < Dist) then 4961 begin 4980 if (NewFocus < 0) or (TestDist < Dist) then begin 4962 4981 NewFocus := uix; 4963 4982 Dist := TestDist; … … 4966 4985 end; 4967 4986 if GotoOnly then 4968 if NewFocus < 0 then 4969 GoOnPhase := false 4970 else 4971 Break; 4972 end; 4973 if NewFocus >= 0 then 4974 begin 4987 if NewFocus < 0 then GoOnPhase := False 4988 else Break; 4989 end; 4990 if NewFocus >= 0 then begin 4975 4991 SetUnFocus(NewFocus); 4976 4992 SetTroopLoc(MyUn[NewFocus].Loc); 4977 FocusOnLoc(TroopLoc, flRepaintPanel) 4978 end 4979 else if AutoTurn and not mWaitTurn.Checked then 4980 begin 4981 TurnComplete := true; 4993 FocusOnLoc(TroopLoc, flRepaintPanel); 4994 end else 4995 if AutoTurn and not mWaitTurn.Checked then begin 4996 TurnComplete := True; 4982 4997 SetUnFocus(-1); 4983 4998 SetTroopLoc(-1); 4984 PostMessage(Handle, WM_EOT, 0, 0) 4985 end 4986 else 4987 begin 4999 PostMessage(Handle, WM_EOT, 0, 0); 5000 end else begin 4988 5001 if { (UnFocus>=0) and } not TurnComplete and EOT.Visible then 4989 5002 Play('TURNEND'); 4990 TurnComplete := true;5003 TurnComplete := True; 4991 5004 SetUnFocus(-1); 4992 5005 SetTroopLoc(-1); … … 5962 5975 end 5963 5976 else 5964 NextUnit(UnStartLoc, true) 5977 NextUnit(UnStartLoc, true); 5965 5978 end 5966 5979 else if (UnFocus < 0) and (Options and muAutoNext <> 0) then … … 6167 6180 begin 6168 6181 MyUn[uix].Status := MyUn[uix].Status and not usWaiting; 6169 NextUnit(UnStartLoc, true) 6182 NextUnit(UnStartLoc, true); 6170 6183 end; 6171 6184 end; … … 6328 6341 trixFocus := TrCnt; 6329 6342 inc(TrCnt); 6330 end 6343 end; 6331 6344 end 6332 6345 else // count enemy units here … … 6443 6456 mStay.ShortCut := BStay.ShortCut; 6444 6457 mNoOrders.ShortCut := BNoOrders.ShortCut; 6458 mPrevUnit.ShortCut := BPrevUnit.ShortCut; 6459 mNextUnit.ShortCut := BNextUnit.ShortCut; 6445 6460 mCancel.ShortCut := BCancel.ShortCut; 6446 6461 mPillage.ShortCut := BPillage.ShortCut; … … 6636 6651 else if BStay.Test(ShortCut) then MenuClick(mStay) 6637 6652 else if BNoOrders.Test(ShortCut) then MenuClick(mNoOrders) 6653 else if BPrevUnit.Test(ShortCut) then MenuClick(mPrevUnit) 6654 else if BNextUnit.Test(ShortCut) then MenuClick(mNextUnit) 6638 6655 else if BCancel.Test(ShortCut) then MenuClick_Check(UnitPopup, mCancel) 6639 6656 else if BPillage.Test(ShortCut) then MenuClick_Check(UnitPopup, mPillage) … … 6718 6735 end 6719 6736 else 6720 PanelPaint 6737 PanelPaint; 6721 6738 end 6722 6739 else 6723 6740 NextUnit(UnStartLoc, true); 6724 end 6741 end; 6725 6742 end; 6726 6743 case result of … … 6735 6752 if result < rExecuted then 6736 6753 Play('INVALID') 6737 end 6754 end; 6738 6755 end; 6739 6756 … … 6914 6931 end 6915 6932 else if UnFocus >= 0 then 6916 with MyUn[UnFocus]do6933 with TUn(MyUn[UnFocus]) do 6917 6934 if Sender = mGoOn then 6918 6935 begin … … 6945 6962 begin 6946 6963 Centre(Loc); 6947 PaintAllMaps 6964 PaintAllMaps; 6948 6965 end 6949 6966 else if Sender = mCity then … … 6957 6974 PaintAll; 6958 6975 ZoomToCity(Loc0, true, chFounded); 6959 end 6976 end; 6960 6977 end 6961 6978 else … … 7018 7035 if Job > jNone then 7019 7036 Server(sStartJob + jNone shl 4, me, UnFocus, nil^); 7020 NextUnit(UnStartLoc, true) 7037 NextUnit(UnStartLoc, true); 7021 7038 end 7022 7039 else if Sender = mRecover then … … 7027 7044 if Job > jNone then 7028 7045 Server(sStartJob + jNone shl 4, me, UnFocus, nil^); 7029 NextUnit(UnStartLoc, true) 7046 NextUnit(UnStartLoc, true); 7030 7047 end 7031 7048 else if Sender = mNoOrders then 7032 7049 begin 7033 7050 Status := Status and not usWaiting; 7034 NextUnit(UnStartLoc, true) 7051 NextUnit(UnStartLoc, true); 7052 end 7053 else if Sender = mPrevUnit then 7054 begin 7055 Status := Status and not usWaiting; 7056 FocusNextUnit(-1); 7057 end 7058 else if Sender = mNextUnit then 7059 begin 7060 Status := Status and not usWaiting; 7061 FocusNextUnit(1); 7035 7062 end 7036 7063 else if Sender = mCancel then … … 7113 7140 NextUnit(Loc, true) 7114 7141 else 7115 PanelPaint 7142 PanelPaint; 7116 7143 end 7117 7144 else if i = eNoTime_Load then … … 8035 8062 end; 8036 8063 8037 initialization8038 8039 8064 end. 8040 8065 -
branches/highdpi/LocalPlayer/UKeyBindings.pas
r303 r405 17 17 ShortCut: TShortCut; 18 18 ShortCut2: TShortCut; 19 DefaultShortCut: TShortCut; 20 DefaultShortCut2: TShortCut; 19 21 function Test(AShortCut: TShortCut): Boolean; 22 procedure Assign(Source: TKeyBinding); 23 procedure SetDefault; 20 24 end; 21 25 … … 23 27 24 28 TKeyBindings = class(TFPGObjectList<TKeyBinding>) 29 private 25 30 public 26 31 function AddItem(const ShortName, FullName: string; ShortCut: TShortCut; ShortCut2: TShortCut = 0): TKeyBinding; overload; … … 29 34 procedure LoadFromRegistry(RootKey: HKEY; Key: string); 30 35 procedure SaveToRegistry(RootKey: HKEY; Key: string); 36 procedure LoadToStrings(Strings: TStrings); 37 procedure Assign(Source: TKeyBindings); 38 procedure ResetToDefault; 39 procedure RemoveShortCut(ShortCut: TShortCut); 31 40 end; 32 41 … … 52 61 BStay: TKeyBinding; 53 62 BNoOrders: TKeyBinding; 63 BPrevUnit: TKeyBinding; 64 BNextUnit: TKeyBinding; 54 65 BCancel: TKeyBinding; 55 66 BPillage: TKeyBinding; … … 123 134 end; 124 135 136 procedure TKeyBinding.Assign(Source: TKeyBinding); 137 begin 138 ShortName := Source.ShortName; 139 FullName := Source.FullName; 140 ShortCut := Source.ShortCut; 141 ShortCut2 := Source.ShortCut2; 142 DefaultShortCut := Source.DefaultShortCut; 143 DefaultShortCut2 := Source.DefaultShortCut2; 144 end; 145 146 procedure TKeyBinding.SetDefault; 147 begin 148 ShortCut := DefaultShortCut; 149 ShortCut2 := DefaultShortCut2; 150 end; 151 125 152 { TKeyBindings } 126 153 … … 133 160 Result.ShortCut := ShortCut; 134 161 Result.ShortCut2 := ShortCut2; 162 Result.DefaultShortCut := ShortCut; 163 Result.DefaultShortCut2 := ShortCut2; 135 164 Add(Result); 136 165 end; … … 207 236 end; 208 237 238 procedure TKeyBindings.LoadToStrings(Strings: TStrings); 239 var 240 I: Integer; 241 Text: string; 242 begin 243 Strings.Clear; 244 for I := 0 to Count - 1 do begin 245 Text:= ''; 246 if Items[I].ShortCut <> 0 then 247 Text:= Text + ShortCutToText(Items[I].ShortCut); 248 if Items[I].ShortCut2 <> 0 then begin 249 if Text <> '' then Text := Text + ', '; 250 Text:= Text + ShortCutToText(Items[I].ShortCut2); 251 end; 252 if Text <> '' then Text := Items[I].FullName + ' (' + Text + ')' 253 else Text := Items[I].FullName; 254 Strings.Add(Text); 255 end; 256 end; 257 258 procedure TKeyBindings.Assign(Source: TKeyBindings); 259 var 260 I: Integer; 261 begin 262 while Count < Source.Count do 263 Add(TKeyBinding.Create); 264 while Count > Source.Count do 265 Delete(Count - 1); 266 for I := 0 to Count - 1 do 267 Items[I].Assign(Source.Items[I]); 268 end; 269 270 procedure TKeyBindings.ResetToDefault; 271 var 272 I: Integer; 273 begin 274 for I := 0 to Count - 1 do 275 Items[I].SetDefault; 276 end; 277 278 procedure TKeyBindings.RemoveShortCut(ShortCut: TShortCut); 279 var 280 I: Integer; 281 begin 282 for I := 0 to Count - 1 do begin 283 if Items[I].ShortCut = ShortCut then Items[I].ShortCut := 0; 284 if Items[I].ShortCut2 = ShortCut then Items[I].ShortCut2 := 0; 285 end; 286 end; 287 209 288 210 289 initialization … … 231 310 BStay := AddItem('Stay', 'Stay', 'S'); 232 311 BNoOrders := AddItem('NoOrders', 'No orders', 'Space'); 312 BPrevUnit := AddItem('PrevUnit', 'Previous unit', 'Del'); 313 BNextUnit := AddItem('NextUnit', 'Next unit', 'Ins'); 233 314 BCancel := AddItem('Cancel', 'Cancel', 'Ctrl+C'); 234 315 BPillage := AddItem('Pillage', 'Pillage', 'Ctrl+P'); -
branches/highdpi/LocalPlayer/UnitStat.pas
r361 r405 52 52 53 53 uses 54 Tribes, Help, Directories ;54 Tribes, Help, Directories, UTexture; 55 55 56 56 {$R *.lfm} -
branches/highdpi/Localization/cs/Language.txt
r378 r405 341 341 #BTN_NO Ne 342 342 #BTN_INFO Info 343 #BTN_RESET Výchozí 343 344 344 345 'Button Tooltips … … 547 548 Střední 548 549 Velká 550 Předchozí jednotka 551 Další jednotka 549 552 550 553 #ADVANCES … … 952 955 Gamma 953 956 Pro projevení změn je potřeba restart 957 Hlavní 958 Vedlejší 959 Jazyky 960 Klávesové zkratky -
branches/highdpi/Localization/de/Language.txt
r378 r405 344 344 #BTN_NO Nein 345 345 #BTN_INFO Info 346 #BTN_RESET Reset 346 347 347 348 'Button Tooltips … … 556 557 Medium 557 558 Big 559 Previous Unit 560 Next Unit 558 561 559 562 #ADVANCES … … 970 973 Gamma 971 974 Restart is needed to apply changes 975 Primary 976 Secondary 977 Languages 978 Key bindings -
branches/highdpi/Localization/it/Language.txt
r378 r405 331 331 #BTN_NO No 332 332 #BTN_INFO Dati 333 #BTN_RESET Reset 333 334 334 335 'Button Tooltips … … 537 538 Medium 538 539 Big 540 Previous Unit 541 Next Unit 539 542 540 543 #ADVANCES … … 942 945 Gamma 943 946 Restart is needed to apply changes 947 Primary 948 Secondary 949 Languages 950 Key bindings -
branches/highdpi/Localization/ru/Language.txt
r378 r405 351 351 #BTN_NO Нет 352 352 #BTN_INFO Информация 353 #BTN_RESET Reset 353 354 354 355 'Названия кнопок-инструментов … … 563 564 Medium 564 565 Big 566 Previous Unit 567 Next Unit 565 568 566 569 #ADVANCES … … 977 980 Gamma 978 981 Restart is needed to apply changes 982 Primary 983 Secondary 984 Languages 985 Key bindings -
branches/highdpi/Localization/zh-Hans/language.txt
r378 r405 344 344 #BTN_NO ·ñ 345 345 #BTN_INFO °ïÖú 346 #BTN_RESET Reset 346 347 347 348 'Button Tooltips … … 555 556 Medium 556 557 Big 558 Previous Unit 559 Next Unit 557 560 558 561 #ADVANCES … … 969 972 Gamma 970 973 Restart is needed to apply changes 974 Primary 975 Secondary 976 Languages 977 Key bindings -
branches/highdpi/Localization/zh-Hant/language.txt
r378 r405 344 344 #BTN_NO §_ 345 345 #BTN_INFO À°§U 346 #BTN_RESET Reset 346 347 347 348 'Button Tooltips … … 555 556 Medium 556 557 Big 558 Previous Unit 559 Next Unit 557 560 558 561 #ADVANCES … … 969 972 Gamma 970 973 Restart is needed to apply changes 974 Primary 975 Secondary 976 Languages 977 Key bindings -
branches/highdpi/Network/UNetworkClient.pas
r378 r405 48 48 49 49 uses 50 LocalPlayer , Global, UNetworkCommon;50 LocalPlayer{$IFDEF LINUX}, Global, UNetworkCommon{$ENDIF}; 51 51 52 52 procedure Client(Command, Player: Integer; var Data); 53 {$IFDEF LINUX} 53 54 var 54 55 Cmd: TCommand; 56 {$ENDIF} 55 57 begin 56 58 {$IFDEF LINUX} -
branches/highdpi/Network/UNetworkServer.pas
r378 r405 6 6 7 7 uses 8 Classes, SysUtils , fgl{$IFDEF LINUX}, fpAsync, fpsock{$ENDIF}, Protocol, fphttpclient;8 Classes, SysUtils{$IFDEF LINUX}, fgl, fpAsync, fpsock, fphttpclient{$ENDIF}, Protocol; 9 9 10 10 {$IFDEF LINUX} … … 87 87 implementation 88 88 89 {$IFDEF LINUX} 89 90 uses 90 91 Global, UNetworkCommon; 92 {$ENDIF} 91 93 92 94 procedure Client(Command, Player: integer; var Data); -
branches/highdpi/Packages/CevoComponents/CevoComponents.lpk
r349 r405 37 37 <Description Value="C-evo components"/> 38 38 <Version Major="1" Minor="2"/> 39 <Files Count="1 7">39 <Files Count="16"> 40 40 <Item1> 41 41 <Filename Value="Area.pas"/> … … 99 99 </Item13> 100 100 <Item14> 101 <Filename Value=" UPixelPointer.pas"/>102 <UnitName Value=" UPixelPointer"/>101 <Filename Value="AsyncProcess2.pas"/> 102 <UnitName Value="AsyncProcess2"/> 103 103 </Item14> 104 104 <Item15> 105 <Filename Value=" AsyncProcess2.pas"/>106 <UnitName Value=" AsyncProcess2"/>105 <Filename Value="UGraphicSet.pas"/> 106 <UnitName Value="UGraphicSet"/> 107 107 </Item15> 108 108 <Item16> 109 <Filename Value="U GraphicSet.pas"/>110 <UnitName Value="U GraphicSet"/>109 <Filename Value="UTexture.pas"/> 110 <UnitName Value="UTexture"/> 111 111 </Item16> 112 <Item17>113 <Filename Value="UXMLUtils.pas"/>114 <UnitName Value="UXMLUtils"/>115 </Item17>116 112 </Files> 117 113 <RequiredPkgs Count="3"> 118 114 <Item1> 119 <PackageName Value=" DpiControls"/>115 <PackageName Value="Common"/> 120 116 </Item1> 121 117 <Item2> -
branches/highdpi/Packages/CevoComponents/CevoComponents.pas
r349 r405 10 10 uses 11 11 Area, ButtonA, ButtonB, ButtonC, ButtonN, EOTButton, ButtonBase, DrawDlg, 12 Sound, BaseWin, UPixelPointer, AsyncProcess2, UGraphicSet, UXMLUtils, 13 LazarusPackageIntf; 12 Sound, BaseWin, AsyncProcess2, UGraphicSet, UTexture, LazarusPackageIntf; 14 13 15 14 implementation -
branches/highdpi/Packages/CevoComponents/Directories.pas
r246 r405 67 67 Src, Dst: TSearchRec; 68 68 begin 69 if not DirectoryExists(DestinationDir) then CreateDir(DestinationDir);69 if not DirectoryExists(DestinationDir) then ForceDirectories(DestinationDir); 70 70 if FindFirst(SourceDir + DirectorySeparator + Filter, $21, Src) = 0 then 71 71 repeat … … 79 79 end; 80 80 81 procedure CopyFiles; 82 begin 83 if DirectoryExists(GetSavedDir(True)) and not DirectoryExists(GetSavedDir(False)) then 84 CopyDir(GetSavedDir(True), GetSavedDir(False), '*.*'); 85 if DirectoryExists(GetMapsDir(True)) and not DirectoryExists(GetMapsDir(False)) then 86 CopyDir(GetMapsDir(True), GetMapsDir(False), '*.*'); 87 end; 88 81 89 procedure UnitInit; 82 90 var … … 87 95 88 96 AppDataDir := GetAppConfigDir(False); 89 if AppDataDir = '' then 90 DataDir := HomeDir 91 else 92 begin 93 if not DirectoryExists(AppDataDir) then CreateDir(AppDataDir); 97 if AppDataDir = '' then DataDir := HomeDir 98 else begin 99 if not DirectoryExists(AppDataDir) then ForceDirectories(AppDataDir); 94 100 DataDir := AppDataDir; 95 101 end; 96 97 CopyDir(GetSavedDir(True), GetSavedDir(False), '*.*'); 98 CopyDir(GetMapsDir(True), GetMapsDir(False), '*.*'); 102 CopyFiles; 99 103 end; 100 104 -
branches/highdpi/Packages/CevoComponents/DrawDlg.pas
r378 r405 7 7 uses 8 8 UDpiControls, Classes, SysUtils, Forms, LCLIntf, LCLType, {$IFDEF LINUX}LMessages,{$ENDIF} 9 Messages, Graphics, Controls, ButtonBase, ButtonA, ButtonB, Area, ScreenTools; 9 Messages, Graphics, Controls, ButtonBase, ButtonA, ButtonB, Area, ScreenTools 10 {$IFDEF LCLGTK2}, Gtk2Globals{$ENDIF}; 10 11 11 12 type … … 187 188 begin 188 189 MoveActive := False; 190 191 {$IFDEF LCLGTK2} 192 // GTK2 bug workaround https://bugs.freepascal.org/view.php?id=35720 193 if Visible then LastMouse.WinControl := Self; 194 {$ENDIF} 189 195 end; 190 196 -
branches/highdpi/Packages/CevoComponents/ScreenTools.pas
r378 r405 8 8 {$ENDIF} 9 9 StringTables, LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, Math, 10 Forms, Menus, GraphType, fgl, UGraphicSet, LazFileUtils ;10 Forms, Menus, GraphType, fgl, UGraphicSet, LazFileUtils, UTexture; 11 11 12 12 type 13 14 { TTexture }15 16 TTexture = class17 private18 FAge: Integer;19 function GetHeight: Integer;20 function GetWidth: Integer;21 procedure SetAge(AValue: Integer);22 public23 Image: TDpiBitmap;24 ColorBevelLight: TColor;25 ColorBevelShade: TColor;26 ColorTextLight: TColor;27 ColorTextShade: TColor;28 ColorLitText: TColor;29 ColorMark: TColor;30 ColorPage: TColor;31 ColorCover: TColor;32 constructor Create;33 destructor Destroy; override;34 procedure Assign(Source: TTexture);35 property Age: Integer read FAge write SetAge;36 property Width: Integer read GetWidth;37 property Height: Integer read GetHeight;38 end;39 40 13 TLoadGraphicFileOption = (gfNoError, gfNoGamma); 41 14 TLoadGraphicFileOptions = set of TLoadGraphicFileOption; … … 1835 1808 end; 1836 1809 1837 { TTexture }1838 1839 procedure TTexture.SetAge(AValue: Integer);1840 begin1841 if FAge = AValue then Exit;1842 FAge := AValue;1843 LoadGraphicFile(Image, GetGraphicsDir + DirectorySeparator +1844 'Texture' + IntToStr(Age + 1) + '.jpg');1845 ColorBevelLight := Colors.Canvas.Pixels[clkAge0 + Age, cliBevelLight];1846 ColorBevelShade := Colors.Canvas.Pixels[clkAge0 + Age, cliBevelShade];1847 ColorTextLight := Colors.Canvas.Pixels[clkAge0 + Age, cliTextLight];1848 ColorTextShade := Colors.Canvas.Pixels[clkAge0 + Age, cliTextShade];1849 ColorLitText := Colors.Canvas.Pixels[clkAge0 + Age, cliLitText];1850 ColorMark := Colors.Canvas.Pixels[clkAge0 + Age, cliMark];1851 ColorPage := Colors.Canvas.Pixels[clkAge0 + Age, cliPage];1852 ColorCover := Colors.Canvas.Pixels[clkAge0 + Age, cliCover];1853 end;1854 1855 function TTexture.GetHeight: Integer;1856 begin1857 Result := Image.Height;1858 end;1859 1860 function TTexture.GetWidth: Integer;1861 begin1862 Result := Image.Width;1863 end;1864 1865 constructor TTexture.Create;1866 begin1867 Image := TDpiBitmap.Create;1868 FAge := -2;1869 end;1870 1871 destructor TTexture.Destroy;1872 begin1873 FreeAndNil(Image);1874 inherited;1875 end;1876 1877 procedure TTexture.Assign(Source: TTexture);1878 begin1879 FAge := Source.FAge;1880 Image.Assign(Image);1881 ColorBevelLight := Source.ColorBevelLight;1882 ColorBevelShade := Source.ColorBevelShade;1883 ColorTextLight := Source.ColorTextLight;1884 ColorTextShade := Source.ColorTextShade;1885 ColorLitText := Source.ColorLitText;1886 ColorMark := Source.ColorMark;1887 ColorPage := Source.ColorPage;1888 ColorCover := Source.ColorCover;1889 end;1890 1891 1810 end. -
branches/highdpi/Packages/CevoComponents/Sound.pas
r349 r405 150 150 if (FindDefaultExecutablePath('afplay') <> '') then 151 151 Result := 'afplay'; 152 // Try mpg321 153 if (Result = '') then 154 if (FindDefaultExecutablePath('mpg321') <> '') then 155 Result := 'mpg321 -q'; 152 156 end; 153 157 -
branches/highdpi/Packages/DpiControls/UDpiControls.pas
r378 r405 6 6 7 7 uses 8 {$IFDEF WINDOWS}Windows, {$ENDIF}Classes, SysUtils, LCLProc, LResources, Forms, FormEditingIntf, ProjectIntf, 9 Controls, StdCtrls, fgl, Graphics, ComCtrls, ExtCtrls, LCLType, GraphType, 10 Types, CustApp, LMessages, LCLIntf, Menus, Math, UPixelPointer2; 8 {$IFDEF WINDOWS}Windows, {$ENDIF}Classes, SysUtils, LCLProc, LResources, Forms, 9 FormEditingIntf, ProjectIntf, Controls, StdCtrls, fgl, Graphics, ComCtrls, 10 ExtCtrls, LCLType, GraphType, Types, CustApp, LMessages, LCLIntf, Menus, Math, 11 UPixelPointer2, Grids, Spin; 11 12 12 13 const … … 102 103 destructor Destroy; override; 103 104 procedure Assign(Source: TPersistent); override; 105 procedure GetTextSize(Text: string; var w, h: Integer); 106 function GetTextHeight(Text: string): Integer; 107 function GetTextWidth(Text: string): Integer; 104 108 published 105 109 property CharSet: TFontCharSet read GetCharSet write SetCharSet default DEFAULT_CHARSET; … … 158 162 function GetAlign: TAlign; 159 163 function GetAnchors: TAnchors; 164 function GetAutoSize: Boolean; 160 165 function GetBoundsRect: TRect; 161 166 function GetClientHeight: Integer; … … 173 178 procedure SetAlign(AValue: TAlign); 174 179 procedure SetAnchors(AValue: TAnchors); 180 procedure SetAutoSize(AValue: Boolean); 175 181 procedure SetBorderSpacing(AValue: TDpiControlBorderSpacing); 176 182 procedure SetBoundsRect(AValue: TRect); … … 239 245 procedure Repaint; 240 246 procedure Update; 247 procedure Refresh; 241 248 function IsParentOf(AControl: TDpiControl): boolean; virtual; 249 function Scale96ToScreen(const ASize: Integer): Integer; 242 250 constructor Create(TheOwner: TComponent); override; 243 251 destructor Destroy; override; … … 248 256 property BorderSpacing: TDpiControlBorderSpacing read FBorderSpacing write SetBorderSpacing; 249 257 published 258 property AutoSize: Boolean read GetAutoSize write SetAutoSize default False; 250 259 property ClientHeight: Integer read GetClientHeight write SetClientHeight; 251 260 property ClientWidth: Integer read GetClientWidth write SetClientWidth; … … 341 350 function GetNativeRasterImage: TRasterImage; virtual; 342 351 public 352 procedure BeginUpdate(ACanvasOnly: Boolean = False); 353 procedure EndUpdate(AStreamIsValid: Boolean = False); 343 354 property RawImage: TRawImage read GetRawImage; 344 355 end; … … 403 414 FNativeCanvasFree: Boolean; 404 415 function GetHandle: HDC; 405 function GetHeight: Integer;406 416 function GetPixel(X, Y: Integer): TColor; 407 function GetWidth: Integer;408 417 procedure SetBrush(AValue: TDpiBrush); 409 418 procedure SetFont(AValue: TDpiFont); … … 413 422 procedure SetNativeCanvas(AValue: TCanvas); 414 423 protected 424 procedure SetHeight(AValue: Integer); virtual; 425 procedure SetWidth(AValue: Integer); virtual; 426 function GetWidth: Integer; virtual; 427 function GetHeight: Integer; virtual; 415 428 function GetNativeCanvas: TCanvas; virtual; 416 429 public … … 423 436 function TextHeight(Text: string): Integer; 424 437 function TextExtent(Text: string): TSize; 425 procedure TextOut(X, Y: Integer; Text: string);438 procedure TextOut(X, Y: Integer; const Text: string); virtual; 426 439 procedure TextRect(ARect: TRect; X, Y: Integer; Text: string); 427 440 procedure MoveTo(X, Y: Integer); 428 441 procedure LineTo(X, Y: Integer); 429 procedure FillRect( ARect: TRect);442 procedure FillRect(const ARect: TRect); virtual; 430 443 procedure FillRect(X1, Y1, X2, Y2: Integer); 431 444 procedure Draw(X, Y: Integer; Source: TDpiGraphic); … … 581 594 function GetOnShow: TNotifyEvent; 582 595 function GetPosition: TPosition; 596 function GetRestoredHeight: Integer; 597 function GetRestoredLeft: Integer; 598 function GetRestoredTop: Integer; 599 function GetRestoredWidth: Integer; 583 600 function GetWindowState: TWindowState; 584 601 procedure SetBorderIcons(AValue: TBorderIcons); … … 624 641 destructor Destroy; override; 625 642 published 643 property RestoredLeft: integer read GetRestoredLeft; 644 property RestoredTop: integer read GetRestoredTop; 645 property RestoredWidth: integer read GetRestoredWidth; 646 property RestoredHeight: integer read GetRestoredHeight; 626 647 property DesignTimePPI: Integer read GetDesignTimePPI write SetDesignTimePPI; // Not used 627 648 property FormState: TFormState read GetFormState; … … 698 719 function GetItemIndex: Integer; 699 720 function GetItems: TStrings; 721 function GetOnSelectionChange: TSelectionChangeEvent; 700 722 function GetParentFont: Boolean; 701 723 function GetScrollWidth: Integer; … … 707 729 procedure SetItemIndex(AValue: Integer); 708 730 procedure SetItems(AValue: TStrings); 731 procedure SetOnSelectionChange(AValue: TSelectionChangeEvent); 709 732 procedure SetParentFont(AValue: Boolean); 710 733 procedure SetScrollWidth(AValue: Integer); … … 729 752 property Visible; 730 753 property Anchors; 754 property OnSelectionChange: TSelectionChangeEvent read GetOnSelectionChange 755 write SetOnSelectionChange; 731 756 end; 732 757 … … 773 798 function GetPixelFormat: TPixelFormat; 774 799 function GetScanLine(Row: Integer): Pointer; 800 function GetTransparent: Boolean; 801 function GetTransparentColor: TColor; 775 802 procedure SetPixelFormat(AValue: TPixelFormat); 803 procedure SetTransparent(AValue: Boolean); 804 procedure SetTransparentColor(AValue: TColor); 776 805 protected 777 806 function GetHeight: Integer; override; … … 796 825 property Width: Integer read GetWidth write SetWidth; 797 826 property Canvas: TDpiCanvas read GetCanvas; 827 property TransparentColor: TColor read GetTransparentColor 828 write SetTransparentColor default clDefault; 829 property Transparent: Boolean read GetTransparent write SetTransparent default False; 798 830 end; 799 831 … … 841 873 end; 842 874 875 { TDpiListView } 876 877 TDpiListView = class(TDpiWinControl) 878 private 879 NativeListView: TListView; 880 function GetColumns: TListColumns; 881 function GetItems: TListItems; 882 procedure SetColumns(AValue: TListColumns); 883 procedure SetItems(AValue: TListItems); 884 public 885 function GetNativeListView: TListView; 886 constructor Create(TheOwner: TComponent); override; 887 destructor Destroy; override; 888 property Columns: TListColumns read GetColumns write SetColumns; 889 property Items: TListItems read GetItems write SetItems; 890 published 891 end; 892 893 { TDpiPanel } 894 895 TDpiPanel = class(TDpiWinControl) 896 private 897 NativePanel: TPanel; 898 public 899 function GetNativePanel: TPanel; 900 constructor Create(TheOwner: TComponent); override; 901 destructor Destroy; override; 902 end; 903 904 { TDpiCustomDrawGrid } 905 906 TDpiCustomDrawGrid = class(TDpiWinControl) 907 private 908 NativeCustomDrawGrid: TCustomDrawGrid; 909 function GetEditor: TDpiWinControl; 910 procedure SetEditor(AValue: TDpiWinControl); 911 public 912 function GetNativeCustomDrawGrid: TCustomDrawGrid; 913 constructor Create(TheOwner: TComponent); override; 914 destructor Destroy; override; 915 property Editor: TDpiWinControl read GetEditor write SetEditor; 916 end; 917 918 { TDpiPageControl } 919 920 TDpiPageControl = class(TDpiWinControl) 921 private 922 NativePageControl: TPageControl; 923 function GetPageCount: Integer; 924 function GetTabSheet(Index: Integer): TTabSheet; 925 public 926 function GetNativePageControl: TPageControl; 927 constructor Create(TheOwner: TComponent); override; 928 destructor Destroy; override; 929 property PageCount: Integer read GetPageCount; 930 property Pages[Index: Integer]: TTabSheet read GetTabSheet; 931 end; 932 933 { TDpiRadioButton } 934 935 TDpiRadioButton = class(TDpiWinControl) 936 private 937 NativeRadioButton: TRadioButton; 938 public 939 function GetNativeRadioButton: TRadioButton; 940 constructor Create(TheOwner: TComponent); override; 941 destructor Destroy; override; 942 end; 943 944 { TDpiSpinEdit } 945 946 TDpiSpinEdit = class(TDpiWinControl) 947 private 948 NativeSpinEdit: TSpinEdit; 949 public 950 function GetNativeSpinEdit: TSpinEdit; 951 constructor Create(TheOwner: TComponent); override; 952 destructor Destroy; override; 953 end; 954 955 { TDpiComboBox } 956 957 TDpiComboBox = class(TDpiWinControl) 958 private 959 NativeComboBox: TComboBox; 960 public 961 function GetNativeComboBox: TComboBox; 962 constructor Create(TheOwner: TComponent); override; 963 destructor Destroy; override; 964 end; 965 966 { TDpiCheckBox } 967 968 TDpiCheckBox = class(TDpiWinControl) 969 private 970 NativeCheckBox: TCheckBox; 971 public 972 function GetNativeCheckBox: TCheckBox; 973 constructor Create(TheOwner: TComponent); override; 974 destructor Destroy; override; 975 end; 976 977 { TDpiMemo } 978 979 TDpiMemo = class(TDpiWinControl) 980 private 981 NativeMemo: TMemo; 982 function GetLines: TStrings; 983 procedure SetLines(AValue: TStrings); 984 public 985 procedure Clear; 986 function GetNativeMemo: TMemo; 987 constructor Create(TheOwner: TComponent); override; 988 destructor Destroy; override; 989 property Lines: TStrings read GetLines write SetLines; 990 end; 991 992 { TDpiToolBar } 993 994 TDpiToolBar = class(TDpiCustomControl) 995 private 996 NativeToolBar: TToolBar; 997 function ButtonHeightIsStored: Boolean; 998 function ButtonWidthIsStored: Boolean; 999 function GetButtonHeight: Integer; 1000 function GetButtonWidth: Integer; 1001 procedure SetButtonHeight(AValue: Integer); 1002 procedure SetButtonWidth(AValue: Integer); 1003 public 1004 function GetNativeToolBar: TToolBar; 1005 constructor Create(TheOwner: TComponent); override; 1006 destructor Destroy; override; 1007 property ButtonHeight: Integer read GetButtonHeight write SetButtonHeight stored ButtonHeightIsStored; 1008 property ButtonWidth: Integer read GetButtonWidth write SetButtonWidth stored ButtonWidthIsStored; 1009 end; 1010 1011 { TDpiCoolBand } 1012 1013 TDpiCoolBand = class(TDpiCustomControl) 1014 private 1015 NativeCoolBand: TCoolBand; 1016 function GetMinHeight: Integer; 1017 function GetMinWidth: Integer; 1018 procedure SetMinHeight(AValue: Integer); 1019 procedure SetMinWidth(AValue: Integer); 1020 protected const 1021 cDefMinHeight = 25; 1022 cDefMinWidth = 100; 1023 public 1024 function GetNativeCoolBand: TCoolBand; 1025 constructor Create(TheOwner: TComponent); override; 1026 destructor Destroy; override; 1027 property MinHeight: Integer read GetMinHeight write SetMinHeight default cDefMinHeight; 1028 property MinWidth: Integer read GetMinWidth write SetMinWidth default cDefMinWidth; 1029 end; 1030 1031 { TDpiCoolBands } 1032 1033 TDpiCoolBands = class(TCollection) 1034 private 1035 procedure SetItem(Index: Integer; AValue: TDpiCoolBand); 1036 function GetItem(Index: Integer): TDpiCoolBand; 1037 public 1038 property Items[Index: Integer]: TDpiCoolBand read GetItem write SetItem; default; 1039 end; 1040 1041 { TDpiCoolBar } 1042 1043 TDpiCoolBar = class(TDpiCustomControl) 1044 private 1045 NativeCoolBar: TCoolBar; 1046 function GetBands: TDpiCoolBands; 1047 function GetThemed: Boolean; 1048 procedure SetBands(AValue: TDpiCoolBands); 1049 procedure SetThemed(AValue: Boolean); 1050 public 1051 procedure BeginUpdate; 1052 procedure EndUpdate; 1053 function GetNativeCoolBar: TCoolBar; 1054 constructor Create(TheOwner: TComponent); override; 1055 destructor Destroy; override; 1056 property Bands: TDpiCoolBands read GetBands write SetBands; 1057 property Themed: Boolean read GetThemed write SetThemed default True; 1058 end; 1059 1060 { TDpiImageList } 1061 1062 TDpiImageList = class(TComponent) 1063 private 1064 NativeImageList: TImageList; 1065 function GetCount: Integer; 1066 function GetHeight: Integer; 1067 function GetWidth: Integer; 1068 procedure SetHeight(AValue: Integer); 1069 procedure SetWidth(AValue: Integer); 1070 public 1071 function GetNativeImageList: TImageList; 1072 procedure GetBitmap(Index: Integer; Image: TDpiBitmap); 1073 procedure BeginUpdate; 1074 procedure EndUpdate; 1075 procedure Clear; 1076 function Add(Image, Mask: TDpiBitmap): Integer; 1077 constructor Create(TheOwner: TComponent); override; 1078 destructor Destroy; override; 1079 property Width: Integer read GetWidth write SetWidth default 16; 1080 property Height: Integer read GetHeight write SetHeight default 16; 1081 property Count: Integer read GetCount; 1082 end; 1083 1084 { TDpiStringGrid } 1085 1086 TDpiStringGrid = class(TDpiWinControl) 1087 private 1088 NativeStringGrid: TStringGrid; 1089 function DefaultRowHeightIsStored: Boolean; 1090 function GetDefRowHeight: Integer; 1091 procedure SetDefRowHeight(AValue: Integer); 1092 public 1093 function GetNativeStringGrid: TStringGrid; 1094 constructor Create(TheOwner: TComponent); override; 1095 destructor Destroy; override; 1096 published 1097 property DefaultRowHeight: Integer read GetDefRowHeight write SetDefRowHeight stored DefaultRowHeightIsStored; 1098 end; 1099 843 1100 { TDpiScreen } 844 1101 … … 851 1108 FForms: TDpiForms; 852 1109 procedure AddForm(AForm: TDpiForm); 1110 function GetDesktopHeight: Integer; 1111 function GetDesktopLeft: Integer; 1112 function GetDesktopTop: Integer; 1113 function GetDesktopWidth: Integer; 853 1114 procedure RemoveForm(AForm: TDpiForm); 854 1115 function GetActiveForm: TDpiForm; … … 868 1129 procedure UpdateScreen; 869 1130 procedure UpdateActiveFormFromNativeScreen; 1131 function DisableForms(SkipForm: TDpiForm; DisabledList: TList = nil): TList; 1132 procedure EnableForms(var AFormList: TList); 870 1133 property FormCount: Integer read GetFormCount; 871 1134 property Forms[Index: Integer]: TDpiForm read GetForms; … … 878 1141 property Width: Integer read GetWidth; 879 1142 property Height: Integer read GetHeight; 1143 property DesktopLeft: Integer read GetDesktopLeft; 1144 property DesktopTop: Integer read GetDesktopTop; 1145 property DesktopWidth: Integer read GetDesktopWidth; 1146 property DesktopHeight: Integer read GetDesktopHeight; 880 1147 end; 881 1148 … … 912 1179 FOldExitProc: Pointer; 913 1180 function GetActive: Boolean; 1181 function GetExeName: string; 914 1182 function GetShowMainForm: Boolean; 915 1183 function GetTitle: string; … … 935 1203 property Title: string read GetTitle write SetTitle; 936 1204 property Active: Boolean read GetActive; 1205 property ExeName: string read GetExeName; 937 1206 end; 938 1207 … … 994 1263 property Items[Index: Integer]: TDpiMenuItem read GetItem; default; 995 1264 property Count: Integer read GetCount; 1265 procedure Clear; 996 1266 published 997 1267 property RadioItem: Boolean read GetRadioItem write SetRadioItem default False; … … 1231 1501 ScaleToNative(XSrc), ScaleToNative(YSrc), Rop); 1232 1502 end else begin 1233 Result := StretchBlt(DestDC, ScaleToNative(X), ScaleToNative(Y), 1503 Result := BitBlt(DestDC, ScaleToNative(X), ScaleToNative(Y), 1504 DstWidth, DstHeight, SrcDC, 1505 ScaleToNative(XSrc), ScaleToNative(YSrc), Rop); 1506 { Result := StretchBlt(DestDC, ScaleToNative(X), ScaleToNative(Y), 1234 1507 DstWidth, DstHeight, SrcDC, 1235 1508 ScaleToNative(XSrc), ScaleToNative(YSrc), 1236 1509 SrcWidth, SrcHeight, Rop); 1237 end;1510 } end; 1238 1511 1239 1512 { Result := BitBlt(DestDC, ScaleToNative(X), ScaleToNative(Y), … … 1242 1515 } 1243 1516 {$ENDIF} 1517 end; 1518 1519 { TDpiRadioButton } 1520 1521 function TDpiRadioButton.GetNativeRadioButton: TRadioButton; 1522 begin 1523 if not Assigned(NativeRadioButton) then NativeRadioButton := TRadioButton.Create(nil); 1524 Result := NativeRadioButton; 1525 end; 1526 1527 constructor TDpiRadioButton.Create(TheOwner: TComponent); 1528 begin 1529 inherited Create(TheOwner); 1530 end; 1531 1532 destructor TDpiRadioButton.Destroy; 1533 begin 1534 FreeAndNil(NativeRadioButton); 1535 inherited; 1536 end; 1537 1538 { TDpiPageControl } 1539 1540 function TDpiPageControl.GetPageCount: Integer; 1541 begin 1542 Result := GetNativePageControl.PageCount; 1543 end; 1544 1545 function TDpiPageControl.GetTabSheet(Index: Integer): TTabSheet; 1546 begin 1547 Result := GetNativePageControl.Pages[Index]; 1548 end; 1549 1550 function TDpiPageControl.GetNativePageControl: TPageControl; 1551 begin 1552 if not Assigned(NativePageControl) then NativePageControl := TPageControl.Create(nil); 1553 Result := NativePageControl; 1554 end; 1555 1556 constructor TDpiPageControl.Create(TheOwner: TComponent); 1557 begin 1558 inherited Create(TheOwner); 1559 end; 1560 1561 destructor TDpiPageControl.Destroy; 1562 begin 1563 FreeAndNil(NativePageControl); 1564 inherited; 1565 end; 1566 1567 { TDpiCustomDrawGrid } 1568 1569 function TDpiCustomDrawGrid.GetEditor: TDpiWinControl; 1570 begin 1571 //Result := GetNativeCustomDrawGrid.Editor; 1572 end; 1573 1574 procedure TDpiCustomDrawGrid.SetEditor(AValue: TDpiWinControl); 1575 begin 1576 //GetNativeCustomDrawGrid.Editor := AValue 1577 end; 1578 1579 function TDpiCustomDrawGrid.GetNativeCustomDrawGrid: TCustomDrawGrid; 1580 begin 1581 if not Assigned(NativeCustomDrawGrid) then NativeCustomDrawGrid := TCustomDrawGrid.Create(nil); 1582 Result := NativeCustomDrawGrid; 1583 end; 1584 1585 constructor TDpiCustomDrawGrid.Create(TheOwner: TComponent); 1586 begin 1587 inherited Create(TheOwner); 1588 end; 1589 1590 destructor TDpiCustomDrawGrid.Destroy; 1591 begin 1592 FreeAndNil(NativeCustomDrawGrid); 1593 inherited; 1594 end; 1595 1596 { TDpiCheckBox } 1597 1598 function TDpiCheckBox.GetNativeCheckBox: TCheckBox; 1599 begin 1600 if not Assigned(NativeCheckBox) then NativeCheckBox := TCheckBox.Create(nil); 1601 Result := NativeCheckBox; 1602 end; 1603 1604 constructor TDpiCheckBox.Create(TheOwner: TComponent); 1605 begin 1606 inherited Create(TheOwner); 1607 end; 1608 1609 destructor TDpiCheckBox.Destroy; 1610 begin 1611 FreeAndNil(NativeCheckBox); 1612 inherited; 1613 end; 1614 1615 { TDpiComboBox } 1616 1617 function TDpiComboBox.GetNativeComboBox: TComboBox; 1618 begin 1619 if not Assigned(NativeComboBox) then NativeComboBox := TComboBox.Create(nil); 1620 Result := NativeComboBox; 1621 end; 1622 1623 constructor TDpiComboBox.Create(TheOwner: TComponent); 1624 begin 1625 inherited Create(TheOwner); 1626 end; 1627 1628 destructor TDpiComboBox.Destroy; 1629 begin 1630 FreeAndNil(NativeComboBox); 1631 inherited; 1632 end; 1633 1634 { TDpiSpinEdit } 1635 1636 function TDpiSpinEdit.GetNativeSpinEdit: TSpinEdit; 1637 begin 1638 if not Assigned(NativeSpinEdit) then NativeSpinEdit := TSpinEdit.Create(nil); 1639 Result := NativeSpinEdit; 1640 end; 1641 1642 constructor TDpiSpinEdit.Create(TheOwner: TComponent); 1643 begin 1644 inherited Create(TheOwner); 1645 end; 1646 1647 destructor TDpiSpinEdit.Destroy; 1648 begin 1649 FreeAndNil(NativeSpinEdit); 1650 inherited; 1651 end; 1652 1653 { TDpiMemo } 1654 1655 function TDpiMemo.GetLines: TStrings; 1656 begin 1657 Result := GetNativeMemo.Lines; 1658 end; 1659 1660 procedure TDpiMemo.SetLines(AValue: TStrings); 1661 begin 1662 GetNativeMemo.Lines := AValue; 1663 end; 1664 1665 procedure TDpiMemo.Clear; 1666 begin 1667 GetNativeMemo.Clear; 1668 end; 1669 1670 function TDpiMemo.GetNativeMemo: TMemo; 1671 begin 1672 if not Assigned(NativeMemo) then NativeMemo := TMemo.Create(nil); 1673 Result := NativeMemo; 1674 end; 1675 1676 constructor TDpiMemo.Create(TheOwner: TComponent); 1677 begin 1678 inherited Create(TheOwner); 1679 end; 1680 1681 destructor TDpiMemo.Destroy; 1682 begin 1683 FreeAndNil(NativeMemo); 1684 inherited; 1685 end; 1686 1687 { TDpiImageList } 1688 1689 function TDpiImageList.GetHeight: Integer; 1690 begin 1691 1692 end; 1693 1694 function TDpiImageList.GetCount: Integer; 1695 begin 1696 1697 end; 1698 1699 function TDpiImageList.GetWidth: Integer; 1700 begin 1701 1702 end; 1703 1704 procedure TDpiImageList.SetHeight(AValue: Integer); 1705 begin 1706 1707 end; 1708 1709 procedure TDpiImageList.SetWidth(AValue: Integer); 1710 begin 1711 1712 end; 1713 1714 function TDpiImageList.GetNativeImageList: TImageList; 1715 begin 1716 if not Assigned(NativeImageList) then NativeImageList := TImageList.Create(nil); 1717 Result := NativeImageList; 1718 end; 1719 1720 procedure TDpiImageList.GetBitmap(Index: Integer; Image: TDpiBitmap); 1721 begin 1722 1723 end; 1724 1725 procedure TDpiImageList.BeginUpdate; 1726 begin 1727 1728 end; 1729 1730 procedure TDpiImageList.EndUpdate; 1731 begin 1732 1733 end; 1734 1735 procedure TDpiImageList.Clear; 1736 begin 1737 1738 end; 1739 1740 function TDpiImageList.Add(Image, Mask: TDpiBitmap): Integer; 1741 begin 1742 1743 end; 1744 1745 constructor TDpiImageList.Create(TheOwner: TComponent); 1746 begin 1747 inherited Create(TheOwner); 1748 end; 1749 1750 destructor TDpiImageList.Destroy; 1751 begin 1752 FreeAndNil(NativeImageList); 1753 inherited Destroy; 1754 end; 1755 1756 { TDpiCoolBands } 1757 1758 procedure TDpiCoolBands.SetItem(Index: Integer; AValue: TDpiCoolBand); 1759 begin 1760 1761 end; 1762 1763 function TDpiCoolBands.GetItem(Index: Integer): TDpiCoolBand; 1764 begin 1765 1766 end; 1767 1768 { TDpiCoolBand } 1769 1770 function TDpiCoolBand.GetMinWidth: Integer; 1771 begin 1772 1773 end; 1774 1775 function TDpiCoolBand.GetMinHeight: Integer; 1776 begin 1777 1778 end; 1779 1780 procedure TDpiCoolBand.SetMinHeight(AValue: Integer); 1781 begin 1782 1783 end; 1784 1785 procedure TDpiCoolBand.SetMinWidth(AValue: Integer); 1786 begin 1787 1788 end; 1789 1790 function TDpiCoolBand.GetNativeCoolBand: TCoolBand; 1791 begin 1792 1793 end; 1794 1795 constructor TDpiCoolBand.Create(TheOwner: TComponent); 1796 begin 1797 inherited Create(TheOwner); 1798 end; 1799 1800 destructor TDpiCoolBand.Destroy; 1801 begin 1802 inherited Destroy; 1803 end; 1804 1805 { TDpiCoolBar } 1806 1807 function TDpiCoolBar.GetBands: TDpiCoolBands; 1808 begin 1809 1810 end; 1811 1812 function TDpiCoolBar.GetThemed: Boolean; 1813 begin 1814 Result := GetNativeCoolBar.Themed; 1815 end; 1816 1817 procedure TDpiCoolBar.SetBands(AValue: TDpiCoolBands); 1818 begin 1819 1820 end; 1821 1822 procedure TDpiCoolBar.SetThemed(AValue: Boolean); 1823 begin 1824 GetNativeCoolBar.Themed := AValue 1825 end; 1826 1827 procedure TDpiCoolBar.BeginUpdate; 1828 begin 1829 GetNativeCoolBar.BeginUpdate; 1830 end; 1831 1832 procedure TDpiCoolBar.EndUpdate; 1833 begin 1834 GetNativeCoolBar.EndUpdate; 1835 end; 1836 1837 function TDpiCoolBar.GetNativeCoolBar: TCoolBar; 1838 begin 1839 if not Assigned(NativeCoolBar) then NativeCoolBar := TCoolBar.Create(nil); 1840 Result := NativeCoolBar; 1841 end; 1842 1843 constructor TDpiCoolBar.Create(TheOwner: TComponent); 1844 begin 1845 inherited Create(TheOwner); 1846 end; 1847 1848 destructor TDpiCoolBar.Destroy; 1849 begin 1850 FreeAndNil(NativeCoolBar); 1851 inherited Destroy; 1852 end; 1853 1854 { TDpiToolBar } 1855 1856 function TDpiToolBar.ButtonHeightIsStored: Boolean; 1857 begin 1858 1859 end; 1860 1861 function TDpiToolBar.ButtonWidthIsStored: Boolean; 1862 begin 1863 1864 end; 1865 1866 function TDpiToolBar.GetButtonHeight: Integer; 1867 begin 1868 Result := ScaleFromNative(GetNativeToolBar.ButtonHeight); 1869 end; 1870 1871 function TDpiToolBar.GetButtonWidth: Integer; 1872 begin 1873 Result := ScaleFromNative(GetNativeToolBar.ButtonWidth); 1874 end; 1875 1876 procedure TDpiToolBar.SetButtonHeight(AValue: Integer); 1877 begin 1878 GetNativeToolBar.ButtonHeight := ScaleToNative(AValue); 1879 end; 1880 1881 procedure TDpiToolBar.SetButtonWidth(AValue: Integer); 1882 begin 1883 GetNativeToolBar.ButtonWidth := ScaleToNative(AValue); 1884 end; 1885 1886 function TDpiToolBar.GetNativeToolBar: TToolBar; 1887 begin 1888 if not Assigned(NativeToolBar) then NativeToolBar := TToolBar.Create(nil); 1889 Result := NativeToolBar; 1890 end; 1891 1892 constructor TDpiToolBar.Create(TheOwner: TComponent); 1893 begin 1894 inherited Create(TheOwner); 1895 end; 1896 1897 destructor TDpiToolBar.Destroy; 1898 begin 1899 FreeAndNil(NativeToolBar); 1900 inherited; 1901 end; 1902 1903 { TDpiPanel } 1904 1905 function TDpiPanel.GetNativePanel: TPanel; 1906 begin 1907 if not Assigned(NativePanel) then NativePanel := TPanel.Create(nil); 1908 Result := NativePanel; 1909 end; 1910 1911 constructor TDpiPanel.Create(TheOwner: TComponent); 1912 begin 1913 inherited Create(TheOwner); 1914 end; 1915 1916 destructor TDpiPanel.Destroy; 1917 begin 1918 FreeAndNil(NativePanel); 1919 inherited; 1920 end; 1921 1922 { TDpiStringGrid } 1923 1924 function TDpiStringGrid.DefaultRowHeightIsStored: Boolean; 1925 begin 1926 Result := GetDefRowHeight>=0; 1927 end; 1928 1929 function TDpiStringGrid.GetDefRowHeight: Integer; 1930 begin 1931 Result := GetNativeStringGrid.DefaultRowHeight; 1932 end; 1933 1934 procedure TDpiStringGrid.SetDefRowHeight(AValue: Integer); 1935 begin 1936 GetNativeStringGrid.DefaultRowHeight := AValue; 1937 end; 1938 1939 function TDpiStringGrid.GetNativeStringGrid: TStringGrid; 1940 begin 1941 if not Assigned(NativeStringGrid) then NativeStringGrid := TStringGrid.Create(nil); 1942 Result := NativeStringGrid; 1943 end; 1944 1945 constructor TDpiStringGrid.Create(TheOwner: TComponent); 1946 begin 1947 inherited Create(TheOwner); 1948 end; 1949 1950 destructor TDpiStringGrid.Destroy; 1951 begin 1952 FreeAndNil(NativeStringGrid); 1953 inherited; 1954 end; 1955 1956 { TDpiListView } 1957 1958 function TDpiListView.GetItems: TListItems; 1959 begin 1960 Result := GetNativeListView.Items; 1961 end; 1962 1963 function TDpiListView.GetColumns: TListColumns; 1964 begin 1965 Result := NativeListView.Columns; 1966 end; 1967 1968 procedure TDpiListView.SetColumns(AValue: TListColumns); 1969 begin 1970 NativeListView.Columns := AValue; 1971 end; 1972 1973 procedure TDpiListView.SetItems(AValue: TListItems); 1974 begin 1975 GetNativeListView.Items := AValue; 1976 end; 1977 1978 function TDpiListView.GetNativeListView: TListView; 1979 begin 1980 if not Assigned(NativeListView) then NativeListView := TListView.Create(nil); 1981 Result := NativeListView; 1982 end; 1983 1984 constructor TDpiListView.Create(TheOwner: TComponent); 1985 begin 1986 inherited Create(TheOwner); 1987 end; 1988 1989 destructor TDpiListView.Destroy; 1990 begin 1991 FreeAndNil(NativeListView); 1992 inherited; 1244 1993 end; 1245 1994 … … 1671 2420 raise EMenuError.Create(SMenuNotFound); 1672 2421 Delete(I); 2422 end; 2423 2424 procedure TDpiMenuItem.Clear; 2425 begin 2426 GetNativeMenuItem.Clear; 1673 2427 end; 1674 2428 … … 1881 2635 begin 1882 2636 Result := Application.Active; 2637 end; 2638 2639 function TDpiApplication.GetExeName: string; 2640 begin 2641 Result := GetNativeApplication.ExeName; 1883 2642 end; 1884 2643 … … 2210 2969 begin 2211 2970 Result := nil; 2971 end; 2972 2973 procedure TDpiRasterImage.BeginUpdate(ACanvasOnly: Boolean); 2974 begin 2975 GetNativeRasterImage.BeginUpdate(ACanvasOnly); 2976 end; 2977 2978 procedure TDpiRasterImage.EndUpdate(AStreamIsValid: Boolean); 2979 begin 2980 GetNativeRasterImage.EndUpdate(AStreamIsValid); 2212 2981 end; 2213 2982 … … 2349 3118 end; 2350 3119 3120 function TDpiBitmap.GetTransparent: Boolean; 3121 begin 3122 Result := GetNativeBitmap.Transparent; 3123 end; 3124 3125 function TDpiBitmap.GetTransparentColor: TColor; 3126 begin 3127 Result := GetNativeBitmap.TransparentColor; 3128 end; 3129 2351 3130 function TDpiBitmap.GetWidth: Integer; 2352 3131 begin … … 2363 3142 begin 2364 3143 GetNativeBitmap.PixelFormat := AValue; 3144 end; 3145 3146 procedure TDpiBitmap.SetTransparent(AValue: Boolean); 3147 begin 3148 GetNativeBitmap.Transparent := AValue; 3149 end; 3150 3151 procedure TDpiBitmap.SetTransparentColor(AValue: TColor); 3152 begin 3153 GetNativeBitmap.TransparentColor := AValue; 2365 3154 end; 2366 3155 … … 2478 3267 end; 2479 3268 3269 function TDpiListBox.GetOnSelectionChange: TSelectionChangeEvent; 3270 begin 3271 Result := GetNativeListBox.OnSelectionChange; 3272 end; 3273 2480 3274 function TDpiListBox.GetParentFont: Boolean; 2481 3275 begin … … 2521 3315 begin 2522 3316 GetNativeListBox.Items := AValue; 3317 end; 3318 3319 procedure TDpiListBox.SetOnSelectionChange(AValue: TSelectionChangeEvent); 3320 begin 3321 GetNativeListBox.OnSelectionChange := AValue; 2523 3322 end; 2524 3323 … … 2631 3430 begin 2632 3431 GetNativeCanvas.Handle := AValue; 3432 end; 3433 3434 procedure TDpiCanvas.SetHeight(AValue: Integer); 3435 begin 3436 GetNativeCanvas.Height; 3437 end; 3438 3439 procedure TDpiCanvas.SetWidth(AValue: Integer); 3440 begin 3441 2633 3442 end; 2634 3443 … … 2711 3520 end; 2712 3521 2713 procedure TDpiCanvas.TextOut(X, Y: Integer; Text: string);3522 procedure TDpiCanvas.TextOut(X, Y: Integer; const Text: string); 2714 3523 begin 2715 3524 GetNativeCanvas.TextOut(ScaleToNative(X), ScaleToNative(Y), Text); … … 2731 3540 end; 2732 3541 2733 procedure TDpiCanvas.FillRect( ARect: TRect);3542 procedure TDpiCanvas.FillRect(const ARect: TRect); 2734 3543 begin 2735 3544 GetNativeCanvas.FillRect(ScaleRectToNative(ARect)); … … 3012 3821 end; 3013 3822 3823 procedure TDpiFont.GetTextSize(Text: string; var w, h: Integer); 3824 begin 3825 W := GetTextWidth(Text); 3826 H := GetTextHeight(Text); 3827 end; 3828 3829 function TDpiFont.GetTextHeight(Text: string): Integer; 3830 begin 3831 Result := ScaleFromNative(GetNativeFont.GetTextHeight(Text)); 3832 end; 3833 3834 function TDpiFont.GetTextWidth(Text: string): Integer; 3835 begin 3836 Result := ScaleFromNative(GetNativeFont.GetTextWidth(Text)); 3837 end; 3838 3014 3839 { TDpiWinControl } 3015 3840 … … 3188 4013 //DpiApplication.UpdateVisible; 3189 4014 end; 4015 end; 4016 4017 function TDpiScreen.GetDesktopHeight: Integer; 4018 begin 4019 Result := ScaleFromNative(Screen.DesktopHeight); 4020 end; 4021 4022 function TDpiScreen.GetDesktopLeft: Integer; 4023 begin 4024 Result := ScaleFromNative(Screen.DesktopLeft); 4025 end; 4026 4027 function TDpiScreen.GetDesktopTop: Integer; 4028 begin 4029 Result := ScaleFromNative(Screen.DesktopTop); 4030 end; 4031 4032 function TDpiScreen.GetDesktopWidth: Integer; 4033 begin 4034 Result := ScaleFromNative(Screen.DesktopWidth); 3190 4035 end; 3191 4036 … … 3220 4065 for I := 0 to FForms.Count - 1 do 3221 4066 FForms[I].ScreenChanged; 4067 end; 4068 4069 function TDpiScreen.DisableForms(SkipForm: TDpiForm; DisabledList: TList 4070 ): TList; 4071 begin 4072 Result := Screen.DisableForms(SkipForm.GetNativeForm, DisabledList); 4073 end; 4074 4075 procedure TDpiScreen.EnableForms(var AFormList: TList); 4076 begin 4077 Screen.EnableForms(AFormList); 3222 4078 end; 3223 4079 … … 3454 4310 end; 3455 4311 4312 procedure TDpiControl.Refresh; 4313 begin 4314 GetNativeControl.Refresh; 4315 end; 4316 3456 4317 function TDpiControl.IsParentOf(AControl: TDpiControl): boolean; 3457 4318 begin … … 3463 4324 Exit(True); 3464 4325 end; 4326 end; 4327 4328 function TDpiControl.Scale96ToScreen(const ASize: Integer): Integer; 4329 begin 4330 Result := MulDiv(ASize, Screen.PixelsPerInch, 96); 3465 4331 end; 3466 4332 … … 3544 4410 end; 3545 4411 4412 function TDpiControl.GetAutoSize: Boolean; 4413 begin 4414 Result := GetNativeControl.AutoSize; 4415 end; 4416 3546 4417 function TDpiControl.GetClientHeight: Integer; 3547 4418 begin … … 3617 4488 begin 3618 4489 GetNativeControl.Anchors := AValue; 4490 end; 4491 4492 procedure TDpiControl.SetAutoSize(AValue: Boolean); 4493 begin 4494 GetNativeControl.AutoSize := AValue; 3619 4495 end; 3620 4496 … … 3846 4722 begin 3847 4723 Result := GetNativeForm.Position; 4724 end; 4725 4726 function TDpiForm.GetRestoredHeight: Integer; 4727 begin 4728 Result := ScaleFromNative(GetNativeForm.RestoredHeight); 4729 end; 4730 4731 function TDpiForm.GetRestoredLeft: Integer; 4732 begin 4733 Result := ScaleFromNative(GetNativeForm.RestoredLeft); 4734 end; 4735 4736 function TDpiForm.GetRestoredTop: Integer; 4737 begin 4738 Result := ScaleFromNative(GetNativeForm.RestoredTop); 4739 end; 4740 4741 function TDpiForm.GetRestoredWidth: Integer; 4742 begin 4743 Result := ScaleFromNative(GetNativeForm.RestoredWidth); 3848 4744 end; 3849 4745 -
branches/highdpi/Settings.lfm
r349 r405 10 10 DesignTimePPI = 144 11 11 FormStyle = fsStayOnTop 12 OnClose = FormClose 12 13 OnCreate = FormCreate 13 14 OnDestroy = FormDestroy … … 17 18 LCLVersion = '2.0.12.0' 18 19 Scaled = False 19 object List : TDpiListBox20 object ListLanguages: TDpiListBox 20 21 Tag = 15360 21 Left = 24 22 Height = 304 23 Top = 16 24 Width = 424 25 Anchors = [akTop, akLeft, akRight, akBottom] 22 Left = 16 23 Height = 267 24 Top = 32 25 Width = 144 26 26 BorderStyle = bsNone 27 27 Color = clBlack … … 34 34 ItemHeight = 0 35 35 ParentFont = False 36 ScrollWidth = 42437 TabOrder = 036 ScrollWidth = 144 37 TabOrder = 1 38 38 TabStop = False 39 39 TopIndex = -1 40 40 end 41 object OKBtn: TButtonA42 Left = 27241 object ButtonOk: TButtonA 42 Left = 364 43 43 Height = 25 44 44 Top = 400 … … 46 46 Down = False 47 47 Permanent = False 48 OnClick = OKBtnClick48 OnClick = ButtonOkClick 49 49 end 50 object CancelBtn: TButtonA51 Left = 9650 object ButtonCancel: TButtonA 51 Left = 244 52 52 Height = 25 53 53 Top = 400 … … 55 55 Down = False 56 56 Permanent = False 57 OnClick = CancelBtnClick57 OnClick = ButtonCancelClick 58 58 end 59 59 object ButtonFullscreen: TButtonC … … 89 89 ButtonIndex = 0 90 90 end 91 object ListKeyBindings: TDpiListBox 92 Tag = 15360 93 Left = 176 94 Height = 192 95 Top = 32 96 Width = 288 97 BorderStyle = bsNone 98 Color = clBlack 99 ExtendedSelect = False 100 Font.Color = 4176863 101 Font.Height = -15 102 Font.Name = 'Times New Roman' 103 Font.Style = [fsBold] 104 IntegralHeight = True 105 ItemHeight = 0 106 OnSelectionChange = ListKeyBindingsSelectionChange 107 ParentFont = False 108 ScrollWidth = 288 109 TabOrder = 0 110 TabStop = False 111 TopIndex = -1 112 end 113 object EditShortCutPrimary: TDpiEdit 114 Left = 176 115 Height = 42 116 Top = 256 117 Width = 136 118 Enabled = False 119 OnKeyUp = EditShortCutPrimaryKeyUp 120 TabOrder = 2 121 end 122 object EditShortCutSecondary: TDpiEdit 123 Left = 328 124 Height = 42 125 Top = 257 126 Width = 136 127 Enabled = False 128 OnKeyUp = EditShortCutSecondaryKeyUp 129 TabOrder = 3 130 end 131 object ButtonReset: TButtonA 132 Left = 16 133 Height = 25 134 Top = 400 135 Width = 100 136 Down = False 137 Permanent = False 138 OnClick = ButtonResetClick 139 end 91 140 end -
branches/highdpi/Settings.pas
r361 r405 7 7 uses 8 8 UDpiControls, Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 ScreenTools, Messg, ButtonA, Registry, fgl, Directories, DrawDlg, ButtonC; 9 LCLProc, ScreenTools, Messg, ButtonA, Registry, fgl, Directories, DrawDlg, 10 ButtonC, UKeyBindings, ULanguages; 10 11 11 12 type 12 TLanguage = class13 ShortName: string;14 FullName: string;15 Author: string;16 end;17 18 { TLanguages }19 20 TLanguages = class(TFPGObjectList<TLanguage>)21 procedure AddItem(const ShortName, FullName: string);22 procedure LoadToStrings(Strings: TStrings);23 function Search(ShortName: string): Integer;24 end;25 26 13 { TSettingsDlg } 27 14 … … 29 16 ButtonFullscreen: TButtonC; 30 17 Down2Btn: TButtonC; 31 List: TDpiListBox; 32 OKBtn: TButtonA; 33 CancelBtn: TButtonA; 18 EditShortCutPrimary: TDpiEdit; 19 EditShortCutSecondary: TDpiEdit; 20 ListLanguages: TDpiListBox; 21 ListKeyBindings: TDpiListBox; 22 ButtonOk: TButtonA; 23 ButtonCancel: TButtonA; 24 ButtonReset: TButtonA; 34 25 Up2Btn: TButtonC; 35 26 procedure ButtonFullscreenClick(Sender: TObject); 36 procedure CancelBtnClick(Sender: TObject); 27 procedure ButtonCancelClick(Sender: TObject); 28 procedure ButtonResetClick(Sender: TObject); 37 29 procedure Down2BtnClick(Sender: TObject); 30 procedure EditShortCutPrimaryKeyUp(Sender: TObject; var Key: Word; 31 Shift: TShiftState); 32 procedure EditShortCutSecondaryKeyUp(Sender: TObject; var Key: Word; 33 Shift: TShiftState); 34 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 38 35 procedure FormCreate(Sender: TObject); 39 36 procedure FormDestroy(Sender: TObject); 40 37 procedure FormPaint(Sender: TObject); 41 38 procedure FormShow(Sender: TObject); 42 procedure OKBtnClick(Sender: TObject); 39 procedure ListKeyBindingsSelectionChange(Sender: TObject; User: boolean); 40 procedure ButtonOkClick(Sender: TObject); 43 41 procedure Up2BtnClick(Sender: TObject); 44 42 private 45 43 LocalGamma: Integer; 44 LocalKeyBindings: TKeyBindings; 45 CurrentKeyBinding: TKeyBinding; 46 procedure UpdateShortCutItem; 46 47 public 47 Languages: TLanguages;48 48 procedure LoadData; 49 49 procedure SaveData; … … 53 53 SettingsDlg: TSettingsDlg; 54 54 55 55 56 implementation 56 57 57 58 {$R *.lfm} 58 59 59 { TLanguages }60 61 procedure TLanguages.AddItem(const ShortName, FullName: string);62 60 var 63 Language: TLanguage; 64 begin 65 Language := TLanguage.Create; 66 Language.ShortName := ShortName; 67 Language.FullName := FullName; 68 Add(Language); 69 end; 70 71 procedure TLanguages.LoadToStrings(Strings: TStrings); 72 var 73 I: Integer; 74 begin 75 Strings.Clear; 76 for I := 0 to Count - 1 do 77 Strings.Add(Items[I].FullName); 78 end; 79 80 function TLanguages.Search(ShortName: string): Integer; 81 var 82 I: Integer; 83 begin 84 I := 0; 85 while (I < Count) and (Items[I].ShortName <> ShortName) do Inc(I); 86 if I < Count then Result := I 87 else Result := -1; 61 SFullScreen, SGamma, SRestartMsg, SShortCutPrimary, SShortCutSecondary, 62 SLanguages, SKeyBindings: string; 63 64 procedure ReloadLanguages; 65 begin 66 SFullScreen := Phrases.Lookup('SETTINGS', 0); 67 SGamma := Phrases.Lookup('SETTINGS', 1); 68 SRestartMsg := Phrases.Lookup('SETTINGS', 2); 69 SShortCutPrimary := Phrases.Lookup('SETTINGS', 3); 70 SShortCutSecondary := Phrases.Lookup('SETTINGS', 4); 71 SLanguages := Phrases.Lookup('SETTINGS', 5); 72 SKeyBindings := Phrases.Lookup('SETTINGS', 6); 88 73 end; 89 74 … … 92 77 procedure TSettingsDlg.FormCreate(Sender: TObject); 93 78 begin 79 LocalKeyBindings := TKeyBindings.Create; 80 94 81 Canvas.Font.Assign(UniFont[ftNormal]); 95 82 Canvas.Brush.Style := bsClear; 96 83 97 Languages := TLanguages.Create; 98 Languages.AddItem('', 'System'); 99 Languages.AddItem('cs', 'Czech'); 100 Languages.AddItem('de', 'German'); 101 Languages.AddItem('en', 'English'); 102 Languages.AddItem('it', 'Italian'); 103 Languages.AddItem('ru', 'Russian'); 104 Languages.AddItem('zh-Hant', 'Traditional Chinese'); 105 Languages.AddItem('zh-Hans', 'Simplified Chinese'); 106 107 OKBtn.Caption := Phrases.Lookup('BTN_OK'); 108 CancelBtn.Caption := Phrases.Lookup('BTN_CANCEL'); 84 ButtonOk.Caption := Phrases.Lookup('BTN_OK'); 85 ButtonCancel.Caption := Phrases.Lookup('BTN_CANCEL'); 86 ButtonReset.Caption := Phrases.Lookup('BTN_RESET'); 109 87 InitButtons; 110 88 end; 111 89 112 procedure TSettingsDlg. CancelBtnClick(Sender: TObject);90 procedure TSettingsDlg.ButtonCancelClick(Sender: TObject); 113 91 begin 114 92 ModalResult := mrCancel; 93 end; 94 95 procedure TSettingsDlg.ButtonResetClick(Sender: TObject); 96 begin 97 ListLanguages.ItemIndex := 0; 98 ButtonFullscreen.ButtonIndex := 3; 99 LocalGamma := 100; 100 ListKeyBindings.ItemIndex := -1; 101 ListKeyBindingsSelectionChange(nil, False); 102 LocalKeyBindings.ResetToDefault; 103 LocalKeyBindings.LoadToStrings(ListKeyBindings.Items); 104 Repaint; 115 105 end; 116 106 … … 124 114 end; 125 115 116 procedure TSettingsDlg.EditShortCutPrimaryKeyUp(Sender: TObject; var Key: Word; 117 Shift: TShiftState); 118 begin 119 if Assigned(CurrentKeyBinding) and not (Key in [16..18]) then begin 120 CurrentKeyBinding.ShortCut := Key or 121 (scShift * Integer(ssShift in Shift)) or 122 (scCtrl * Integer(ssCtrl in Shift)) or 123 (scAlt * Integer(ssAlt in Shift)); 124 EditShortCutPrimary.Text := ShortCutToText(CurrentKeyBinding.ShortCut); 125 Key := 0; 126 UpdateShortCutItem; 127 end; 128 end; 129 130 procedure TSettingsDlg.EditShortCutSecondaryKeyUp(Sender: TObject; 131 var Key: Word; Shift: TShiftState); 132 begin 133 if Assigned(CurrentKeyBinding) and not (Key in [16..18]) then begin 134 CurrentKeyBinding.ShortCut2 := Key or 135 (scShift * Integer(ssShift in Shift)) or 136 (scCtrl * Integer(ssCtrl in Shift)) or 137 (scAlt * Integer(ssAlt in Shift)); 138 EditShortCutSecondary.Text := ShortCutToText(CurrentKeyBinding.ShortCut2); 139 Key := 0; 140 UpdateShortCutItem; 141 end; 142 end; 143 144 procedure TSettingsDlg.FormClose(Sender: TObject; var CloseAction: TCloseAction 145 ); 146 begin 147 ListKeyBindings.ItemIndex := -1; 148 end; 149 126 150 procedure TSettingsDlg.ButtonFullscreenClick(Sender: TObject); 127 151 begin … … 131 155 procedure TSettingsDlg.FormDestroy(Sender: TObject); 132 156 begin 133 FreeAndNil(L anguages);157 FreeAndNil(LocalKeyBindings); 134 158 end; 135 159 136 160 procedure TSettingsDlg.FormPaint(Sender: TObject); 137 var138 S: string;139 161 begin 140 162 PaintBackground(self, 3, 3, ClientWidth - 6, ClientHeight - 6); … … 144 166 Frame(Canvas, 2, 2, ClientWidth - 3, ClientHeight - 3, 145 167 MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 146 EditFrame(Canvas, List .BoundsRect, MainTexture);147 BtnFrame(Canvas, OKBtn.BoundsRect, MainTexture);148 BtnFrame(Canvas, CancelBtn.BoundsRect, MainTexture);168 EditFrame(Canvas, ListLanguages.BoundsRect, MainTexture); 169 BtnFrame(Canvas, ButtonOk.BoundsRect, MainTexture); 170 BtnFrame(Canvas, ButtonCancel.BoundsRect, MainTexture); 149 171 150 172 RFrame(Canvas, ButtonFullscreen.Left - 1, ButtonFullscreen.Top - 1, … … 152 174 MainTexture.ColorBevelLight); 153 175 154 S := Phrases.Lookup('SETTINGS', 0); 176 LoweredTextOut(Canvas, -2, MainTexture, ListLanguages.Left, 177 ListLanguages.Top - 26, SLanguages); 178 LoweredTextOut(Canvas, -2, MainTexture, ListKeyBindings.Left, 179 ListKeyBindings.Top - 26, SKeyBindings); 155 180 LoweredTextOut(Canvas, -2, MainTexture, ButtonFullscreen.Left + 32, 156 ButtonFullscreen.Top - 4, S); 157 158 // Gamma 159 UnderlinedTitleValue(Canvas, Phrases.Lookup('SETTINGS', 1), IntToStr(LocalGamma) + '%', 181 ButtonFullscreen.Top - 4, SFullScreen); 182 UnderlinedTitleValue(Canvas, SGamma, IntToStr(LocalGamma) + '%', 160 183 Up2Btn.Left - 150 - 4, Up2Btn.Top + 2, 150); 184 LoweredTextOut(Canvas, -2, MainTexture, EditShortCutPrimary.Left, 185 EditShortCutPrimary.Top - 26, SShortCutPrimary); 186 LoweredTextOut(Canvas, -2, MainTexture, EditShortCutSecondary.Left, 187 EditShortCutSecondary.Top - 26, SShortCutSecondary); 161 188 end; 162 189 163 190 procedure TSettingsDlg.FormShow(Sender: TObject); 164 191 begin 165 Languages.LoadToStrings(List.Items); 166 List.Font.Color := MainTexture.ColorMark; 192 ReloadLanguages; 193 Languages.LoadToStrings(ListLanguages.Items); 194 ListLanguages.Font.Color := MainTexture.ColorMark; 195 ListKeyBindings.Font.Color := MainTexture.ColorMark; 167 196 LoadData; 168 end; 169 170 procedure TSettingsDlg.OKBtnClick(Sender: TObject); 197 LocalKeyBindings.LoadToStrings(ListKeyBindings.Items); 198 end; 199 200 procedure TSettingsDlg.ListKeyBindingsSelectionChange(Sender: TObject; 201 User: boolean); 202 begin 203 if Assigned(CurrentKeyBinding) then begin 204 CurrentKeyBinding.ShortCut := TextToShortCut(EditShortCutPrimary.Text); 205 CurrentKeyBinding.ShortCut2 := TextToShortCut(EditShortCutSecondary.Text); 206 end; 207 208 if ListKeyBindings.ItemIndex >= 0 then 209 CurrentKeyBinding := LocalKeyBindings[ListKeyBindings.ItemIndex] 210 else CurrentKeyBinding := nil; 211 212 if Assigned(CurrentKeyBinding) then begin 213 if CurrentKeyBinding.ShortCut <> 0 then 214 EditShortCutPrimary.Text := ShortCutToText(CurrentKeyBinding.ShortCut) 215 else EditShortCutPrimary.Text := ''; 216 EditShortCutPrimary.Enabled := True; 217 if CurrentKeyBinding.ShortCut2 <> 0 then 218 EditShortCutSecondary.Text := ShortCutToText(CurrentKeyBinding.ShortCut2) 219 else EditShortCutSecondary.Text := ''; 220 EditShortCutSecondary.Enabled := True; 221 end else begin 222 EditShortCutPrimary.Text := ''; 223 EditShortCutPrimary.Enabled := False; 224 EditShortCutSecondary.Text := ''; 225 EditShortCutSecondary.Enabled := False; 226 end; 227 end; 228 229 procedure TSettingsDlg.ButtonOkClick(Sender: TObject); 171 230 begin 172 231 SaveData; … … 182 241 end; 183 242 243 procedure TSettingsDlg.UpdateShortCutItem; 244 begin 245 if Assigned(CurrentKeyBinding) then begin 246 if CurrentKeyBinding.ShortCut > 0 then 247 LocalKeyBindings.RemoveShortCut(CurrentKeyBinding.ShortCut); 248 if CurrentKeyBinding.ShortCut2 > 0 then 249 LocalKeyBindings.RemoveShortCut(CurrentKeyBinding.ShortCut2); 250 CurrentKeyBinding.ShortCut := TextToShortCut(EditShortCutPrimary.Text); 251 CurrentKeyBinding.ShortCut2 := TextToShortCut(EditShortCutSecondary.Text); 252 LocalKeyBindings.LoadToStrings(ListKeyBindings.Items); 253 end; 254 end; 255 184 256 procedure TSettingsDlg.LoadData; 185 257 begin 186 List .ItemIndex := Languages.Search(LocaleCode);187 if (List .ItemIndex = -1) and (Languages.Count > 0) then188 List .ItemIndex := 0;258 ListLanguages.ItemIndex := Languages.Search(LocaleCode); 259 if (ListLanguages.ItemIndex = -1) and (Languages.Count > 0) then 260 ListLanguages.ItemIndex := 0; 189 261 if FullScreen then ButtonFullscreen.ButtonIndex := 3 190 262 else ButtonFullscreen.ButtonIndex := 2; 191 263 LocalGamma := Gamma; 264 LocalKeyBindings.Assign(KeyBindings); 192 265 end; 193 266 … … 197 270 begin 198 271 NeedRestart := Gamma <> LocalGamma; 199 LocaleCode := Languages[List .ItemIndex].ShortName;272 LocaleCode := Languages[ListLanguages.ItemIndex].ShortName; 200 273 FullScreen := (ButtonFullscreen.ButtonIndex and 1) = 1; 201 274 Gamma := LocalGamma; 202 if NeedRestart then SimpleMessage(Phrases.Lookup('SETTINGS', 2)); 275 if NeedRestart then SimpleMessage(SRestartMsg); 276 KeyBindings.Assign(LocalKeyBindings); 203 277 end; 204 278 -
branches/highdpi/Start.pas
r378 r405 428 428 Free; 429 429 end; 430 431 KeyBindings.LoadFromRegistry(HKEY_CURRENT_USER, AppRegistryKey + '\KeyBindings'); 430 432 end; 431 433 … … 450 452 Free; 451 453 end; 454 455 KeyBindings.SaveToRegistry(HKEY_CURRENT_USER, AppRegistryKey + '\KeyBindings'); 452 456 end; 453 457 … … 1624 1628 f: file; 1625 1629 ok: boolean; 1630 MapPictureFileName: string; 1626 1631 begin 1627 1632 if List.ItemIndex >= 0 then … … 1644 1649 begin 1645 1650 SimpleMessage(Format(Phrases.Lookup('NOFILENAME'), [NewName[i]])); 1646 exit1651 Exit; 1647 1652 end; 1648 1653 if Page = pgLoad then … … 1659 1664 except 1660 1665 // Play('INVALID'); 1661 ok := false 1662 end; 1663 if Page <> pgLoad then 1664 try // rename map picture 1666 ok := False; 1667 end; 1668 if Page <> pgLoad then begin 1669 // Rename map picture 1670 MapPictureFileName := GetMapsDir + DirectorySeparator + 1671 List.Items[List.ItemIndex] + CevoMapPictureExt; 1672 if FileExists(MapPictureFileName) then 1673 try 1665 1674 AssignFile(f, GetMapsDir + DirectorySeparator + List.Items[List.ItemIndex] 1666 + '.png');1667 Rename(f, GetMapsDir + DirectorySeparator + NewName + '.png');1675 + CevoMapPictureExt); 1676 Rename(f, GetMapsDir + DirectorySeparator + NewName + CevoMapPictureExt); 1668 1677 except 1669 1678 end; 1670 if ok then1671 begin1679 end; 1680 if ok then begin 1672 1681 if Page = pgLoad then 1673 1682 FormerGames[List.ItemIndex] := NewName -
branches/highdpi/UMiniMap.pas
r349 r405 115 115 ImageFileName: string; 116 116 begin 117 ImageFileName := Copy(FileName, 1, Length(FileName) - Length(CevoMapExt)) + '.png';117 ImageFileName := Copy(FileName, 1, Length(FileName) - Length(CevoMapExt)) + CevoMapPictureExt; 118 118 Mode := mmPicture; 119 119 if LoadGraphicFile(Bitmap, ImageFileName, [gfNoError]) then -
branches/highdpi/readme.txt
r349 r405 29 29 == Release new version == 30 30 31 * Update version in G ameServer.pas Version constant.31 * Update version in Global.pas CevoVersion constants. 32 32 * Update version in Install\win\Common.iss MyAppVersion define. 33 33 * Update version in Install\rpm\c-evo.spec Version field.
Note:
See TracChangeset
for help on using the changeset viewer.