开源 企业版 高校版 私有云 模力方舟 AI 队友
代码拉取完成,页面将自动刷新
加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
已有帐号? 立即登录
文件
devel
分支 (25)
devel
spiderbasic-3.10
v6.21
v6.20
spiderbasic-3.02
qt
v6.12
spiderbasic-3.01
enablejs-ignore-formatting
master
spiderbasic-3.00
webview-tool
v6.11
v6.10
v6.04
spiderbasic-2.51
v6.03
editor-fix-3
editor-slow-fix2
editor-slow-fix
devel
分支 (25)
devel
spiderbasic-3.10
v6.21
v6.20
spiderbasic-3.02
qt
v6.12
spiderbasic-3.01
enablejs-ignore-formatting
master
spiderbasic-3.00
webview-tool
v6.11
v6.10
v6.04
spiderbasic-2.51
v6.03
editor-fix-3
editor-slow-fix2
editor-slow-fix
克隆/下载
克隆/下载
提示
下载代码请复制以下命令到终端执行
为确保你提交的代码身份被 Gitee 正确识别,请执行以下命令完成配置
初次使用 SSH 协议进行代码克隆、推送等操作时,需按下述提示完成 SSH 配置
1 生成 RSA 密钥
2 获取 RSA 公钥内容,并配置到 SSH公钥
在 Gitee 上使用 SVN,请访问 使用指南
使用 HTTPS 协议时,命令行会出现如下账号密码验证步骤。基于安全考虑,Gitee 建议 配置并使用私人令牌 替代登录密码进行克隆、推送等操作
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # 私人令牌
devel
分支 (25)
devel
spiderbasic-3.10
v6.21
v6.20
spiderbasic-3.02
qt
v6.12
spiderbasic-3.01
enablejs-ignore-formatting
master
spiderbasic-3.00
webview-tool
v6.11
v6.10
v6.04
spiderbasic-2.51
v6.03
editor-fix-3
editor-slow-fix2
editor-slow-fix
purebasic
/
PureBasicIDE
/
CompilerOptions.pb
purebasic
/
PureBasicIDE
/
CompilerOptions.pb
CompilerOptions.pb 65.76 KB
一键复制 编辑 原始数据 按行查看 历史
Fred Laboureur 提交于 2025年01月30日 17:34 +08:00 . - Fixed SpiderBasic build
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519
; --------------------------------------------------------------------------------------------
; Copyright (c) Fantaisie Software. All rights reserved.
; Dual licensed under the GPL and Fantaisie Software licenses.
; See LICENSE and LICENSE-FANTAISIE in the project root for license information.
; --------------------------------------------------------------------------------------------
Procedure DisableOptionGadgets()
If Options_IsProjectMode
UseMainFile = #False ; do disable any of these options
Else
UseMainFile = GetGadgetState(#GADGET_Option_UseMainFile)
DisableGadget(#GADGET_Option_MainFile, 1-UseMainFile)
DisableGadget(#GADGET_Option_SelectMainFile, 1-UseMainFile)
EndIf
For Gadget = #GADGET_Option_UseCompiler To #GADGET_Option_ConstantLine
DisableGadget(Gadget, UseMainFile)
Next Gadget
If UseMainFile = 0
CompilerIf Not #SpiderBasic
UseIcon = GetGadgetState(#GADGET_Option_UseIcon)
DisableGadget(#GADGET_Option_IconName, 1-UseIcon)
DisableGadget(#GADGET_Option_SelectIcon, 1-UseIcon)
CompilerEndIf
DisableGadget(#GADGET_Option_SelectCompiler, 1-GetGadgetState(#GADGET_Option_UseCompiler))
DisableGadget(#GADGET_Option_CompileCount, 1-GetGadgetState(#GADGET_Option_UseCompileCount))
DisableGadget(#GADGET_Option_BuildCount, 1-GetGadgetState(#GADGET_Option_UseBuildCount))
EndIf
CompilerIf Not #SpiderBasic
CustomDebugger = GetGadgetState(#GADGET_Option_SelectDebugger)
DisableGadget(#GADGET_Option_DebuggerMode, 1-CustomDebugger)
If (CustomDebugger And GetGadgetState(#GADGET_Option_DebuggerMode) = 2) Or (CustomDebugger = 0 And DebuggerMode = 3)
DisableGadget(#GADGET_Option_SelectWarning, 1)
DisableGadget(#GADGET_Option_WarningMode, 1)
Else
DisableGadget(#GADGET_Option_SelectWarning, 0)
DisableGadget(#GADGET_Option_WarningMode, 1-GetGadgetState(#GADGET_Option_SelectWarning))
EndIf
CompilerEndIf
; disable / enable the resource options
CompilerIf #CompileWindows And Not #SpiderBasic
DisableGadget(#GADGET_Option_IncludeVersion, UseMainFile)
UseVersion = GetGadgetState(#GADGET_Option_IncludeVersion)
For i = 0 To 23
DisableGadget(#GADGET_Option_VersionValue0+i, (1-UseVersion)|UseMainFile)
Next i
DisableGadget(#GADGET_Option_ResourceList, UseMainFile)
DisableGadget(#GADGET_Option_ResourceAdd, UseMainFile)
DisableGadget(#GADGET_Option_ResourceRemove, UseMainFile)
DisableGadget(#GADGET_Option_ResourceClear, UseMainFile)
DisableGadget(#GADGET_Option_ResourceFile, UseMainFile)
DisableGadget(#GADGET_Option_ResourceSelectFile, UseMainFile)
CompilerEndIf
; always disable unsupported options on linux / mac
CompilerIf #CompileLinux And Not #SpiderBasic ; Icon is supported only on windows
DisableGadget(#GADGET_Option_UseIcon, 1)
DisableGadget(#GADGET_Option_IconName, 1)
DisableGadget(#GADGET_Option_SelectIcon, 1)
DisableGadget(#GADGET_Option_DPIAware, 1)
CompilerEndIf
CompilerIf #CompileLinux | #CompileMac And Not #SpiderBasic ; this stuff is Windows only
DisableGadget(#GADGET_Option_EnableXP, 1)
DisableGadget(#GADGET_Option_EnableAdmin, 1)
DisableGadget(#GADGET_Option_EnableUser, 1)
DisableGadget(#GADGET_Option_DllProtection, 1)
DisableGadget(#GADGET_Option_SharedUCRT, 1)
CompilerEndIf
CompilerIf Not #CompileLinux And Not #SpiderBasic ; this stuff is Linux only
DisableGadget(#GADGET_Option_EnableWayland, 1)
CompilerEndIf
EndProcedure
; get the list of enabled tools as it is stored in the structure/ide options
; (in uppercase, spaces replaced by '_', separated by comma)
;
Procedure.s CompilerWindow_EnabledToolsList()
Result$ = ""
For i = 0 To CountGadgetItems(#GADGET_Option_ToolsList)-1
If GetGadgetItemState(#GADGET_Option_ToolsList, i) & #PB_ListIcon_Checked
Result$ + ReplaceString(UCase(Trim(GetGadgetItemText(#GADGET_Option_ToolsList, i, 0))), " ", "_") + ","
EndIf
Next i
If Len(Result$) > 0
ProcedureReturn Left(Result,ドル Len(Result$)-1) ; cut last ","
Else
ProcedureReturn ""
EndIf
EndProcedure
Procedure SetTargetOptions(*Target.CompileTarget)
SetGadgetText(#GADGET_Option_MainFile, *Target\MainFile$)
If Options_IsProjectMode
SetGadgetText(#GADGET_Option_OutputFile, *Target\OutputFile$)
Else
SetGadgetState(#GADGET_Option_UseMainFile, *Target\UseMainFile)
EndIf
SetGadgetState(#GADGET_Option_UseCompiler, *Target\CustomCompiler)
If *Target\CustomCompiler = #False
SetGadgetState(#GADGET_Option_SelectCompiler, 0) ; that's the default compiler
Else
; find a matching compiler
*Compiler.Compiler = FindCompiler(*Target\CompilerVersion$)
If *Compiler = 0
MessageRequester(#ProductName,ドル Language("Compiler","CompilerNotFound")+":"+#NewLine+*Target\CompilerVersion,ドル #FLAG_Warning)
SetGadgetState(#GADGET_Option_SelectCompiler, 0)
ElseIf *Compiler = @DefaultCompiler
SetGadgetState(#GADGET_Option_SelectCompiler, 0)
Else
; one of them must match, as FindCompiler() returned something
last = CountGadgetItems(#GADGET_Option_SelectCompiler)
For index = 1 To last
If GetGadgetItemData(#GADGET_Option_SelectCompiler, index) = *Compiler
SetGadgetState(#GADGET_Option_SelectCompiler, index)
Break
EndIf
Next index
EndIf
EndIf
SetGadgetText(#GADGET_Option_SubSystem, *Target\SubSystem$)
SetGadgetState(#GADGET_Option_Debugger , *Target\Debugger)
SetGadgetState(#GADGET_Option_Optimizer, *Target\Optimizer)
SetGadgetState(#GADGET_Option_DPIAware , *Target\DPIAware)
CompilerIf #SpiderBasic
SetGadgetText(#GADGET_Option_SelectWindowTheme, *Target\WindowTheme$)
SetGadgetText(#GADGET_Option_SelectGadgetTheme, *Target\GadgetTheme$)
SetGadgetText(#GADGET_Option_WebServerAddress, *Target\WebServerAddress$)
CompilerElse
SetGadgetText(#GADGET_Option_IconName, *Target\IconName$)
SetGadgetState(#GADGET_Option_UseIcon , *Target\UseIcon)
SetGadgetText(#GADGET_Option_CommandLine, *Target\CommandLine$)
SetGadgetText(#GADGET_Option_Linker, *Target\LinkerOptions$)
SetGadgetText(#GADGET_Option_CurrentDir, *Target\CurrentDirectory$)
SetGadgetState(#GADGET_Option_ExecutableFormat, *Target\ExecutableFormat)
SetGadgetState(#GADGET_Option_CPU , *Target\CPU)
SetGadgetState(#GADGET_Option_Purifier , *Target\EnablePurifier)
SetGadgetState(#GADGET_Option_EnableASM , *Target\EnableASM)
SetGadgetState(#GADGET_Option_EnableThread , *Target\EnableThread)
SetGadgetState(#GADGET_Option_EnableXP , *Target\EnableXP)
SetGadgetState(#GADGET_Option_EnableWayland, *Target\EnableWayland)
SetGadgetState(#GADGET_Option_EnableAdmin , *Target\EnableAdmin)
SetGadgetState(#GADGET_Option_EnableUser , *Target\EnableUser)
SetGadgetState(#GADGET_Option_DllProtection, *Target\DllProtection)
SetGadgetState(#GADGET_Option_SharedUCRT , *Target\SharedUCRT)
SetGadgetState(#GADGET_Option_EnableOnError, *Target\EnableOnError)
SetGadgetState(#GADGET_Option_SelectDebugger, *Target\CustomDebugger)
If *Target\DebuggerType > 0 And *Target\DebuggerType < 4
SetGadgetState(#GADGET_Option_DebuggerMode, *Target\DebuggerType-1)
Else
SetGadgetState(#GADGET_Option_DebuggerMode, 0)
EndIf
SetGadgetState(#GADGET_Option_SelectWarning, *Target\CustomWarning)
If *Target\WarningMode >= 0 And *Target\WarningMode < 3
SetGadgetState(#GADGET_Option_WarningMode, *Target\WarningMode)
Else
SetGadgetState(#GADGET_Option_WarningMode, 1)
EndIf
SetGadgetState(#GADGET_Option_TemporaryExe, *Target\TemporaryExePlace)
CompilerEndIf
SetGadgetState(#GADGET_Option_UseCompileCount, *Target\UseCompileCount)
SetGadgetState(#GADGET_Option_UseBuildCount, *Target\UseBuildCount)
SetGadgetState(#GADGET_Option_UseCreateExe, *Target\UseCreateExe)
SetGadgetText(#GADGET_Option_CompileCount, Str(*Target\CompileCount))
SetGadgetText(#GADGET_Option_BuildCount, Str(*Target\BuildCount))
ClearGadgetItems(#GADGET_Option_ConstantList)
SetGadgetText(#GADGET_Option_ConstantLine, "")
For i = 0 To *Target\NbConstants-1
AddGadgetItem(#GADGET_Option_ConstantList, i, *Target\Constant$[i])
If *Target\ConstantEnabled[i]
SetGadgetItemState(#GADGET_Option_ConstantList, i, #PB_ListIcon_Checked)
EndIf
Next i
ClearGadgetItems(#GADGET_Option_ToolsList)
ForEach ToolsList()
If ToolsList()\SourceSpecific
Tool$ = ToolsList()\MenuItemName$+Chr(10)+Language("AddTools","Trigger"+Str(ToolsList()\Trigger))
If ToolsList()\DeactivateTool
Tool$ + Chr(10) + Language("Misc", "Disabled")
Else
Tool$ + Chr(10) + Language("Misc", "Enabled")
EndIf
AddGadgetItem(#GADGET_Option_ToolsList, -1, Tool$)
; check if the tool is enabled
; the list is in uppercase, no spaces (spaces inside names replaced by '_')
; separated by comma
;
If FindString(","+*Target\EnabledTools$+",", ","+ReplaceString(UCase(Trim(ToolsList()\MenuItemName$)), " ", "_")+",", 1) <> 0
SetGadgetItemState(#GADGET_Option_ToolsList, CountGadgetItems(#GADGET_Option_ToolsList)-1, #PB_ListIcon_Checked)
EndIf
EndIf
Next ToolsList()
CompilerIf #CompileWindows And Not #SpiderBasic
For i = 0 To 23
If i >= 15 And i <= 17 And *Target\VersionField$[i] = "" ; comboboxes
SetGadgetState(#GADGET_Option_VersionValue0+i, 0) ; set comboboxes to default
Else
SetGadgetText(#GADGET_Option_VersionValue0+i, *Target\VersionField$[i])
EndIf
Next i
SetGadgetState(#GADGET_Option_IncludeVersion, *Target\VersionInfo)
ClearGadgetItems(#GADGET_Option_ResourceList)
SetGadgetText(#GADGET_Option_ResourceFile, "")
For i = 0 To *Target\NbResourceFiles-1
AddGadgetItem(#GADGET_Option_ResourceList, -1, *Target\ResourceFiles$[i])
Next i
CompilerEndIf
DisableOptionGadgets()
EndProcedure
; returns #true if changes were made
;
Procedure TargetOptionsChanged(*Target.CompileTarget)
Changed = 0
If Options_IsProjectMode
If *Target\OutputFile$ <> GetGadgetText(#GADGET_Option_OutputFile): Changed = 1: EndIf
Else
If *Target\UseMainFile <> GetGadgetState(#GADGET_Option_UseMainFile): Changed = 1: EndIf
EndIf
If *Target\CustomCompiler <> GetGadgetState(#GADGET_Option_UseCompiler): Changed = 1: EndIf
If *Target\CustomCompiler And MatchCompilerVersion(*Target\CompilerVersion,ドル GetGadgetText(#GADGET_Option_SelectCompiler), #MATCH_Version|#MATCH_Beta|#MATCH_Processor) = 0
Changed = 1
EndIf
If *Target\Debugger <> GetGadgetState(#GADGET_Option_Debugger): Changed = 1: EndIf
If *Target\Optimizer <> GetGadgetState(#GADGET_Option_Optimizer): Changed = 1: EndIf
If *Target\DPIAware <> GetGadgetState(#GADGET_Option_DPIAware): Changed = 1: EndIf
CompilerIf #SpiderBasic
If *Target\WindowTheme$ <> GetGadgetText(#GADGET_Option_SelectWindowTheme): Changed = 1: EndIf
If *Target\GadgetTheme$ <> GetGadgetText(#GADGET_Option_SelectGadgetTheme): Changed = 1: EndIf
If *Target\WebServerAddress$ <> GetGadgetText(#GADGET_Option_WebServerAddress): Changed = 1: EndIf
CompilerElse
If *Target\EnableASM <> GetGadgetState(#GADGET_Option_EnableASM): Changed = 1: EndIf
If *Target\EnablePurifier <> GetGadgetState(#GADGET_Option_Purifier): Changed = 1: EndIf
If *Target\EnableThread <> GetGadgetState(#GADGET_Option_EnableThread): Changed = 1: EndIf
If *Target\EnableXP <> GetGadgetState(#GADGET_Option_EnableXP): Changed = 1: EndIf
If *Target\EnableWayland <> GetGadgetState(#GADGET_Option_EnableWayland): Changed = 1: EndIf
If *Target\EnableAdmin <> GetGadgetState(#GADGET_Option_EnableAdmin): Changed = 1: EndIf
If *Target\EnableUser <> GetGadgetState(#GADGET_Option_EnableUser): Changed = 1: EndIf
If *Target\DllProtection <> GetGadgetState(#GADGET_Option_DllProtection): Changed = 1: EndIf
If *Target\SharedUCRT <> GetGadgetState(#GADGET_Option_SharedUCRT): Changed = 1: EndIf
If *Target\EnableOnError <> GetGadgetState(#GADGET_Option_EnableOnError): Changed = 1: EndIf
If *Target\CPU <> GetGadgetState(#GADGET_Option_CPU): Changed = 1: EndIf
If *Target\ExecutableFormat <> GetGadgetState(#GADGET_Option_ExecutableFormat): Changed = 1: EndIf
If *Target\CommandLine$ <> GetGadgetText(#GADGET_Option_CommandLine): Changed = 1: EndIf
If *Target\LinkerOptions$ <> GetGadgetText(#GADGET_Option_Linker): Changed = 1: EndIf
If *Target\CurrentDirectory$ <> GetGadgetText(#GADGET_Option_CurrentDir): Changed = 1: EndIf
If *Target\CustomDebugger <> GetGadgetState(#GADGET_Option_SelectDebugger): Changed = 1: EndIf
If *Target\CustomWarning <> GetGadgetState(#GADGET_Option_SelectWarning): Changed = 1: EndIf
If *Target\DebuggerType-1 <> GetGadgetState(#GADGET_Option_DebuggerMode) And GetGadgetState(#GADGET_Option_SelectDebugger): Changed = 1: EndIf
If *Target\WarningMode <> GetGadgetState(#GADGET_Option_WarningMode) And GetGadgetState(#GADGET_Option_SelectWarning): Changed = 1: EndIf
If *Target\TemporaryExePlace <> GetGadgetState(#GADGET_Option_TemporaryExe): Changed = 1: EndIf
If *Target\UseIcon <> GetGadgetState(#GADGET_Option_UseIcon): Changed = 1: EndIf
If *Target\IconName$ <> GetGadgetText(#GADGET_Option_IconName): Changed = 1: EndIf
CompilerEndIf
If *Target\SubSystem$ <> GetGadgetText(#GADGET_Option_SubSystem): Changed = 1: EndIf
If *Target\MainFile$ <> GetGadgetText(#GADGET_Option_MainFile): Changed = 1: EndIf
If *Target\CompileCount <> Val(GetGadgetText(#GADGET_Option_CompileCount)): Changed = 1: EndIf
If *Target\BuildCount <> Val(GetGadgetText(#GADGET_Option_BuildCount)): Changed = 1: EndIf
If *Target\UseCompileCount <> GetGadgetState(#GADGET_Option_UseCompileCount): Changed = 1: EndIf
If *Target\UseBuildCount <> GetGadgetState(#GADGET_Option_UseBuildCount): Changed = 1: EndIf
If *Target\UseCreateExe <> GetGadgetState(#GADGET_Option_UseCreateExe): Changed = 1: EndIf
If *Target\EnabledTools$ <> CompilerWindow_EnabledToolsList(): Changed = 1: EndIf
Count = CountGadgetItems(#GADGET_Option_ConstantList)
If *Target\NbConstants <> Count
Changed = 1
Else
For i = 0 To Count-1
If *Target\Constant$[i] <> GetGadgetItemText(#GADGET_Option_ConstantList, i, 0)
Changed = 1
Break
EndIf
If (GetGadgetItemState(#GADGET_Option_ConstantList, i) & #PB_ListIcon_Checked And *Target\ConstantEnabled[i] = 0) Or (GetGadgetItemState(#GADGET_Option_ConstantList, i) & #PB_ListIcon_Checked = 0 And *Target\ConstantEnabled[i])
Changed = 1
Break
EndIf
Next i
EndIf
CompilerIf #CompileWindows And Not #SpiderBasic
If *Target\VersionInfo <> GetGadgetState(#GADGET_Option_IncludeVersion): Changed = 1: EndIf
For i = 0 To 14
If *Target\VersionField$[i] <> GetGadgetText(#GADGET_Option_VersionValue0+i): Changed = 1: EndIf
Next i
; these fields are made empty when the defaults are set:
For i = 15 To 17
If *Target\VersionField$[i] <> "" Or GetGadgetState(#GADGET_Option_VersionValue0+i) <> 0
If *Target\VersionField$[i] <> GetGadgetText(#GADGET_Option_VersionValue0+i): Changed = 1: EndIf
EndIf
Next i
For i = 18 To 23
If *Target\VersionField$[i] <> GetGadgetText(#GADGET_Option_VersionValue0+i): Changed = 1: EndIf
Next i
If *Target\NbResourceFiles <> CountGadgetItems(#GADGET_Option_ResourceList): Changed = 1: EndIf
If *Target\NbResourceFiles > 0
For i = 0 To *Target\NbResourceFiles-1
If *Target\ResourceFiles$[i] <> GetGadgetItemText(#GADGET_Option_ResourceList, i, 0)
Changed = 1
Break
EndIf
Next i
EndIf
CompilerEndIf
ProcedureReturn Changed
EndProcedure
Procedure GetTargetOptions(*Target.CompileTarget)
If Options_IsProjectMode = 0
*Target\UseMainFile = GetGadgetState(#GADGET_Option_UseMainFile)
EndIf
*Target\CustomCompiler = GetGadgetState(#GADGET_Option_UseCompiler)
If *Target\CustomCompiler
*Target\CompilerVersion$ = GetGadgetText(#GADGET_Option_SelectCompiler)
EndIf
*Target\Debugger = GetGadgetState(#GADGET_Option_Debugger)
*Target\Optimizer = GetGadgetState(#GADGET_Option_Optimizer)
*Target\DPIAware = GetGadgetState(#GADGET_Option_DPIAware)
CompilerIf #SpiderBasic
*Target\WebServerAddress$ = GetGadgetText(#GADGET_Option_WebServerAddress)
*Target\WindowTheme$ = GetGadgetText(#GADGET_Option_SelectWindowTheme)
*Target\GadgetTheme$ = GetGadgetText(#GADGET_Option_SelectGadgetTheme)
CompilerElse
*Target\EnableASM = GetGadgetState(#GADGET_Option_EnableASM)
*Target\EnablePurifier = GetGadgetState(#GADGET_Option_Purifier)
*Target\EnableThread = GetGadgetState(#GADGET_Option_EnableThread)
*Target\EnableXP = GetGadgetState(#GADGET_Option_EnableXP)
*Target\EnableWayland = GetGadgetState(#GADGET_Option_EnableWayland)
*Target\EnableAdmin = GetGadgetState(#GADGET_Option_EnableAdmin)
*Target\EnableUser = GetGadgetState(#GADGET_Option_EnableUser)
*Target\DllProtection = GetGadgetState(#GADGET_Option_DllProtection)
*Target\SharedUCRT = GetGadgetState(#GADGET_Option_SharedUCRT)
*Target\EnableOnError = GetGadgetState(#GADGET_Option_EnableOnError)
*Target\CPU = GetGadgetState(#GADGET_Option_CPU)
*Target\TemporaryExePlace= GetGadgetState(#GADGET_Option_TemporaryExe)
*Target\CustomDebugger = GetGadgetState(#GADGET_Option_SelectDebugger)
*Target\DebuggerType = GetGadgetState(#GADGET_Option_DebuggerMode)+1
*Target\CustomWarning = GetGadgetState(#GADGET_Option_SelectWarning)
*Target\WarningMode = GetGadgetState(#GADGET_Option_WarningMode)
*Target\UseIcon = GetGadgetState(#GADGET_Option_UseIcon)
If *Target\UseIcon
*Target\IconName$ = Trim(GetGadgetText(#GADGET_Option_IconName))
EndIf
CompilerEndIf
*Target\UseCompileCount = GetGadgetState(#GADGET_Option_UseCompileCount)
*Target\UseBuildCount = GetGadgetState(#GADGET_Option_UseBuildCount)
*Target\UseCreateExe = GetGadgetState(#GADGET_Option_UseCreateExe)
If Options_IsProjectMode
*Target\MainFile$ = Trim(GetGadgetText(#GADGET_Option_MainFile))
*Target\OutputFile$ = Trim(GetGadgetText(#GADGET_Option_OutputFile))
*Target\FileName$ = ResolveRelativePath(GetPathPart(ProjectFile$), *Target\MainFile$)
ElseIf *Target\UseMainFile
*Target\MainFile$ = Trim(GetGadgetText(#GADGET_Option_MainFile))
EndIf
CompilerIf Not #SpiderBasic
*Target\ExecutableFormat = GetGadgetState(#GADGET_Option_ExecutableFormat)
*Target\CommandLine$ = GetGadgetText(#GADGET_Option_CommandLine)
*Target\LinkerOptions$ = Trim(GetGadgetText(#GADGET_Option_Linker))
*Target\CurrentDirectory$ = Trim(GetGadgetText(#GADGET_Option_CurrentDir))
CompilerEndIf
*Target\SubSystem$ = GetGadgetText(#GADGET_Option_SubSystem)
*Target\CompileCount = Val(GetGadgetText(#GADGET_Option_CompileCount))
*Target\BuildCount = Val(GetGadgetText(#GADGET_Option_BuildCount))
*Target\EnabledTools$ = CompilerWindow_EnabledToolsList()
*Target\NbConstants = CountGadgetItems(#GADGET_Option_ConstantList)
If *Target\NbConstants > #MAX_Constants
*Target\NbConstants = #MAX_Constants
EndIf
For i = 0 To *Target\NbConstants-1
*Target\Constant$[i] = GetGadgetItemText(#GADGET_Option_ConstantList, i, 0)
If GetGadgetItemState(#GADGET_Option_ConstantList, i) & #PB_ListIcon_Checked
*Target\ConstantEnabled[i] = #True
Else
*Target\ConstantEnabled[i] = #False
EndIf
Next i
CompilerIf #CompileWindows And Not #SpiderBasic
*Target\VersionInfo = GetGadgetState(#GADGET_Option_IncludeVersion)
For i = 0 To 23
*Target\VersionField$[i] = GetGadgetText(#GADGET_Option_VersionValue0+i)
Next i
; make fields empty when the default values are selected ( so they do not appear in the file info block all the time)
If GetGadgetState(#GADGET_Option_VersionValue0+15) = 0
*Target\VersionField$[15] = ""
EndIf
If GetGadgetState(#GADGET_Option_VersionValue0+16) = 0
*Target\VersionField$[16] = ""
EndIf
If GetGadgetState(#GADGET_Option_VersionValue0+17) = 0
*Target\VersionField$[17] = ""
EndIf
*Target\NbResourceFiles = CountGadgetItems(#GADGET_Option_ResourceList)
If *Target\NbResourceFiles > #MAX_ResourceFiles
*Target\NbResourceFiles = #MAX_ResourceFiles
EndIf
For i = 0 To *Target\NbResourceFiles-1
*Target\ResourceFiles$[i] = Trim(GetGadgetItemText(#GADGET_Option_ResourceList, i, 0))
Next i
CompilerEndIf
ProcedureReturn Changed
EndProcedure
Procedure UpdateTargetGadgets()
State = GetGadgetState(#GADGET_Option_TargetList)
If State = -1
DisableGadget(#GADGET_Option_EditTarget, 1)
DisableGadget(#GADGET_Option_CopyTarget, 1)
DisableGadget(#GADGET_Option_RemoveTarget, 1)
DisableGadget(#GADGET_Option_TargetUp, 1)
DisableGadget(#GADGET_Option_TargetDown, 1)
DisableGadget(#GADGET_Option_DefaultTarget, 1)
DisableGadget(#GADGET_Option_TargetEnabled, 1)
SetGadgetState(#GADGET_Option_DefaultTarget, 0)
SetGadgetState(#GADGET_Option_TargetEnabled, 0)
DisableMenuItem(#POPUPMENU_Options, #GADGET_Option_EditTarget, 1)
DisableMenuItem(#POPUPMENU_Options, #GADGET_Option_CopyTarget, 1)
DisableMenuItem(#POPUPMENU_Options, #GADGET_Option_RemoveTarget, 1)
DisableMenuItem(#POPUPMENU_Options, #GADGET_Option_TargetUp, 1)
DisableMenuItem(#POPUPMENU_Options, #GADGET_Option_TargetDown, 1)
DisableMenuItem(#POPUPMENU_Options, #GADGET_Option_DefaultTargetMenu, 1)
DisableMenuItem(#POPUPMENU_Options, #GADGET_Option_TargetEnabledMenu, 1)
SetMenuItemState(#POPUPMENU_Options, #GADGET_Option_DefaultTargetMenu, 0)
SetMenuItemState(#POPUPMENU_Options, #GADGET_Option_TargetEnabledMenu, 0)
Else
SelectElement(ProjectOptionTargets(), State)
Count = ListSize(ProjectOptionTargets())
DisableGadget(#GADGET_Option_EditTarget, 0)
DisableGadget(#GADGET_Option_CopyTarget, 0)
DisableMenuItem(#POPUPMENU_Options, #GADGET_Option_EditTarget, 0)
DisableMenuItem(#POPUPMENU_Options, #GADGET_Option_CopyTarget, 0)
If Count = 1
DisableGadget(#GADGET_Option_RemoveTarget, 1) ; must keep at least one target (and at least one default)
DisableGadget(#GADGET_Option_DefaultTarget, 1)
SetGadgetState(#GADGET_Option_DefaultTarget, 1)
DisableMenuItem(#POPUPMENU_Options, #GADGET_Option_RemoveTarget, 1)
DisableMenuItem(#POPUPMENU_Options, #GADGET_Option_DefaultTargetMenu, 1)
SetMenuItemState(#POPUPMENU_Options, #GADGET_Option_DefaultTargetMenu, 1)
Else
DisableGadget(#GADGET_Option_RemoveTarget, 0)
DisableGadget(#GADGET_Option_DefaultTarget, 0)
DisableMenuItem(#POPUPMENU_Options, #GADGET_Option_RemoveTarget, 0)
DisableMenuItem(#POPUPMENU_Options, #GADGET_Option_DefaultTargetMenu, 0)
If ProjectOptionTargets()\IsDefault
SetGadgetState(#GADGET_Option_DefaultTarget, 1)
SetMenuItemState(#POPUPMENU_Options, #GADGET_Option_DefaultTargetMenu, 1)
Else
SetGadgetState(#GADGET_Option_DefaultTarget, 0)
SetMenuItemState(#POPUPMENU_Options, #GADGET_Option_DefaultTargetMenu, 0)
EndIf
EndIf
If State = 0
DisableGadget(#GADGET_Option_TargetUp, 1)
DisableMenuItem(#POPUPMENU_Options, #GADGET_Option_TargetUp, 1)
Else
DisableGadget(#GADGET_Option_TargetUp, 0)
DisableMenuItem(#POPUPMENU_Options, #GADGET_Option_TargetUp, 0)
EndIf
If State = Count-1
DisableGadget(#GADGET_Option_TargetDown, 1)
DisableMenuItem(#POPUPMENU_Options, #GADGET_Option_TargetDown, 1)
Else
DisableGadget(#GADGET_Option_TargetDown, 0)
DisableMenuItem(#POPUPMENU_Options, #GADGET_Option_TargetDown, 0)
EndIf
DisableGadget(#GADGET_Option_TargetEnabled, 0)
DisableMenuItem(#POPUPMENU_Options, #GADGET_Option_TargetEnabledMenu, 0)
If ProjectOptionTargets()\IsEnabled
SetGadgetState(#GADGET_Option_TargetEnabled, 1)
SetMenuItemState(#POPUPMENU_Options, #GADGET_Option_TargetEnabledMenu, 1)
Else
SetGadgetState(#GADGET_Option_TargetEnabled, 0)
SetMenuItemState(#POPUPMENU_Options, #GADGET_Option_TargetEnabledMenu, 0)
EndIf
EndIf
EndProcedure
Procedure ProjectTargetImage(*Target.CompileTarget)
If *Target\IsDefault
ProcedureReturn ImageID(#IMAGE_Option_DefaultTarget)
ElseIf *Target\IsEnabled
ProcedureReturn ImageID(#IMAGE_Option_NormalTarget)
Else
ProcedureReturn ImageID(#IMAGE_Option_DisabledTarget)
EndIf
EndProcedure
Procedure OpenOptionWindow(ForceProjectOptions, *InitialTarget.CompileTarget = 0)
If IsWindow(#WINDOW_Option) = 0
; Use a slightly different dialog for project options
;
If *ActiveSource = *ProjectInfo Or *ActiveSource\ProjectFile Or (IsProject And ForceProjectOptions)
Options_IsProjectMode = #True
OptionWindowDialog = OpenDialog(?Dialog_ProjectCompilerOptions, WindowID(#WINDOW_Main), @ProjectOptionWindowPosition)
Else
Options_IsProjectMode = #False
OptionWindowDialog = OpenDialog(?Dialog_CompilerOptions, WindowID(#WINDOW_Main), @OptionWindowPosition)
EndIf
If OptionWindowDialog
EnsureWindowOnDesktop(#WINDOW_Option)
EnableGadgetDrop(#GADGET_Option_MainFile, #PB_Drop_Files, #PB_Drag_Copy)
CompilerIf #SpiderBasic
If Options_IsProjectMode
HideGadget(#GADGET_Option_OutputFileLabel, #True)
HideGadget(#GADGET_Option_OutputFile, #True)
HideGadget(#GADGET_Option_SelectOutputFile, #True)
EndIf
; Scan the available window themes
;
If ExamineDirectory(0, PureBasicPath$+"libraries/javascript/themes", "")
While NextDirectoryEntry(0)
If DirectoryEntryType(0) = #PB_DirectoryEntry_Directory And Left(DirectoryEntryName(0), 1) <> "." ; ignore ".", ".." and all hidden directories
AddGadgetItem(#GADGET_Option_SelectWindowTheme, -1, DirectoryEntryName(0))
EndIf
Wend
FinishDirectory(0)
EndIf
; Scan the available gadget themes
;
If ExamineDirectory(0, PureBasicPath$+"libraries/javascript/dojo/themes", "")
While NextDirectoryEntry(0)
If DirectoryEntryType(0) = #PB_DirectoryEntry_Directory And Left(DirectoryEntryName(0), 1) <> "." ; ignore ".", ".." and all hidden directories
AddGadgetItem(#GADGET_Option_SelectGadgetTheme, -1, DirectoryEntryName(0))
EndIf
Wend
FinishDirectory(0)
EndIf
CompilerElse
EnableGadgetDrop(#GADGET_Option_IconName, #PB_Drop_Files, #PB_Drag_Copy)
EnableGadgetDrop(#GADGET_Option_Linker, #PB_Drop_Files, #PB_Drag_Copy)
EnableGadgetDrop(#GADGET_Option_CurrentDir, #PB_Drop_Files, #PB_Drag_Copy)
CompilerEndIf
AddGadgetItem(#GADGET_Option_SelectCompiler, -1, DefaultCompiler\VersionString$)
ForEach Compilers()
If Compilers()\Validated
AddGadgetItem(#GADGET_Option_SelectCompiler, -1, Compilers()\VersionString$)
SetGadgetItemData(#GADGET_Option_SelectCompiler, CountGadgetItems(#GADGET_Option_SelectCompiler)-1, @Compilers())
EndIf
Next Compilers()
CompilerIf #CompileWindows And Not #SpiderBasic
Restore Resource_Strings
For i = 15 To 17
Read.l Count
For s = 1 To Count
Read.s Value$
AddGadgetItem(#GADGET_Option_VersionValue0+i, -1, Value$)
Next s
Next i
EnableGadgetDrop(#GADGET_Option_ResourceList, #PB_Drop_Files, #PB_Drag_Copy)
EnableGadgetDrop(#GADGET_Option_ResourceFile, #PB_Drop_Files, #PB_Drag_Copy)
CompilerEndIf
If Options_IsProjectMode
Options_CurrentBasePath$ = GetPathPart(ProjectFile$)
EnableGadgetDrop(#GADGET_Option_OutputFile, #PB_Drop_Files, #PB_Drag_Copy)
SetGadgetAttribute(#GADGET_Option_AddTarget, #PB_Button_Image, ImageID(#IMAGE_Option_AddTarget))
SetGadgetAttribute(#GADGET_Option_EditTarget, #PB_Button_Image, ImageID(#IMAGE_Option_EditTarget))
SetGadgetAttribute(#GADGET_Option_CopyTarget, #PB_Button_Image, ImageID(#IMAGE_Option_CopyTarget))
SetGadgetAttribute(#GADGET_Option_RemoveTarget, #PB_Button_Image, ImageID(#IMAGE_Option_RemoveTarget))
SetGadgetAttribute(#GADGET_Option_TargetUp, #PB_Button_Image, ImageID(#IMAGE_Option_TargetUp))
SetGadgetAttribute(#GADGET_Option_TargetDown, #PB_Button_Image, ImageID(#IMAGE_Option_TargetDown))
GadgetToolTip(#GADGET_Option_AddTarget, Language("Compiler","AddTarget"))
GadgetToolTip(#GADGET_Option_EditTarget, Language("Compiler","RenameTarget"))
GadgetToolTip(#GADGET_Option_CopyTarget, Language("Compiler","CopyTarget"))
GadgetToolTip(#GADGET_Option_RemoveTarget, Language("Compiler","RemoveTarget"))
GadgetToolTip(#GADGET_Option_TargetUp, Language("Compiler","TargetUp"))
GadgetToolTip(#GADGET_Option_TargetDown, Language("Compiler","TargetDown"))
If EnableAccessibility
; Give all these controls labels to screen readers, using a hack with SetGadgetText() on ButtonImageGadgets that adds an accessibility label.
SetGadgetText(#GADGET_Option_AddTarget, Language("Compiler","AddTarget"))
SetGadgetText(#GADGET_Option_EditTarget, Language("Compiler","RenameTarget"))
SetGadgetText(#GADGET_Option_CopyTarget, Language("Compiler","CopyTarget"))
SetGadgetText(#GADGET_Option_RemoveTarget, Language("Compiler","RemoveTarget"))
SetGadgetText(#GADGET_Option_TargetUp, Language("Compiler","TargetUp"))
SetGadgetText(#GADGET_Option_TargetDown, Language("Compiler","TargetDown"))
EndIf
; resize with the actual button images and fold state
OptionWindowDialog\GuiUpdate()
; Create the popupmenu
;
If EnableMenuIcons
*Popup = CreatePopupImageMenu(#POPUPMENU_Options)
Else
*Popup = CreatePopupMenu(#POPUPMENU_Options)
EndIf
; Re-use the gadget ids for the menu for simplicity (same as for the shortcuts)
If *Popup
MenuItem(#GADGET_Option_AddTarget, Language("Compiler","AddTarget"), ImageID(#IMAGE_Option_AddTarget))
MenuItem(#GADGET_Option_CopyTarget, Language("Compiler","CopyTarget"), ImageID(#IMAGE_Option_CopyTarget))
MenuItem(#GADGET_Option_EditTarget, Language("Compiler","RenameTarget"), ImageID(#IMAGE_Option_EditTarget))
MenuBar()
MenuItem(#GADGET_Option_RemoveTarget, Language("Compiler","RemoveTarget"), ImageID(#IMAGE_Option_RemoveTarget))
MenuBar()
MenuItem(#GADGET_Option_TargetUp, Language("Compiler","TargetUp"), ImageID(#IMAGE_Option_TargetUp))
MenuItem(#GADGET_Option_TargetDown, Language("Compiler","TargetDown"), ImageID(#IMAGE_Option_TargetDown))
MenuBar()
MenuItem(#GADGET_Option_DefaultTargetMenu, Language("Compiler","DefaultTarget"))
MenuItem(#GADGET_Option_TargetEnabledMenu, Language("Compiler","EnableTarget"))
EndIf
ClearList(ProjectOptionTargets())
CurrentIndex = -1
*Options_CurrentTarget = 0
If *InitialTarget = 0
*InitialTarget = *DefaultTarget
EndIf
ForEach ProjectTargets()
AddElement(ProjectOptionTargets())
ProjectOptionTargets() = ProjectTargets() ; copy the entire settings
If @ProjectTargets() = *InitialTarget
CurrentIndex = ListIndex(ProjectTargets())
*Options_CurrentTarget = @ProjectOptionTargets()
EndIf
If @ProjectTargets() = *DefaultTarget
ProjectOptionTargets()\IsDefault = #True
Else
ProjectOptionTargets()\IsDefault = #False
EndIf
AddGadgetItem(#GADGET_Option_TargetList, -1, ProjectOptionTargets()\Name,ドル ProjectTargetImage(@ProjectOptionTargets()))
Next ProjectTargets()
If CurrentIndex <> -1
SetGadgetState(#GADGET_Option_TargetList, CurrentIndex)
EndIf
SetTargetOptions(*InitialTarget)
UpdateTargetGadgets()
Else
If *ActiveSource\Filename$ ; already saved
Options_CurrentBasePath$ = GetPathPart(*ActiveSource\Filename$)
Else
Options_CurrentBasePath$ = "" ; use full paths then
EndIf
; just set the active source options
SetTargetOptions(*ActiveSource)
EndIf
CompilerIf #CompileWindows
SendMessage_(GadgetID(#GADGET_Option_ConstantList), #LVM_SETCOLUMNWIDTH, 0, #LVSCW_AUTOSIZE_USEHEADER)
If Options_IsProjectMode
SendMessage_(GadgetID(#GADGET_Option_TargetList), #LVM_SETCOLUMNWIDTH, 0, #LVSCW_AUTOSIZE_USEHEADER)
EndIf
CompilerEndIf
; While this dialog is open, disable the menu entry to avoid inconsistency
DisableMenuItem(#MENU, #MENU_Debugger, #True)
HideWindow(#WINDOW_Option, 0)
EndIf
Else
SetWindowForeground(#WINDOW_Option)
EndIf
EndProcedure
Procedure OptionWindowEvents(EventID)
If EventID = #PB_Event_Menu ; Little wrapper to map the shortcut events (identified as menu)
EventID = #PB_Event_Gadget ; to normal gadget events...
GadgetID = EventMenu()
Else
GadgetID = EventGadget()
EndIf
Select EventID
Case #PB_Event_CloseWindow
Quit = 1
Case #PB_Event_GadgetDrop
Select GadgetID
Case #GADGET_Option_MainFile
File$ = StringField(EventDropFiles(), 1, Chr(10)) ; ignore all but the first entry
SetGadgetText(#GADGET_Option_MainFile, CreateRelativePath(Options_CurrentBasePath,ドル File$))
Case #GADGET_Option_OutputFile
File$ = StringField(EventDropFiles(), 1, Chr(10)) ; ignore all but the first entry
SetGadgetText(#GADGET_Option_MainFile, CreateRelativePath(Options_CurrentBasePath,ドル File$))
CompilerIf Not #SpiderBasic
Case #GADGET_Option_IconName
File$ = StringField(EventDropFiles(), 1, Chr(10))
SetGadgetText(#GADGET_Option_IconName, CreateRelativePath(Options_CurrentBasePath,ドル File$))
Case #GADGET_Option_Linker
File$ = StringField(EventDropFiles(), 1, Chr(10))
SetGadgetText(#GADGET_Option_Linker, CreateRelativePath(Options_CurrentBasePath,ドル File$))
Case #GADGET_Option_CurrentDir
Path$ = StringField(EventDropFiles(), 1, Chr(10))
If FileSize(Path$) <> -2 ; probably a file then
Path$ = GetPathPart(Path$)
EndIf
SetGadgetText(#GADGET_Option_CurrentDir, CreateRelativePath(Options_CurrentBasePath,ドル Path$))
CompilerIf #CompileWindows
Case #GADGET_Option_ResourceList
Files$ = EventDropFiles() ; look at all files here...
Count = CountString(Files,ドル Chr(10))+1
For i = 1 To Count
File$ = StringField(Files,ドル i, Chr(10))
If FileSize(File$) <> -2 ; no directories!
AddGadgetItem(#GADGET_Option_ResourceList, -1, CreateRelativePath(Options_CurrentBasePath,ドル File$))
EndIf
Next i
Case #GADGET_Option_ResourceFile
File$ = StringField(EventDropFiles(), 1, Chr(10))
SetGadgetText(#GADGET_Option_ResourceFile, CreateRelativePath(Options_CurrentBasePath,ドル File$))
CompilerEndIf
CompilerEndIf
EndSelect
Case #PB_Event_Gadget
Select GadgetID
Case #GADGET_Option_Ok
If Options_IsProjectMode = 0
; Make sure the modified flag is set if any changes were done.
;
If TargetOptionsChanged(*ActiveSource)
UpdateSourceStatus(1) ; set the changed flag
EndIf
; update the highlighting if EnableASM changes
;
OldEnableASM = *ActiveSource\EnableASM
GetTargetOptions(*ActiveSource)
If OldEnableASM <> *ActiveSource\EnableASM
UpdateHighlighting()
EndIf
SetDebuggerMenuStates() ; update the debugger menu state, as we can enable/disable it in the compiler options
Quit = 1
Else
; get the latest changes
If *Options_CurrentTarget
GetTargetOptions(*Options_CurrentTarget)
EndIf
; check for missing MainFile$ names in the list and warn/abort if so
Quit = 1
ForEach ProjectOptionTargets()
If Trim(ProjectOptionTargets()\MainFile$) = ""
; make the target in question the current one
*Options_CurrentTarget = @ProjectOptionTargets()
SetTargetOptions(*Options_CurrentTarget)
SetGadgetState(#GADGET_Option_TargetList, ListIndex(ProjectOptionTargets()))
UpdateTargetGadgets()
If MessageRequester(Language("Compiler","OptionsTitle"), LanguagePattern("Compiler","NoInputFile", "%target%", ProjectOptionTargets()\Name$)+#NewLine+Language("Compiler","SaveAnyway"), #PB_MessageRequester_YesNo|#FLAG_Warning) = #PB_MessageRequester_No
Quit = 0
Break
EndIf
EndIf
Next ProjectOptionTargets()
; copy the changes back to the real project list
If Quit
ClearList(ProjectTargets())
ForEach ProjectOptionTargets()
AddElement(ProjectTargets())
ProjectTargets() = ProjectOptionTargets() ; structure copy
Next ProjectOptionTargets()
; set the *DefaultTarget variable properly and ensuer there is a def target
SetProjectDefaultTarget()
SetDebuggerMenuStates()
; update the menu to reflect our target changes
StartFlickerFix(#WINDOW_Main)
CreateIDEMenu()
StopFlickerFix(#WINDOW_Main, 1)
EndIf
EndIf
Case #GADGET_Option_Cancel
ClearList(ProjectOptionTargets()) ; do not apply these changes
Quit = 1
Case #GADGET_Option_UseMainFile
DisableOptionGadgets()
Case #GADGET_Option_Debugger
; No action here anymore, as the menu item is disabled anyway for consistency
Case #GADGET_Option_SelectMainFile
File$ = ResolveRelativePath(Options_CurrentBasePath,ドル GetGadgetText(#GADGET_Option_MainFile))
If Trim(File$) = ""
File$ = Options_CurrentBasePath$
EndIf
File$ = OpenFileRequester(Language("Compiler","OpenMainFile"), File,ドル Language("Compiler","SourcePattern"), 0)
If File$
SetGadgetText(#GADGET_Option_MainFile, CreateRelativePath(Options_CurrentBasePath,ドル File$))
EndIf
Case #GADGET_Option_UseCompiler
DisableGadget(#GADGET_Option_SelectCompiler, 1-GetGadgetState(#GADGET_Option_UseCompiler))
CompilerIf Not #SpiderBasic
Case #GADGET_Option_SelectOutputFile
File$ = ResolveRelativePath(Options_CurrentBasePath,ドル GetGadgetText(#GADGET_Option_OutputFile))
If Trim(File$) = ""
File$ = Options_CurrentBasePath$
EndIf
If GetGadgetState(#GADGET_Option_ExecutableFormat) = 2 ; shared dll
CompilerIf #CompileWindows
Pattern$ = Language("Compiler","DllPattern")
Extension$ = ".dll"
CompilerElseIf #CompileMac
Pattern$ = "Shared Library (*.dylib)|*.dylib|All Files (*.*)|*.*"
Extension$ = ".dylib"
CompilerElse ; Linux
Pattern$ = "Shared Library (*.so)|*.so|All Files (*.*)|*.*"
Extension$ = ".so"
CompilerEndIf
Else
CompilerIf #CompileWindows
Pattern$ = Language("Compiler","ExePattern")
Extension$ = ".exe"
CompilerElseIf #CompileMac
Pattern$ = ""
If GetGadgetState(#GADGET_Option_ExecutableFormat) = 1 ; console
Extension$ = "" ; console, do not append .app automatically here
Else
Extension$ = ".app" ; automatically append ".app" for gui programs
EndIf
CompilerElse ; Linux
Pattern$ = ""
Extension$ = ""
CompilerEndIf
EndIf
File$ = SaveFileRequester(Language("Compiler","SetOutputFile"), File,ドル Pattern,ドル 0)
If File$
If LCase(Right(File,ドル Len(Extension$))) <> Extension$ And SelectedFilePattern() <> 1
File$+Extension$
EndIf
SetGadgetText(#GADGET_Option_OutputFile, CreateRelativePath(Options_CurrentBasePath,ドル File$))
EndIf
Case #GADGET_Option_SelectIcon
File$ = ResolveRelativePath(Options_CurrentBasePath,ドル GetGadgetText(#GADGET_Option_IconName))
If Trim(File$) = ""
File$ = Options_CurrentBasePath$
EndIf
Pattern$ = Language("Compiler","IconPattern")
CompilerIf #CompileMac
; change .ico to .icns
Pattern$ = ReplaceString(Pattern,ドル "ico", "icns")
CompilerEndIf
File$ = OpenFileRequester(Language("Compiler","OpenIcon"), File,ドル Pattern,ドル 0)
If File$
If SelectedFilePattern() = 0 And GetExtensionPart(File$) = ""
CompilerIf #CompileWindows
Ext$ = "ico"
CompilerElse
Ext$ = "icns"
CompilerEndIf
File$ + "." + Ext$
EndIf
SetGadgetText(#GADGET_Option_IconName, CreateRelativePath(Options_CurrentBasePath,ドル File$))
EndIf
Case #GADGET_Option_UseIcon
Result = GetGadgetState(#GADGET_Option_UseIcon)
DisableGadget(#GADGET_Option_IconName , 1-Result)
DisableGadget(#GADGET_Option_SelectIcon, 1-Result)
Case #GADGET_Option_GetLinker
File$ = ResolveRelativePath(Options_CurrentBasePath,ドル GetGadgetText(#GADGET_Option_Linker))
If Trim(File$) = ""
File$ = Options_CurrentBasePath$
EndIf
File$ = OpenFileRequester(Language("Compiler","OpenLinkerFile"), File,ドル Language("Compiler","AllFilesPattern"), 0)
If File$
SetGadgetText(#GADGET_Option_Linker, CreateRelativePath(Options_CurrentBasePath,ドル File$))
EndIf
Case #GADGET_Option_SelectDebugger
DisableOptionGadgets()
Case #GADGET_Option_DebuggerMode
DisableOptionGadgets()
Case #GADGET_Option_SelectWarning
DisableOptionGadgets()
Case #GADGET_Option_SelectCurrentDir
If Trim(GetGadgetText(#GADGET_Option_CurrentDir)) = ""
Path$ = Options_CurrentBasePath$
Else
Path$ = ResolveRelativePath(Options_CurrentBasePath,ドル GetGadgetText(#GADGET_Option_CurrentDir))
EndIf
Path$ = PathRequester("", Path$)
If Path$
SetGadgetText(#GADGET_Option_CurrentDir, CreateRelativePath(Options_CurrentBasePath,ドル Path$))
EndIf
CompilerEndIf
Case #GADGET_Option_UseCompileCount
DisableOptionGadgets()
Case #GADGET_Option_UseBuildCount
DisableOptionGadgets()
Case #GADGET_Option_ConstantList
index = GetGadgetState(#GADGET_Option_ConstantList)
If index = -1
SetGadgetText(#GADGET_Option_ConstantLine, "")
Else
SetGadgetText(#GADGET_Option_ConstantLine, GetGadgetItemText(#GADGET_Option_ConstantList, index, 0))
EndIf
Case #GADGET_Option_ConstantAdd
Text$ = GetGadgetText(#GADGET_Option_ConstantLine)
index = CountGadgetItems(#GADGET_Option_ConstantList)
If Text$ <> "" And index < #MAX_Constants-1
AddGadgetItem(#GADGET_Option_ConstantList, index, Text$)
SetGadgetItemState(#GADGET_Option_ConstantList, index, #PB_ListIcon_Checked)
SetGadgetState(#GADGET_Option_ConstantList, index)
EndIf
Case #GADGET_Option_ConstantSet
Text$ = GetGadgetText(#GADGET_Option_ConstantLine)
index = GetGadgetState(#GADGET_Option_ConstantList)
If Text$ <> "" And index <> -1
SetGadgetItemText(#GADGET_Option_ConstantList, index, Text,ドル 0)
EndIf
Case #GADGET_Option_ConstantRemove
index = GetGadgetState(#GADGET_Option_ConstantList)
If index <> -1
RemoveGadgetItem(#GADGET_Option_ConstantList, index)
SetGadgetText(#GADGET_Option_ConstantLine, "")
EndIf
Case #GADGET_Option_ConstantClear
ClearGadgetItems(#GADGET_Option_ConstantList)
SetGadgetText(#GADGET_Option_ConstantLine, "")
Case #GADGET_Option_TargetList
State = GetGadgetState(#GADGET_Option_TargetList)
If State = -1
; we must have a selection, so select the default target
State = 0 ; fallback
ForEach ProjectOptionTargets()
If ProjectOptionTargets()\IsDefault
State = ListIndex(ProjectOptionTargets())
Break
EndIf
Next ProjectOptionTargets()
SetGadgetState(#GADGET_Option_TargetList, State)
EndIf
SelectElement(ProjectOptionTargets(), State)
; don't need to do anything when the selection did not change
If *Options_CurrentTarget <> @ProjectOptionTargets()
If *Options_CurrentTarget
GetTargetOptions(*Options_CurrentTarget) ; save old options
EndIf
*Options_CurrentTarget = @ProjectOptionTargets()
SetTargetOptions(*Options_CurrentTarget) ; set new options
EndIf
UpdateTargetGadgets()
; Display popupmenu if needed
If EventType() = #PB_EventType_RightClick
DisplayPopupMenu(#POPUPMENU_Options, WindowID(#WINDOW_Option))
EndIf
Case #GADGET_Option_AddTarget
Name$ = Trim(InputRequester(Language("Compiler","AddTarget"), Language("Compiler","EnterTargetName"), Language("Compiler","NewTargetName")))
If Name$
found = 0
ForEach ProjectOptionTargets()
If UCase(ProjectOptionTargets()\Name$) = Name$
found = 1
Break
EndIf
Next ProjectOptionTargets()
If found
MessageRequester(Language("Compiler","OptionsTitle"), Language("Compiler","NameExists"))
Else
If *Options_CurrentTarget
GetTargetOptions(*Options_CurrentTarget) ; save old options
EndIf
LastElement(ProjectOptionTargets())
AddElement(ProjectOptionTargets())
ProjectOptionTargets()\ID = GetUniqueID() ; already generate the unique id here (there is no harm if it the user aborts)
ProjectOptionTargets()\IsProject = #True
ProjectOptionTargets()\Name$ = Name$
ProjectOptionTargets()\IsEnabled = #True
ProjectOptionTargets()\IsDefault = #False
*Options_CurrentTarget = @ProjectOptionTargets()
SetTargetOptions(*Options_CurrentTarget)
AddGadgetItem(#GADGET_Option_TargetList, -1, Name,ドル ProjectTargetImage(@ProjectOptionTargets()))
SetGadgetState(#GADGET_Option_TargetList, CountGadgetItems(#GADGET_Option_TargetList)-1)
UpdateTargetGadgets()
EndIf
EndIf
Case #GADGET_Option_CopyTarget
State = GetGadgetState(#GADGET_Option_TargetList)
If State <> -1
SelectElement(ProjectOptionTargets(), State)
Name$ = Trim(InputRequester(Language("Compiler","CopyTarget"), Language("Compiler","EnterTargetName"), ProjectOptionTargets()\Name$ + " " + Language("Compiler", "TargetCopySuffix")))
If Name$
found = 0
ForEach ProjectOptionTargets()
If UCase(ProjectOptionTargets()\Name$) = Name$
found = 1
Break
EndIf
Next ProjectOptionTargets()
If found
MessageRequester(Language("Compiler","OptionsTitle"), Language("Compiler","NameExists"))
Else
If *Options_CurrentTarget
GetTargetOptions(*Options_CurrentTarget) ; save old options
EndIf
; Copy the whole structure to the end of the list
; We need a dummy temp element, as we cannot do CopyStructure across different elements else
SelectElement(ProjectOptionTargets(), State)
Temp.CompileTarget = ProjectOptionTargets()
LastElement(ProjectOptionTargets())
AddElement(ProjectOptionTargets())
ProjectOptionTargets() = Temp
ProjectOptionTargets()\ID = GetUniqueID() ; make sure the new target get its own unique id
ProjectOptionTargets()\Name$ = Name$
ProjectOptionTargets()\IsDefault = #False ; there can be only 1 default
*Options_CurrentTarget = @ProjectOptionTargets()
SetTargetOptions(*Options_CurrentTarget)
AddGadgetItem(#GADGET_Option_TargetList, -1, Name,ドル ProjectTargetImage(@ProjectOptionTargets()))
SetGadgetState(#GADGET_Option_TargetList, CountGadgetItems(#GADGET_Option_TargetList)-1)
UpdateTargetGadgets()
EndIf
EndIf
EndIf
Case #GADGET_Option_EditTarget
State = GetGadgetState(#GADGET_Option_TargetList)
If State <> -1
SelectElement(ProjectOptionTargets(), State)
Name$ = Trim(InputRequester(Language("Compiler","EditTarget"), Language("Compiler","EnterTargetName"), ProjectOptionTargets()\Name$))
If Name$ <> ""
ForEach ProjectOptionTargets()
If ListIndex(ProjectOptionTargets()) <> State And UCase(Name$) = UCase(ProjectOptionTargets()\Name$)
found = 1
Break
EndIf
Next ProjectOptionTargets()
SelectElement(ProjectOptionTargets(), State)
If found
MessageRequester(Language("Compiler","OptionsTitle"), Language("Compiler","NameExists"))
Else
ProjectOptionTargets()\Name$ = Name$
SetGadgetItemText(#GADGET_Option_TargetList, State, Name,ドル 0)
EndIf
EndIf
EndIf
Case #GADGET_Option_RemoveTarget
State = GetGadgetState(#GADGET_Option_TargetList)
; cannot delete the last target
If State <> -1 And ListSize(ProjectOptionTargets()) > 1 And MessageRequester(Language("Compiler","OptionsTitle"), Language("Compiler","ConfirmTargetDelete"), #PB_MessageRequester_YesNo|#FLAG_Question) = #PB_MessageRequester_Yes
If State > 0
NewState = State - 1
Else
NewState = 0
EndIf
SelectElement(ProjectOptionTargets(), State)
IsDefault = ProjectOptionTargets()\IsDefault
DeleteElement(ProjectOptionTargets())
RemoveGadgetItem(#GADGET_Option_TargetList, State)
; If the old target was the default, set a new one
If IsDefault
SelectElement(ProjectOptionTargets(), 0)
ProjectOptionTargets()\IsDefault = #True
SetGadgetItemImage(#GADGET_Option_TargetList, 0, ProjectTargetImage(@ProjectOptionTargets()))
EndIf
; We need a new current element always
;
SetGadgetState(#GADGET_Option_TargetList, NewState)
SelectElement(ProjectOptionTargets(), NewState)
*Options_CurrentTarget = @ProjectOptionTargets()
SetTargetOptions(*Options_CurrentTarget)
UpdateTargetGadgets()
EndIf
Case #GADGET_Option_TargetUp
State = GetGadgetState(#GADGET_Option_TargetList)
If State > 0
SelectElement(ProjectOptionTargets(), State)
*Current = @ProjectOptionTargets()
If PreviousElement(ProjectOptionTargets())
SwapElements(ProjectOptionTargets(), @ProjectOptionTargets(), *Current)
SelectElement(ProjectOptionTargets(), State-1)
SetGadgetItemText(#GADGET_Option_TargetList, State-1, ProjectOptionTargets()\Name,ドル 0)
SetGadgetItemImage(#GADGET_Option_TargetList, State-1, ProjectTargetImage(@ProjectOptionTargets()))
SelectElement(ProjectOptionTargets(), State)
SetGadgetItemText(#GADGET_Option_TargetList, State, ProjectOptionTargets()\Name,ドル 0)
SetGadgetItemImage(#GADGET_Option_TargetList, State, ProjectTargetImage(@ProjectOptionTargets()))
; We end up with the same selection as before, so no change in the displayed target
SetGadgetState(#GADGET_Option_TargetList, State-1)
UpdateTargetGadgets()
EndIf
EndIf
Case #GADGET_Option_TargetDown
State = GetGadgetState(#GADGET_Option_TargetList)
If State <> -1 And State < ListSize(ProjectOptionTargets())-1
SelectElement(ProjectOptionTargets(), State)
*Current = @ProjectOptionTargets()
If NextElement(ProjectOptionTargets())
SwapElements(ProjectOptionTargets(), @ProjectOptionTargets(), *Current)
SelectElement(ProjectOptionTargets(), State+1)
SetGadgetItemText(#GADGET_Option_TargetList, State+1, ProjectOptionTargets()\Name,ドル 0)
SetGadgetItemImage(#GADGET_Option_TargetList, State+1, ProjectTargetImage(@ProjectOptionTargets()))
SelectElement(ProjectOptionTargets(), State)
SetGadgetItemText(#GADGET_Option_TargetList, State, ProjectOptionTargets()\Name,ドル 0)
SetGadgetItemImage(#GADGET_Option_TargetList, State, ProjectTargetImage(@ProjectOptionTargets()))
; We end up with the same selection as before, so no change in the displayed target
SetGadgetState(#GADGET_Option_TargetList, State+1)
UpdateTargetGadgets()
EndIf
EndIf
Case #GADGET_Option_DefaultTarget, #GADGET_Option_DefaultTargetMenu
State = GetGadgetState(#GADGET_Option_TargetList)
If State <> -1
SelectElement(ProjectOptionTargets(), State)
Selected = GetGadgetState(#GADGET_Option_DefaultTarget)
; If it was menu action, the gadget state did not change, so reverse it ourselves
If GadgetID = #GADGET_Option_DefaultTargetMenu
Selected = 1-Selected
EndIf
If Selected
ProjectOptionTargets()\IsDefault = #True
SetGadgetItemImage(#GADGET_Option_TargetList, State, ProjectTargetImage(@ProjectOptionTargets()))
ForEach ProjectOptionTargets()
If ListIndex(ProjectOptionTargets()) <> State
ProjectOptionTargets()\IsDefault = #False
SetGadgetItemImage(#GADGET_Option_TargetList, ListIndex(ProjectOptionTargets()), ProjectTargetImage(@ProjectOptionTargets()))
EndIf
Next ProjectOptionTargets()
Else
If ListSize(ProjectOptionTargets()) = 1
SetGadgetState(#GADGET_Option_TargetList, #True) ; cannot unset this if it is the only target
Else
ProjectOptionTargets()\IsDefault = #False
SetGadgetItemImage(#GADGET_Option_TargetList, ListIndex(ProjectOptionTargets()), ProjectTargetImage(@ProjectOptionTargets()))
; select a different target as default, as there must always be one
If State = 0
NextElement(ProjectOptionTargets())
Else
FirstElement(ProjectOptionTargets())
EndIf
ProjectOptionTargets()\IsDefault = #True
SetGadgetItemImage(#GADGET_Option_TargetList, ListIndex(ProjectOptionTargets()), ProjectTargetImage(@ProjectOptionTargets()))
EndIf
EndIf
EndIf
UpdateTargetGadgets() ; sync the menu states
Case #GADGET_Option_TargetEnabled, #GADGET_Option_TargetEnabledMenu
State = GetGadgetState(#GADGET_Option_TargetList)
If State <> -1
SelectElement(ProjectOptionTargets(), State)
ProjectOptionTargets()\IsEnabled = GetGadgetState(#GADGET_Option_TargetEnabled)
; If it was menu action, the gadget state did not change, so reverse it ourselves
If GadgetID = #GADGET_Option_TargetEnabledMenu
ProjectOptionTargets()\IsEnabled = 1-ProjectOptionTargets()\IsEnabled
EndIf
SetGadgetItemImage(#GADGET_Option_TargetList, State, ProjectTargetImage(@ProjectOptionTargets()))
EndIf
UpdateTargetGadgets() ; sync the menu states
Case #GADGET_Option_OpenProject
OpenProjectOptions(#False) ; no new project
CompilerIf #CompileWindows And Not #SpiderBasic
Case #GADGET_Option_EnableAdmin
If GetGadgetState(#GADGET_Option_EnableAdmin)
SetGadgetState(#GADGET_Option_EnableUser, 0) ; both cannot be set at once
EndIf
Case #GADGET_Option_EnableUser
If GetGadgetState(#GADGET_Option_EnableUser)
SetGadgetState(#GADGET_Option_EnableAdmin, 0) ; both cannot be set at once
EndIf
Case #GADGET_Option_IncludeVersion
DisableOptionGadgets()
Case #GADGET_Option_ResourceAdd
File$ = GetGadgetText(#GADGET_Option_ResourceFile)
If File$ <> ""
AddGadgetItem(#GADGET_Option_ResourceList, -1, File$)
SetGadgetState(#GADGET_Option_ResourceList, CountGadgetItems(#GADGET_Option_ResourceList)-1)
SetGadgetText(#GADGET_Option_ResourceFile, "")
EndIf
Case #GADGET_Option_ResourceRemove
index = GetGadgetState(#GADGET_Option_ResourceList)
If index <> -1
RemoveGadgetItem(#GADGET_Option_ResourceList, index)
EndIf
Case #GADGET_Option_ResourceClear
ClearGadgetItems(#GADGET_Option_ResourceList)
Case #GADGET_Option_ResourceSelectFile
File$ = ResolveRelativePath(Options_CurrentBasePath,ドル GetGadgetText(#GADGET_Option_ResourceFile))
If File$ = ""
File$ = Options_CurrentBasePath$
EndIf
File$ = OpenFileRequester(Language("Resources","OpenResource"), File,ドル Language("Resources","ResourcePattern"), 0)
If File$ <> ""
SetGadgetText(#GADGET_Option_ResourceFile, CreateRelativePath(Options_CurrentBasePath,ドル File$))
EndIf
Case #GADGET_Option_Tokens
Text$ = ""
For i = 0 To 4
Text$ + Language("Resources","Token"+Str(i)) + #NewLine
Next i
Text$ + Language("Resources","DateTokens")
MessageRequester(Language("Resources","Tokens"), Text,ドル #FLAG_Info)
CompilerEndIf
EndSelect
EndSelect
If Quit = 1
If MemorizeWindow
If Options_IsProjectMode
OptionWindowDialog\Close(@ProjectOptionWindowPosition)
Else
OptionWindowDialog\Close(@OptionWindowPosition)
EndIf
Else
OptionWindowDialog\Close()
EndIf
; Re-enable this so the user can make changes again
DisableMenuItem(#MENU, #MENU_Debugger, #False)
UpdateProjectInfo()
EndIf
EndProcedure
Procedure UpdateOptionWindow()
; Update the compiler list
;
If GetGadgetState(#GADGET_Option_UseCompiler)
OldSelection$ = GetGadgetText(#GADGET_Option_SelectCompiler)
EndIf
ClearGadgetItems(#GADGET_Option_SelectCompiler)
AddGadgetItem(#GADGET_Option_SelectCompiler, -1, DefaultCompiler\VersionString$)
ForEach Compilers()
If Compilers()\Validated
AddGadgetItem(#GADGET_Option_SelectCompiler, -1, Compilers()\VersionString$)
SetGadgetItemData(#GADGET_Option_SelectCompiler, CountGadgetItems(#GADGET_Option_SelectCompiler)-1, @Compilers())
EndIf
Next Compilers()
If GetGadgetState(#GADGET_Option_UseCompiler)
; find a matching compiler
*Compiler.Compiler = FindCompiler(OldSelection$)
If *Compiler = 0
MessageRequester(#ProductName,ドル Language("Compiler","CompilerNotFound")+":"+#NewLine+OldSelection,ドル #FLAG_Warning)
SetGadgetState(#GADGET_Option_SelectCompiler, 0)
ElseIf *Compiler = @DefaultCompiler
SetGadgetState(#GADGET_Option_SelectCompiler, 0)
Else
; one of them must match, as FindCompiler() returned something
last = CountGadgetItems(#GADGET_Option_SelectCompiler)
For index = 1 To last
If GetGadgetItemData(#GADGET_Option_SelectCompiler, index) = *Compiler
SetGadgetState(#GADGET_Option_SelectCompiler, index)
Break
EndIf
Next index
EndIf
Else
SetGadgetState(#GADGET_Option_SelectCompiler, 0)
EndIf
If Options_IsProjectMode
; Re-apply the images for theme changes
;
SetGadgetAttribute(#GADGET_Option_AddTarget, #PB_Button_Image, ImageID(#IMAGE_Option_AddTarget))
SetGadgetAttribute(#GADGET_Option_EditTarget, #PB_Button_Image, ImageID(#IMAGE_Option_EditTarget))
SetGadgetAttribute(#GADGET_Option_CopyTarget, #PB_Button_Image, ImageID(#IMAGE_Option_CopyTarget))
SetGadgetAttribute(#GADGET_Option_RemoveTarget, #PB_Button_Image, ImageID(#IMAGE_Option_RemoveTarget))
SetGadgetAttribute(#GADGET_Option_TargetUp, #PB_Button_Image, ImageID(#IMAGE_Option_TargetUp))
SetGadgetAttribute(#GADGET_Option_TargetDown, #PB_Button_Image, ImageID(#IMAGE_Option_TargetDown))
GadgetToolTip(#GADGET_Option_AddTarget, Language("Compiler","AddTarget"))
GadgetToolTip(#GADGET_Option_EditTarget, Language("Compiler","RenameTarget"))
GadgetToolTip(#GADGET_Option_CopyTarget, Language("Compiler","CopyTarget"))
GadgetToolTip(#GADGET_Option_RemoveTarget, Language("Compiler","RemoveTarget"))
GadgetToolTip(#GADGET_Option_TargetUp, Language("Compiler","TargetUp"))
GadgetToolTip(#GADGET_Option_TargetDown, Language("Compiler","TargetDown"))
; Re-create the popup menu with new images/text
;
If EnableMenuIcons
*Popup = CreatePopupImageMenu(#POPUPMENU_Options)
Else
*Popup = CreatePopupMenu(#POPUPMENU_Options)
EndIf
; Re-use the gadget ids for the menu for simplicity (same as for the shortcuts)
If *Popup
MenuItem(#GADGET_Option_AddTarget, Language("Compiler","AddTarget"), ImageID(#IMAGE_Option_AddTarget))
MenuItem(#GADGET_Option_CopyTarget, Language("Compiler","CopyTarget"), ImageID(#IMAGE_Option_CopyTarget))
MenuItem(#GADGET_Option_EditTarget, Language("Compiler","EditTarget"), ImageID(#IMAGE_Option_EditTarget))
MenuBar()
MenuItem(#GADGET_Option_RemoveTarget, Language("Compiler","RemoveTarget"), ImageID(#IMAGE_Option_RemoveTarget))
MenuBar()
MenuItem(#GADGET_Option_TargetUp, Language("Compiler","TargetUp"), ImageID(#IMAGE_Option_TargetUp))
MenuItem(#GADGET_Option_TargetDown, Language("Compiler","TargetDown"), ImageID(#IMAGE_Option_TargetDown))
MenuBar()
MenuItem(#GADGET_Option_DefaultTargetMenu, Language("Compiler","DefaultTarget"))
MenuItem(#GADGET_Option_TargetEnabledMenu, Language("Compiler","EnableTarget"))
EndIf
; apply enabled/disabled states to this new popup menu
UpdateTargetGadgets()
; apply theme changes to the list of targets too
ForEach ProjectOptionTargets()
SetGadgetItemImage(#GADGET_Option_TargetList, ListIndex(ProjectOptionTargets()), ProjectTargetImage(@ProjectOptionTargets()))
Next ProjectOptionTargets()
EndIf
OptionWindowDialog\LanguageUpdate()
OptionWindowDialog\GuiUpdate()
EndProcedure
Loading...
举报
举报成功
我们将于2个工作日内通过站内信反馈结果给你!
请认真填写举报原因,尽可能描述详细。
请选择举报类型
取消
发送
误判申诉

此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。

如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。

取消
提交

简介

PureBasic是由Fantaisie Software所开发的商用BASIC程序语言及集成开发环境。特点是语法简单直接,不依赖运行时库,因此能编译出相当小巧的程序,包含命令列或GUI执行档、DLL等。而且不使用各系统的API,所以有高度的跨平台特性,支持Windows 32/64位元、Linux 32/64位元、Mac OS X、Amiga。
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
编辑仓库简介
简介内容
主页
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/PureBasic/purebasic.git
git@gitee.com:PureBasic/purebasic.git
PureBasic
purebasic
PureBASIC
devel
点此查找更多帮助

搜索帮助

评论
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册

AltStyle によって変換されたページ (->オリジナル) /