PowerBuilder Progress Bar
Source Code Example
Datawindow d_progress
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | release 10.5; datawindow(units=0 timer_interval=0 color=78748035 processing=0 HTMLDW=no print.printername="" print.documentname="" print.orientation = 0 print.margin.left = 107 print.margin.right = 107 print.margin.top = 97 print.margin.bottom = 97 print.paper.source = 0 print.paper.size = 0 print.canusedefaultprinter=yes print.prompt=no print.buttons=no print.preview.buttons=no print.cliptext=no print.overrideprintjob=no print.collate=yes print.preview.outline=yes hidegrayline=no ) header(height=84 color="536870912" ) summary(height=0 color="536870912" ) footer(height=0 color="536870912" ) detail(height=0 color="536870912" ) table(column=(type=char(1000) updatewhereclause=no name=pct dbname="pct" initial="0" ) ) rectangle(band=header x="0" y="0" height="92" width="1006" name=progress_rect visible="1~t0" brush.hatch="6" brush.color="16711680" pen.style="5" pen.width="5" pen.color="553648127" background.mode="2" background.color="33554432" ) column(band=header id=1 alignment="2" tabsequence=32766 border="0" color="33554432" x="0" y="0" height="80" width="142" format="[General]" html.valueishtml="0" name=pct visible="1~t0" edit.limit=0 edit.case=any edit.focusrectangle=no edit.autoselect=no edit.displayonly=yes font.face="MS Sans Serif" font.height="-8" font.weight="700" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="553648127" ) htmltable(border="0" ) htmlgen(clientevents="1" clientvalidation="1" clientcomputedfields="1" clientformatting="0" clientscriptable="0" generatejavascript="1" encodeselflinkargs="1" netscapelayers="0" pagingmethod=0 generatedddwframes="1" ) xhtmlgen() cssgen(sessionspecific="0" ) xmlgen(inline="0" ) xsltgen() jsgen() export.xml(headgroups="1" includewhitespace="0" metadatatype=0 savemetadata=0 ) import.xml() export.pdf(method=0 distill.custompostscript="0" xslfop.print="0" ) export.xhtml() |
nvo_infoattrib from nonvisualobject
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | forward global type nvo_infoattrib from nonvisualobject end type end forward global type nvo_infoattrib from nonvisualobject autoinstantiate end type type variables String is_name String is_description end variables on nvo_infoattrib.create call super::create TriggerEvent( this, "constructor" ) end on on nvo_infoattrib.destroy TriggerEvent( this, "destructor" ) call super::destroy end on |
uo_progressbar from userobject
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 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 | forward global type uo_progressbar from userobject end type type dw_progress from datawindow within uo_progressbar end type end forward global type uo_progressbar from userobject integer width = 1170 integer height = 72 long backcolor = 74481808 long tabbackcolor = 74481808 dw_progress dw_progress end type global uo_progressbar uo_progressbar type variables Public: // display style Constant Integer BAR = 0 Constant Integer PCTCOMPLETE = 1 Constant Integer Position = 2 Constant Integer MSGTEXT = 3 // fill style Constant Integer LEFTRIGHT = 0 Constant Integer RIGHTLEFT = 1 Constant Integer TOPDOWN = 2 Constant Integer BOTTOMUP = 3 Protected: Boolean ib_autoreset = True Integer ii_displaystyle = BAR //0=just the bar/1=% complete/2=#complete/3=text from settext Integer ii_fillstyle = LEFTRIGHT //topdown = 2/bottomup=3/leftright=0/rightleft=1 Integer ii_maximum = 100 Integer ii_minimum = 0 Integer ii_step = 10 Integer ii_percentcomplete Integer ii_position Integer ii_msgtextcount Long il_fillcolor = 16668075 // blue Long il_textcolor = 0 // black Long il_backcolor = 78682240 // buttonface String is_msgtext[] end variables forward prototypes public function integer of_getdisplaystyle () public function integer of_getmaximum () public function integer of_getminimum () public function integer of_getposition () public function integer of_getstep () public function long of_getfillcolor () public function integer of_setposition (integer ai_position) public function string of_setfontbold (boolean ab_bold) public function string of_setfontitalic (boolean ab_italic) public function string of_setfontunderline (boolean ab_underline) public function string of_setfontface (string as_fontface) public function string of_setfontfamily (fontfamily aff_fontfamily) public function string of_setfontpitch (fontpitch afp_fontpitch) public function integer of_setmaximum (integer ai_maximum) public function integer of_setminimum (integer ai_minimum) public function integer of_setstep (integer ai_step) public function integer of_setfillcolor (long al_fillcolor) public function integer of_setfillstyle (integer ai_fillstyle) public function integer of_getfillstyle () public function integer of_reset () public function integer of_setdisplaystyle (integer ai_displaystyle) public function string of_getcurrenttext () public function integer of_increment (integer ai_inc) public function integer of_increment () protected function integer of_updatevisuals (decimal adc_completion) public function string of_setfontsize (integer ai_fontsize) protected function string of_setfont (string as_fontface, integer ai_fontsize, integer ai_fontcharset, fontfamily aff_fontfamily, fontpitch afp_fontpitch, boolean ab_bold, boolean ab_italic, boolean ab_underline) public function string of_setfontcharset (integer ai_fontcharset) public function integer of_setautoreset (boolean ab_switch) public function boolean of_isautoreset () public function integer of_setmessagetext (string as_msgtext[]) public function integer of_settextcolor (long al_textcolor) public function long of_gettextcolor () public function long of_getbackcolor () public function integer of_setbackcolor (long al_backcolor) public function integer of_getmessagetext (ref string as_messagetext[]) public function integer of_getpctcomplete () public function integer of_getinfo (ref nvo_infoattrib anv_infoattrib) end prototypes public function integer of_getdisplaystyle ();//==================================================================== // Function: uo_progressbar.of_getdisplaystyle() //-------------------------------------------------------------------- // Description: Returns the display style of the progress bar //-------------------------------------------------------------------- // Arguments: //-------------------------------------------------------------------- // Returns: integer // the display style of the progress bar // 0=just the bar // 1=% complete // 2=position // 3=text from settext //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== Return ii_displaystyle end function public function integer of_getmaximum ();//==================================================================== // Function: uo_progressbar.of_getmaximum() //-------------------------------------------------------------------- // Description: Returns the maximum value the progress bar will increment to //-------------------------------------------------------------------- // Arguments: //-------------------------------------------------------------------- // Returns: integer the maximum value the progress bar will increment to //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== Return ii_maximum end function public function integer of_getminimum ();//==================================================================== // Function: uo_progressbar.of_getminimum() //-------------------------------------------------------------------- // Description: Return the minumum value progress bar will start from //-------------------------------------------------------------------- // Arguments: //-------------------------------------------------------------------- // Returns: integer the minimum value the progress bar starts from //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== Return ii_minimum end function public function integer of_getposition ();//==================================================================== // Function: uo_progressbar.of_getposition() //-------------------------------------------------------------------- // Description: Returns the currently incremented position of the progress bar //-------------------------------------------------------------------- // Arguments: //-------------------------------------------------------------------- // Returns: integer the incremented position of the progress bar (between minimum and maximum) //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== Return ii_position end function public function integer of_getstep ();//==================================================================== // Function: uo_progressbar.of_getstep() //-------------------------------------------------------------------- // Description: Returns the step value to use during a default increment process //-------------------------------------------------------------------- // Arguments: //-------------------------------------------------------------------- // Returns: integer the step value of the increment if default value is to be used //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== Return ii_step end function public function long of_getfillcolor ();//==================================================================== // Function: uo_progressbar.of_getfillcolor() //-------------------------------------------------------------------- // Description: Returns the color the progress bar fills up with. //-------------------------------------------------------------------- // Arguments: //-------------------------------------------------------------------- // Returns: long the color the progressbar will fill with //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== Return il_fillcolor end function public function integer of_setposition (integer ai_position);//==================================================================== // Function: uo_progressbar.of_setposition() //-------------------------------------------------------------------- // Description: Sets the current position of the progress bar //-------------------------------------------------------------------- // Arguments: // integer ai_position the position the progress bar //-------------------------------------------------------------------- // Returns: integer SUCCESS = the current position of the progress bar ERROR = -1 //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== Decimal ldc_completion Integer li_rc If IsNull(ai_position) Then Return -1 End If // If this is less than the minimum, the current position is set to the minimum If ai_position < ii_minimum Then ai_position = ii_minimum End If // If this is greater than the maximum, the current position is set to the maximum If ai_position > ii_maximum Then ai_position = ii_maximum End If ii_position = ai_position dw_progress.SetRedraw(False) // if maximum value is zero we are completed (prevents divide by zero) // or if completion result will be greater than 1 then make it 1 // otherwise find our completion percentage If (ii_maximum = 0) Or (ii_position > ii_maximum) Then ldc_completion = 1 Else // turn on the progress rectangle and percentage text if style uses it dw_progress.Object.pct.Visible = 1 dw_progress.Object.progress_rect.Visible = 1 ldc_completion = ii_position / ii_maximum ii_percentcomplete = ldc_completion * 100 End If li_rc = of_updatevisuals(ldc_completion) dw_progress.SetRedraw(True) // turn off progressbar after it reaches 100% If ldc_completion >= 1 And ib_autoreset Then This.Post Function of_reset() End If If li_rc < 0 Then Return li_rc Else Return ii_position End If end function public function string of_setfontbold (boolean ab_bold);//==================================================================== // Function: uo_progressbar.of_setfontbold() //-------------------------------------------------------------------- // Description: Sets the progress bar text attribute to bold/not bold //-------------------------------------------------------------------- // Arguments: // boolean ab_bold true if progress bar text should be bold //-------------------------------------------------------------------- // Returns: string The output of the Modify command (the error text or "") //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== String ls_fontface Integer li_fontsize, li_fontcharset FontFamily lff_fontfamily FontPitch lfp_fontpitch Boolean lb_bold, lb_italic, lb_underline SetNull(ls_fontface) SetNull(li_fontsize) SetNull(li_fontcharset) SetNull(lff_fontfamily) SetNull(lfp_fontpitch) SetNull(lb_bold) SetNull(lb_italic) SetNull(lb_underline) Return of_setfont(ls_fontface, li_fontsize, li_fontcharset, lff_fontfamily, lfp_fontpitch, ab_bold, lb_italic, lb_underline) end function public function string of_setfontitalic (boolean ab_italic);//==================================================================== // Function: uo_progressbar.of_setfontitalic() //-------------------------------------------------------------------- // Description: Sets the progress bar text attribute to italic/not italic //-------------------------------------------------------------------- // Arguments: // boolean ab_italic true if progress bar text should be italic //-------------------------------------------------------------------- // Returns: string The output of the Modify command (the error text or "") //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== String ls_fontface Integer li_fontsize, li_fontcharset FontFamily lff_fontfamily FontPitch lfp_fontpitch Boolean lb_bold, lb_italic, lb_underline SetNull(ls_fontface) SetNull(li_fontsize) SetNull(li_fontcharset) SetNull(lff_fontfamily) SetNull(lfp_fontpitch) SetNull(lb_bold) SetNull(lb_italic) SetNull(lb_underline) Return of_setfont(ls_fontface, li_fontsize, li_fontcharset, lff_fontfamily, lfp_fontpitch, lb_bold, & ab_italic, lb_underline) end function public function string of_setfontunderline (boolean ab_underline);//==================================================================== // Function: uo_progressbar.of_setfontunderline() //-------------------------------------------------------------------- // Description: Sets the progress bar text attribute to underline/not underline //-------------------------------------------------------------------- // Arguments: // boolean ab_underline true if progress bar text should be underlined //-------------------------------------------------------------------- // Returns: string The output of the Modify command (the error text or "") //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== String ls_fontface Integer li_fontsize, li_fontcharset FontFamily lff_fontfamily FontPitch lfp_fontpitch Boolean lb_bold, lb_italic, lb_underline SetNull(ls_fontface) SetNull(li_fontsize) SetNull(li_fontcharset) SetNull(lff_fontfamily) SetNull(lfp_fontpitch) SetNull(lb_bold) SetNull(lb_italic) SetNull(lb_underline) Return of_setfont(ls_fontface, li_fontsize, li_fontcharset, lff_fontfamily, lfp_fontpitch, lb_bold, lb_italic, ab_underline) end function public function string of_setfontface (string as_fontface);//==================================================================== // Function: uo_progressbar.of_setfontface() //-------------------------------------------------------------------- // Description: Sets the progress bar font face //-------------------------------------------------------------------- // Arguments: // string as_fontface Sets the font face of the progress bar text (eg "Arial") //-------------------------------------------------------------------- // Returns: string The output of the Modify command (the error text or "") //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== String ls_fontface Integer li_fontsize, li_fontcharset FontFamily lff_fontfamily FontPitch lfp_fontpitch Boolean lb_bold, lb_italic, lb_underline SetNull(ls_fontface) SetNull(li_fontsize) SetNull(li_fontcharset) SetNull(lff_fontfamily) SetNull(lfp_fontpitch) SetNull(lb_bold) SetNull(lb_italic) SetNull(lb_underline) Return of_setfont(as_fontface, li_fontsize, li_fontcharset, lff_fontfamily, lfp_fontpitch, lb_bold, lb_italic, lb_underline) end function public function string of_setfontfamily (fontfamily aff_fontfamily);//==================================================================== // Function: uo_progressbar.of_setfontfamily() //-------------------------------------------------------------------- // Description: Sets the font family progress bar text attribute //-------------------------------------------------------------------- // Arguments: // fontfamily aff_fontfamily enumerated fontfamily datatype representation Family font belongs to (eg roman!) //-------------------------------------------------------------------- // Returns: string The output of the Modify command (the error text or "") //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== String ls_fontface Integer li_fontsize, li_fontcharset FontFamily lff_fontfamily FontPitch lfp_fontpitch Boolean lb_bold, lb_italic, lb_underline SetNull(ls_fontface) SetNull(li_fontsize) SetNull(li_fontcharset) SetNull(lff_fontfamily) SetNull(lfp_fontpitch) SetNull(lb_bold) SetNull(lb_italic) SetNull(lb_underline) Return of_setfont(ls_fontface, li_fontsize, li_fontcharset, aff_fontfamily, lfp_fontpitch, lb_bold, lb_italic, lb_underline) end function public function string of_setfontpitch (fontpitch afp_fontpitch);//==================================================================== // Function: uo_progressbar.of_setfontpitch() //-------------------------------------------------------------------- // Description: Sets the progress bar font pitch text attribute //-------------------------------------------------------------------- // Arguments: // fontpitch afp_fontpitch enumerated datatype font should be (fixed!) //-------------------------------------------------------------------- // Returns: string The output of the Modify command (the error text or "") //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== String ls_fontface Integer li_fontsize, li_fontcharset FontFamily lff_fontfamily FontPitch lfp_fontpitch Boolean lb_bold, lb_italic, lb_underline SetNull(ls_fontface) SetNull(li_fontsize) SetNull(li_fontcharset) SetNull(lff_fontfamily) SetNull(lfp_fontpitch) SetNull(lb_bold) SetNull(lb_italic) SetNull(lb_underline) Return of_setfont(ls_fontface, li_fontsize, li_fontcharset, lff_fontfamily, afp_fontpitch, lb_bold, lb_italic, lb_underline) end function public function integer of_setmaximum (integer ai_maximum);//==================================================================== // Function: uo_progressbar.of_setmaximum() //-------------------------------------------------------------------- // Description: Sets the maximum value the progress bar will increment to //-------------------------------------------------------------------- // Arguments: // integer ai_maximum the maximum value the progress bar will increment to //-------------------------------------------------------------------- // Returns: integer SUCCESS = 1 ERROR = -1 //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== If IsNull(ai_maximum) Or (ai_maximum <= 0) Then Return -1 End If ii_maximum = ai_maximum Return 1 end function public function integer of_setminimum (integer ai_minimum);//==================================================================== // Function: uo_progressbar.of_setminimum() //-------------------------------------------------------------------- // Description: Sets the minimum value the progress bar will start from //-------------------------------------------------------------------- // Arguments: // integer ai_minimum the minimum value the progress bar will start from //-------------------------------------------------------------------- // Returns: integer SUCCESS = 1 ERROR = -1 //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== If IsNull(ai_minimum) Or (ai_minimum < 0) Then Return -1 End If ii_minimum = ai_minimum Return 1 end function public function integer of_setstep (integer ai_step);//==================================================================== // Function: uo_progressbar.of_setstep() //-------------------------------------------------------------------- // Description: Sets the step value the progress bar will increment by //-------------------------------------------------------------------- // Arguments: // integer ai_step the step value the progress bar will increment by //-------------------------------------------------------------------- // Returns: integer SUCCESS = 1 ERROR = -1 //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== If IsNull(ai_step) Or (ai_step <= 0) Then Return -1 End If ii_step = ai_step Return 1 end function public function integer of_setfillcolor (long al_fillcolor);//==================================================================== // Function: uo_progressbar.of_setfillcolor() //-------------------------------------------------------------------- // Description: Set the color the progress bar will fill with //-------------------------------------------------------------------- // Arguments: // long al_fillcolor color the progress bar will fill with //-------------------------------------------------------------------- // Returns: integer SUCCESS = 1 ERROR = -1 //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== String ls_modify, ls_return If IsNull(al_fillcolor) Then Return -1 End If il_fillcolor = al_fillcolor ls_modify = "progress_rect.brush.color='" + String(al_fillcolor) + "'" ls_return = dw_progress.Modify(ls_modify) If ls_return <> "" Then Return -1 End If Return 1 end function public function integer of_setfillstyle (integer ai_fillstyle);//==================================================================== // Function: uo_progressbar.of_setfillstyle() //-------------------------------------------------------------------- // Description: Set the fill style of the progress bar // 0 = LEFTRIGHT // 1 = RIGHTLEFT // 2 = TOPDOWN // 3 = BOTTOMUP //-------------------------------------------------------------------- // Arguments: // integer ai_fillstyle the fill style of the progressbar //-------------------------------------------------------------------- // Returns: integer SUCCESS = 1 ERROR = -1 //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== If IsNull(ai_fillstyle) Then Return -1 End If If Not ((ai_fillstyle = TOPDOWN) Or (ai_fillstyle = BOTTOMUP) Or & (ai_fillstyle = LEFTRIGHT) Or (ai_fillstyle = RIGHTLEFT)) Then Return -1 End If ii_fillstyle = ai_fillstyle Return 1 end function public function integer of_getfillstyle ();//==================================================================== // Function: uo_progressbar.of_getfillstyle() //-------------------------------------------------------------------- // Description: Returns the fill style of the progress bar //-------------------------------------------------------------------- // Arguments: //-------------------------------------------------------------------- // Returns: integer // the fill style of the progress bar // 0 = LEFTRIGHT // 1 = RIGHTLEFT // 2 = TOPDOWN // 3 = BOTTOMUP //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== Return ii_fillstyle end function public function integer of_reset ();//==================================================================== // Function: uo_progressbar.of_reset() //-------------------------------------------------------------------- // Description: Reset the progress bar. //-------------------------------------------------------------------- // Arguments: //-------------------------------------------------------------------- // Returns: integer SUCCESS = 1 ERROR = -1 //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== dw_progress.SetRedraw(False) // turn the visible properties of the progress bar off dw_progress.Object.progress_rect.Visible = 0 dw_progress.Object.pct.Visible = 0 dw_progress.SetRedraw(True) // reset the position of the progress bar ii_position = ii_minimum ii_percentcomplete = 0 dw_progress.Object.pct[1] = "" Return 1 end function public function integer of_setdisplaystyle (integer ai_displaystyle);//==================================================================== // Function: uo_progressbar.of_setdisplaystyle() //-------------------------------------------------------------------- // Description: Set the display style of the progress bar, 0=just the bar, 1=% complete, 2=position , 3=text from settext //-------------------------------------------------------------------- // Arguments: // integer ai_displaystyle display style of the progressbar //-------------------------------------------------------------------- // Returns: integer SUCCESS = 1 ERROR = -1 //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== If IsNull(ai_displaystyle) Then Return -1 End If If Not ((ai_displaystyle = BAR) Or (ai_displaystyle = PCTCOMPLETE) Or & (ai_displaystyle = Position) Or (ai_displaystyle = MSGTEXT)) Then Return -1 End If ii_displaystyle = ai_displaystyle Return 1 end function public function string of_getcurrenttext ();//==================================================================== // Function: uo_progressbar.of_getcurrenttext() //-------------------------------------------------------------------- // Description: returns the current text on the progress bar //-------------------------------------------------------------------- // Arguments: //-------------------------------------------------------------------- // Returns: string the current text on the progress bar //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== String ls_msgtext ls_msgtext = dw_progress.Object.pct[1] Return ls_msgtext end function public function integer of_increment (integer ai_inc);//==================================================================== // Function: uo_progressbar.of_increment() //-------------------------------------------------------------------- // Description: Increments the progress bar by ai_inc //-------------------------------------------------------------------- // Arguments: // integer ai_inc value to increment the progress bar //-------------------------------------------------------------------- // Returns: integer the new position of the progress bar //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== Integer li_completion If (ai_inc <= 0) Or IsNull(ai_inc) Then Return -1 End If // increment the position i = i+inc ii_position += ai_inc // display the change on the progress bar Return of_setposition(ii_position) end function public function integer of_increment ();//==================================================================== // Function: uo_progressbar.of_increment() //-------------------------------------------------------------------- // Description: Increments the progress bar by the default step value //-------------------------------------------------------------------- // Arguments: //-------------------------------------------------------------------- // Returns: integer the new position of the progress bar //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== Return of_increment(ii_step) end function protected function integer of_updatevisuals (decimal adc_completion);////////////////////////////////////////////////////////////////////////////// // // Function: of_UpdateVisuals // // Access: protected // // Arguments: decimal // adc_completion the completion value of the progress bar // // Returns: integer // SUCCESS = 1 // ERROR = -1 // // Description: // Resizes the progressbar to the completion size and sets the display text // ////////////////////////////////////////////////////////////////////////////// // // Revision History // // Version // 6.0 Initial version // ////////////////////////////////////////////////////////////////////////////// // // Copyright © 1996-1997 Sybase, Inc. and its subsidiaries. All rights reserved. // Any distribution of the PowerBuilder Foundation Classes (PFC) // source code by other than Sybase, Inc. and its subsidiaries is prohibited. // ////////////////////////////////////////////////////////////////////////////// long ll_index, ll_width, ll_height if isnull(adc_completion) or (adc_completion < 0) then return -1 end if ll_width = this.width ll_height = this.height CHOOSE Case ii_fillstyle Case RIGHTLEFT // horizontal movement from right to left dw_progress.object.progress_rect.x = ll_width - integer(adc_completion * ll_width) dw_progress.object.progress_rect.width = integer(adc_completion * ll_width) Case LEFTRIGHT // horizontal movement from left to right dw_progress.object.progress_rect.width = integer(adc_completion * ll_width) Case TOPDOWN // vertical movement from top to bottom dw_progress.object.progress_rect.height = integer(adc_completion * ll_height) Case BOTTOMUP // vertical movement from bottom to top dw_progress.object.progress_rect.y = ll_height - integer(adc_completion * ll_height) dw_progress.object.progress_rect.height = integer(adc_completion * ll_height) END CHOOSE // Set percentages on screen CHOOSE CASE ii_displaystyle CASE BAR dw_progress.object.pct.visible = 0 dw_progress.object.pct[1] = "" CASE PCTCOMPLETE dw_progress.object.pct[1] = string(adc_completion, "#%") CASE POSITION dw_progress.object.pct[1] = string(ii_position, "#") CASE MSGTEXT if ii_msgtextcount > 0 then for ll_index = 1 to ii_msgtextcount if (adc_completion <= (ll_index / ii_msgtextcount)) then dw_progress.object.pct[1] = is_msgtext[ll_index] exit end if end for else dw_progress.object.pct[1] = "??" end if CASE ELSE dw_progress.object.pct.visible = 0 END CHOOSE return 1 end function public function string of_setfontsize (integer ai_fontsize);//==================================================================== // Function: uo_progressbar.of_setfontsize() //-------------------------------------------------------------------- // Description: Sets the progress bar text font size //-------------------------------------------------------------------- // Arguments: // integer ai_fontsize size the progress bar text should display in //-------------------------------------------------------------------- // Returns: string The output of the Modify command (the error text or "") //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== String ls_fontface Integer li_fontsize, li_fontcharset FontFamily lff_fontfamily FontPitch lfp_fontpitch Boolean lb_bold, lb_italic, lb_underline SetNull(ls_fontface) SetNull(li_fontsize) SetNull(li_fontcharset) SetNull(lff_fontfamily) SetNull(lfp_fontpitch) SetNull(lb_bold) SetNull(lb_italic) SetNull(lb_underline) Return of_setfont(ls_fontface, ai_fontsize, li_fontcharset, lff_fontfamily, lfp_fontpitch, lb_bold, lb_italic, lb_underline) end function protected function string of_setfont (string as_fontface, integer ai_fontsize, integer ai_fontcharset, fontfamily aff_fontfamily, fontpitch afp_fontpitch, boolean ab_bold, boolean ab_italic, boolean ab_underline);//==================================================================== // Function: uo_progressbar.of_setfont() //-------------------------------------------------------------------- // Description: Change the font of an object in the datawindow. //-------------------------------------------------------------------- // Arguments: // string as_fontface The font to use (i.e. "MS Sans Serif") // integer ai_fontsize The point size of the font. // integer ai_fontcharset The Character set to use for the Font (0 - ANSI) // fontfamily aff_fontfamily The font family (AnyFont!, Roman!, Swiss!, Modern!, Script!, Decorative!) // fontpitch afp_fontpitch The pitch of the font (Default!, Fixed!, Variable!) // boolean ab_bold True - Bold, False - Normal. // boolean ab_italic True - Yes, False - No. // boolean ab_underline True - Yes, False - No. //-------------------------------------------------------------------- // Returns: string The output of the Modify command (the error text or "") //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== String ls_FontFace, ls_Modify, ls_Objects[], ls_Undo, ls_FontSize, & ls_FontFamily, ls_OldFamily, ls_FontPitch, ls_OldPitch, ls_FontWeight, & ls_OldWeight, ls_Italic, ls_OldItalic, ls_Underline, ls_OldUnderline, & ls_FontCharSet, ls_name, ls_Return Integer li_NumObjects, li_Count, li_Undo // Determine the DataWindow Modify parameters Choose Case aff_FontFamily Case AnyFont! ls_FontFamily = "0" Case Roman! ls_FontFamily = "1" Case Swiss! ls_FontFamily = "2" Case Modern! ls_FontFamily = "3" Case Script! ls_FontFamily = "4" Case Decorative! ls_FontFamily = "5" End Choose Choose Case afp_FontPitch Case Default! ls_FontPitch = "0" Case Fixed! ls_FontPitch = "1" Case Variable! ls_FontPitch = "2" End Choose If ab_Bold Then ls_FontWeight = "700" Else ls_FontWeight = "400" End If If ab_Italic Then ls_Italic = "1" Else ls_Italic = "0" End If If ab_Underline Then ls_Underline = "1" Else ls_Underline = "0" End If // Change font size ls_FontSize = dw_progress.Object.pct.Font.Height If Not IsNull(ai_FontSize) And ai_FontSize <> Integer(ls_FontSize) Then ls_Modify = " pct.Font.Height='-" + String(ai_FontSize) + "'" End If // Change font CharSet ls_FontCharSet = dw_progress.Object.pct.Font.CharSet If Not IsNull(ai_FontCharSet) And ai_FontCharSet <> Integer(ls_FontCharSet) Then ls_Modify = " pct.Font.CharSet='" + String(ai_FontCharSet) + "'" End If // Change font face If Not IsNull(as_FontFace) Then ls_FontFace = dw_progress.Object.pct.Font.Face If as_FontFace <> ls_FontFace Then ls_Modify = ls_Modify + " pct.Font.Face='" + as_FontFace + "'" End If End If // Change font family If Not IsNull(aff_FontFamily) Then ls_OldFamily = dw_progress.Object.pct.Font.Family If ls_FontFamily <> ls_OldFamily Then ls_Modify = ls_Modify + " pct.Font.Family='" + ls_FontFamily + "'" End If End If // Change font pitch If Not IsNull(afp_FontPitch) Then ls_OldPitch = dw_progress.Object.pct.Font.Pitch If ls_FontPitch <> ls_OldPitch Then ls_Modify = ls_Modify + " pct.Font.Pitch='" + ls_FontPitch + "'" End If End If // Change font weight If Not IsNull(ab_Bold) Then ls_OldWeight = dw_progress.Object.pct.Font.Weight If ls_FontWeight <> ls_OldWeight Then ls_Modify = ls_Modify + " pct.Font.Weight='" + ls_FontWeight + "'" End If End If // Change italic If Not IsNull(ab_Italic) Then If dw_progress.Object.pct.Font.Italic <> "1" Then ls_OldItalic = "0" Else ls_OldItalic = "1" End If If ls_Italic <> ls_OldItalic Then ls_Modify = ls_Modify + " pct.Font.Italic='" + ls_Italic + "'" End If End If // Change underline If Not IsNull(ab_Underline) Then If dw_progress.Object.pct.Font.Underline <> "1" Then ls_OldUnderline = "0" Else ls_OldUnderline = "1" End If If ls_Underline <> ls_OldUnderline Then ls_Modify = ls_Modify + " pct.Font.Underline='" + ls_Underline + "'" End If End If ls_Return = dw_progress.Modify(ls_Modify) Return ls_Return end function public function string of_setfontcharset (integer ai_fontcharset);//==================================================================== // Function: uo_progressbar.of_setfontcharset() //-------------------------------------------------------------------- // Description: Sets the progress bar text font character set //-------------------------------------------------------------------- // Arguments: // integer ai_fontcharset The Character Set The Font Uses on the Progress Bar //-------------------------------------------------------------------- // Returns: string The output of the Modify command (the error text or "") //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== String ls_fontface Integer li_fontsize, li_fontcharset FontFamily lff_fontfamily FontPitch lfp_fontpitch Boolean lb_bold, lb_italic, lb_underline SetNull(ls_fontface) SetNull(li_fontsize) SetNull(li_fontcharset) SetNull(lff_fontfamily) SetNull(lfp_fontpitch) SetNull(lb_bold) SetNull(lb_italic) SetNull(lb_underline) Return of_setfont(ls_fontface, li_fontsize, ai_fontcharset, lff_fontfamily, lfp_fontpitch, lb_bold, lb_italic, lb_underline) end function public function integer of_setautoreset (boolean ab_switch);//==================================================================== // Function: uo_progressbar.of_setautoreset() //-------------------------------------------------------------------- // Description: Sets the flag to reset the progress bar when it reaches 100% //-------------------------------------------------------------------- // Arguments: // boolean ab_switch True to Reset the progress bar, false to leave it visible //-------------------------------------------------------------------- // Returns: integer SUCCESS = 1 ERROR = -1 //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== If IsNull(ab_switch) Then Return -1 End If ib_autoreset = ab_switch Return 1 end function public function boolean of_isautoreset ();//==================================================================== // Function: uo_progressbar.of_isautoreset() //-------------------------------------------------------------------- // Description: return the flag to reset the progress bar when it reaches 100% //-------------------------------------------------------------------- // Arguments: //-------------------------------------------------------------------- // Returns: boolean True = clear the progress bar . False = Don't clear the progress bar //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== Return ib_autoreset end function public function integer of_setmessagetext (string as_msgtext[]);//==================================================================== // Function: uo_progressbar.of_setmessagetext() //-------------------------------------------------------------------- // Description: Sets the text array which is shown on the progress bar //-------------------------------------------------------------------- // Arguments: // string as_msgtext[] the text array to show on the progress bar separated by as_delimiter //-------------------------------------------------------------------- // Returns: integer the number of elements in the text which is parsed -1 = error //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== If IsNull(as_msgtext) Then Return -1 End If // pass in array of messagetext and return # of elements is_msgtext = as_msgtext ii_msgtextcount = UpperBound(is_msgtext) Return ii_msgtextcount end function public function integer of_settextcolor (long al_textcolor);//==================================================================== // Function: uo_progressbar.of_settextcolor() //-------------------------------------------------------------------- // Description: Set the color the progress bar text //-------------------------------------------------------------------- // Arguments: // long al_textcolor color the progress bar text will display //-------------------------------------------------------------------- // Returns: integer SUCCESS = 1 ERROR = -1 //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== String ls_modify, ls_return If IsNull(al_textcolor) Or (al_textcolor < 0) Then Return -1 End If il_textcolor = al_textcolor ls_modify = "pct.color='" + String(al_textcolor) + "'" ls_return = dw_progress.Modify(ls_modify) If ls_return <> "" Then Return -1 End If Return 1 end function public function long of_gettextcolor ();//==================================================================== // Function: uo_progressbar.of_gettextcolor() //-------------------------------------------------------------------- // Description: Returns the color of the progress bar text. //-------------------------------------------------------------------- // Arguments: //-------------------------------------------------------------------- // Returns: long the color of the progress bar text //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== Return il_textcolor end function public function long of_getbackcolor ();//==================================================================== // Function: uo_progressbar.of_getbackcolor() //-------------------------------------------------------------------- // Description: Returns background the color of the empty progress bar. //-------------------------------------------------------------------- // Arguments: //-------------------------------------------------------------------- // Returns: long the background color of the empty progress bar //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== Return il_backcolor end function public function integer of_setbackcolor (long al_backcolor);//==================================================================== // Function: uo_progressbar.of_setbackcolor() //-------------------------------------------------------------------- // Description: Set the background color of the empty progress bar //-------------------------------------------------------------------- // Arguments: // long al_backcolor background color of the empty progress bar //-------------------------------------------------------------------- // Returns: integer SUCCESS = 1 ERROR = -1 //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== String ls_modify, ls_return If IsNull(al_backcolor) Or (al_backcolor < 0) Then Return -1 End If il_backcolor = al_backcolor ls_modify = "datawindow.color='" + String(al_backcolor) + "'" ls_return = dw_progress.Modify(ls_modify) If ls_return <> "" Then Return -1 End If Return 1 end function public function integer of_getmessagetext (ref string as_messagetext[]);//==================================================================== // Function: uo_progressbar.of_getmessagetext() //-------------------------------------------------------------------- // Description: Returns the message text used for display on the progress bar //-------------------------------------------------------------------- // Arguments: // ref string as_messagetext[] array to hold the message text - by reference //-------------------------------------------------------------------- // Returns: integer the number of elements in the message text array //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== Integer li_itemcount String ls_temp[] // clear out the argument array as_messagetext = ls_temp // set the value as_messagetext = is_msgtext // get the number of items in the array li_itemcount = UpperBound(as_messagetext) Return li_itemcount end function public function integer of_getpctcomplete ();//==================================================================== // Function: uo_progressbar.of_getpctcomplete() //-------------------------------------------------------------------- // Description: Returns the visual percent complete of the progress bar //-------------------------------------------------------------------- // Arguments: //-------------------------------------------------------------------- // Returns: integer the visual percent complete of the progress bar (1-100) //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== Return ii_percentcomplete end function public function integer of_getinfo (ref nvo_infoattrib anv_infoattrib);//==================================================================== // Function: uo_progressbar.of_getinfo() //-------------------------------------------------------------------- // Description: Gets the Object Information. //-------------------------------------------------------------------- // Arguments: // ref nvo_infoattrib anv_infoattrib he Information attributes. //-------------------------------------------------------------------- // Returns: integer 1 for success. -1 for error. //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== // Populate Information. anv_infoattrib.is_name = 'Progress Bar' anv_infoattrib.is_description = 'Progress Bar' Return 1 end function on uo_progressbar.create this.dw_progress=create dw_progress this.Control[]={this.dw_progress} end on on uo_progressbar.destroy destroy(this.dw_progress) end on event constructor; // initalize the display text dw_progress.Object.pct[1] = "" // expand dw to dimensions of on screen object dw_progress.Height = This.Height dw_progress.Width = This.Width // make the dw header band height of on screen object dw_progress.Object.datawindow.header.Height = This.Height // make the progress rectangle the height and width of on screen object dw_progress.Object.progress_rect.Height = This.Height dw_progress.Object.progress_rect.Width = This.Width // center percentage text on screen object dw_progress.Object.pct.Y = Integer((Integer(dw_progress.Object.datawindow.header.Height) / 2 ) - & (Integer(dw_progress.Object.pct.Height) / 2)) dw_progress.Object.pct.Width = This.Width end event type dw_progress from datawindow within uo_progressbar integer width = 384 integer height = 76 string dataobject = "d_progress" boolean border = false end type event rbuttondown;//==================================================================== // Event: uo_progressbar.Properties - dw_progress inherited from datawindow() //-------------------------------------------------------------------- // Description: Pass the button properties to the uo since this object takes up the whole uo space //-------------------------------------------------------------------- // Arguments: // integer xpos // integer ypos // long row // dwobject dwo //-------------------------------------------------------------------- // Returns: (none) //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== // pass right mouse button processing to the parent user object. Parent.Event RButtonDown(2, xpos, ypos) end event |
u_progressbar from uo_progressbar
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 | forward global type u_progressbar from uo_progressbar end type end forward global type u_progressbar from uo_progressbar event resize pbm_size end type global u_progressbar u_progressbar event resize;call super::resize;// expand dw to dimensions of on screen object dw_progress.height = this.height dw_progress.width = this.width // make the dw header band height of on screen object dw_progress.object.datawindow.header.height = this.height // make the progress rectangle the height and width of on screen object dw_progress.object.progress_rect.height = this.height dw_progress.object.progress_rect.width = this.width // center percentage text on screen object dw_progress.object.pct.y = integer((integer(dw_progress.object.datawindow.header.height) / 2 ) - & (integer(dw_progress.object.pct.height) / 2)) dw_progress.object.pct.width = this.width end event on u_progressbar.create call uo_progressbar::create end on on u_progressbar.destroy call uo_progressbar::destroy end on |
w_main from window
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 | forward global type w_main from window end type type cb_stop from commandbutton within w_main end type type uo_8 from u_progressbar within w_main end type type uo_7 from u_progressbar within w_main end type type uo_6 from u_progressbar within w_main end type type uo_5 from u_progressbar within w_main end type type st_4 from statictext within w_main end type type uo_4 from u_progressbar within w_main end type type st_3 from statictext within w_main end type type uo_3 from u_progressbar within w_main end type type st_2 from statictext within w_main end type type uo_2 from u_progressbar within w_main end type type st_1 from statictext within w_main end type type uo_1 from u_progressbar within w_main end type type cb_start from commandbutton within w_main end type type cb_close from commandbutton within w_main end type end forward global type w_main from window integer width = 1911 integer height = 1908 boolean titlebar = true string title = "Progress Bar" boolean controlmenu = true boolean minbox = true boolean maxbox = true boolean resizable = true long backcolor = 67108864 string icon = "AppIcon!" boolean center = true event type integer ue_startprocess ( ) event ue_postopen ( ) cb_stop cb_stop uo_8 uo_8 uo_7 uo_7 uo_6 uo_6 uo_5 uo_5 st_4 st_4 uo_4 uo_4 st_3 st_3 uo_3 uo_3 st_2 st_2 uo_2 uo_2 st_1 st_1 uo_1 uo_1 cb_start cb_start cb_close cb_close end type global w_main w_main type variables Protected: Boolean ib_cancelled Boolean ib_closed Boolean ib_started end variables event type integer ue_startprocess();//==================================================================== // Event: w_main.ue_startprocess() //-------------------------------------------------------------------- // Description: Start the progress meters by calling of_SetPosition and running a defined algorithm. //-------------------------------------------------------------------- // Arguments: //-------------------------------------------------------------------- // Returns: integer : // 0 - User closed the window while the process was being run. // 1 - User cancelled the process midstream. // 2 - The process completed on its own. //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== Integer li_count Long ll_complete1 Long ll_complete2 Long ll_complete3 Long ll_complete4 Long ll_complete5 Long ll_complete6 Long ll_complete7 Long ll_complete8 ib_started = True // Initialize the Progress Bars. uo_1.of_SetPosition(0) uo_2.of_SetPosition(0) uo_3.of_SetPosition(0) uo_4.of_SetPosition(0) uo_5.of_SetPosition(0) uo_6.of_SetPosition(0) uo_7.of_SetPosition(0) uo_8.of_SetPosition(0) ib_cancelled = False ib_closed = False // Start the algorithm. For li_count = 1 To 10000 Yield() If ib_closed = True Then ib_cancelled = True ib_started = False //event pfc_close() Return 0 End If If ib_cancelled = True Then ib_started = False Return 1 End If If Mod(li_count, 100) = 0 Then If ll_complete1 < 100 Then ll_complete1 = uo_1.of_Increment() //10 End If st_1.Text = String(ll_complete1, "#") + " % Complete" If ll_complete2 < 100 Then ll_complete2 = uo_2.of_Increment() //5 End If st_2.Text = String(ll_complete2, "#") + " % Complete" If ll_complete3 < 100 Then ll_complete3 = uo_3.of_Increment() //2 End If st_3.Text = String(ll_complete3, "#") + " % Complete" If ll_complete4 < 100 Then ll_complete4 = uo_4.of_Increment() //1 End If st_4.Text = String(ll_complete4, "#") + " % Complete" If ll_complete5 < 100 Then ll_complete5 = uo_5.of_Increment() //10 End If If ll_complete6 < 100 Then ll_complete6 = uo_6.of_Increment() //4 End If If ll_complete7 < 100 Then ll_complete7 = uo_7.of_Increment() //2 End If If ll_complete8 < 100 Then ll_complete8 = uo_8.of_Increment() //1 End If End If Next ib_started = False Return 2 end event event ue_postopen();cb_start.triggerevent(clicked!) end event on w_main.create this.cb_stop=create cb_stop this.uo_8=create uo_8 this.uo_7=create uo_7 this.uo_6=create uo_6 this.uo_5=create uo_5 this.st_4=create st_4 this.uo_4=create uo_4 this.st_3=create st_3 this.uo_3=create uo_3 this.st_2=create st_2 this.uo_2=create uo_2 this.st_1=create st_1 this.uo_1=create uo_1 this.cb_start=create cb_start this.cb_close=create cb_close this.Control[]={this.cb_stop,& this.uo_8,& this.uo_7,& this.uo_6,& this.uo_5,& this.st_4,& this.uo_4,& this.st_3,& this.uo_3,& this.st_2,& this.uo_2,& this.st_1,& this.uo_1,& this.cb_start,& this.cb_close} end on on w_main.destroy destroy(this.cb_stop) destroy(this.uo_8) destroy(this.uo_7) destroy(this.uo_6) destroy(this.uo_5) destroy(this.st_4) destroy(this.uo_4) destroy(this.st_3) destroy(this.uo_3) destroy(this.st_2) destroy(this.uo_2) destroy(this.st_1) destroy(this.uo_1) destroy(this.cb_start) destroy(this.cb_close) end on event closequery;If ib_started = True Then cb_close.TriggerEvent(Clicked!) Return 1 End If end event event open;This.Post Event ue_postopen () end event type cb_stop from commandbutton within w_main integer x = 1426 integer y = 1508 integer width = 361 integer height = 88 integer taborder = 20 boolean bringtotop = true integer textsize = -8 integer weight = 400 fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "MS Sans Serif" string text = "S&top" end type event clicked;//==================================================================== // Event: cb_stop.clicked() //-------------------------------------------------------------------- // Description: Stop the progress meters in process. //-------------------------------------------------------------------- // Arguments: //-------------------------------------------------------------------- // Returns: long //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== If ib_cancelled = False Then ib_cancelled = True End If end event type uo_8 from u_progressbar within w_main event destroy ( ) integer x = 1106 integer y = 664 integer width = 219 integer height = 1048 integer taborder = 80 boolean border = true long backcolor = 77571519 borderstyle borderstyle = styleshadowbox! end type on uo_8.destroy call u_progressbar::destroy end on event constructor;call super::constructor;//==================================================================== // Event: uo_8.constructor() //-------------------------------------------------------------------- // Description: Initializes the Progress Bar. //-------------------------------------------------------------------- // Arguments: //-------------------------------------------------------------------- // Returns: long //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== of_SetFillStyle(RIGHTLEFT) of_SetDisplayStyle(Position) of_SetStep(1) of_SetFillColor(RGB(255,255,0)) of_SetTextColor(RGB(0,0,128)) of_SetAutoReset(False) end event type uo_7 from u_progressbar within w_main event destroy ( ) integer x = 763 integer y = 664 integer width = 219 integer height = 1048 integer taborder = 70 boolean border = true long backcolor = 77571519 borderstyle borderstyle = styleraised! end type on uo_7.destroy call u_progressbar::destroy end on event constructor;call super::constructor;//==================================================================== // Event: uo_7.constructor() //-------------------------------------------------------------------- // Description: Initializes the Progress Bar. //-------------------------------------------------------------------- // Arguments: //-------------------------------------------------------------------- // Returns: long //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== of_SetFillStyle(LEFTRIGHT) of_SetDisplayStyle(Position) of_SetStep(2) of_SetFillColor(RGB(255,0,0)) of_SetFontSize(12) of_SetFontFace("Arial") of_SetAutoReset(False) end event type uo_6 from u_progressbar within w_main event destroy ( ) integer x = 416 integer y = 664 integer width = 219 integer height = 1048 integer taborder = 60 boolean border = true long backcolor = 77571519 borderstyle borderstyle = stylelowered! end type on uo_6.destroy call u_progressbar::destroy end on event constructor;call super::constructor;//==================================================================== // Event: uo_6.constructor() //-------------------------------------------------------------------- // Description: Initializes the Progress Bar. //-------------------------------------------------------------------- // Arguments: //-------------------------------------------------------------------- // Returns: long //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== of_SetFillStyle(BOTTOMUP) of_SetDisplayStyle(PCTCOMPLETE) of_SetStep(4) of_SetMaximum(100) of_SetMinimum(0) of_SetTextColor(RGB(255,255,255)) of_SetFillColor(RGB(0,0,128)) of_SetFontBold(True) of_SetFontItalic(True) of_SetFontUnderline(True) of_SetFontSize(12) of_SetAutoReset(False) end event type uo_5 from u_progressbar within w_main event destroy ( ) integer x = 69 integer y = 664 integer width = 219 integer height = 1048 integer taborder = 50 boolean border = true long backcolor = 77571519 end type on uo_5.destroy call u_progressbar::destroy end on event constructor;call super::constructor;//==================================================================== // Event: uo_5.constructor() //-------------------------------------------------------------------- // Description: Initializes the Progress Bar. //-------------------------------------------------------------------- // Arguments: //-------------------------------------------------------------------- // Returns: long //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== of_SetFillStyle(TOPDOWN) of_SetDisplayStyle(BAR) of_SetTextColor(RGB(255,255,0)) of_SetFillColor(RGB(0,128,0)) of_SetFontBold(True) of_SetFontSize(12) of_SetAutoReset(False) end event type st_4 from statictext within w_main integer x = 1362 integer y = 468 integer width = 375 integer height = 68 integer textsize = -8 integer weight = 400 fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "MS Sans Serif" long textcolor = 33554432 long backcolor = 74481808 boolean enabled = false boolean focusrectangle = false end type type uo_4 from u_progressbar within w_main event destroy ( ) string tag = "uo_4" integer x = 37 integer y = 452 integer width = 1289 integer height = 84 integer taborder = 40 boolean border = true long backcolor = 77571519 borderstyle borderstyle = styleshadowbox! end type on uo_4.destroy call u_progressbar::destroy end on event constructor;call super::constructor;//==================================================================== // Event: uo_4.constructor() //-------------------------------------------------------------------- // Description: Initializes the Progress Bar. //-------------------------------------------------------------------- // Arguments: //-------------------------------------------------------------------- // Returns: long //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== String ls_messages[] of_SetFillStyle(LEFTRIGHT) of_SetDisplayStyle(MSGTEXT) ls_messages[1] = "Inspecting Application Dependencies..." ls_messages[2] = "Opening File..." ls_messages[3] = "Parsing Data..." ls_messages[4] = "Deleting..." ls_messages[5] = "Inserting..." of_SetMessageText(ls_messages) of_SetStep(1) of_SetMaximum(100) of_SetMinimum(0) of_SetTextColor(RGB(255,255,255)) of_SetFontBold(True) of_SetAutoReset(False) of_SetFontSize(10) end event type st_3 from statictext within w_main integer x = 1362 integer y = 348 integer width = 375 integer height = 68 integer textsize = -8 integer weight = 400 fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "MS Sans Serif" long textcolor = 33554432 long backcolor = 74481808 boolean enabled = false boolean focusrectangle = false end type type uo_3 from u_progressbar within w_main event destroy ( ) integer x = 37 integer y = 332 integer width = 1289 integer height = 84 integer taborder = 30 boolean border = true long backcolor = 77571519 end type on uo_3.destroy call u_progressbar::destroy end on event constructor;call super::constructor;//==================================================================== // Event: uo_3.constructor() //-------------------------------------------------------------------- // Description: Initializes the Progress Bar. //-------------------------------------------------------------------- // Arguments: //-------------------------------------------------------------------- // Returns: long //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== of_SetFillStyle(TOPDOWN) of_SetDisplayStyle(Position) of_SetStep(2) of_SetFillColor(RGB(255,255,0)) of_SetTextColor(RGB(128,0,0)) of_SetFontBold(True) of_SetFontItalic(True) of_SetFontSize(12) of_SetAutoReset(False) end event type st_2 from statictext within w_main integer x = 1362 integer y = 228 integer width = 375 integer height = 68 integer textsize = -8 integer weight = 400 fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "MS Sans Serif" long textcolor = 33554432 long backcolor = 74481808 boolean enabled = false boolean focusrectangle = false end type type uo_2 from u_progressbar within w_main event destroy ( ) integer x = 37 integer y = 212 integer width = 1289 integer height = 84 integer taborder = 20 boolean border = true long backcolor = 77571519 borderstyle borderstyle = styleraised! end type on uo_2.destroy call u_progressbar::destroy end on event constructor;call super::constructor;//==================================================================== // Event: uo_2.constructor() //-------------------------------------------------------------------- // Description: Initializes the Progress Bar. //-------------------------------------------------------------------- // Arguments: //-------------------------------------------------------------------- // Returns: long //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== of_SetFillStyle(BOTTOMUP) of_SetDisplayStyle(PCTCOMPLETE) of_SetFillColor(RGB(0,128,0)) of_SetStep(5) of_SetMaximum(100) of_SetMinimum(0) of_SetFontBold(True) of_SetFontSize(10) of_SetAutoReset(False) end event type st_1 from statictext within w_main integer x = 1362 integer y = 108 integer width = 375 integer height = 68 integer textsize = -8 integer weight = 400 fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "MS Sans Serif" long textcolor = 41943040 long backcolor = 74481808 boolean enabled = false boolean focusrectangle = false end type type uo_1 from u_progressbar within w_main event destroy ( ) integer x = 37 integer y = 92 integer width = 1289 integer height = 84 integer taborder = 10 boolean border = true long backcolor = 77571519 borderstyle borderstyle = stylelowered! end type on uo_1.destroy call u_progressbar::destroy end on event constructor;call super::constructor;//==================================================================== // Event: uo_1.constructor() //-------------------------------------------------------------------- // Description: Initializes the Progress Bar. //-------------------------------------------------------------------- // Arguments: //-------------------------------------------------------------------- // Returns: long //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/07/01 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== of_SetFillStyle(RIGHTLEFT) of_SetDisplayStyle(MSGTEXT) of_SetMessageText({"Right mouse on any PBar to change properties..."}) of_SetFontSize(8) of_SetFillColor(RGB(255,0,0)) of_SetFontBold(true) of_SetAutoReset(false) end event type cb_start from commandbutton within w_main integer x = 1426 integer y = 1396 integer width = 352 integer height = 92 integer taborder = 10 boolean bringtotop = true integer textsize = -8 integer weight = 400 fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "MS Sans Serif" string text = "&Start" boolean default = true end type event clicked;Parent.Event ue_startprocess() end event type cb_close from commandbutton within w_main integer x = 1426 integer y = 1620 integer width = 361 integer height = 88 integer taborder = 10 integer textsize = -8 integer weight = 400 fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "MS Sans Serif" string text = "Close" boolean cancel = true end type event clicked; If ib_started = True Then ib_closed = True Else Close(Parent) End If end event |
Find Projects On Github click here
Good Luck!