开源 企业版 高校版 私有云 模力方舟 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
codeviewer.pb 51.87 KB
一键复制 编辑 原始数据 按行查看 历史
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
; --------------------------------------------------------------------------------------------
; Copyright (c) Fantaisie Software and Gaetan DUPONT-PANON. 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.s FD_SelectCode(contentonly = 0, testcode = 0)
If Not contentonly
; HideGadget(#Form_ContDraw,1)
; DisableGadget(#Form_ContDraw,1)
; HideGadget(#Form_ContCode,0)
; DisableGadget(#Form_ContCode,0)
; TE_ClearGadgetItems(code_gadget)
EndIf
CleanImageList()
firstwindow = 1
NewList ContainerLevel.i()
NewList Procs.s()
NewList Img.FormImg()
NewList Fonts.fontlist()
NewList MenuVars.twostring()
windowvar.s = "" : gadgetvar.s = "" : imgvar.s = ""
windowenum.s = "" : gadgetenum.s = "" : imgenum.s = ""
menuenum.s = ""
cust_gadget_init.s = ""
imagecount.i = 0
toolbarcount = 0
statusbarcount = 0
fontcount = 0
scintilla = 0
codegenresize = 0
If FormWindows()\pbany
If windowvar <> ""
windowvar + ", "
EndIf
windowvar + FormWindows()\variable
Else
windowenum + " #" + FormWindows()\variable + #Endline
EndIf
ForEach FormWindows()\FormMenus()
If FormWindows()\FormMenus()\id <> ""
menuenum + " " + FormWindows()\FormMenus()\id + #Endline
AddElement(MenuVars())
MenuVars()\a = FormWindows()\FormMenus()\id
MenuVars()\b = FormWindows()\FormMenus()\event
EndIf
Next
ForEach FormWindows()\FormGadgets()
If FormWindows()\FormGadgets()\type = #Form_Type_Scintilla
scintilla = 1
EndIf
If FormWindows()\FormGadgets()\pbany
If gadgetvar <> ""
gadgetvar + ", "
EndIf
gadgetvar + FormWindows()\FormGadgets()\variable
Else
gadgetenum + " #" + FormWindows()\FormGadgets()\variable + #Endline
EndIf
If FormWindows()\FormGadgets()\cust_init <> ""
cust_gadget_init + "; " + Str(ListIndex(FormWindows()\FormGadgets())) + " Custom gadget initialisation (do Not remove this line)" + #Endline + FormWindows()\FormGadgets()\cust_init + #Endline
EndIf
If FormWindows()\FormGadgets()\gadgetfont <> ""
found = 0
ForEach Fonts()
If Fonts()\flags = FormWindows()\FormGadgets()\gadgetfontflags And Fonts()\name = FormWindows()\FormGadgets()\gadgetfont And Fonts()\size = FormWindows()\FormGadgets()\gadgetfontsize
found = 1
Break
EndIf
Next
If Not found
AddElement(Fonts())
Fonts()\flags = FormWindows()\FormGadgets()\gadgetfontflags
Fonts()\name = FormWindows()\FormGadgets()\gadgetfont
Fonts()\size = FormWindows()\FormGadgets()\gadgetfontsize
Fonts()\id = "#Font_" + FormWindows()\variable + "_" + Str(fontcount)
fontcount + 1
EndIf
EndIf
Next
ForEach FormWindows()\FormToolbars()
If FormWindows()\FormToolbars()\id <> ""
searchduplicate = 0
ForEach FormWindows()\FormMenus()
If FormWindows()\FormToolbars()\id = FormWindows()\FormMenus()\id
searchduplicate = 1
If FormWindows()\FormToolbars()\event <> ""
ForEach MenuVars()
If MenuVars()\a = FormWindows()\FormToolbars()\id
If MenuVars()\b = ""
MenuVars()\b = FormWindows()\FormToolbars()\event
EndIf
Break
EndIf
Next
EndIf
Break
EndIf
Next
If Not searchduplicate And Not FormWindows()\FormToolbars()\separator
menuenum + " " + FormWindows()\FormToolbars()\id + #Endline
LastElement(MenuVars())
AddElement(MenuVars())
MenuVars()\a = FormWindows()\FormToolbars()\id
MenuVars()\b = FormWindows()\FormToolbars()\event
EndIf
EndIf
Next
ForEach FormWindows()\FormImg()
AddElement(Img())
Img()\img = FormWindows()\FormImg()\img
If FormWindows()\FormImg()\pbany
Img()\id = "Img_" + FormWindows()\variable + "_" + Str(ListIndex(FormWindows()\FormImg()))
If imgvar <> ""
imgvar + ", "
EndIf
imgvar + Img()\id
Else
Img()\id = "#Img_" + FormWindows()\variable + "_" + Str(ListIndex(FormWindows()\FormImg()))
imgenum + " " + Img()\id + #Endline
EndIf
Img()\inline = FormWindows()\FormImg()\inline
Img()\pbany = FormWindows()\FormImg()\pbany
Next
content.s = ";" + #Endline +
"; This code is automatically generated by the Form Designer." + #Endline +
"; Manual modification is possible to adjust existing commands, but anything else will be dropped when the code is compiled." + #Endline +
"; Event procedures need to be put in another source file." + #Endline +
";" + #Endline + #Endline
If windowvar <> ""
content + "Global "+windowvar + #Endline
content + "" + #Endline
EndIf
If gadgetvar <> ""
content + "Global "+gadgetvar + #Endline
content + "" + #Endline
EndIf
If imgvar <> ""
content + "Global "+imgvar + #Endline
content + "" + #Endline
EndIf
If windowenum <> ""
content + "Enumeration FormWindow" + #Endline
content + windowenum
content + "EndEnumeration" + #Endline
content + "" + #Endline
EndIf
If gadgetenum <> ""
content + "Enumeration FormGadget" + #Endline
content + gadgetenum
content + "EndEnumeration" + #Endline
content + "" + #Endline
EndIf
If menuenum <> ""
content + "Enumeration FormMenu" + #Endline
content + menuenum
content + "EndEnumeration" + #Endline
content + "" + #Endline
EndIf
If imgenum <> ""
content + "Enumeration FormImage" + #Endline
content + imgenum
content + "EndEnumeration" + #Endline
content + "" + #Endline
EndIf
num = CountString(cust_gadget_init,#Endline)
If num
For i = 1 To num
content + StringField(cust_gadget_init,i,#Endline) + #Endline
Next
content + "" + #Endline
EndIf
If ListSize(Img())
;check if image decoder is required
jpgdecoder.b = 0 : pngdecoder.b = 0 : tgadecoder.b = 0 : tiffdecoder.b = 0
ForEach Img()
img.s = LCase(Img()\img)
If Not jpgdecoder And (FindString(img,"jpg") Or FindString(img,"jpeg"))
jpgdecoder = 1
EndIf
If Not pngdecoder And (FindString(img,"png"))
pngdecoder = 1
EndIf
If Not tgadecoder And (FindString(img,"tga"))
tgadecoder = 1
EndIf
If Not tiffdecoder And (FindString(img,"tiff"))
tiffdecoder = 1
EndIf
Next
If jpgdecoder
content + "UseJPEGImageDecoder()" + #Endline
EndIf
If pngdecoder
content + "UsePNGImageDecoder()" + #Endline
EndIf
If tgadecoder
content + "UseJTAImageDecoder()" + #Endline
EndIf
If tiffdecoder
content + "UseTIFFImageDecoder()" + #Endline
EndIf
If jpgdecoder Or pngdecoder Or tgadecoder Or tiffdecoder
content + "" + #Endline
EndIf
; load images
ForEach Img()
If Img()\pbany
If Img()\inline
image_id.s = Img()\id
If Left(image_id, 1) = "#"
image_id = Right(image_id, Len(image_id) - 1)
EndIf
content + Img()\id + " = CatchImage(#PB_Any,?" + image_id + ")" + #Endline
Else
content + Img()\id + " = LoadImage(#PB_Any,"+Chr(34)+Img()\img+Chr(34)+")" + #Endline
EndIf
Else
If Img()\inline
image_id.s = Img()\id
If Left(image_id, 1) = "#"
image_id = Right(image_id, Len(image_id) - 1)
EndIf
content + "CatchImage("+Img()\id+",?" + image_id + ")" + #Endline
Else
content + "LoadImage("+Img()\id+","+Chr(34)+Img()\img+Chr(34)+")" + #Endline
EndIf
EndIf
Next
content +"" + #Endline
EndIf
If ListSize(Fonts())
; enumeration of font ID
content +"Enumeration FormFont" + #Endline
ForEach Fonts()
content +" "+Fonts()\id + #Endline
Next
content +"EndEnumeration" + #Endline
content +"" + #Endline
; load fonts
ForEach Fonts()
flags.s = ""
If Fonts()\flags & FlagValue("#PB_Font_Bold")
flags + "#PB_Font_Bold"
EndIf
If Fonts()\flags & FlagValue("#PB_Font_Italic")
If flags <> ""
flags + " | "
EndIf
flags + "#PB_Font_Italic"
EndIf
If Fonts()\flags & FlagValue("#PB_Font_StrikeOut")
If flags <> ""
flags + " | "
EndIf
flags + "#PB_Font_StrikeOut"
EndIf
If Fonts()\flags & FlagValue("#PB_Font_Underline")
If flags <> ""
flags + " | "
EndIf
flags + "#PB_Font_Underline"
EndIf
If flags <> ""
flags = ", " + flags
EndIf
content + "LoadFont("+Fonts()\id+","+Chr(34)+Fonts()\name+Chr(34)+", "+Str(Fonts()\size)+flags+")" + #Endline
Next
content +"" + #Endline
EndIf
ForEach FormWindows()\FormGadgets()
; only declare callbacks for scintilla if user press run so that form can still be tested.
If FormWindows()\FormGadgets()\type = #Form_Type_Scintilla And testcode
If FormWindows()\FormGadgets()\caption <> "" And FormWindows()\FormGadgets()\caption <> "0"
content +"ProcedureDLL "+Left(FormWindows()\FormGadgets()\caption,Len(FormWindows()\FormGadgets()\caption)-1)+"Gadget, *scinotify.SCNotification)" + #Endline
content +" " + #Endline
content +"EndProcedure" + #Endline
content +"" + #Endline
EndIf
EndIf
Next
ForEach FormWindows()\FormGadgets()
If FormWindows()\FormGadgets()\lock_bottom Or FormWindows()\FormGadgets()\lock_right
codegenresize = 1
Break
EndIf
Next
If codegenresize
content + "Declare ResizeGadgets" + FormWindows()\variable + "()" + #Endline + #Endline
EndIf
; Declare all event procedures
; The map is used to easily remove duplicates, when a procedure is used for several gadgets.
; Menus
NewMap FormProcedures.s()
ForEach MenuVars()
If MenuVars()\b <> ""
procedurestring.s = "Declare " + MenuVars()\b + "(Event)" + #Endline
FormProcedures(procedurestring) = procedurestring
EndIf
Next
ForEach FormProcedures()
content + FormProcedures()
Next
ClearMap(FormProcedures())
; Gadgets
ForEach FormWindows()\FormGadgets()
If FormWindows()\FormGadgets()\event_proc
procedurestring.s = "Declare " + FormWindows()\FormGadgets()\event_proc + "(EventType)" + #Endline
FormProcedures(procedurestring) = procedurestring
EndIf
Next
ForEach FormProcedures()
content + FormProcedures()
Next
ClearMap(FormProcedures())
; Window
If FormWindows()\event_proc
procedurestring.s = "Declare " + FormWindows()\event_proc + "(Event, Window)" + #Endline
FormProcedures(procedurestring) = procedurestring
EndIf
ForEach FormProcedures()
content + FormProcedures()
Next
ClearMap(FormProcedures())
content + #Endline
If FormWindows()\pbany
winid.s = FormWindows()\variable
Else
winid.s = "#"+FormWindows()\variable
EndIf
ForEach ObjList()
If ObjList()\window = @FormWindows()
ForEach ContainerLevel()
If ObjList()\level <= ContainerLevel()
content + " CloseGadgetList()" + #Endline
DeleteElement(ContainerLevel())
EndIf
Next
If ObjList()\gadget
codepaddingy.s = ""
codepaddingheight.s = ""
If ObjList()\level <= 1
; add correct padding to gadget coordinates, only if they are in the window gadget list
codepaddingy.s = ""
If ListSize(FormWindows()\FormMenus())
;codepaddingy + "MenuHeight()"
codepaddingheight + " - MenuHeight()"
EndIf
If ListSize(FormWindows()\FormToolbars())
If codepaddingy <> ""
codepaddingy + " + "
EndIf
codepaddingy + "ToolBarHeight("+Str(toolbarcount - 1)+")"
codepaddingheight + " - ToolBarHeight("+Str(toolbarcount - 1)+")"
EndIf
If ListSize(FormWindows()\FormStatusbars())
codepaddingheight + " - StatusBarHeight("+Str(statusbarcount - 1)+")"
EndIf
If codepaddingy <> ""
codepaddingy + " + "
EndIf
EndIf
ChangeCurrentElement(FormWindows()\FormGadgets(),ObjList()\gadget)
If FormWindows()\FormGadgets()\type = #Form_Type_Custom
line.s = " "+FormWindows()\FormGadgets()\cust_create
If FormWindows()\FormGadgets()\pbany
line = ReplaceString(line,"%id%",FormWindows()\FormGadgets()\variable)
Else
line = ReplaceString(line,"%id%","#"+FormWindows()\FormGadgets()\variable)
EndIf
line = ReplaceString(line,"%x%",Str(DesktopUnscaledX(FormWindows()\FormGadgets()\x1)))
line = ReplaceString(line,"%y%",codepaddingy + Str(DesktopUnscaledY(FormWindows()\FormGadgets()\y1)))
line = ReplaceString(line,"%w%",Str(DesktopUnscaledX(FormWindows()\FormGadgets()\x2 - FormWindows()\FormGadgets()\x1)))
line = ReplaceString(line,"%h%",Str(DesktopUnscaledY(FormWindows()\FormGadgets()\y2 - FormWindows()\FormGadgets()\y1)))
If FormWindows()\FormGadgets()\pbany
line = ReplaceString(line,"%hwnd%",FormWindows()\FormGadgets()\variable)
Else
line = ReplaceString(line,"%hwnd%","#"+FormWindows()\FormGadgets()\variable)
EndIf
If FormWindows()\FormGadgets()\captionvariable
line = ReplaceString(line,"%txt%",FormWindows()\FormGadgets()\caption)
Else
line = ReplaceString(line,"%txt%",Chr(34)+FormWindows()\FormGadgets()\caption+Chr(34))
EndIf
content + " ; "+Str(ListIndex(FormWindows()\FormGadgets())) + " Custom gadget creation (do not remove this line) " + FormWindows()\FormGadgets()\cust_create + #Endline + line + #Endline
Else
If ObjList()\gadget_item > -1
Debug ObjList()\name
line.s = " AddGadgetItem("
SelectElement(FormWindows()\FormGadgets()\Items(),ObjList()\gadget_item)
If FormWindows()\FormGadgets()\pbany
line + FormWindows()\FormGadgets()\variable
Else
line + "#" + FormWindows()\FormGadgets()\variable
EndIf
If FormWindows()\FormGadgets()\type <> #Form_Type_Panel
itemstring.s = ReplaceString(ObjList()\name,"|",Chr(34) + " + Chr(10) + " + Chr(34))
Else
itemstring.s = ObjList()\name
EndIf
line + ", -1, "+Chr(34)+itemstring+Chr(34)
If FormWindows()\FormGadgets()\Items()\level > 0
line + ", 0, " + Str(FormWindows()\FormGadgets()\Items()\level)
EndIf
line + ")"
content + line + #Endline
Else
If FormWindows()\FormGadgets()\type = #Form_Type_Container Or FormWindows()\FormGadgets()\type = #Form_Type_Panel Or FormWindows()\FormGadgets()\type = #Form_Type_ScrollArea
AddElement(ContainerLevel())
ContainerLevel() = ObjList()\level
ElseIf FormWindows()\FormGadgets()\type = #Form_Type_Frame3D
If FormWindows()\FormGadgets()\flags & #PB_Frame_Container
AddElement(ContainerLevel())
ContainerLevel() = ObjList()\level
EndIf
EndIf
If FormWindows()\FormGadgets()\pbany
line.s = FormWindows()\FormGadgets()\variable + " = "
Else
line.s = ""
EndIf
Select FormWindows()\FormGadgets()\type ;{ procedure name
Case #Form_Type_Button
line + "ButtonGadget("
Case #Form_Type_ButtonImg
line + "ButtonImageGadget("
Case #Form_Type_StringGadget
line + "StringGadget("
Case #Form_Type_Checkbox
line + "CheckBoxGadget("
Case #Form_Type_Text
line + "TextGadget("
Case #Form_Type_Option
line + "OptionGadget("
Case #Form_Type_TreeGadget
line + "TreeGadget("
Case #Form_Type_ListView
line + "ListViewGadget("
Case #Form_Type_ListIcon
line + "ListIconGadget("
Case #Form_Type_Combo
line + "ComboBoxGadget("
Case #Form_Type_Spin
line + "SpinGadget("
Case #Form_Type_Trackbar
line + "TrackBarGadget("
Case #Form_Type_ProgressBar
line + "ProgressBarGadget("
Case #Form_Type_Img
line + "ImageGadget("
Case #Form_Type_IP
line + "IPAddressGadget("
Case #Form_Type_Scrollbar
line + "ScrollBarGadget("
Case #Form_Type_HyperLink
line + "HyperLinkGadget("
Case #Form_Type_Editor
line + "EditorGadget("
Case #Form_Type_ExplorerTree
line + "ExplorerTreeGadget("
Case #Form_Type_ExplorerList
line + "ExplorerListGadget("
Case #Form_Type_ExplorerCombo
line + "ExplorerComboGadget("
Case #Form_Type_Date
line + "DateGadget("
Case #Form_Type_Calendar
line + "CalendarGadget("
Case #Form_Type_Scintilla
line + "ScintillaGadget("
Case #Form_Type_Splitter
line + "SplitterGadget("
Case #Form_Type_Frame3D
line + "FrameGadget("
Case #Form_Type_ScrollArea
line + "ScrollAreaGadget("
Case #Form_Type_Web
line + "WebGadget("
Case #Form_Type_WebView
line + "WebViewGadget("
Case #Form_Type_Container
line + "ContainerGadget("
Case #Form_Type_Panel
line + "PanelGadget("
Case #Form_Type_Canvas
line + "CanvasGadget("
Case #Form_Type_OpenGL
line + "OpenGLGadget("
;}
EndSelect
If FormWindows()\FormGadgets()\pbany
variable.s = "#PB_Any"
Else
variable.s = "#" + FormWindows()\FormGadgets()\variable
EndIf
line.s + variable + ", "
linevars.s = ""
If FormWindows()\pbany
winvar.s = FormWindows()\variable
Else
winvar.s = "#" + FormWindows()\variable
EndIf
; x
If FormWindows()\FormGadgets()\lock_left ;{
linevars + Str(DesktopUnscaledX(FormWindows()\FormGadgets()\x1))+", "
Else
If FormWindows()\FormGadgets()\parent
PushListPosition(FormWindows()\FormGadgets())
FD_FindParent(FormWindows()\FormGadgets()\parent)
If FormWindows()\FormGadgets()\pbany
gadgetvar.s = FormWindows()\FormGadgets()\variable
Else
gadgetvar.s = "#" + FormWindows()\FormGadgets()\variable
EndIf
If FormWindows()\FormGadgets()\type = #Form_Type_Panel
linevars + "GetGadgetAttribute("+gadgetvar+",#PB_Panel_ItemWidth) - "
Else
linevars + "GadgetWidth("+gadgetvar+") - "
EndIf
tempvalue = FormWindows()\FormGadgets()\x2 - FormWindows()\FormGadgets()\x1
PopListPosition(FormWindows()\FormGadgets())
linevars + Str(DesktopUnscaledX(tempvalue - FormWindows()\FormGadgets()\x1)) + ", "
Else
linevars + "FormWindowWidth - " + Str(DesktopUnscaledX(FormWindows()\width - FormWindows()\FormGadgets()\x1))+", "
EndIf
EndIf ;}
; y
If FormWindows()\FormGadgets()\lock_top ;{
linevars + codepaddingy + Str(FormWindows()\FormGadgets()\y1)+", "
Else
If FormWindows()\FormGadgets()\parent
PushListPosition(FormWindows()\FormGadgets())
FD_FindParent(FormWindows()\FormGadgets()\parent)
If FormWindows()\FormGadgets()\pbany
gadgetvar.s = FormWindows()\FormGadgets()\variable
Else
gadgetvar.s = "#" + FormWindows()\FormGadgets()\variable
EndIf
If FormWindows()\FormGadgets()\type = #Form_Type_Panel
linevars + codepaddingy + "GetGadgetAttribute("+gadgetvar+",#PB_Panel_ItemHeight) - "
Else
linevars + codepaddingy + "GadgetHeight("+gadgetvar+") - "
EndIf
tempvalue = FormWindows()\FormGadgets()\y2 - FormWindows()\FormGadgets()\y1
If FormWindows()\FormGadgets()\type = #Form_Type_Panel
tempvalue - Panel_Height
EndIf
PopListPosition(FormWindows()\FormGadgets())
linevars + Str(tempvalue - FormWindows()\FormGadgets()\y1) + ", "
Else
linevars + codepaddingy + "FormWindowHeight - " + Str(FormWindows()\height - FormWindows()\FormGadgets()\y1)+", "
EndIf
EndIf ;}
; width
If FormWindows()\FormGadgets()\lock_right And FormWindows()\FormGadgets()\lock_left ;{
If FormWindows()\FormGadgets()\parent
PushListPosition(FormWindows()\FormGadgets())
FD_FindParent(FormWindows()\FormGadgets()\parent)
If FormWindows()\FormGadgets()\pbany
gadgetvar.s = FormWindows()\FormGadgets()\variable
Else
gadgetvar.s = "#" + FormWindows()\FormGadgets()\variable
EndIf
If FormWindows()\FormGadgets()\type = #Form_Type_Panel
linevars + "GetGadgetAttribute("+gadgetvar+",#PB_Panel_ItemWidth) - "
Else
linevars + "GadgetWidth("+gadgetvar+") - "
EndIf
tempvalue = FormWindows()\FormGadgets()\x2 - FormWindows()\FormGadgets()\x1
PopListPosition(FormWindows()\FormGadgets())
linevars + Str(DesktopUnscaledX(tempvalue - (FormWindows()\FormGadgets()\x2 - FormWindows()\FormGadgets()\x1))) + ", "
Else
linevars + "FormWindowWidth - " + Str(DesktopUnscaledX(FormWindows()\width - (FormWindows()\FormGadgets()\x2 - FormWindows()\FormGadgets()\x1)))+", "
EndIf
Else
linevars + Str(DesktopUnscaledX(FormWindows()\FormGadgets()\x2 - FormWindows()\FormGadgets()\x1))+", "
EndIf ;}
; height
If FormWindows()\FormGadgets()\lock_top And FormWindows()\FormGadgets()\lock_bottom ;{
If FormWindows()\FormGadgets()\parent
PushListPosition(FormWindows()\FormGadgets())
FD_FindParent(FormWindows()\FormGadgets()\parent)
If FormWindows()\FormGadgets()\pbany
gadgetvar.s = FormWindows()\FormGadgets()\variable
Else
gadgetvar.s = "#" + FormWindows()\FormGadgets()\variable
EndIf
If FormWindows()\FormGadgets()\type = #Form_Type_Panel
linevars + "GetGadgetAttribute("+gadgetvar+",#PB_Panel_ItemHeight) - "
Else
linevars + "GadgetHeight("+gadgetvar+") - "
EndIf
tempvalue = FormWindows()\FormGadgets()\y2 - FormWindows()\FormGadgets()\y1
If FormWindows()\FormGadgets()\type = #Form_Type_Panel
tempvalue - Panel_Height
EndIf
PopListPosition(FormWindows()\FormGadgets())
linevars + Str(tempvalue - (FormWindows()\FormGadgets()\y2 - FormWindows()\FormGadgets()\y1))
Else
value = FormWindows()\height - (FormWindows()\FormGadgets()\y2 - FormWindows()\FormGadgets()\y1)
If FormSkin <> #PB_OS_MacOS
value - bottompaddingsb - toptoolpadding
If ListSize(FormWindows()\FormMenus())
value - P_Menu
EndIf
Else
value - bottompaddingsb
EndIf
If codepaddingheight <> ""
linevars + "FormWindowHeight" + codepaddingheight + " - " + Str(value)
Else
linevars + "FormWindowHeight - " + Str(value)
EndIf
EndIf
Else
linevars + Str(FormWindows()\FormGadgets()\y2 - FormWindows()\FormGadgets()\y1)
EndIf ;}
line + Str(DesktopUnscaledX(FormWindows()\FormGadgets()\x1)) + ", " + codepaddingy + Str(DesktopUnscaledY(FormWindows()\FormGadgets()\y1)) + ", " + Str(DesktopUnscaledX(FormWindows()\FormGadgets()\x2 - FormWindows()\FormGadgets()\x1)) + ", " + Str(DesktopUnscaledY(FormWindows()\FormGadgets()\y2 - FormWindows()\FormGadgets()\y1))
If (FormWindows()\FormGadgets()\lock_right And FormWindows()\FormGadgets()\lock_left) Or
(FormWindows()\FormGadgets()\lock_top And FormWindows()\FormGadgets()\lock_bottom) Or
(Not FormWindows()\FormGadgets()\lock_top And FormWindows()\FormGadgets()\lock_bottom) Or
(FormWindows()\FormGadgets()\lock_right And Not FormWindows()\FormGadgets()\lock_left)
If FormWindows()\FormGadgets()\pbany
contentsize.s + " ResizeGadget(" + FormWindows()\FormGadgets()\variable + ", " + linevars + ")" + #Endline
Else
contentsize.s + " ResizeGadget(#" + FormWindows()\FormGadgets()\variable + ", " + linevars + ")" + #Endline
EndIf
EndIf
flags.s = ""
ForEach Gadgets()
If Gadgets()\type = FormWindows()\FormGadgets()\type
ForEach Gadgets()\Flags()
If FormWindows()\FormGadgets()\flags & Gadgets()\Flags()\ivalue
If flags <> ""
flags + " | "
EndIf
flags + Gadgets()\Flags()\name
EndIf
Next
EndIf
Next
If flags
flags = ", "+flags
EndIf
; add caption for the gadgets who requires it.
Select FormWindows()\FormGadgets()\type ;{
Case #Form_Type_Web, #Form_Type_Frame3D, #Form_Type_ExplorerCombo, #Form_Type_ExplorerList, #Form_Type_ExplorerTree, #Form_Type_HyperLink, #Form_Type_Button, #Form_Type_StringGadget, #Form_Type_Checkbox, #Form_Type_Text, #Form_Type_Option, #Form_Type_Date
If FormWindows()\FormGadgets()\captionvariable
If FormWindows()\FormGadgets()\caption = ""
line + ", "+Chr(34)+Chr(34)
Else
line + ", "+FormWindows()\FormGadgets()\caption
EndIf
Else
line + ", "+Chr(34)+FormWindows()\FormGadgets()\caption+Chr(34)
EndIf
EndSelect ;}
; additional parameters (min, max...)
Select FormWindows()\FormGadgets()\type ;{
Case #Form_Type_Date ;{
If flags <> ""
line + ", 0"
EndIf
;}
Case #Form_Type_ButtonImg ;{
img_id.s = ""
If FormWindows()\FormGadgets()\image
ChangeCurrentElement(FormWindows()\FormImg(),FormWindows()\FormGadgets()\image)
ForEach Img()
If Img()\img = FormWindows()\FormImg()\img
img_id = Img()\id
Break
EndIf
Next
EndIf
If img_id <> ""
line + ", ImageID("+img_id+")"
Else
line + ", 0"
EndIf
;}
Case #Form_Type_ListIcon ;{
If ListSize(FormWindows()\FormGadgets()\Columns())
FirstElement(FormWindows()\FormGadgets()\Columns())
line + ", " + Chr(34) + FormWindows()\FormGadgets()\Columns()\name + Chr(34) + ", " + Str(FormWindows()\FormGadgets()\Columns()\width)
Else
line + ", " + Chr(34) + Chr(34) + ", 100"
EndIf
;}
Case #Form_Type_Spin ;{
line + ", "+ Str(FormWindows()\FormGadgets()\min) +", " + Str(FormWindows()\FormGadgets()\max)
;}
Case #Form_Type_Trackbar ;{
line + ", "+ Str(FormWindows()\FormGadgets()\min) +", " + Str(FormWindows()\FormGadgets()\max)
;}
Case #Form_Type_ProgressBar ;{
line + ", "+ Str(FormWindows()\FormGadgets()\min) +", " + Str(FormWindows()\FormGadgets()\max)
;}
Case #Form_Type_Img ;{
img_id.s = ""
If FormWindows()\FormGadgets()\image
ChangeCurrentElement(FormWindows()\FormImg(),FormWindows()\FormGadgets()\image)
ForEach Img()
If Img()\img = FormWindows()\FormImg()\img
img_id = Img()\id
Break
EndIf
Next
EndIf
If img_id <> ""
line + ", ImageID("+img_id+")"
Else
line + ", 0"
EndIf
;}
Case #Form_Type_Scrollbar ;{
line + ", "+ Str(FormWindows()\FormGadgets()\min) +", " + Str(FormWindows()\FormGadgets()\max) + ", 0"
;}
Case #Form_Type_HyperLink ;{
line + ", 0"
;}
Case #Form_Type_Scintilla ;{
If FormWindows()\FormGadgets()\caption <> "" And FormWindows()\FormGadgets()\caption <> "0"
line + ", @"+FormWindows()\FormGadgets()\caption ; caption is in fact the callback
Else
line + ", 0"
EndIf
;}
Case #Form_Type_Splitter ;{
gadget1 = FormWindows()\FormGadgets()\gadget1
gadget2 = FormWindows()\FormGadgets()\gadget2
PushListPosition(FormWindows()\FormGadgets())
ForEach FormWindows()\FormGadgets()
If FormWindows()\FormGadgets()\itemnumber = gadget1
var1.s = FormWindows()\FormGadgets()\variable
If Not FormWindows()\FormGadgets()\pbany
var1 = "#" + var1
EndIf
EndIf
If FormWindows()\FormGadgets()\itemnumber = gadget2
var2.s = FormWindows()\FormGadgets()\variable
If Not FormWindows()\FormGadgets()\pbany
var2 = "#" + var2
EndIf
EndIf
Next
PopListPosition(FormWindows()\FormGadgets())
line + ", " + var1 + ", " + var2
;}
Case #Form_Type_ScrollArea ;{
line + ", "+ Str(FormWindows()\FormGadgets()\min) +", " + Str(FormWindows()\FormGadgets()\max) + ", 1"
;}
Case #Form_Type_Calendar ;{
line + ", 0"
;}
EndSelect ;}
line + flags + ")"
content + " "+line + #Endline
If FormWindows()\FormGadgets()\pbany
variable.s = FormWindows()\FormGadgets()\variable
Else
variable.s = "#" + FormWindows()\FormGadgets()\variable
EndIf
If FormWindows()\FormGadgets()\hidden
content + " HideGadget("+variable+", 1)" + #Endline
EndIf
If FormWindows()\FormGadgets()\tooltip <> ""
If FormWindows()\FormGadgets()\tooltipvariable
tooltip.s = FormWindows()\FormGadgets()\tooltip
Else
tooltip.s = Chr(34) + FormWindows()\FormGadgets()\tooltip + Chr(34)
EndIf
content + " GadgetToolTip(" + variable + ", " + tooltip + ")" + #Endline
EndIf
ForEach FormWindows()\FormGadgets()\Columns()
If ListIndex(FormWindows()\FormGadgets()\Columns()) = 0
Continue
EndIf
content + " AddGadgetColumn(" + variable + ", " + Str(ListIndex(FormWindows()\FormGadgets()\Columns())) + ", " + Chr(34) + FormWindows()\FormGadgets()\Columns()\name + Chr(34) + ", " + Str(FormWindows()\FormGadgets()\Columns()\width) + ")" + #Endline
Next
If FormWindows()\FormGadgets()\state
Select FormWindows()\FormGadgets()\type
Case #Form_Type_Checkbox
content + " SetGadgetState("+variable+", #PB_Checkbox_Checked)" + #Endline
Case #Form_Type_Option
content + " SetGadgetState("+variable+", 1)" + #Endline
Case #Form_Type_Splitter
content + " SetGadgetState("+variable+", "+Str(FormWindows()\FormGadgets()\state)+")" + #Endline
EndSelect
EndIf
If FormWindows()\FormGadgets()\frontcolor > -1
content + " SetGadgetColor("+variable+", #PB_Gadget_FrontColor,RGB("+Str(Red(FormWindows()\FormGadgets()\frontcolor))+","+Str(Green(FormWindows()\FormGadgets()\frontcolor))+","+Str(Blue(FormWindows()\FormGadgets()\frontcolor))+"))" + #Endline
EndIf
If FormWindows()\FormGadgets()\backcolor > -1
content + " SetGadgetColor("+variable+", #PB_Gadget_BackColor,RGB("+Str(Red(FormWindows()\FormGadgets()\backcolor))+","+Str(Green(FormWindows()\FormGadgets()\backcolor))+","+Str(Blue(FormWindows()\FormGadgets()\backcolor))+"))" + #Endline
EndIf
If FormWindows()\FormGadgets()\gadgetfont <> ""
ForEach Fonts()
If Fonts()\flags = FormWindows()\FormGadgets()\gadgetfontflags And Fonts()\name = FormWindows()\FormGadgets()\gadgetfont And Fonts()\size = FormWindows()\FormGadgets()\gadgetfontsize
Break
EndIf
Next
content + " SetGadgetFont("+variable+", FontID("+Fonts()\id+"))" + #Endline
EndIf
If FormWindows()\FormGadgets()\disabled
content + " DisableGadget("+variable+", 1)" + #Endline
EndIf
EndIf
EndIf
Else
If Not firstwindow
content +"EndProcedure" + #Endline
content +"" + #Endline
Else
firstwindow = 0
EndIf
If FormWindows()\x = -65535
winx.s = "#PB_Ignore"
Else
winx.s = Str(DesktopUnscaledX(FormWindows()\x))
EndIf
If FormWindows()\y = -65535
winy.s = "#PB_Ignore"
Else
winy.s = Str(DesktopUnscaledY(FormWindows()\y))
EndIf
content +"Procedure Open"+FormWindows()\variable+"(x = " + winx + ", y = " + winy + ", width = " + Str(DesktopUnscaledX(FormWindows()\width)) + ", height = " + Str(DesktopUnscaledY(FormWindows()\height)) + ")" + #Endline
AddElement(Procs())
Procs() = "Open"+FormWindows()\variable+"()"
flags.s = ""
ForEach Gadgets()
If Gadgets()\type = #Form_Type_Window
ForEach Gadgets()\Flags()
If FormWindows()\flags & Gadgets()\Flags()\ivalue
If flags <> ""
flags + " | "
EndIf
flags + Gadgets()\Flags()\name
EndIf
Next
ForEach FormWindows()\FormCustomFlags()
If flags <> ""
flags + " | "
EndIf
flags + FormWindows()\FormCustomFlags()
Next
EndIf
Next
If flags
flags = ", "+flags
EndIf
If FormWindows()\pbany
variable.s = FormWindows()\variable
line.s = " "+FormWindows()\variable+" = OpenWindow(#PB_Any, x, y, width, height, "
If FormWindows()\captionvariable
If FormWindows()\caption = ""
line + Chr(34)+Chr(34)
Else
line + FormWindows()\caption
EndIf
Else
line + Chr(34)+FormWindows()\caption+Chr(34)
EndIf
Else
variable.s = "#"+FormWindows()\variable
line.s = " OpenWindow("+variable+", x, y, width, height, "
If FormWindows()\captionvariable
line + FormWindows()\caption
Else
line + Chr(34)+FormWindows()\caption+Chr(34)
EndIf
EndIf
line + flags
; Add parent
If FormWindows()\parent
If flags = ""
line + ", 0, "
Else
line + ", "
EndIf
If Asc(FormWindows()\parent) <> '='
line + "WindowID(" + FormWindows()\parent + ")"
Else
line + LTrim(FormWindows()\parent, "=")
EndIf
EndIf
line + ")"
content + line + #Endline
If FormWindows()\hidden
content + " HideWindow("+variable+", 1)" + #Endline
EndIf
If FormWindows()\disabled
content + " DisableWindow("+variable+", 1)" + #Endline
EndIf
If FormWindows()\color > -1
content + " SetWindowColor("+variable+", RGB("+Str(Red(FormWindows()\color))+","+Str(Green(FormWindows()\color))+","+Str(Blue(FormWindows()\color))+"))" + #Endline
EndIf
addemptyline = 0
ForEach FormWindows()\FormMenus()
If FormWindows()\FormMenus()\shortcut <> ""
addemptyline = 1
If FindString(FormWindows()\FormMenus()\shortcut,"+")
mod.s = Trim(StringField(FormWindows()\FormMenus()\shortcut,1,"+"))
Select LCase(mod) ; Use LCase() so it works with CTRL, Ctrl, etc. https://www.purebasic.fr/english/viewtopic.php?f=4&t=71127
Case "cmd"
mod = "Command"
Case "ctrl"
mod = "Control"
Case "strg"
mod = "Control"
EndSelect
shortcut.s = Trim(StringField(FormWindows()\FormMenus()\shortcut,2,"+"))
content + " AddKeyboardShortcut("+ winid + ", #PB_Shortcut_" + mod + " | #PB_Shortcut_" + shortcut + ", " + FormWindows()\FormMenus()\id + ")" + #Endline
Else
content + " AddKeyboardShortcut("+ winid + ", #PB_Shortcut_" + FormWindows()\FormMenus()\shortcut + ", " + FormWindows()\FormMenus()\id + ")" + #Endline
EndIf
EndIf
Next
If addemptyline
content + #Endline
EndIf
If ListSize(FormWindows()\FormToolbars())
content + " CreateToolbar("+Str(toolbarcount)+", WindowID("+variable+"))" + #Endline
toolbarcount + 1
ForEach FormWindows()\FormToolbars()
If FormWindows()\FormToolbars()\separator
content + " ToolBarSeparator()" + #Endline
Else
img_id.s = ""
If FormWindows()\FormToolbars()\img
ChangeCurrentElement(FormWindows()\FormImg(),FormWindows()\FormToolbars()\img)
ForEach Img()
If Img()\img = FormWindows()\FormImg()\img
img_id = Img()\id
Break
EndIf
Next
EndIf
line.s = " ToolBarImageButton("+FormWindows()\FormToolbars()\id+",ImageID("+img_id+")"
If FormWindows()\FormToolbars()\toggle
line + ", #PB_ToolBar_Toggle"
EndIf
line + ")"
content + line + #Endline
If FormWindows()\FormToolbars()\tooltip <> ""
content + " ToolBarToolTip("+Str(toolbarcount - 1)+", "+FormWindows()\FormToolbars()\id+", "+Chr(34)+FormWindows()\FormToolbars()\tooltip+Chr(34) + ")" + #Endline
EndIf
EndIf
Next
EndIf
If ListSize(FormWindows()\FormStatusbars())
content + " CreateStatusBar("+Str(statusbarcount)+", WindowID("+variable+"))" + #Endline
ForEach FormWindows()\FormStatusbars()
If FormWindows()\FormStatusbars()\width = -1
content + " AddStatusBarField(#PB_Ignore)" + #Endline
Else
content + " AddStatusBarField("+Str(FormWindows()\FormStatusbars()\width)+")" + #Endline
EndIf
flags.s = ""
If FormWindows()\FormStatusbars()\flags & FlagValue("#PB_StatusBar_BorderLess")
flags.s + "#PB_StatusBar_BorderLess"
EndIf
If FormWindows()\FormStatusbars()\flags & FlagValue("#PB_StatusBar_Center")
If flags <> ""
flags + " | "
EndIf
flags.s + "#PB_StatusBar_Center"
EndIf
If FormWindows()\FormStatusbars()\flags & FlagValue("#PB_StatusBar_Raised")
If flags <> ""
flags + " | "
EndIf
flags.s + "#PB_StatusBar_Raised"
EndIf
If FormWindows()\FormStatusbars()\flags & FlagValue("#PB_StatusBar_Right")
If flags <> ""
flags + " | "
EndIf
flags.s + "#PB_StatusBar_Right"
EndIf
If flags <> ""
flags = ", " + flags
EndIf
If FormWindows()\FormStatusbars()\text <> ""
content + " StatusBarText("+Str(statusbarcount)+", "+Str(ListIndex(FormWindows()\FormStatusbars()))+", "+Chr(34)+FormWindows()\FormStatusbars()\text+Chr(34)+flags+")" + #Endline
ElseIf FormWindows()\FormStatusbars()\img
ChangeCurrentElement(FormWindows()\FormImg(),FormWindows()\FormStatusbars()\img)
ForEach Img()
If Img()\img = FormWindows()\FormImg()\img
img_id = Img()\id
Break
EndIf
Next
content + " StatusBarImage("+Str(statusbarcount)+", "+Str(ListIndex(FormWindows()\FormStatusbars()))+", ImageID("+img_id+")"+flags+")" + #Endline
ElseIf FormWindows()\FormStatusbars()\progressbar > 0
content + " StatusBarProgress("+Str(statusbarcount)+", "+Str(ListIndex(FormWindows()\FormStatusbars()))+", 0"+flags+")" + #Endline
EndIf
Next
statusbarcount + 1
EndIf
If ListSize(FormWindows()\FormMenus())
found = 0
ForEach FormWindows()\FormMenus()
If FormWindows()\FormMenus()\icon
found = 1
Break
EndIf
Next
If found
content + " CreateImageMenu("+Str(menucount)+", WindowID("+variable+"))" + #Endline
Else
content + " CreateMenu("+Str(menucount)+", WindowID("+variable+"))" + #Endline
EndIf
menucount + 1
level = 1
ForEach FormWindows()\FormMenus()
If FormWindows()\FormMenus()\separator
content + " MenuBar()" + #Endline
Else
Select FormWindows()\FormMenus()\level
Case 0
For finishlevel = level To 2 Step -1
content + " CloseSubMenu()" + #Endline
Next
content + " MenuTitle("+Chr(34)+FormWindows()\FormMenus()\item+Chr(34)+")" + #Endline
level = FormWindows()\FormMenus()\level
Default
thislevel = FormWindows()\FormMenus()\level
PushListPosition(FormWindows()\FormMenus())
next_item = 0
If NextElement(FormWindows()\FormMenus())
If FormWindows()\FormMenus()\level > thislevel And FormWindows()\FormMenus()\level<>5
next_item = 1
EndIf
EndIf
PopListPosition(FormWindows()\FormMenus())
If next_item
content + " OpenSubMenu("+Chr(34)+FormWindows()\FormMenus()\item+Chr(34)+")" + #Endline
Else
If FormWindows()\FormMenus()\level < level
content + " CloseSubMenu()" + #Endline
content + " MenuItem("+FormWindows()\FormMenus()\id+", "+Chr(34)+FormWindows()\FormMenus()\item+Chr(34)
Else
content + " MenuItem("+FormWindows()\FormMenus()\id+", "+Chr(34)+FormWindows()\FormMenus()\item+Chr(34)
EndIf
If FormWindows()\FormMenus()\shortcut <> ""
content + " + Chr(9) + " + Chr(34) + FormWindows()\FormMenus()\shortcut + Chr(34)
EndIf
img_id.s = ""
If FormWindows()\FormMenus()\icon
ChangeCurrentElement(FormWindows()\FormImg(),FormWindows()\FormMenus()\icon)
ForEach Img()
If Img()\img = FormWindows()\FormImg()\img
img_id = Img()\id
Break
EndIf
Next
EndIf
If img_id <> ""
content + ", ImageID("+img_id+")"
EndIf
content + ")" + #Endline
EndIf
level = FormWindows()\FormMenus()\level
EndSelect
EndIf
Next
For finishlevel = level To 2 Step -1
content + " CloseSubMenu()" + #Endline
Next
EndIf
EndIf
EndIf
Next
ForEach ContainerLevel()
content + " CloseGadgetList()" + #Endline
DeleteElement(ContainerLevel())
Next
content +"EndProcedure" + #Endline + #Endline
If codegenresize
content + "Procedure ResizeGadgets" + FormWindows()\variable + "()" + #Endline
content + " Protected FormWindowWidth, FormWindowHeight" + #Endline
If FormWindows()\pbany
variable.s = FormWindows()\variable
Else
variable.s = "#"+FormWindows()\variable
EndIf
content + " FormWindowWidth = WindowWidth(" + variable + ")" + #Endline
content + " FormWindowHeight = WindowHeight(" + variable + ")" + #Endline
content + contentsize + "EndProcedure" + #Endline + #Endline
EndIf
; Events procedure
If (FormWindows()\generateeventloop And FormEventProcedure) Or testcode
content + "Procedure " + FormWindows()\variable + "_Events(event)" + #Endline
content + " Select event" + #Endline
If codegenresize
content + " Case #PB_Event_SizeWindow" + #Endline
content + " ResizeGadgets" + FormWindows()\variable + "()" + #Endline
EndIf
content + " Case #PB_Event_CloseWindow" + #Endline
content + " ProcedureReturn #False" + #Endline + #Endline
content + " Case #PB_Event_Menu" + #Endline
content + " Select EventMenu()" + #Endline
ForEach MenuVars()
content + " Case " + MenuVars()\a + #Endline
If MenuVars()\b <> ""
content + " " + MenuVars()\b + "(EventMenu())" + #Endline
EndIf
Next
content + " EndSelect" + #Endline + #Endline
content + " Case #PB_Event_Gadget" + #Endline
content + " Select EventGadget()" + #Endline
ForEach FormWindows()\FormGadgets()
If FormWindows()\FormGadgets()\event_proc
If FormWindows()\FormGadgets()\pbany
var.s = FormWindows()\FormGadgets()\variable
Else
var.s = "#"+FormWindows()\FormGadgets()\variable
EndIf
content + " Case " + var + #Endline
content + " " + FormWindows()\FormGadgets()\event_proc + "(EventType())"
content + " " + #Endline
EndIf
Next
content +" EndSelect" + #Endline
If FormWindows()\event_proc
If FormWindows()\pbany
var.s = FormWindows()\variable
Else
var.s = "#"+FormWindows()\variable
EndIf
content +" Default" + #Endline
content +" " + FormWindows()\event_proc + "(event,"+var+")" + #Endline
EndIf
content +" EndSelect" + #Endline
content +" ProcedureReturn #True" + #Endline
content + "EndProcedure" + #Endline
content + "" + #Endline
EndIf
If testcode
; Declare all event procedures
;
; Menus
ForEach MenuVars()
If MenuVars()\b <> ""
content + "Procedure " + MenuVars()\b + "(Event) : EndProcedure" + #Endline
EndIf
Next
; Gadgets
ForEach FormWindows()\FormGadgets()
If FormWindows()\FormGadgets()\event_proc
content + "Procedure " + FormWindows()\FormGadgets()\event_proc + "(EventType) : EndProcedure" + #Endline
EndIf
Next
; Window
If FormWindows()\event_proc
content +"Procedure " + FormWindows()\event_proc + "(Event, Window) : EndProcedure" + #Endline
EndIf
EndIf
If testcode
content + "Open"+FormWindows()\variable+"()" + #Endline + #Endline
content + "Repeat" + #Endline + " event = WaitWindowEvent()" + #Endline
content + "Until " + FormWindows()\variable + "_Events(event) = #False" + #Endline + #Endline + "End"
EndIf
inline = 0
ForEach Img()
If Img()\inline
content + #Endline + #Endline + "DataSection" + #Endline
inline = 1
Break
EndIf
Next
ForEach Img()
If Img()\inline
image_id.s = Img()\id
If Left(image_id, 1) = "#"
image_id = Right(image_id, Len(image_id) - 1)
EndIf
content +" " + image_id + ": : IncludeBinary "+Chr(34)+Img()\img+Chr(34) + #Endline
EndIf
Next
If inline
content +"EndDataSection" + #Endline
EndIf
If Not contentonly
num = CountString(content,#Endline)
For i = 1 To num
;TE_AddGadgetItem(code_gadget,-1,StringField(content,i,#Endline))
Next
; TE_RemoveGadgetItem(code_gadget,0)
; num = TE_CountGadgetItems(code_gadget) - 1
EndIf
If contentonly
ProcedureReturn content
Else
ProcedureReturn ""
EndIf
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 によって変換されたページ (->オリジナル) /