File size: 233,198 Bytes
9375c9a |
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 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 |
<html><!-- Created using the cpp_pretty_printer from the dlib C++ library. See http://dlib.net for updates. --><head><title>dlib C++ Library - base_widgets.h</title></head><body bgcolor='white'><pre>
<font color='#009900'>// Copyright (C) 2005 Davis E. King ([email protected]), Keita Mochizuki
</font><font color='#009900'>// License: Boost Software License See LICENSE.txt for the full license.
</font>
<font color='#0000FF'>#ifndef</font> DLIB_BASE_WIDGETs_
<font color='#0000FF'>#define</font> DLIB_BASE_WIDGETs_
<font color='#0000FF'>#include</font> <font color='#5555FF'><</font>cctype<font color='#5555FF'>></font>
<font color='#0000FF'>#include</font> <font color='#5555FF'><</font>memory<font color='#5555FF'>></font>
<font color='#0000FF'>#include</font> "<a style='text-decoration:none' href='base_widgets_abstract.h.html'>base_widgets_abstract.h</a>"
<font color='#0000FF'>#include</font> "<a style='text-decoration:none' href='drawable.h.html'>drawable.h</a>"
<font color='#0000FF'>#include</font> "<a style='text-decoration:none' href='../gui_core.h.html'>../gui_core.h</a>"
<font color='#0000FF'>#include</font> "<a style='text-decoration:none' href='../algs.h.html'>../algs.h</a>"
<font color='#0000FF'>#include</font> "<a style='text-decoration:none' href='../member_function_pointer.h.html'>../member_function_pointer.h</a>"
<font color='#0000FF'>#include</font> "<a style='text-decoration:none' href='../timer.h.html'>../timer.h</a>"
<font color='#0000FF'>#include</font> "<a style='text-decoration:none' href='../map.h.html'>../map.h</a>"
<font color='#0000FF'>#include</font> "<a style='text-decoration:none' href='../set.h.html'>../set.h</a>"
<font color='#0000FF'>#include</font> "<a style='text-decoration:none' href='../array2d.h.html'>../array2d.h</a>"
<font color='#0000FF'>#include</font> "<a style='text-decoration:none' href='../pixel.h.html'>../pixel.h</a>"
<font color='#0000FF'>#include</font> "<a style='text-decoration:none' href='../image_transforms/assign_image.h.html'>../image_transforms/assign_image.h</a>"
<font color='#0000FF'>#include</font> "<a style='text-decoration:none' href='../array.h.html'>../array.h</a>"
<font color='#0000FF'>#include</font> "<a style='text-decoration:none' href='style.h.html'>style.h</a>"
<font color='#0000FF'>#include</font> "<a style='text-decoration:none' href='../unicode.h.html'>../unicode.h</a>"
<font color='#0000FF'>#include</font> "<a style='text-decoration:none' href='../any.h.html'>../any.h</a>"
<font color='#0000FF'>namespace</font> dlib
<b>{</b>
<font color='#009900'>// ----------------------------------------------------------------------------------------
</font><font color='#009900'>// ----------------------------------------------------------------------------------------
</font> <font color='#009900'>// class draggable
</font><font color='#009900'>// ----------------------------------------------------------------------------------------
</font><font color='#009900'>// ----------------------------------------------------------------------------------------
</font>
<font color='#0000FF'>class</font> <b><a name='draggable'></a>draggable</b> : <font color='#0000FF'>public</font> drawable
<b>{</b>
<font color='#009900'>/*!
INITIAL VALUE
- drag == false
CONVENTION
- if (the user is holding the left button down over this object) then
- drag == true
- x == the x position of the mouse relative to the upper left corner
of this object.
- y == the y position of the mouse relative to the upper left corner
of this object.
- else
- drag == false
!*/</font>
<font color='#0000FF'>public</font>:
<b><a name='draggable'></a>draggable</b><font face='Lucida Console'>(</font>
drawable_window<font color='#5555FF'>&</font> w,
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> events <font color='#5555FF'>=</font> <font color='#979000'>0</font>
<font face='Lucida Console'>)</font> :
drawable<font face='Lucida Console'>(</font>w,events <font color='#5555FF'>|</font> MOUSE_MOVE <font color='#5555FF'>|</font> MOUSE_CLICK<font face='Lucida Console'>)</font>,
drag<font face='Lucida Console'>(</font><font color='#979000'>false</font><font face='Lucida Console'>)</font>
<b>{</b><b>}</b>
<font color='#0000FF'>virtual</font> ~<b><a name='draggable'></a>draggable</b><font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#5555FF'>=</font> <font color='#979000'>0</font>;
rectangle <b><a name='draggable_area'></a>draggable_area</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font> <b>{</b> auto_mutex <font color='#BB00BB'>M</font><font face='Lucida Console'>(</font>m<font face='Lucida Console'>)</font>; <font color='#0000FF'>return</font> area; <b>}</b>
<font color='#0000FF'><u>void</u></font> <b><a name='set_draggable_area'></a>set_draggable_area</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> rectangle<font color='#5555FF'>&</font> area_
<font face='Lucida Console'>)</font> <b>{</b> auto_mutex <font color='#BB00BB'>M</font><font face='Lucida Console'>(</font>m<font face='Lucida Console'>)</font>; area <font color='#5555FF'>=</font> area_; <b>}</b>
<font color='#0000FF'>protected</font>:
<font color='#0000FF'><u>bool</u></font> <b><a name='is_being_dragged'></a>is_being_dragged</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font> <b>{</b> <font color='#0000FF'>return</font> drag; <b>}</b>
<font color='#0000FF'>virtual</font> <font color='#0000FF'><u>void</u></font> <b><a name='on_drag'></a>on_drag</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font><b>{</b><b>}</b>
<font color='#0000FF'>virtual</font> <font color='#0000FF'><u>void</u></font> <b><a name='on_drag_stop'></a>on_drag_stop</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font><b>{</b><b>}</b>
<font color='#0000FF'><u>void</u></font> <b><a name='on_mouse_move'></a>on_mouse_move</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> state,
<font color='#0000FF'><u>long</u></font> x,
<font color='#0000FF'><u>long</u></font> y
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='on_mouse_down'></a>on_mouse_down</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> btn,
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> ,
<font color='#0000FF'><u>long</u></font> x,
<font color='#0000FF'><u>long</u></font> y,
<font color='#0000FF'><u>bool</u></font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='on_mouse_up'></a>on_mouse_up</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> btn,
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> state,
<font color='#0000FF'><u>long</u></font> x,
<font color='#0000FF'><u>long</u></font> y
<font face='Lucida Console'>)</font>;
<font color='#0000FF'>private</font>:
rectangle area;
<font color='#0000FF'><u>bool</u></font> drag;
<font color='#0000FF'><u>long</u></font> x, y;
<font color='#009900'>// restricted functions
</font> <b><a name='draggable'></a>draggable</b><font face='Lucida Console'>(</font>draggable<font color='#5555FF'>&</font><font face='Lucida Console'>)</font>; <font color='#009900'>// copy constructor
</font> draggable<font color='#5555FF'>&</font> <b><a name='operator'></a>operator</b><font color='#5555FF'>=</font><font face='Lucida Console'>(</font>draggable<font color='#5555FF'>&</font><font face='Lucida Console'>)</font>; <font color='#009900'>// assignment operator
</font> <b>}</b>;
<font color='#009900'>// ----------------------------------------------------------------------------------------
</font><font color='#009900'>// ----------------------------------------------------------------------------------------
</font> <font color='#009900'>// class mouse_over_event
</font><font color='#009900'>// ----------------------------------------------------------------------------------------
</font><font color='#009900'>// ----------------------------------------------------------------------------------------
</font>
<font color='#0000FF'>class</font> <b><a name='mouse_over_event'></a>mouse_over_event</b> : <font color='#0000FF'>public</font> drawable
<b>{</b>
<font color='#009900'>/*!
INITIAL VALUE
- is_mouse_over_ == false
CONVENTION
- is_mouse_over_ == is_mouse_over()
!*/</font>
<font color='#0000FF'>public</font>:
<b><a name='mouse_over_event'></a>mouse_over_event</b><font face='Lucida Console'>(</font>
drawable_window<font color='#5555FF'>&</font> w,
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> events <font color='#5555FF'>=</font> <font color='#979000'>0</font>
<font face='Lucida Console'>)</font> :
drawable<font face='Lucida Console'>(</font>w,events <font color='#5555FF'>|</font> MOUSE_MOVE<font face='Lucida Console'>)</font>,
is_mouse_over_<font face='Lucida Console'>(</font><font color='#979000'>false</font><font face='Lucida Console'>)</font>
<b>{</b><b>}</b>
<font color='#0000FF'>virtual</font> ~<b><a name='mouse_over_event'></a>mouse_over_event</b><font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#5555FF'>=</font> <font color='#979000'>0</font>;
<font color='#0000FF'><u>int</u></font> <b><a name='next_free_user_event_number'></a>next_free_user_event_number</b><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>
<b>{</b>
<font color='#0000FF'>return</font> drawable::<font color='#BB00BB'>next_free_user_event_number</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>+</font><font color='#979000'>1</font>;
<b>}</b>
<font color='#0000FF'>protected</font>:
<font color='#0000FF'><u>bool</u></font> <b><a name='is_mouse_over'></a>is_mouse_over</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>;
<font color='#0000FF'>virtual</font> <font color='#0000FF'><u>void</u></font> <b><a name='on_mouse_over'></a>on_mouse_over</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font><b>{</b><b>}</b>
<font color='#0000FF'>virtual</font> <font color='#0000FF'><u>void</u></font> <b><a name='on_mouse_not_over'></a>on_mouse_not_over</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font><b>{</b><b>}</b>
<font color='#0000FF'><u>void</u></font> <b><a name='on_mouse_leave'></a>on_mouse_leave</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='on_mouse_move'></a>on_mouse_move</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> state,
<font color='#0000FF'><u>long</u></font> x,
<font color='#0000FF'><u>long</u></font> y
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='on_user_event'></a>on_user_event</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>int</u></font> num
<font face='Lucida Console'>)</font>;
<font color='#0000FF'>private</font>:
<font color='#0000FF'>mutable</font> <font color='#0000FF'><u>bool</u></font> is_mouse_over_;
<font color='#009900'>// restricted functions
</font> <b><a name='mouse_over_event'></a>mouse_over_event</b><font face='Lucida Console'>(</font>mouse_over_event<font color='#5555FF'>&</font><font face='Lucida Console'>)</font>; <font color='#009900'>// copy constructor
</font> mouse_over_event<font color='#5555FF'>&</font> <b><a name='operator'></a>operator</b><font color='#5555FF'>=</font><font face='Lucida Console'>(</font>mouse_over_event<font color='#5555FF'>&</font><font face='Lucida Console'>)</font>; <font color='#009900'>// assignment operator
</font> <b>}</b>;
<font color='#009900'>// ----------------------------------------------------------------------------------------
</font><font color='#009900'>// ----------------------------------------------------------------------------------------
</font> <font color='#009900'>// class button_action
</font><font color='#009900'>// ----------------------------------------------------------------------------------------
</font><font color='#009900'>// ----------------------------------------------------------------------------------------
</font>
<font color='#0000FF'>class</font> <b><a name='button_action'></a>button_action</b> : <font color='#0000FF'>public</font> mouse_over_event
<b>{</b>
<font color='#009900'>/*!
INITIAL VALUE
- is_depressed_ == false
- seen_click == false
CONVENTION
- is_depressed_ == is_depressed()
- if (the user has clicked the button but hasn't yet released the
left mouse button) then
- seen_click == true
- else
- seen_click == false
!*/</font>
<font color='#0000FF'>public</font>:
<b><a name='button_action'></a>button_action</b><font face='Lucida Console'>(</font>
drawable_window<font color='#5555FF'>&</font> w,
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> events <font color='#5555FF'>=</font> <font color='#979000'>0</font>
<font face='Lucida Console'>)</font> :
mouse_over_event<font face='Lucida Console'>(</font>w,events <font color='#5555FF'>|</font> MOUSE_MOVE <font color='#5555FF'>|</font> MOUSE_CLICK<font face='Lucida Console'>)</font>,
is_depressed_<font face='Lucida Console'>(</font><font color='#979000'>false</font><font face='Lucida Console'>)</font>,
seen_click<font face='Lucida Console'>(</font><font color='#979000'>false</font><font face='Lucida Console'>)</font>
<b>{</b><b>}</b>
<font color='#0000FF'>virtual</font> ~<b><a name='button_action'></a>button_action</b><font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#5555FF'>=</font> <font color='#979000'>0</font>;
<font color='#0000FF'><u>int</u></font> <b><a name='next_free_user_event_number'></a>next_free_user_event_number</b><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>
<b>{</b>
<font color='#0000FF'>return</font> mouse_over_event::<font color='#BB00BB'>next_free_user_event_number</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>+</font><font color='#979000'>1</font>;
<b>}</b>
<font color='#0000FF'>protected</font>:
<font color='#0000FF'><u>bool</u></font> <b><a name='is_depressed'></a>is_depressed</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>;
<font color='#0000FF'>virtual</font> <font color='#0000FF'><u>void</u></font> <b><a name='on_button_down'></a>on_button_down</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font><b>{</b><b>}</b>
<font color='#0000FF'>virtual</font> <font color='#0000FF'><u>void</u></font> <b><a name='on_button_up'></a>on_button_up</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>bool</u></font>
<font face='Lucida Console'>)</font><b>{</b><b>}</b>
<font color='#0000FF'><u>void</u></font> <b><a name='on_mouse_not_over'></a>on_mouse_not_over</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='on_mouse_down'></a>on_mouse_down</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> btn,
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> ,
<font color='#0000FF'><u>long</u></font> x,
<font color='#0000FF'><u>long</u></font> y,
<font color='#0000FF'><u>bool</u></font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='on_mouse_move'></a>on_mouse_move</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> state,
<font color='#0000FF'><u>long</u></font> x,
<font color='#0000FF'><u>long</u></font> y
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='on_mouse_up'></a>on_mouse_up</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> btn,
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font>,
<font color='#0000FF'><u>long</u></font> x,
<font color='#0000FF'><u>long</u></font> y
<font face='Lucida Console'>)</font>;
<font color='#0000FF'>private</font>:
<font color='#0000FF'>mutable</font> <font color='#0000FF'><u>bool</u></font> is_depressed_;
<font color='#0000FF'><u>bool</u></font> seen_click;
<font color='#0000FF'><u>void</u></font> <b><a name='on_user_event'></a>on_user_event</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>int</u></font> num
<font face='Lucida Console'>)</font>;
<font color='#009900'>// restricted functions
</font> <b><a name='button_action'></a>button_action</b><font face='Lucida Console'>(</font>button_action<font color='#5555FF'>&</font><font face='Lucida Console'>)</font>; <font color='#009900'>// copy constructor
</font> button_action<font color='#5555FF'>&</font> <b><a name='operator'></a>operator</b><font color='#5555FF'>=</font><font face='Lucida Console'>(</font>button_action<font color='#5555FF'>&</font><font face='Lucida Console'>)</font>; <font color='#009900'>// assignment operator
</font> <b>}</b>;
<font color='#009900'>// ----------------------------------------------------------------------------------------
</font><font color='#009900'>// ----------------------------------------------------------------------------------------
</font> <font color='#009900'>// class widget_group
</font><font color='#009900'>// ----------------------------------------------------------------------------------------
</font><font color='#009900'>// ----------------------------------------------------------------------------------------
</font>
<font color='#0000FF'>class</font> <b><a name='widget_group'></a>widget_group</b> : <font color='#0000FF'>public</font> drawable
<b>{</b>
<font color='#009900'>/*!
INITIAL VALUE
widgets.size() == 0
CONVENTION
- widgets contains all the drawable objects and their relative positions
that are in *this.
- wg_widgets contains pointers to just the widgets that happen
to be widget_group objects.
!*/</font>
<font color='#0000FF'>struct</font> <b><a name='relpos'></a>relpos</b>
<b>{</b>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> x;
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> y;
<b>}</b>;
<font color='#0000FF'>public</font>:
<b><a name='widget_group'></a>widget_group</b><font face='Lucida Console'>(</font>
drawable_window<font color='#5555FF'>&</font> w
<font face='Lucida Console'>)</font> : drawable<font face='Lucida Console'>(</font>w<font face='Lucida Console'>)</font> <b>{</b> rect <font color='#5555FF'>=</font> <font color='#BB00BB'>rectangle</font><font face='Lucida Console'>(</font><font color='#979000'>0</font>,<font color='#979000'>0</font>,<font color='#5555FF'>-</font><font color='#979000'>1</font>,<font color='#5555FF'>-</font><font color='#979000'>1</font><font face='Lucida Console'>)</font>; <font color='#BB00BB'>enable_events</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;<b>}</b>
<font color='#0000FF'>virtual</font> ~<b><a name='widget_group'></a>widget_group</b><font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font><b>{</b> <font color='#BB00BB'>disable_events</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>; <b>}</b>
<font color='#0000FF'><u>void</u></font> <b><a name='empty'></a>empty</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='add'></a>add</b> <font face='Lucida Console'>(</font>
drawable<font color='#5555FF'>&</font> widget,
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> x,
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> y
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='add'></a>add</b> <font face='Lucida Console'>(</font>
widget_group<font color='#5555FF'>&</font> widget,
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> x,
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> y
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>bool</u></font> <b><a name='is_member'></a>is_member</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> drawable<font color='#5555FF'>&</font> widget
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='remove'></a>remove</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> drawable<font color='#5555FF'>&</font> widget
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>size_t</u></font> <b><a name='size'></a>size</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='set_pos'></a>set_pos</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>long</u></font> x,
<font color='#0000FF'><u>long</u></font> y
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='set_z_order'></a>set_z_order</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>long</u></font> order
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='show'></a>show</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='hide'></a>hide</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='enable'></a>enable</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='disable'></a>disable</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='fit_to_contents'></a>fit_to_contents</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'>protected</font>:
<font color='#009900'>// this object doesn't draw anything but also isn't abstract
</font> <font color='#0000FF'><u>void</u></font> <b><a name='draw'></a>draw</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> canvas<font color='#5555FF'>&</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font> <b>{</b><b>}</b>
<font color='#0000FF'>private</font>:
map<font color='#5555FF'><</font>drawable<font color='#5555FF'>*</font>,relpos<font color='#5555FF'>></font>::kernel_1a_c widgets;
set<font color='#5555FF'><</font>widget_group<font color='#5555FF'>*</font><font color='#5555FF'>></font>::kernel_1a_c wg_widgets;
<font color='#009900'>// restricted functions
</font> <b><a name='widget_group'></a>widget_group</b><font face='Lucida Console'>(</font>widget_group<font color='#5555FF'>&</font><font face='Lucida Console'>)</font>; <font color='#009900'>// copy constructor
</font> widget_group<font color='#5555FF'>&</font> <b><a name='operator'></a>operator</b><font color='#5555FF'>=</font><font face='Lucida Console'>(</font>widget_group<font color='#5555FF'>&</font><font face='Lucida Console'>)</font>; <font color='#009900'>// assignment operator
</font> <b>}</b>;
<font color='#009900'>// ----------------------------------------------------------------------------------------
</font>
<font color='#0000FF'>class</font> <b><a name='image_widget'></a>image_widget</b> : <font color='#0000FF'>public</font> draggable
<b>{</b>
<font color='#009900'>/*!
INITIAL VALUE
- img.size() == 0
CONVENTION
- img == the image this object displays
!*/</font>
<font color='#0000FF'>public</font>:
<b><a name='image_widget'></a>image_widget</b><font face='Lucida Console'>(</font>
drawable_window<font color='#5555FF'>&</font> w
<font face='Lucida Console'>)</font>: draggable<font face='Lucida Console'>(</font>w<font face='Lucida Console'>)</font> <b>{</b> <font color='#BB00BB'>enable_events</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>; <b>}</b>
~<b><a name='image_widget'></a>image_widget</b><font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>
<b>{</b>
<font color='#BB00BB'>disable_events</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
parent.<font color='#BB00BB'>invalidate_rectangle</font><font face='Lucida Console'>(</font>rect<font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'>template</font> <font color='#5555FF'><</font>
<font color='#0000FF'>typename</font> image_type
<font color='#5555FF'>></font>
<font color='#0000FF'><u>void</u></font> <b><a name='set_image'></a>set_image</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> image_type<font color='#5555FF'>&</font> new_img
<font face='Lucida Console'>)</font>
<b>{</b>
auto_mutex <font color='#BB00BB'>M</font><font face='Lucida Console'>(</font>m<font face='Lucida Console'>)</font>;
<font color='#BB00BB'>assign_image_scaled</font><font face='Lucida Console'>(</font>img,new_img<font face='Lucida Console'>)</font>;
rectangle <font color='#BB00BB'>old</font><font face='Lucida Console'>(</font>rect<font face='Lucida Console'>)</font>;
rect.<font color='#BB00BB'>set_right</font><font face='Lucida Console'>(</font>rect.<font color='#BB00BB'>left</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>+</font><font color='#BB00BB'>num_columns</font><font face='Lucida Console'>(</font>img<font face='Lucida Console'>)</font><font color='#5555FF'>-</font><font color='#979000'>1</font><font face='Lucida Console'>)</font>;
rect.<font color='#BB00BB'>set_bottom</font><font face='Lucida Console'>(</font>rect.<font color='#BB00BB'>top</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>+</font><font color='#BB00BB'>num_rows</font><font face='Lucida Console'>(</font>img<font face='Lucida Console'>)</font><font color='#5555FF'>-</font><font color='#979000'>1</font><font face='Lucida Console'>)</font>;
parent.<font color='#BB00BB'>invalidate_rectangle</font><font face='Lucida Console'>(</font>rect<font color='#5555FF'>+</font>old<font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'>private</font>:
<font color='#0000FF'><u>void</u></font> <b><a name='draw'></a>draw</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> canvas<font color='#5555FF'>&</font> c
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>
<b>{</b>
rectangle area <font color='#5555FF'>=</font> rect.<font color='#BB00BB'>intersect</font><font face='Lucida Console'>(</font>c<font face='Lucida Console'>)</font>;
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>area.<font color='#BB00BB'>is_empty</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>
<font color='#0000FF'>return</font>;
<font color='#BB00BB'>draw_image</font><font face='Lucida Console'>(</font>c, <font color='#BB00BB'>point</font><font face='Lucida Console'>(</font>rect.<font color='#BB00BB'>left</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>,rect.<font color='#BB00BB'>top</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>, img<font face='Lucida Console'>)</font>;
<b>}</b>
array2d<font color='#5555FF'><</font>rgb_alpha_pixel<font color='#5555FF'>></font> img;
<font color='#009900'>// restricted functions
</font> <b><a name='image_widget'></a>image_widget</b><font face='Lucida Console'>(</font>image_widget<font color='#5555FF'>&</font><font face='Lucida Console'>)</font>; <font color='#009900'>// copy constructor
</font> image_widget<font color='#5555FF'>&</font> <b><a name='operator'></a>operator</b><font color='#5555FF'>=</font><font face='Lucida Console'>(</font>image_widget<font color='#5555FF'>&</font><font face='Lucida Console'>)</font>; <font color='#009900'>// assignment operator
</font> <b>}</b>;
<font color='#009900'>// ----------------------------------------------------------------------------------------
</font><font color='#009900'>// ----------------------------------------------------------------------------------------
</font> <font color='#009900'>// class tooltip
</font><font color='#009900'>// ----------------------------------------------------------------------------------------
</font><font color='#009900'>// ----------------------------------------------------------------------------------------
</font>
<font color='#0000FF'>class</font> <b><a name='tooltip'></a>tooltip</b> : <font color='#0000FF'>public</font> mouse_over_event
<b>{</b>
<font color='#009900'>/*!
INITIAL VALUE
- stuff.get() == 0
- events_are_enabled() == false
CONVENTION
- if (events_are_enabled() == true) then
- stuff.get() != 0
!*/</font>
<font color='#0000FF'>public</font>:
<b><a name='tooltip'></a>tooltip</b><font face='Lucida Console'>(</font>
drawable_window<font color='#5555FF'>&</font> w
<font face='Lucida Console'>)</font> :
mouse_over_event<font face='Lucida Console'>(</font>w,MOUSE_CLICK<font face='Lucida Console'>)</font>
<b>{</b><b>}</b>
~<b><a name='tooltip'></a>tooltip</b><font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font><b>{</b> <font color='#BB00BB'>disable_events</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;<b>}</b>
<font color='#0000FF'><u>void</u></font> <b><a name='set_size'></a>set_size</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> width,
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> height
<font face='Lucida Console'>)</font>
<b>{</b>
auto_mutex <font color='#BB00BB'>M</font><font face='Lucida Console'>(</font>m<font face='Lucida Console'>)</font>;
rect <font color='#5555FF'>=</font> <font color='#BB00BB'>resize_rect</font><font face='Lucida Console'>(</font>rect,width,height<font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'><u>void</u></font> <b><a name='set_text'></a>set_text</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> std::string<font color='#5555FF'>&</font> str
<font face='Lucida Console'>)</font>
<b>{</b>
<font color='#BB00BB'>set_text</font><font face='Lucida Console'>(</font><font color='#BB00BB'>convert_mbstring_to_wstring</font><font face='Lucida Console'>(</font>str<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'><u>void</u></font> <b><a name='set_text'></a>set_text</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> std::wstring<font color='#5555FF'>&</font> str
<font face='Lucida Console'>)</font>
<b>{</b>
<font color='#BB00BB'>set_text</font><font face='Lucida Console'>(</font><font color='#BB00BB'>convert_wstring_to_utf32</font><font face='Lucida Console'>(</font>str<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'><u>void</u></font> <b><a name='set_text'></a>set_text</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> ustring<font color='#5555FF'>&</font> str
<font face='Lucida Console'>)</font>
<b>{</b>
auto_mutex <font color='#BB00BB'>M</font><font face='Lucida Console'>(</font>m<font face='Lucida Console'>)</font>;
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font><font color='#5555FF'>!</font>stuff<font face='Lucida Console'>)</font>
<b>{</b>
stuff.<font color='#BB00BB'>reset</font><font face='Lucida Console'>(</font><font color='#0000FF'>new</font> <font color='#BB00BB'>data</font><font face='Lucida Console'>(</font><font color='#5555FF'>*</font><font color='#0000FF'>this</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
<font color='#BB00BB'>enable_events</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
<b>}</b>
stuff<font color='#5555FF'>-</font><font color='#5555FF'>></font>win.<font color='#BB00BB'>set_text</font><font face='Lucida Console'>(</font>str<font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'>const</font> std::string <b><a name='text'></a>text</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>
<b>{</b>
<font color='#0000FF'>return</font> <font color='#BB00BB'>convert_wstring_to_mbstring</font><font face='Lucida Console'>(</font><font color='#BB00BB'>wtext</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'>const</font> std::wstring <b><a name='wtext'></a>wtext</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>
<b>{</b>
<font color='#0000FF'>return</font> <font color='#BB00BB'>convert_utf32_to_wstring</font><font face='Lucida Console'>(</font><font color='#BB00BB'>utext</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'>const</font> dlib::ustring <b><a name='utext'></a>utext</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>
<b>{</b>
auto_mutex <font color='#BB00BB'>M</font><font face='Lucida Console'>(</font>m<font face='Lucida Console'>)</font>;
dlib::ustring temp;
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>stuff<font face='Lucida Console'>)</font>
<b>{</b>
temp <font color='#5555FF'>=</font> stuff<font color='#5555FF'>-</font><font color='#5555FF'>></font>win.text;
<b>}</b>
<font color='#0000FF'>return</font> temp.<font color='#BB00BB'>c_str</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'><u>void</u></font> <b><a name='hide'></a>hide</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>
<b>{</b>
auto_mutex <font color='#BB00BB'>M</font><font face='Lucida Console'>(</font>m<font face='Lucida Console'>)</font>;
mouse_over_event::<font color='#BB00BB'>hide</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>stuff<font face='Lucida Console'>)</font>
<b>{</b>
stuff<font color='#5555FF'>-</font><font color='#5555FF'>></font>tt_timer.<font color='#BB00BB'>stop</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
stuff<font color='#5555FF'>-</font><font color='#5555FF'>></font>win.<font color='#BB00BB'>hide</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
<b>}</b>
<b>}</b>
<font color='#0000FF'><u>void</u></font> <b><a name='disable'></a>disable</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>
<b>{</b>
auto_mutex <font color='#BB00BB'>M</font><font face='Lucida Console'>(</font>m<font face='Lucida Console'>)</font>;
mouse_over_event::<font color='#BB00BB'>disable</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>stuff<font face='Lucida Console'>)</font>
<b>{</b>
stuff<font color='#5555FF'>-</font><font color='#5555FF'>></font>tt_timer.<font color='#BB00BB'>stop</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
stuff<font color='#5555FF'>-</font><font color='#5555FF'>></font>win.<font color='#BB00BB'>hide</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
<b>}</b>
<b>}</b>
<font color='#0000FF'>protected</font>:
<font color='#0000FF'><u>void</u></font> <b><a name='on_mouse_over'></a>on_mouse_over</b><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>
<b>{</b>
stuff<font color='#5555FF'>-</font><font color='#5555FF'>></font>x <font color='#5555FF'>=</font> lastx;
stuff<font color='#5555FF'>-</font><font color='#5555FF'>></font>y <font color='#5555FF'>=</font> lasty;
stuff<font color='#5555FF'>-</font><font color='#5555FF'>></font>tt_timer.<font color='#BB00BB'>start</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'><u>void</u></font> <b><a name='on_mouse_not_over'></a>on_mouse_not_over</b> <font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>
<b>{</b>
stuff<font color='#5555FF'>-</font><font color='#5555FF'>></font>tt_timer.<font color='#BB00BB'>stop</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
stuff<font color='#5555FF'>-</font><font color='#5555FF'>></font>win.<font color='#BB00BB'>hide</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'><u>void</u></font> <b><a name='on_mouse_down'></a>on_mouse_down</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> btn,
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> state,
<font color='#0000FF'><u>long</u></font> x,
<font color='#0000FF'><u>long</u></font> y,
<font color='#0000FF'><u>bool</u></font> is_double_click
<font face='Lucida Console'>)</font>
<b>{</b>
mouse_over_event::<font color='#BB00BB'>on_mouse_down</font><font face='Lucida Console'>(</font>btn,state,x,y,is_double_click<font face='Lucida Console'>)</font>;
stuff<font color='#5555FF'>-</font><font color='#5555FF'>></font>tt_timer.<font color='#BB00BB'>stop</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
stuff<font color='#5555FF'>-</font><font color='#5555FF'>></font>win.<font color='#BB00BB'>hide</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'><u>void</u></font> <b><a name='draw'></a>draw</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> canvas<font color='#5555FF'>&</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font><b>{</b><b>}</b>
<font color='#0000FF'>private</font>:
<font color='#0000FF'>class</font> <b><a name='tooltip_window'></a>tooltip_window</b> : <font color='#0000FF'>public</font> base_window
<b>{</b>
<font color='#0000FF'>public</font>:
<b><a name='tooltip_window'></a>tooltip_window</b> <font face='Lucida Console'>(</font><font color='#0000FF'>const</font> std::shared_ptr<font color='#5555FF'><</font>font<font color='#5555FF'>></font><font color='#5555FF'>&</font> f<font face='Lucida Console'>)</font> : base_window<font face='Lucida Console'>(</font><font color='#979000'>false</font>,<font color='#979000'>true</font><font face='Lucida Console'>)</font>, pad<font face='Lucida Console'>(</font><font color='#979000'>3</font><font face='Lucida Console'>)</font>, mfont<font face='Lucida Console'>(</font>f<font face='Lucida Console'>)</font>
<b>{</b>
<b>}</b>
ustring text;
rectangle rect_all;
rectangle rect_text;
<font color='#0000FF'>const</font> <font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> pad;
<font color='#0000FF'>const</font> std::shared_ptr<font color='#5555FF'><</font>font<font color='#5555FF'>></font> mfont;
<font color='#0000FF'><u>void</u></font> <b><a name='set_text'></a>set_text</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> std::string<font color='#5555FF'>&</font> str
<font face='Lucida Console'>)</font>
<b>{</b>
<font color='#BB00BB'>set_text</font><font face='Lucida Console'>(</font><font color='#BB00BB'>convert_mbstring_to_wstring</font><font face='Lucida Console'>(</font>str<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'><u>void</u></font> <b><a name='set_text'></a>set_text</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> std::wstring<font color='#5555FF'>&</font> str
<font face='Lucida Console'>)</font>
<b>{</b>
<font color='#BB00BB'>set_text</font><font face='Lucida Console'>(</font><font color='#BB00BB'>convert_wstring_to_utf32</font><font face='Lucida Console'>(</font>str<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'><u>void</u></font> <b><a name='set_text'></a>set_text</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> dlib::ustring<font color='#5555FF'>&</font> str
<font face='Lucida Console'>)</font>
<b>{</b>
text <font color='#5555FF'>=</font> str.<font color='#BB00BB'>c_str</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> width, height;
mfont<font color='#5555FF'>-</font><font color='#5555FF'>></font><font color='#BB00BB'>compute_size</font><font face='Lucida Console'>(</font>text,width,height<font face='Lucida Console'>)</font>;
<font color='#BB00BB'>set_size</font><font face='Lucida Console'>(</font>width<font color='#5555FF'>+</font>pad<font color='#5555FF'>*</font><font color='#979000'>2</font>, height<font color='#5555FF'>+</font>pad<font color='#5555FF'>*</font><font color='#979000'>2</font><font face='Lucida Console'>)</font>;
rect_all.<font color='#BB00BB'>set_left</font><font face='Lucida Console'>(</font><font color='#979000'>0</font><font face='Lucida Console'>)</font>;
rect_all.<font color='#BB00BB'>set_top</font><font face='Lucida Console'>(</font><font color='#979000'>0</font><font face='Lucida Console'>)</font>;
rect_all.<font color='#BB00BB'>set_right</font><font face='Lucida Console'>(</font>width<font color='#5555FF'>+</font>pad<font color='#5555FF'>*</font><font color='#979000'>2</font><font color='#5555FF'>-</font><font color='#979000'>1</font><font face='Lucida Console'>)</font>;
rect_all.<font color='#BB00BB'>set_bottom</font><font face='Lucida Console'>(</font>height<font color='#5555FF'>+</font>pad<font color='#5555FF'>*</font><font color='#979000'>2</font><font color='#5555FF'>-</font><font color='#979000'>1</font><font face='Lucida Console'>)</font>;
rect_text <font color='#5555FF'>=</font> <font color='#BB00BB'>move_rect</font><font face='Lucida Console'>(</font><font color='#BB00BB'>rectangle</font><font face='Lucida Console'>(</font>width,height<font face='Lucida Console'>)</font>,pad,pad<font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'><u>void</u></font> <b><a name='paint'></a>paint</b><font face='Lucida Console'>(</font><font color='#0000FF'>const</font> canvas<font color='#5555FF'>&</font> c<font face='Lucida Console'>)</font>
<b>{</b>
c.<font color='#BB00BB'>fill</font><font face='Lucida Console'>(</font><font color='#979000'>255</font>,<font color='#979000'>255</font>,<font color='#979000'>150</font><font face='Lucida Console'>)</font>;
<font color='#BB00BB'>draw_rectangle</font><font face='Lucida Console'>(</font>c, rect_all<font face='Lucida Console'>)</font>;
mfont<font color='#5555FF'>-</font><font color='#5555FF'>></font><font color='#BB00BB'>draw_string</font><font face='Lucida Console'>(</font>c,rect_text,text<font face='Lucida Console'>)</font>;
<b>}</b>
<b>}</b>;
<font color='#0000FF'><u>void</u></font> <b><a name='show_tooltip'></a>show_tooltip</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>
<b>{</b>
auto_mutex <font color='#BB00BB'>M</font><font face='Lucida Console'>(</font>m<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>long</u></font> x, y;
<font color='#009900'>// if the mouse has moved since we started the timer then
</font> <font color='#009900'>// keep waiting until the user stops moving it
</font> <font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>lastx <font color='#5555FF'>!</font><font color='#5555FF'>=</font> stuff<font color='#5555FF'>-</font><font color='#5555FF'>></font>x <font color='#5555FF'>|</font><font color='#5555FF'>|</font> lasty <font color='#5555FF'>!</font><font color='#5555FF'>=</font> stuff<font color='#5555FF'>-</font><font color='#5555FF'>></font>y<font face='Lucida Console'>)</font>
<b>{</b>
stuff<font color='#5555FF'>-</font><font color='#5555FF'>></font>x <font color='#5555FF'>=</font> lastx;
stuff<font color='#5555FF'>-</font><font color='#5555FF'>></font>y <font color='#5555FF'>=</font> lasty;
<font color='#0000FF'>return</font>;
<b>}</b>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> display_width, display_height;
<font color='#009900'>// stop the timer
</font> stuff<font color='#5555FF'>-</font><font color='#5555FF'>></font>tt_timer.<font color='#BB00BB'>stop</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
parent.<font color='#BB00BB'>get_pos</font><font face='Lucida Console'>(</font>x,y<font face='Lucida Console'>)</font>;
x <font color='#5555FF'>+</font><font color='#5555FF'>=</font> lastx<font color='#5555FF'>+</font><font color='#979000'>15</font>;
y <font color='#5555FF'>+</font><font color='#5555FF'>=</font> lasty<font color='#5555FF'>+</font><font color='#979000'>15</font>;
<font color='#009900'>// make sure the tooltip isn't going to be off the screen
</font> parent.<font color='#BB00BB'>get_display_size</font><font face='Lucida Console'>(</font>display_width, display_height<font face='Lucida Console'>)</font>;
rectangle <font color='#BB00BB'>wrect</font><font face='Lucida Console'>(</font><font color='#BB00BB'>move_rect</font><font face='Lucida Console'>(</font>stuff<font color='#5555FF'>-</font><font color='#5555FF'>></font>win.rect_all,x,y<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
rectangle <font color='#BB00BB'>srect</font><font face='Lucida Console'>(</font>display_width, display_height<font face='Lucida Console'>)</font>;
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>srect.<font color='#BB00BB'>contains</font><font face='Lucida Console'>(</font>wrect<font face='Lucida Console'>)</font> <font color='#5555FF'>=</font><font color='#5555FF'>=</font> <font color='#979000'>false</font><font face='Lucida Console'>)</font>
<b>{</b>
rectangle <font color='#BB00BB'>temp</font><font face='Lucida Console'>(</font>srect.<font color='#BB00BB'>intersect</font><font face='Lucida Console'>(</font>wrect<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
x <font color='#5555FF'>-</font><font color='#5555FF'>=</font> wrect.<font color='#BB00BB'>width</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>-</font>temp.<font color='#BB00BB'>width</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
y <font color='#5555FF'>-</font><font color='#5555FF'>=</font> wrect.<font color='#BB00BB'>height</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>-</font>temp.<font color='#BB00BB'>height</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
<b>}</b>
stuff<font color='#5555FF'>-</font><font color='#5555FF'>></font>win.<font color='#BB00BB'>set_pos</font><font face='Lucida Console'>(</font>x,y<font face='Lucida Console'>)</font>;
stuff<font color='#5555FF'>-</font><font color='#5555FF'>></font>win.<font color='#BB00BB'>show</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#009900'>// put all this stuff in data so we can arrange to only
</font> <font color='#009900'>// construct it when someone is actually using the tooltip widget
</font> <font color='#009900'>// rather than just instantiating it.
</font> <font color='#0000FF'>struct</font> <b><a name='data'></a>data</b>
<b>{</b>
<b><a name='data'></a>data</b><font face='Lucida Console'>(</font>
tooltip<font color='#5555FF'>&</font> self
<font face='Lucida Console'>)</font> :
x<font face='Lucida Console'>(</font><font color='#5555FF'>-</font><font color='#979000'>1</font><font face='Lucida Console'>)</font>,
y<font face='Lucida Console'>(</font><font color='#5555FF'>-</font><font color='#979000'>1</font><font face='Lucida Console'>)</font>,
win<font face='Lucida Console'>(</font>self.mfont<font face='Lucida Console'>)</font>,
tt_timer<font face='Lucida Console'>(</font>self,<font color='#5555FF'>&</font>tooltip::show_tooltip<font face='Lucida Console'>)</font>
<b>{</b>
tt_timer.<font color='#BB00BB'>set_delay_time</font><font face='Lucida Console'>(</font><font color='#979000'>400</font><font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'><u>long</u></font> x, y;
tooltip_window win;
timer<font color='#5555FF'><</font>tooltip<font color='#5555FF'>></font> tt_timer;
<b>}</b>;
<font color='#0000FF'>friend</font> <font color='#0000FF'>struct</font> data;
std::unique_ptr<font color='#5555FF'><</font>data<font color='#5555FF'>></font> stuff;
<font color='#009900'>// restricted functions
</font> <b><a name='tooltip'></a>tooltip</b><font face='Lucida Console'>(</font>tooltip<font color='#5555FF'>&</font><font face='Lucida Console'>)</font>; <font color='#009900'>// copy constructor
</font> tooltip<font color='#5555FF'>&</font> <b><a name='operator'></a>operator</b><font color='#5555FF'>=</font><font face='Lucida Console'>(</font>tooltip<font color='#5555FF'>&</font><font face='Lucida Console'>)</font>; <font color='#009900'>// assignment operator
</font> <b>}</b>;
<font color='#009900'>// ----------------------------------------------------------------------------------------
</font><font color='#009900'>// ----------------------------------------------------------------------------------------
</font> <font color='#009900'>// class button
</font><font color='#009900'>// ----------------------------------------------------------------------------------------
</font><font color='#009900'>// ----------------------------------------------------------------------------------------
</font>
<font color='#0000FF'>class</font> <b><a name='button'></a>button</b> : <font color='#0000FF'>public</font> button_action
<b>{</b>
<font color='#0000FF'>public</font>:
<b><a name='button'></a>button</b><font face='Lucida Console'>(</font>
drawable_window<font color='#5555FF'>&</font> w
<font face='Lucida Console'>)</font> :
button_action<font face='Lucida Console'>(</font>w<font face='Lucida Console'>)</font>,
btn_tooltip<font face='Lucida Console'>(</font>w<font face='Lucida Console'>)</font>
<b>{</b>
style.<font color='#BB00BB'>reset</font><font face='Lucida Console'>(</font><font color='#0000FF'>new</font> <font color='#BB00BB'>button_style_default</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
<font color='#BB00BB'>enable_events</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
<b>}</b>
~<b><a name='button'></a>button</b><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font> <b>{</b> <font color='#BB00BB'>disable_events</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>; parent.<font color='#BB00BB'>invalidate_rectangle</font><font face='Lucida Console'>(</font>style<font color='#5555FF'>-</font><font color='#5555FF'>></font><font color='#BB00BB'>get_invalidation_rect</font><font face='Lucida Console'>(</font>rect<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>; <b>}</b>
<font color='#0000FF'><u>void</u></font> <b><a name='set_size'></a>set_size</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> width,
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> height
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='set_name'></a>set_name</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> std::string<font color='#5555FF'>&</font> name_
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='set_name'></a>set_name</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> std::wstring<font color='#5555FF'>&</font> name_
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='set_name'></a>set_name</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> dlib::ustring<font color='#5555FF'>&</font> name_
<font face='Lucida Console'>)</font>;
<font color='#0000FF'>const</font> std::string <b><a name='name'></a>name</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>;
<font color='#0000FF'>const</font> std::wstring <b><a name='wname'></a>wname</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>;
<font color='#0000FF'>const</font> dlib::ustring <b><a name='uname'></a>uname</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='set_tooltip_text'></a>set_tooltip_text</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> std::string<font color='#5555FF'>&</font> text
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='set_tooltip_text'></a>set_tooltip_text</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> std::wstring<font color='#5555FF'>&</font> text
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='set_tooltip_text'></a>set_tooltip_text</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> dlib::ustring<font color='#5555FF'>&</font> text
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='set_pos'></a>set_pos</b><font face='Lucida Console'>(</font>
<font color='#0000FF'><u>long</u></font> x,
<font color='#0000FF'><u>long</u></font> y
<font face='Lucida Console'>)</font>;
<font color='#0000FF'>const</font> std::string <b><a name='tooltip_text'></a>tooltip_text</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>;
<font color='#0000FF'>const</font> std::wstring <b><a name='tooltip_wtext'></a>tooltip_wtext</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>;
<font color='#0000FF'>const</font> dlib::ustring <b><a name='tooltip_utext'></a>tooltip_utext</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='set_main_font'></a>set_main_font</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> std::shared_ptr<font color='#5555FF'><</font>font<font color='#5555FF'>></font><font color='#5555FF'>&</font> f
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='show'></a>show</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='hide'></a>hide</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='enable'></a>enable</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='disable'></a>disable</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'>template</font> <font color='#5555FF'><</font>
<font color='#0000FF'>typename</font> style_type
<font color='#5555FF'>></font>
<font color='#0000FF'><u>void</u></font> <b><a name='set_style'></a>set_style</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> style_type<font color='#5555FF'>&</font> style_
<font face='Lucida Console'>)</font>
<b>{</b>
auto_mutex <font color='#BB00BB'>M</font><font face='Lucida Console'>(</font>m<font face='Lucida Console'>)</font>;
style.<font color='#BB00BB'>reset</font><font face='Lucida Console'>(</font><font color='#0000FF'>new</font> <font color='#BB00BB'>style_type</font><font face='Lucida Console'>(</font>style_<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
rect <font color='#5555FF'>=</font> <font color='#BB00BB'>move_rect</font><font face='Lucida Console'>(</font>style<font color='#5555FF'>-</font><font color='#5555FF'>></font><font color='#BB00BB'>get_min_size</font><font face='Lucida Console'>(</font>name_,<font color='#5555FF'>*</font>mfont<font face='Lucida Console'>)</font>, rect.<font color='#BB00BB'>left</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>, rect.<font color='#BB00BB'>top</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
parent.<font color='#BB00BB'>invalidate_rectangle</font><font face='Lucida Console'>(</font>style<font color='#5555FF'>-</font><font color='#5555FF'>></font><font color='#BB00BB'>get_invalidation_rect</font><font face='Lucida Console'>(</font>rect<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'>template</font> <font color='#5555FF'><</font>
<font color='#0000FF'>typename</font> T
<font color='#5555FF'>></font>
<font color='#0000FF'><u>void</u></font> <b><a name='set_click_handler'></a>set_click_handler</b> <font face='Lucida Console'>(</font>
T<font color='#5555FF'>&</font> object,
<font color='#0000FF'><u>void</u></font> <font face='Lucida Console'>(</font>T::<font color='#5555FF'>*</font>event_handler_<font face='Lucida Console'>)</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>
<font face='Lucida Console'>)</font>
<b>{</b>
auto_mutex <font color='#BB00BB'>M</font><font face='Lucida Console'>(</font>m<font face='Lucida Console'>)</font>;
event_handler <font color='#5555FF'>=</font> <font color='#BB00BB'>make_mfp</font><font face='Lucida Console'>(</font>object,event_handler_<font face='Lucida Console'>)</font>;
event_handler_self.<font color='#BB00BB'>clear</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'><u>void</u></font> <b><a name='set_click_handler'></a>set_click_handler</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> any_function<font color='#5555FF'><</font><font color='#0000FF'><u>void</u></font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>></font><font color='#5555FF'>&</font> event_handler_
<font face='Lucida Console'>)</font>
<b>{</b>
auto_mutex <font color='#BB00BB'>M</font><font face='Lucida Console'>(</font>m<font face='Lucida Console'>)</font>;
event_handler <font color='#5555FF'>=</font> event_handler_;
event_handler_self.<font color='#BB00BB'>clear</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'>template</font> <font color='#5555FF'><</font>
<font color='#0000FF'>typename</font> T
<font color='#5555FF'>></font>
<font color='#0000FF'><u>void</u></font> <b><a name='set_click_handler'></a>set_click_handler</b> <font face='Lucida Console'>(</font>
T<font color='#5555FF'>&</font> object,
<font color='#0000FF'><u>void</u></font> <font face='Lucida Console'>(</font>T::<font color='#5555FF'>*</font>event_handler_<font face='Lucida Console'>)</font><font face='Lucida Console'>(</font>button<font color='#5555FF'>&</font><font face='Lucida Console'>)</font>
<font face='Lucida Console'>)</font>
<b>{</b>
auto_mutex <font color='#BB00BB'>M</font><font face='Lucida Console'>(</font>m<font face='Lucida Console'>)</font>;
event_handler_self <font color='#5555FF'>=</font> <font color='#BB00BB'>make_mfp</font><font face='Lucida Console'>(</font>object,event_handler_<font face='Lucida Console'>)</font>;
event_handler.<font color='#BB00BB'>clear</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'><u>void</u></font> <b><a name='set_sourced_click_handler'></a>set_sourced_click_handler</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> any_function<font color='#5555FF'><</font><font color='#0000FF'><u>void</u></font><font face='Lucida Console'>(</font>button<font color='#5555FF'>&</font><font face='Lucida Console'>)</font><font color='#5555FF'>></font><font color='#5555FF'>&</font> event_handler_
<font face='Lucida Console'>)</font>
<b>{</b>
auto_mutex <font color='#BB00BB'>M</font><font face='Lucida Console'>(</font>m<font face='Lucida Console'>)</font>;
event_handler_self <font color='#5555FF'>=</font> event_handler_;
event_handler.<font color='#BB00BB'>clear</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'><u>bool</u></font> <b><a name='is_depressed'></a>is_depressed</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>
<b>{</b>
auto_mutex <font color='#BB00BB'>M</font><font face='Lucida Console'>(</font>m<font face='Lucida Console'>)</font>;
<font color='#0000FF'>return</font> button_action::<font color='#BB00BB'>is_depressed</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'>template</font> <font color='#5555FF'><</font>
<font color='#0000FF'>typename</font> T
<font color='#5555FF'>></font>
<font color='#0000FF'><u>void</u></font> <b><a name='set_button_down_handler'></a>set_button_down_handler</b> <font face='Lucida Console'>(</font>
T<font color='#5555FF'>&</font> object,
<font color='#0000FF'><u>void</u></font> <font face='Lucida Console'>(</font>T::<font color='#5555FF'>*</font>event_handler<font face='Lucida Console'>)</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>
<font face='Lucida Console'>)</font>
<b>{</b>
auto_mutex <font color='#BB00BB'>M</font><font face='Lucida Console'>(</font>m<font face='Lucida Console'>)</font>;
button_down_handler <font color='#5555FF'>=</font> <font color='#BB00BB'>make_mfp</font><font face='Lucida Console'>(</font>object,event_handler<font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'><u>void</u></font> <b><a name='set_button_down_handler'></a>set_button_down_handler</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> any_function<font color='#5555FF'><</font><font color='#0000FF'><u>void</u></font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>></font><font color='#5555FF'>&</font> event_handler
<font face='Lucida Console'>)</font>
<b>{</b>
auto_mutex <font color='#BB00BB'>M</font><font face='Lucida Console'>(</font>m<font face='Lucida Console'>)</font>;
button_down_handler <font color='#5555FF'>=</font> event_handler;
<b>}</b>
<font color='#0000FF'>template</font> <font color='#5555FF'><</font>
<font color='#0000FF'>typename</font> T
<font color='#5555FF'>></font>
<font color='#0000FF'><u>void</u></font> <b><a name='set_button_up_handler'></a>set_button_up_handler</b> <font face='Lucida Console'>(</font>
T<font color='#5555FF'>&</font> object,
<font color='#0000FF'><u>void</u></font> <font face='Lucida Console'>(</font>T::<font color='#5555FF'>*</font>event_handler<font face='Lucida Console'>)</font><font face='Lucida Console'>(</font><font color='#0000FF'><u>bool</u></font> mouse_over<font face='Lucida Console'>)</font>
<font face='Lucida Console'>)</font>
<b>{</b>
auto_mutex <font color='#BB00BB'>M</font><font face='Lucida Console'>(</font>m<font face='Lucida Console'>)</font>;
button_up_handler <font color='#5555FF'>=</font> <font color='#BB00BB'>make_mfp</font><font face='Lucida Console'>(</font>object,event_handler<font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'><u>void</u></font> <b><a name='set_button_up_handler'></a>set_button_up_handler</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> any_function<font color='#5555FF'><</font><font color='#0000FF'><u>void</u></font><font face='Lucida Console'>(</font><font color='#0000FF'><u>bool</u></font><font face='Lucida Console'>)</font><font color='#5555FF'>></font><font color='#5555FF'>&</font> event_handler
<font face='Lucida Console'>)</font>
<b>{</b>
auto_mutex <font color='#BB00BB'>M</font><font face='Lucida Console'>(</font>m<font face='Lucida Console'>)</font>;
button_up_handler <font color='#5555FF'>=</font> event_handler;
<b>}</b>
<font color='#0000FF'>template</font> <font color='#5555FF'><</font>
<font color='#0000FF'>typename</font> T
<font color='#5555FF'>></font>
<font color='#0000FF'><u>void</u></font> <b><a name='set_button_down_handler'></a>set_button_down_handler</b> <font face='Lucida Console'>(</font>
T<font color='#5555FF'>&</font> object,
<font color='#0000FF'><u>void</u></font> <font face='Lucida Console'>(</font>T::<font color='#5555FF'>*</font>event_handler<font face='Lucida Console'>)</font><font face='Lucida Console'>(</font>button<font color='#5555FF'>&</font><font face='Lucida Console'>)</font>
<font face='Lucida Console'>)</font>
<b>{</b>
auto_mutex <font color='#BB00BB'>M</font><font face='Lucida Console'>(</font>m<font face='Lucida Console'>)</font>;
button_down_handler_self <font color='#5555FF'>=</font> <font color='#BB00BB'>make_mfp</font><font face='Lucida Console'>(</font>object,event_handler<font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'><u>void</u></font> <b><a name='set_sourced_button_down_handler'></a>set_sourced_button_down_handler</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> any_function<font color='#5555FF'><</font><font color='#0000FF'><u>void</u></font><font face='Lucida Console'>(</font>button<font color='#5555FF'>&</font><font face='Lucida Console'>)</font><font color='#5555FF'>></font><font color='#5555FF'>&</font> event_handler
<font face='Lucida Console'>)</font>
<b>{</b>
auto_mutex <font color='#BB00BB'>M</font><font face='Lucida Console'>(</font>m<font face='Lucida Console'>)</font>;
button_down_handler_self <font color='#5555FF'>=</font> event_handler;
<b>}</b>
<font color='#0000FF'>template</font> <font color='#5555FF'><</font>
<font color='#0000FF'>typename</font> T
<font color='#5555FF'>></font>
<font color='#0000FF'><u>void</u></font> <b><a name='set_button_up_handler'></a>set_button_up_handler</b> <font face='Lucida Console'>(</font>
T<font color='#5555FF'>&</font> object,
<font color='#0000FF'><u>void</u></font> <font face='Lucida Console'>(</font>T::<font color='#5555FF'>*</font>event_handler<font face='Lucida Console'>)</font><font face='Lucida Console'>(</font><font color='#0000FF'><u>bool</u></font> mouse_over, button<font color='#5555FF'>&</font><font face='Lucida Console'>)</font>
<font face='Lucida Console'>)</font>
<b>{</b>
auto_mutex <font color='#BB00BB'>M</font><font face='Lucida Console'>(</font>m<font face='Lucida Console'>)</font>;
button_up_handler_self <font color='#5555FF'>=</font> <font color='#BB00BB'>make_mfp</font><font face='Lucida Console'>(</font>object,event_handler<font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'><u>void</u></font> <b><a name='set_sourced_button_up_handler'></a>set_sourced_button_up_handler</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> any_function<font color='#5555FF'><</font><font color='#0000FF'><u>void</u></font><font face='Lucida Console'>(</font><font color='#0000FF'><u>bool</u></font>,button<font color='#5555FF'>&</font><font face='Lucida Console'>)</font><font color='#5555FF'>></font><font color='#5555FF'>&</font> event_handler
<font face='Lucida Console'>)</font>
<b>{</b>
auto_mutex <font color='#BB00BB'>M</font><font face='Lucida Console'>(</font>m<font face='Lucida Console'>)</font>;
button_up_handler_self <font color='#5555FF'>=</font> event_handler;
<b>}</b>
<font color='#0000FF'>private</font>:
<font color='#009900'>// restricted functions
</font> <b><a name='button'></a>button</b><font face='Lucida Console'>(</font>button<font color='#5555FF'>&</font><font face='Lucida Console'>)</font>; <font color='#009900'>// copy constructor
</font> button<font color='#5555FF'>&</font> <b><a name='operator'></a>operator</b><font color='#5555FF'>=</font><font face='Lucida Console'>(</font>button<font color='#5555FF'>&</font><font face='Lucida Console'>)</font>; <font color='#009900'>// assignment operator
</font>
dlib::ustring name_;
tooltip btn_tooltip;
any_function<font color='#5555FF'><</font><font color='#0000FF'><u>void</u></font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>></font> event_handler;
any_function<font color='#5555FF'><</font><font color='#0000FF'><u>void</u></font><font face='Lucida Console'>(</font>button<font color='#5555FF'>&</font><font face='Lucida Console'>)</font><font color='#5555FF'>></font> event_handler_self;
any_function<font color='#5555FF'><</font><font color='#0000FF'><u>void</u></font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>></font> button_down_handler;
any_function<font color='#5555FF'><</font><font color='#0000FF'><u>void</u></font><font face='Lucida Console'>(</font><font color='#0000FF'><u>bool</u></font><font face='Lucida Console'>)</font><font color='#5555FF'>></font> button_up_handler;
any_function<font color='#5555FF'><</font><font color='#0000FF'><u>void</u></font><font face='Lucida Console'>(</font>button<font color='#5555FF'>&</font><font face='Lucida Console'>)</font><font color='#5555FF'>></font> button_down_handler_self;
any_function<font color='#5555FF'><</font><font color='#0000FF'><u>void</u></font><font face='Lucida Console'>(</font><font color='#0000FF'><u>bool</u></font>,button<font color='#5555FF'>&</font><font face='Lucida Console'>)</font><font color='#5555FF'>></font> button_up_handler_self;
std::unique_ptr<font color='#5555FF'><</font>button_style<font color='#5555FF'>></font> style;
<font color='#0000FF'>protected</font>:
<font color='#0000FF'><u>void</u></font> <b><a name='draw'></a>draw</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> canvas<font color='#5555FF'>&</font> c
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font> <b>{</b> style<font color='#5555FF'>-</font><font color='#5555FF'>></font><font color='#BB00BB'>draw_button</font><font face='Lucida Console'>(</font>c,rect,enabled,<font color='#5555FF'>*</font>mfont,lastx,lasty,name_,<font color='#BB00BB'>is_depressed</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>; <b>}</b>
<font color='#0000FF'><u>void</u></font> <b><a name='on_button_up'></a>on_button_up</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>bool</u></font> mouse_over
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='on_button_down'></a>on_button_down</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='on_mouse_over'></a>on_mouse_over</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font><b>{</b> <font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>style<font color='#5555FF'>-</font><font color='#5555FF'>></font><font color='#BB00BB'>redraw_on_mouse_over</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font> parent.<font color='#BB00BB'>invalidate_rectangle</font><font face='Lucida Console'>(</font>style<font color='#5555FF'>-</font><font color='#5555FF'>></font><font color='#BB00BB'>get_invalidation_rect</font><font face='Lucida Console'>(</font>rect<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>; <b>}</b>
<font color='#0000FF'><u>void</u></font> <b><a name='on_mouse_not_over'></a>on_mouse_not_over</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font><b>{</b> <font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>style<font color='#5555FF'>-</font><font color='#5555FF'>></font><font color='#BB00BB'>redraw_on_mouse_over</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font> parent.<font color='#BB00BB'>invalidate_rectangle</font><font face='Lucida Console'>(</font>style<font color='#5555FF'>-</font><font color='#5555FF'>></font><font color='#BB00BB'>get_invalidation_rect</font><font face='Lucida Console'>(</font>rect<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>; <b>}</b>
<b>}</b>;
<font color='#009900'>// ----------------------------------------------------------------------------------------
</font><font color='#009900'>// ----------------------------------------------------------------------------------------
</font> <font color='#009900'>// class scroll_bar
</font><font color='#009900'>// ----------------------------------------------------------------------------------------
</font><font color='#009900'>// ----------------------------------------------------------------------------------------
</font>
<font color='#0000FF'>class</font> <b><a name='scroll_bar'></a>scroll_bar</b> : <font color='#0000FF'>public</font> drawable
<b>{</b>
<font color='#009900'>/*!
INITIAL VALUE
- ori == a value given by the constructor
- style == a scroll_bar_style_default object
- pos == 0
- max_pos == 0
- js == 10
CONVENTION
- ori == orientation()
- b1 == the button that is near the 0 end of the scroll bar
- b2 == the button that is near the max_pos() end of the scroll bar
- max_pos == max_slider_pos()
- pos == slider_pos()
- js == jump_size()
!*/</font>
<font color='#0000FF'>public</font>:
<font color='#0000FF'>enum</font> <b><a name='bar_orientation'></a>bar_orientation</b>
<b>{</b>
HORIZONTAL,
VERTICAL
<b>}</b>;
<b><a name='scroll_bar'></a>scroll_bar</b><font face='Lucida Console'>(</font>
drawable_window<font color='#5555FF'>&</font> w,
bar_orientation orientation_
<font face='Lucida Console'>)</font>;
<font color='#0000FF'>virtual</font> ~<b><a name='scroll_bar'></a>scroll_bar</b><font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
bar_orientation <b><a name='orientation'></a>orientation</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='set_length'></a>set_length</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> length
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>long</u></font> <b><a name='max_slider_pos'></a>max_slider_pos</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='set_max_slider_pos'></a>set_max_slider_pos</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>long</u></font> mpos
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='set_slider_pos'></a>set_slider_pos</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>long</u></font> pos
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>long</u></font> <b><a name='slider_pos'></a>slider_pos</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>;
<font color='#0000FF'>template</font> <font color='#5555FF'><</font>
<font color='#0000FF'>typename</font> T
<font color='#5555FF'>></font>
<font color='#0000FF'><u>void</u></font> <b><a name='set_scroll_handler'></a>set_scroll_handler</b> <font face='Lucida Console'>(</font>
T<font color='#5555FF'>&</font> object,
<font color='#0000FF'><u>void</u></font> <font face='Lucida Console'>(</font>T::<font color='#5555FF'>*</font>eh<font face='Lucida Console'>)</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>
<font face='Lucida Console'>)</font> <b>{</b> auto_mutex <font color='#BB00BB'>M</font><font face='Lucida Console'>(</font>m<font face='Lucida Console'>)</font>; scroll_handler <font color='#5555FF'>=</font> <font color='#BB00BB'>make_mfp</font><font face='Lucida Console'>(</font>object,eh<font face='Lucida Console'>)</font>; <b>}</b>
<font color='#0000FF'><u>void</u></font> <b><a name='set_scroll_handler'></a>set_scroll_handler</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> any_function<font color='#5555FF'><</font><font color='#0000FF'><u>void</u></font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>></font><font color='#5555FF'>&</font> eh
<font face='Lucida Console'>)</font> <b>{</b> auto_mutex <font color='#BB00BB'>M</font><font face='Lucida Console'>(</font>m<font face='Lucida Console'>)</font>; scroll_handler <font color='#5555FF'>=</font> eh; <b>}</b>
<font color='#0000FF'><u>void</u></font> <b><a name='set_pos'></a>set_pos</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>long</u></font> x,
<font color='#0000FF'><u>long</u></font> y
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='enable'></a>enable</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>
<b>{</b>
auto_mutex <font color='#BB00BB'>M</font><font face='Lucida Console'>(</font>m<font face='Lucida Console'>)</font>;
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font><font color='#5555FF'>!</font>hidden<font face='Lucida Console'>)</font>
<font color='#BB00BB'>show_slider</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>max_pos <font color='#5555FF'>!</font><font color='#5555FF'>=</font> <font color='#979000'>0</font><font face='Lucida Console'>)</font>
<b>{</b>
b1.<font color='#BB00BB'>enable</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
b2.<font color='#BB00BB'>enable</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
<b>}</b>
drawable::<font color='#BB00BB'>enable</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'><u>void</u></font> <b><a name='disable'></a>disable</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>
<b>{</b>
auto_mutex <font color='#BB00BB'>M</font><font face='Lucida Console'>(</font>m<font face='Lucida Console'>)</font>;
<font color='#BB00BB'>hide_slider</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
b1.<font color='#BB00BB'>disable</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
b2.<font color='#BB00BB'>disable</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
drawable::<font color='#BB00BB'>disable</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'><u>void</u></font> <b><a name='hide'></a>hide</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>
<b>{</b>
auto_mutex <font color='#BB00BB'>M</font><font face='Lucida Console'>(</font>m<font face='Lucida Console'>)</font>;
<font color='#BB00BB'>hide_slider</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
top_filler.<font color='#BB00BB'>hide</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
bottom_filler.<font color='#BB00BB'>hide</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
b1.<font color='#BB00BB'>hide</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
b2.<font color='#BB00BB'>hide</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
drawable::<font color='#BB00BB'>hide</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'><u>void</u></font> <b><a name='show'></a>show</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>
<b>{</b>
auto_mutex <font color='#BB00BB'>M</font><font face='Lucida Console'>(</font>m<font face='Lucida Console'>)</font>;
b1.<font color='#BB00BB'>show</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
b2.<font color='#BB00BB'>show</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
drawable::<font color='#BB00BB'>show</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
top_filler.<font color='#BB00BB'>show</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>enabled<font face='Lucida Console'>)</font>
<font color='#BB00BB'>show_slider</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'><u>void</u></font> <b><a name='set_z_order'></a>set_z_order</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>long</u></font> order
<font face='Lucida Console'>)</font>
<b>{</b>
auto_mutex <font color='#BB00BB'>M</font><font face='Lucida Console'>(</font>m<font face='Lucida Console'>)</font>;
slider.<font color='#BB00BB'>set_z_order</font><font face='Lucida Console'>(</font>order<font face='Lucida Console'>)</font>;
top_filler.<font color='#BB00BB'>set_z_order</font><font face='Lucida Console'>(</font>order<font face='Lucida Console'>)</font>;
bottom_filler.<font color='#BB00BB'>set_z_order</font><font face='Lucida Console'>(</font>order<font face='Lucida Console'>)</font>;
b1.<font color='#BB00BB'>set_z_order</font><font face='Lucida Console'>(</font>order<font face='Lucida Console'>)</font>;
b2.<font color='#BB00BB'>set_z_order</font><font face='Lucida Console'>(</font>order<font face='Lucida Console'>)</font>;
drawable::<font color='#BB00BB'>set_z_order</font><font face='Lucida Console'>(</font>order<font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'><u>void</u></font> <b><a name='set_jump_size'></a>set_jump_size</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>long</u></font> js
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>long</u></font> <b><a name='jump_size'></a>jump_size</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>;
<font color='#0000FF'>template</font> <font color='#5555FF'><</font>
<font color='#0000FF'>typename</font> style_type
<font color='#5555FF'>></font>
<font color='#0000FF'><u>void</u></font> <b><a name='set_style'></a>set_style</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> style_type<font color='#5555FF'>&</font> style_
<font face='Lucida Console'>)</font>
<b>{</b>
auto_mutex <font color='#BB00BB'>M</font><font face='Lucida Console'>(</font>m<font face='Lucida Console'>)</font>;
style.<font color='#BB00BB'>reset</font><font face='Lucida Console'>(</font><font color='#0000FF'>new</font> <font color='#BB00BB'>style_type</font><font face='Lucida Console'>(</font>style_<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>ori <font color='#5555FF'>=</font><font color='#5555FF'>=</font> HORIZONTAL<font face='Lucida Console'>)</font>
<b>{</b>
b1.<font color='#BB00BB'>set_style</font><font face='Lucida Console'>(</font>style_.<font color='#BB00BB'>get_left_button_style</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
b2.<font color='#BB00BB'>set_style</font><font face='Lucida Console'>(</font>style_.<font color='#BB00BB'>get_right_button_style</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
<font color='#BB00BB'>set_length</font><font face='Lucida Console'>(</font>rect.<font color='#BB00BB'>width</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'>else</font>
<b>{</b>
b1.<font color='#BB00BB'>set_style</font><font face='Lucida Console'>(</font>style_.<font color='#BB00BB'>get_up_button_style</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
b2.<font color='#BB00BB'>set_style</font><font face='Lucida Console'>(</font>style_.<font color='#BB00BB'>get_down_button_style</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
<font color='#BB00BB'>set_length</font><font face='Lucida Console'>(</font>rect.<font color='#BB00BB'>height</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
<b>}</b>
<b>}</b>
<font color='#0000FF'>private</font>:
<font color='#0000FF'><u>void</u></font> <b><a name='hide_slider'></a>hide_slider</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#009900'>/*!
ensures
- hides the slider and makes any other changes needed so that the
scroll_bar still looks right.
!*/</font>
<font color='#0000FF'><u>void</u></font> <b><a name='show_slider'></a>show_slider</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#009900'>/*!
ensures
- shows the slider and makes any other changes needed so that the
scroll_bar still looks right.
!*/</font>
<font color='#0000FF'><u>void</u></font> <b><a name='on_slider_drag'></a>on_slider_drag</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#009900'>/*!
requires
- is called whenever the user drags the slider
!*/</font>
<font color='#0000FF'><u>void</u></font> <b><a name='draw'></a>draw</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> canvas<font color='#5555FF'>&</font> c
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='b1_down'></a>b1_down</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='b1_up'></a>b1_up</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>bool</u></font> mouse_over
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='b2_down'></a>b2_down</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='b2_up'></a>b2_up</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>bool</u></font> mouse_over
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='top_filler_down'></a>top_filler_down</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='top_filler_up'></a>top_filler_up</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>bool</u></font> mouse_over
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='bottom_filler_down'></a>bottom_filler_down</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='bottom_filler_up'></a>bottom_filler_up</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>bool</u></font> mouse_over
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='on_user_event'></a>on_user_event</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>int</u></font> i
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='delayed_set_slider_pos'></a>delayed_set_slider_pos</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> dpos
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='b1_down_t'></a>b1_down_t</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='b2_down_t'></a>b2_down_t</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='top_filler_down_t'></a>top_filler_down_t</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='bottom_filler_down_t'></a>bottom_filler_down_t</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'>friend</font> <font color='#0000FF'>class</font> filler;
<font color='#0000FF'>class</font> <b><a name='filler'></a>filler</b> : <font color='#0000FF'>public</font> button_action
<b>{</b>
<font color='#0000FF'>friend</font> <font color='#0000FF'>class</font> scroll_bar;
<font color='#0000FF'>public</font>:
<b><a name='filler'></a>filler</b> <font face='Lucida Console'>(</font>
drawable_window<font color='#5555FF'>&</font> w,
scroll_bar<font color='#5555FF'>&</font> object,
<font color='#0000FF'><u>void</u></font> <font face='Lucida Console'>(</font>scroll_bar::<font color='#5555FF'>*</font>down<font face='Lucida Console'>)</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>,
<font color='#0000FF'><u>void</u></font> <font face='Lucida Console'>(</font>scroll_bar::<font color='#5555FF'>*</font>up<font face='Lucida Console'>)</font><font face='Lucida Console'>(</font><font color='#0000FF'><u>bool</u></font><font face='Lucida Console'>)</font>
<font face='Lucida Console'>)</font>:
button_action<font face='Lucida Console'>(</font>w<font face='Lucida Console'>)</font>,
my_scroll_bar<font face='Lucida Console'>(</font>object<font face='Lucida Console'>)</font>
<b>{</b>
bup <font color='#5555FF'>=</font> <font color='#BB00BB'>make_mfp</font><font face='Lucida Console'>(</font>object,up<font face='Lucida Console'>)</font>;
bdown <font color='#5555FF'>=</font> <font color='#BB00BB'>make_mfp</font><font face='Lucida Console'>(</font>object,down<font face='Lucida Console'>)</font>;
<font color='#BB00BB'>enable_events</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
<b>}</b>
~<b><a name='filler'></a>filler</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>
<b>{</b>
<font color='#BB00BB'>disable_events</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'><u>void</u></font> <b><a name='set_size'></a>set_size</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> width,
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> height
<font face='Lucida Console'>)</font>
<b>{</b>
rectangle <font color='#BB00BB'>old</font><font face='Lucida Console'>(</font>rect<font face='Lucida Console'>)</font>;
<font color='#0000FF'>const</font> <font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> x <font color='#5555FF'>=</font> rect.<font color='#BB00BB'>left</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
<font color='#0000FF'>const</font> <font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> y <font color='#5555FF'>=</font> rect.<font color='#BB00BB'>top</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
rect.<font color='#BB00BB'>set_right</font><font face='Lucida Console'>(</font>x<font color='#5555FF'>+</font>width<font color='#5555FF'>-</font><font color='#979000'>1</font><font face='Lucida Console'>)</font>;
rect.<font color='#BB00BB'>set_bottom</font><font face='Lucida Console'>(</font>y<font color='#5555FF'>+</font>height<font color='#5555FF'>-</font><font color='#979000'>1</font><font face='Lucida Console'>)</font>;
parent.<font color='#BB00BB'>invalidate_rectangle</font><font face='Lucida Console'>(</font>rect<font color='#5555FF'>+</font>old<font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'>private</font>:
<font color='#0000FF'><u>void</u></font> <b><a name='draw'></a>draw</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> canvas<font color='#5555FF'>&</font> c
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>
<b>{</b>
my_scroll_bar.style<font color='#5555FF'>-</font><font color='#5555FF'>></font><font color='#BB00BB'>draw_scroll_bar_background</font><font face='Lucida Console'>(</font>c,rect,enabled,lastx,lasty,<font color='#BB00BB'>is_depressed</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'><u>void</u></font> <b><a name='on_button_down'></a>on_button_down</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <b>{</b> <font color='#BB00BB'>bdown</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>; <b>}</b>
<font color='#0000FF'><u>void</u></font> <b><a name='on_button_up'></a>on_button_up</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>bool</u></font> mouse_over
<font face='Lucida Console'>)</font> <b>{</b> <font color='#BB00BB'>bup</font><font face='Lucida Console'>(</font>mouse_over<font face='Lucida Console'>)</font>; <b>}</b>
scroll_bar<font color='#5555FF'>&</font> my_scroll_bar;
any_function<font color='#5555FF'><</font><font color='#0000FF'><u>void</u></font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>></font> bdown;
any_function<font color='#5555FF'><</font><font color='#0000FF'><u>void</u></font><font face='Lucida Console'>(</font><font color='#0000FF'><u>bool</u></font><font face='Lucida Console'>)</font><font color='#5555FF'>></font> bup;
<b>}</b>;
<font color='#0000FF'>friend</font> <font color='#0000FF'>class</font> slider_class;
<font color='#0000FF'>class</font> <b><a name='slider_class'></a>slider_class</b> : <font color='#0000FF'>public</font> draggable
<b>{</b>
<font color='#0000FF'>friend</font> <font color='#0000FF'>class</font> scroll_bar;
<font color='#0000FF'>public</font>:
<b><a name='slider_class'></a>slider_class</b> <font face='Lucida Console'>(</font>
drawable_window<font color='#5555FF'>&</font> w,
scroll_bar<font color='#5555FF'>&</font> object,
<font color='#0000FF'><u>void</u></font> <font face='Lucida Console'>(</font>scroll_bar::<font color='#5555FF'>*</font>handler<font face='Lucida Console'>)</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>
<font face='Lucida Console'>)</font> :
draggable<font face='Lucida Console'>(</font>w, MOUSE_MOVE<font face='Lucida Console'>)</font>,
mouse_in_widget<font face='Lucida Console'>(</font><font color='#979000'>false</font><font face='Lucida Console'>)</font>,
my_scroll_bar<font face='Lucida Console'>(</font>object<font face='Lucida Console'>)</font>
<b>{</b>
callback <font color='#5555FF'>=</font> <font color='#BB00BB'>make_mfp</font><font face='Lucida Console'>(</font>object,handler<font face='Lucida Console'>)</font>;
<font color='#BB00BB'>enable_events</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
<b>}</b>
~<b><a name='slider_class'></a>slider_class</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>
<b>{</b>
<font color='#BB00BB'>disable_events</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'><u>void</u></font> <b><a name='set_size'></a>set_size</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> width,
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> height
<font face='Lucida Console'>)</font>
<b>{</b>
rectangle <font color='#BB00BB'>old</font><font face='Lucida Console'>(</font>rect<font face='Lucida Console'>)</font>;
<font color='#0000FF'>const</font> <font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> x <font color='#5555FF'>=</font> rect.<font color='#BB00BB'>left</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
<font color='#0000FF'>const</font> <font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> y <font color='#5555FF'>=</font> rect.<font color='#BB00BB'>top</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
rect.<font color='#BB00BB'>set_right</font><font face='Lucida Console'>(</font>x<font color='#5555FF'>+</font>width<font color='#5555FF'>-</font><font color='#979000'>1</font><font face='Lucida Console'>)</font>;
rect.<font color='#BB00BB'>set_bottom</font><font face='Lucida Console'>(</font>y<font color='#5555FF'>+</font>height<font color='#5555FF'>-</font><font color='#979000'>1</font><font face='Lucida Console'>)</font>;
parent.<font color='#BB00BB'>invalidate_rectangle</font><font face='Lucida Console'>(</font>rect<font color='#5555FF'>+</font>old<font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'>private</font>:
<font color='#0000FF'>virtual</font> <font color='#0000FF'><u>void</u></font> <b><a name='on_mouse_move'></a>on_mouse_move</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> state,
<font color='#0000FF'><u>long</u></font> x,
<font color='#0000FF'><u>long</u></font> y
<font face='Lucida Console'>)</font>
<b>{</b>
draggable::<font color='#BB00BB'>on_mouse_move</font><font face='Lucida Console'>(</font>state,x,y<font face='Lucida Console'>)</font>;
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font><font color='#5555FF'>!</font>hidden <font color='#5555FF'>&</font><font color='#5555FF'>&</font> my_scroll_bar.style<font color='#5555FF'>-</font><font color='#5555FF'>></font><font color='#BB00BB'>redraw_on_mouse_over_slider</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>
<b>{</b>
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>rect.<font color='#BB00BB'>contains</font><font face='Lucida Console'>(</font>x,y<font face='Lucida Console'>)</font> <font color='#5555FF'>&</font><font color='#5555FF'>&</font> <font color='#5555FF'>!</font>mouse_in_widget<font face='Lucida Console'>)</font>
<b>{</b>
mouse_in_widget <font color='#5555FF'>=</font> <font color='#979000'>true</font>;
parent.<font color='#BB00BB'>invalidate_rectangle</font><font face='Lucida Console'>(</font>rect<font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'>else</font> <font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>rect.<font color='#BB00BB'>contains</font><font face='Lucida Console'>(</font>x,y<font face='Lucida Console'>)</font> <font color='#5555FF'>=</font><font color='#5555FF'>=</font> <font color='#979000'>false</font> <font color='#5555FF'>&</font><font color='#5555FF'>&</font> mouse_in_widget<font face='Lucida Console'>)</font>
<b>{</b>
mouse_in_widget <font color='#5555FF'>=</font> <font color='#979000'>false</font>;
parent.<font color='#BB00BB'>invalidate_rectangle</font><font face='Lucida Console'>(</font>rect<font face='Lucida Console'>)</font>;
<b>}</b>
<b>}</b>
<b>}</b>
<font color='#0000FF'><u>void</u></font> <b><a name='on_mouse_leave'></a>on_mouse_leave</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>
<b>{</b>
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>mouse_in_widget <font color='#5555FF'>&</font><font color='#5555FF'>&</font> my_scroll_bar.style<font color='#5555FF'>-</font><font color='#5555FF'>></font><font color='#BB00BB'>redraw_on_mouse_over_slider</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>
<b>{</b>
mouse_in_widget <font color='#5555FF'>=</font> <font color='#979000'>false</font>;
parent.<font color='#BB00BB'>invalidate_rectangle</font><font face='Lucida Console'>(</font>rect<font face='Lucida Console'>)</font>;
<b>}</b>
<b>}</b>
<font color='#0000FF'><u>void</u></font> <b><a name='on_drag_stop'></a>on_drag_stop</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>
<b>{</b>
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>my_scroll_bar.style<font color='#5555FF'>-</font><font color='#5555FF'>></font><font color='#BB00BB'>redraw_on_mouse_over_slider</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>
parent.<font color='#BB00BB'>invalidate_rectangle</font><font face='Lucida Console'>(</font>rect<font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'><u>void</u></font> <b><a name='on_drag'></a>on_drag</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>
<b>{</b>
<font color='#BB00BB'>callback</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'><u>void</u></font> <b><a name='draw'></a>draw</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> canvas<font color='#5555FF'>&</font> c
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>
<b>{</b>
my_scroll_bar.style<font color='#5555FF'>-</font><font color='#5555FF'>></font><font color='#BB00BB'>draw_scroll_bar_slider</font><font face='Lucida Console'>(</font>c,rect,enabled,lastx,lasty, <font color='#BB00BB'>is_being_dragged</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'><u>bool</u></font> mouse_in_widget;
scroll_bar<font color='#5555FF'>&</font> my_scroll_bar;
any_function<font color='#5555FF'><</font><font color='#0000FF'><u>void</u></font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>></font> callback;
<b>}</b>;
<font color='#0000FF'><u>void</u></font> <b><a name='adjust_fillers'></a>adjust_fillers</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#009900'>/*!
ensures
- top_filler and bottom_filler appear in their correct positions
relative to the current positions of the slider and the b1 and
b2 buttons
!*/</font>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> <b><a name='get_slider_size'></a>get_slider_size</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>;
<font color='#009900'>/*!
ensures
- returns the length in pixels the slider should have based on the current
state of this scroll bar
!*/</font>
button b1, b2;
slider_class slider;
bar_orientation ori;
filler top_filler, bottom_filler;
any_function<font color='#5555FF'><</font><font color='#0000FF'><u>void</u></font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>></font> scroll_handler;
<font color='#0000FF'><u>long</u></font> pos;
<font color='#0000FF'><u>long</u></font> max_pos;
<font color='#0000FF'><u>long</u></font> js;
timer<font color='#5555FF'><</font>scroll_bar<font color='#5555FF'>></font> b1_timer;
timer<font color='#5555FF'><</font>scroll_bar<font color='#5555FF'>></font> b2_timer;
timer<font color='#5555FF'><</font>scroll_bar<font color='#5555FF'>></font> top_filler_timer;
timer<font color='#5555FF'><</font>scroll_bar<font color='#5555FF'>></font> bottom_filler_timer;
<font color='#0000FF'><u>long</u></font> delayed_pos;
std::unique_ptr<font color='#5555FF'><</font>scroll_bar_style<font color='#5555FF'>></font> style;
<font color='#009900'>// restricted functions
</font> <b><a name='scroll_bar'></a>scroll_bar</b><font face='Lucida Console'>(</font>scroll_bar<font color='#5555FF'>&</font><font face='Lucida Console'>)</font>; <font color='#009900'>// copy constructor
</font> scroll_bar<font color='#5555FF'>&</font> <b><a name='operator'></a>operator</b><font color='#5555FF'>=</font><font face='Lucida Console'>(</font>scroll_bar<font color='#5555FF'>&</font><font face='Lucida Console'>)</font>; <font color='#009900'>// assignment operator
</font> <b>}</b>;
<font color='#009900'>// ----------------------------------------------------------------------------------------
</font><font color='#009900'>// ----------------------------------------------------------------------------------------
</font> <font color='#009900'>// class popup_menu
</font><font color='#009900'>// ----------------------------------------------------------------------------------------
</font><font color='#009900'>// ----------------------------------------------------------------------------------------
</font>
<font color='#0000FF'>class</font> <b><a name='menu_item'></a>menu_item</b>
<b>{</b>
<font color='#0000FF'>public</font>:
<font color='#0000FF'>virtual</font> ~<b><a name='menu_item'></a>menu_item</b><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font> <b>{</b><b>}</b>
<font color='#0000FF'>virtual</font> rectangle <b><a name='get_left_size'></a>get_left_size</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font> <b>{</b> <font color='#0000FF'>return</font> <font color='#BB00BB'>rectangle</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>; <b>}</b>
<font color='#0000FF'>virtual</font> rectangle <b><a name='get_middle_size'></a>get_middle_size</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font> <font color='#5555FF'>=</font> <font color='#979000'>0</font>;
<font color='#0000FF'>virtual</font> rectangle <b><a name='get_right_size'></a>get_right_size</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font> <b>{</b> <font color='#0000FF'>return</font> <font color='#BB00BB'>rectangle</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>; <b>}</b>
<font color='#0000FF'>virtual</font> unichar <b><a name='get_hot_key'></a>get_hot_key</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font> <b>{</b> <font color='#0000FF'>return</font> <font color='#979000'>0</font>; <b>}</b>
<font color='#0000FF'>virtual</font> <font color='#0000FF'><u>void</u></font> <b><a name='draw_background'></a>draw_background</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> canvas<font color='#5555FF'>&</font> ,
<font color='#0000FF'>const</font> rectangle<font color='#5555FF'>&</font> ,
<font color='#0000FF'>const</font> <font color='#0000FF'><u>bool</u></font> ,
<font color='#0000FF'>const</font> <font color='#0000FF'><u>bool</u></font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font> <b>{</b><b>}</b>
<font color='#0000FF'>virtual</font> <font color='#0000FF'><u>void</u></font> <b><a name='draw_left'></a>draw_left</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> canvas<font color='#5555FF'>&</font> ,
<font color='#0000FF'>const</font> rectangle<font color='#5555FF'>&</font> ,
<font color='#0000FF'>const</font> <font color='#0000FF'><u>bool</u></font> ,
<font color='#0000FF'>const</font> <font color='#0000FF'><u>bool</u></font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font> <b>{</b><b>}</b>
<font color='#0000FF'>virtual</font> <font color='#0000FF'><u>void</u></font> <b><a name='draw_middle'></a>draw_middle</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> canvas<font color='#5555FF'>&</font> ,
<font color='#0000FF'>const</font> rectangle<font color='#5555FF'>&</font> ,
<font color='#0000FF'>const</font> <font color='#0000FF'><u>bool</u></font> ,
<font color='#0000FF'>const</font> <font color='#0000FF'><u>bool</u></font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font> <font color='#5555FF'>=</font> <font color='#979000'>0</font>;
<font color='#0000FF'>virtual</font> <font color='#0000FF'><u>void</u></font> <b><a name='draw_right'></a>draw_right</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> canvas<font color='#5555FF'>&</font> ,
<font color='#0000FF'>const</font> rectangle<font color='#5555FF'>&</font> ,
<font color='#0000FF'>const</font> <font color='#0000FF'><u>bool</u></font> ,
<font color='#0000FF'>const</font> <font color='#0000FF'><u>bool</u></font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font> <b>{</b><b>}</b>
<font color='#0000FF'>virtual</font> <font color='#0000FF'><u>void</u></font> <b><a name='on_click'></a>on_click</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font> <b>{</b><b>}</b>
<font color='#0000FF'>virtual</font> <font color='#0000FF'><u>bool</u></font> <b><a name='has_click_event'></a>has_click_event</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font> <b>{</b> <font color='#0000FF'>return</font> <font color='#979000'>false</font>; <b>}</b>
<b>}</b>;
<font color='#009900'>// ----------------------------------------------------------------------------------------
</font>
<font color='#0000FF'>class</font> <b><a name='menu_item_submenu'></a>menu_item_submenu</b> : <font color='#0000FF'>public</font> menu_item
<b>{</b>
<font color='#0000FF'><u>void</u></font> <b><a name='initialize'></a>initialize</b> <font face='Lucida Console'>(</font>
unichar hk
<font face='Lucida Console'>)</font>
<b>{</b>
<font color='#0000FF'>const</font> dlib::ustring <font color='#5555FF'>&</font>str <font color='#5555FF'>=</font> text;
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>hk <font color='#5555FF'>!</font><font color='#5555FF'>=</font> <font color='#979000'>0</font><font face='Lucida Console'>)</font>
<b>{</b>
std::string::size_type pos <font color='#5555FF'>=</font> str.<font color='#BB00BB'>find_first_of</font><font face='Lucida Console'>(</font>hk<font face='Lucida Console'>)</font>;
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>pos <font color='#5555FF'>!</font><font color='#5555FF'>=</font> std::string::npos<font face='Lucida Console'>)</font>
<b>{</b>
<font color='#009900'>// now compute the location of the underline bar
</font> rectangle r1 <font color='#5555FF'>=</font> f<font color='#5555FF'>-</font><font color='#5555FF'>></font><font color='#BB00BB'>compute_cursor_rect</font><font face='Lucida Console'>(</font> <font color='#BB00BB'>rectangle</font><font face='Lucida Console'>(</font><font color='#979000'>100000</font>,<font color='#979000'>100000</font><font face='Lucida Console'>)</font>, str, pos<font face='Lucida Console'>)</font>;
rectangle r2 <font color='#5555FF'>=</font> f<font color='#5555FF'>-</font><font color='#5555FF'>></font><font color='#BB00BB'>compute_cursor_rect</font><font face='Lucida Console'>(</font> <font color='#BB00BB'>rectangle</font><font face='Lucida Console'>(</font><font color='#979000'>100000</font>,<font color='#979000'>100000</font><font face='Lucida Console'>)</font>, str, pos<font color='#5555FF'>+</font><font color='#979000'>1</font><font face='Lucida Console'>)</font>;
underline_p1.<font color='#BB00BB'>x</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font> <font color='#5555FF'>=</font> r1.<font color='#BB00BB'>left</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>+</font><font color='#979000'>1</font>;
underline_p2.<font color='#BB00BB'>x</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font> <font color='#5555FF'>=</font> r2.<font color='#BB00BB'>left</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>-</font><font color='#979000'>1</font>;
underline_p1.<font color='#BB00BB'>y</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font> <font color='#5555FF'>=</font> r1.<font color='#BB00BB'>bottom</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>-</font>f<font color='#5555FF'>-</font><font color='#5555FF'>></font><font color='#BB00BB'>height</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>+</font>f<font color='#5555FF'>-</font><font color='#5555FF'>></font><font color='#BB00BB'>ascender</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>+</font><font color='#979000'>2</font>;
underline_p2.<font color='#BB00BB'>y</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font> <font color='#5555FF'>=</font> r2.<font color='#BB00BB'>bottom</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>-</font>f<font color='#5555FF'>-</font><font color='#5555FF'>></font><font color='#BB00BB'>height</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>+</font>f<font color='#5555FF'>-</font><font color='#5555FF'>></font><font color='#BB00BB'>ascender</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>+</font><font color='#979000'>2</font>;
<b>}</b>
<b>}</b>
<b>}</b>
<font color='#0000FF'>public</font>:
<b><a name='menu_item_submenu'></a>menu_item_submenu</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> std::string<font color='#5555FF'>&</font> str,
unichar hk <font color='#5555FF'>=</font> <font color='#979000'>0</font>
<font face='Lucida Console'>)</font> :
text<font face='Lucida Console'>(</font>convert_wstring_to_utf32<font face='Lucida Console'>(</font>convert_mbstring_to_wstring<font face='Lucida Console'>(</font>str<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>,
f<font face='Lucida Console'>(</font>default_font::get_font<font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>,
hotkey<font face='Lucida Console'>(</font>hk<font face='Lucida Console'>)</font>
<b>{</b>
<font color='#BB00BB'>initialize</font><font face='Lucida Console'>(</font>hk<font face='Lucida Console'>)</font>;
<b>}</b>
<b><a name='menu_item_submenu'></a>menu_item_submenu</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> std::wstring<font color='#5555FF'>&</font> str,
unichar hk <font color='#5555FF'>=</font> <font color='#979000'>0</font>
<font face='Lucida Console'>)</font> :
text<font face='Lucida Console'>(</font>convert_wstring_to_utf32<font face='Lucida Console'>(</font>str<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>,
f<font face='Lucida Console'>(</font>default_font::get_font<font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>,
hotkey<font face='Lucida Console'>(</font>hk<font face='Lucida Console'>)</font>
<b>{</b>
<font color='#BB00BB'>initialize</font><font face='Lucida Console'>(</font>hk<font face='Lucida Console'>)</font>;
<b>}</b>
<b><a name='menu_item_submenu'></a>menu_item_submenu</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> dlib::ustring<font color='#5555FF'>&</font> str,
unichar hk <font color='#5555FF'>=</font> <font color='#979000'>0</font>
<font face='Lucida Console'>)</font> :
text<font face='Lucida Console'>(</font>str<font face='Lucida Console'>)</font>,
f<font face='Lucida Console'>(</font>default_font::get_font<font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>,
hotkey<font face='Lucida Console'>(</font>hk<font face='Lucida Console'>)</font>
<b>{</b>
<font color='#BB00BB'>initialize</font><font face='Lucida Console'>(</font>hk<font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'>virtual</font> unichar <b><a name='get_hot_key'></a>get_hot_key</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font> <b>{</b> <font color='#0000FF'>return</font> hotkey; <b>}</b>
<font color='#0000FF'>virtual</font> rectangle <b><a name='get_middle_size'></a>get_middle_size</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>
<b>{</b>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> width, height;
f<font color='#5555FF'>-</font><font color='#5555FF'>></font><font color='#BB00BB'>compute_size</font><font face='Lucida Console'>(</font>text,width,height<font face='Lucida Console'>)</font>;
<font color='#0000FF'>return</font> <font color='#BB00BB'>rectangle</font><font face='Lucida Console'>(</font>width<font color='#5555FF'>+</font><font color='#979000'>30</font>,height<font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'>virtual</font> rectangle <b><a name='get_right_size'></a>get_right_size</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>
<b>{</b>
<font color='#0000FF'>return</font> <font color='#BB00BB'>rectangle</font><font face='Lucida Console'>(</font><font color='#979000'>15</font>, <font color='#979000'>5</font><font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'>virtual</font> <font color='#0000FF'><u>void</u></font> <b><a name='draw_background'></a>draw_background</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> canvas<font color='#5555FF'>&</font> c,
<font color='#0000FF'>const</font> rectangle<font color='#5555FF'>&</font> rect,
<font color='#0000FF'>const</font> <font color='#0000FF'><u>bool</u></font> enabled,
<font color='#0000FF'>const</font> <font color='#0000FF'><u>bool</u></font> is_selected
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>
<b>{</b>
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>c.<font color='#BB00BB'>intersect</font><font face='Lucida Console'>(</font>rect<font face='Lucida Console'>)</font>.<font color='#BB00BB'>is_empty</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>
<font color='#0000FF'>return</font>;
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>enabled <font color='#5555FF'>&</font><font color='#5555FF'>&</font> is_selected<font face='Lucida Console'>)</font>
<b>{</b>
<font color='#BB00BB'>fill_rect_with_vertical_gradient</font><font face='Lucida Console'>(</font>c, rect,<font color='#BB00BB'>rgb_alpha_pixel</font><font face='Lucida Console'>(</font><font color='#979000'>0</font>,<font color='#979000'>200</font>,<font color='#979000'>0</font>,<font color='#979000'>100</font><font face='Lucida Console'>)</font>, <font color='#BB00BB'>rgb_alpha_pixel</font><font face='Lucida Console'>(</font><font color='#979000'>0</font>,<font color='#979000'>0</font>,<font color='#979000'>0</font>,<font color='#979000'>100</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
<font color='#BB00BB'>draw_rectangle</font><font face='Lucida Console'>(</font>c, rect,<font color='#BB00BB'>rgb_alpha_pixel</font><font face='Lucida Console'>(</font><font color='#979000'>0</font>,<font color='#979000'>0</font>,<font color='#979000'>0</font>,<font color='#979000'>100</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
<b>}</b>
<b>}</b>
<font color='#0000FF'>virtual</font> <font color='#0000FF'><u>void</u></font> <b><a name='draw_right'></a>draw_right</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> canvas<font color='#5555FF'>&</font> c,
<font color='#0000FF'>const</font> rectangle<font color='#5555FF'>&</font> rect,
<font color='#0000FF'>const</font> <font color='#0000FF'><u>bool</u></font> enabled,
<font color='#0000FF'>const</font> <font color='#0000FF'><u>bool</u></font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>
<b>{</b>
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>c.<font color='#BB00BB'>intersect</font><font face='Lucida Console'>(</font>rect<font face='Lucida Console'>)</font>.<font color='#BB00BB'>is_empty</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>
<font color='#0000FF'>return</font>;
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>char</u></font> color <font color='#5555FF'>=</font> <font color='#979000'>0</font>;
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>enabled <font color='#5555FF'>=</font><font color='#5555FF'>=</font> <font color='#979000'>false</font><font face='Lucida Console'>)</font>
color <font color='#5555FF'>=</font> <font color='#979000'>128</font>;
<font color='#0000FF'><u>long</u></font> x, y;
x <font color='#5555FF'>=</font> rect.<font color='#BB00BB'>right</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font> <font color='#5555FF'>-</font> <font color='#979000'>7</font>;
y <font color='#5555FF'>=</font> rect.<font color='#BB00BB'>top</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font> <font color='#5555FF'>+</font> rect.<font color='#BB00BB'>height</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>/</font><font color='#979000'>2</font>;
<font color='#0000FF'>for</font> <font face='Lucida Console'>(</font> <font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> i <font color='#5555FF'>=</font> <font color='#979000'>0</font>; i <font color='#5555FF'><</font> <font color='#979000'>5</font>; <font color='#5555FF'>+</font><font color='#5555FF'>+</font>i<font face='Lucida Console'>)</font>
<font color='#BB00BB'>draw_line</font> <font face='Lucida Console'>(</font>c, <font color='#BB00BB'>point</font><font face='Lucida Console'>(</font>x <font color='#5555FF'>-</font> i, y <font color='#5555FF'>+</font> i<font face='Lucida Console'>)</font>, <font color='#BB00BB'>point</font><font face='Lucida Console'>(</font>x <font color='#5555FF'>-</font> i, y <font color='#5555FF'>-</font> i<font face='Lucida Console'>)</font>, color<font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'>virtual</font> <font color='#0000FF'><u>void</u></font> <b><a name='draw_middle'></a>draw_middle</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> canvas<font color='#5555FF'>&</font> c,
<font color='#0000FF'>const</font> rectangle<font color='#5555FF'>&</font> rect,
<font color='#0000FF'>const</font> <font color='#0000FF'><u>bool</u></font> enabled,
<font color='#0000FF'>const</font> <font color='#0000FF'><u>bool</u></font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>
<b>{</b>
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>c.<font color='#BB00BB'>intersect</font><font face='Lucida Console'>(</font>rect<font face='Lucida Console'>)</font>.<font color='#BB00BB'>is_empty</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>
<font color='#0000FF'>return</font>;
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>enabled<font face='Lucida Console'>)</font>
<b>{</b>
f<font color='#5555FF'>-</font><font color='#5555FF'>></font><font color='#BB00BB'>draw_string</font><font face='Lucida Console'>(</font>c,rect,text<font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'>else</font>
<b>{</b>
f<font color='#5555FF'>-</font><font color='#5555FF'>></font><font color='#BB00BB'>draw_string</font><font face='Lucida Console'>(</font>c,rect,text,<font color='#979000'>128</font><font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>underline_p1 <font color='#5555FF'>!</font><font color='#5555FF'>=</font> underline_p2<font face='Lucida Console'>)</font>
<b>{</b>
point <font color='#BB00BB'>base</font><font face='Lucida Console'>(</font>rect.<font color='#BB00BB'>left</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>,rect.<font color='#BB00BB'>top</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
<font color='#BB00BB'>draw_line</font><font face='Lucida Console'>(</font>c, base<font color='#5555FF'>+</font>underline_p1, base<font color='#5555FF'>+</font>underline_p2<font face='Lucida Console'>)</font>;
<b>}</b>
<b>}</b>
<font color='#0000FF'>private</font>:
dlib::ustring text;
<font color='#0000FF'>const</font> std::shared_ptr<font color='#5555FF'><</font>font<font color='#5555FF'>></font> f;
any_function<font color='#5555FF'><</font><font color='#0000FF'><u>void</u></font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>></font> action;
unichar hotkey;
point underline_p1;
point underline_p2;
<b>}</b>;
<font color='#009900'>// ----------------------------------------------------------------------------------------
</font>
<font color='#0000FF'>class</font> <b><a name='menu_item_text'></a>menu_item_text</b> : <font color='#0000FF'>public</font> menu_item
<b>{</b>
<font color='#0000FF'><u>void</u></font> <b><a name='initialize'></a>initialize</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> any_function<font color='#5555FF'><</font><font color='#0000FF'><u>void</u></font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>></font><font color='#5555FF'>&</font> event_handler_,
unichar hk
<font face='Lucida Console'>)</font>
<b>{</b>
dlib::ustring <font color='#5555FF'>&</font>str <font color='#5555FF'>=</font> text;
action <font color='#5555FF'>=</font> event_handler_;
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>hk <font color='#5555FF'>!</font><font color='#5555FF'>=</font> <font color='#979000'>0</font><font face='Lucida Console'>)</font>
<b>{</b>
std::string::size_type pos <font color='#5555FF'>=</font> str.<font color='#BB00BB'>find_first_of</font><font face='Lucida Console'>(</font>hk<font face='Lucida Console'>)</font>;
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>pos <font color='#5555FF'>!</font><font color='#5555FF'>=</font> std::string::npos<font face='Lucida Console'>)</font>
<b>{</b>
<font color='#009900'>// now compute the location of the underline bar
</font> rectangle r1 <font color='#5555FF'>=</font> f<font color='#5555FF'>-</font><font color='#5555FF'>></font><font color='#BB00BB'>compute_cursor_rect</font><font face='Lucida Console'>(</font> <font color='#BB00BB'>rectangle</font><font face='Lucida Console'>(</font><font color='#979000'>100000</font>,<font color='#979000'>100000</font><font face='Lucida Console'>)</font>, str, pos<font face='Lucida Console'>)</font>;
rectangle r2 <font color='#5555FF'>=</font> f<font color='#5555FF'>-</font><font color='#5555FF'>></font><font color='#BB00BB'>compute_cursor_rect</font><font face='Lucida Console'>(</font> <font color='#BB00BB'>rectangle</font><font face='Lucida Console'>(</font><font color='#979000'>100000</font>,<font color='#979000'>100000</font><font face='Lucida Console'>)</font>, str, pos<font color='#5555FF'>+</font><font color='#979000'>1</font><font face='Lucida Console'>)</font>;
underline_p1.<font color='#BB00BB'>x</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font> <font color='#5555FF'>=</font> r1.<font color='#BB00BB'>left</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>+</font><font color='#979000'>1</font>;
underline_p2.<font color='#BB00BB'>x</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font> <font color='#5555FF'>=</font> r2.<font color='#BB00BB'>left</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>-</font><font color='#979000'>1</font>;
underline_p1.<font color='#BB00BB'>y</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font> <font color='#5555FF'>=</font> r1.<font color='#BB00BB'>bottom</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>-</font>f<font color='#5555FF'>-</font><font color='#5555FF'>></font><font color='#BB00BB'>height</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>+</font>f<font color='#5555FF'>-</font><font color='#5555FF'>></font><font color='#BB00BB'>ascender</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>+</font><font color='#979000'>2</font>;
underline_p2.<font color='#BB00BB'>y</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font> <font color='#5555FF'>=</font> r2.<font color='#BB00BB'>bottom</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>-</font>f<font color='#5555FF'>-</font><font color='#5555FF'>></font><font color='#BB00BB'>height</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>+</font>f<font color='#5555FF'>-</font><font color='#5555FF'>></font><font color='#BB00BB'>ascender</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>+</font><font color='#979000'>2</font>;
<b>}</b>
<b>}</b>
<b>}</b>
<font color='#0000FF'>public</font>:
<font color='#0000FF'>template</font> <font color='#5555FF'><</font><font color='#0000FF'>typename</font> T<font color='#5555FF'>></font>
<b><a name='menu_item_text'></a>menu_item_text</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> std::string<font color='#5555FF'>&</font> str,
T<font color='#5555FF'>&</font> object,
<font color='#0000FF'><u>void</u></font> <font face='Lucida Console'>(</font>T::<font color='#5555FF'>*</font>event_handler_<font face='Lucida Console'>)</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>,
unichar hk <font color='#5555FF'>=</font> <font color='#979000'>0</font>
<font face='Lucida Console'>)</font> :
text<font face='Lucida Console'>(</font>convert_wstring_to_utf32<font face='Lucida Console'>(</font>convert_mbstring_to_wstring<font face='Lucida Console'>(</font>str<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>,
f<font face='Lucida Console'>(</font>default_font::get_font<font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>,
hotkey<font face='Lucida Console'>(</font>hk<font face='Lucida Console'>)</font>
<b>{</b>
<font color='#BB00BB'>initialize</font><font face='Lucida Console'>(</font><font color='#BB00BB'>make_mfp</font><font face='Lucida Console'>(</font>object, event_handler_<font face='Lucida Console'>)</font>, hk<font face='Lucida Console'>)</font>;
<b>}</b>
<b><a name='menu_item_text'></a>menu_item_text</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> std::string<font color='#5555FF'>&</font> str,
<font color='#0000FF'>const</font> any_function<font color='#5555FF'><</font><font color='#0000FF'><u>void</u></font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>></font><font color='#5555FF'>&</font> event_handler_,
unichar hk <font color='#5555FF'>=</font> <font color='#979000'>0</font>
<font face='Lucida Console'>)</font> :
text<font face='Lucida Console'>(</font>convert_wstring_to_utf32<font face='Lucida Console'>(</font>convert_mbstring_to_wstring<font face='Lucida Console'>(</font>str<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>,
f<font face='Lucida Console'>(</font>default_font::get_font<font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>,
hotkey<font face='Lucida Console'>(</font>hk<font face='Lucida Console'>)</font>
<b>{</b>
<font color='#BB00BB'>initialize</font><font face='Lucida Console'>(</font>event_handler_, hk<font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'>template</font> <font color='#5555FF'><</font><font color='#0000FF'>typename</font> T<font color='#5555FF'>></font>
<b><a name='menu_item_text'></a>menu_item_text</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> std::wstring<font color='#5555FF'>&</font> str,
T<font color='#5555FF'>&</font> object,
<font color='#0000FF'><u>void</u></font> <font face='Lucida Console'>(</font>T::<font color='#5555FF'>*</font>event_handler_<font face='Lucida Console'>)</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>,
unichar hk <font color='#5555FF'>=</font> <font color='#979000'>0</font>
<font face='Lucida Console'>)</font> :
text<font face='Lucida Console'>(</font>convert_wstring_to_utf32<font face='Lucida Console'>(</font>str<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>,
f<font face='Lucida Console'>(</font>default_font::get_font<font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>,
hotkey<font face='Lucida Console'>(</font>hk<font face='Lucida Console'>)</font>
<b>{</b>
<font color='#BB00BB'>initialize</font><font face='Lucida Console'>(</font><font color='#BB00BB'>make_mfp</font><font face='Lucida Console'>(</font>object, event_handler_<font face='Lucida Console'>)</font>, hk<font face='Lucida Console'>)</font>;
<b>}</b>
<b><a name='menu_item_text'></a>menu_item_text</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> std::wstring<font color='#5555FF'>&</font> str,
<font color='#0000FF'>const</font> any_function<font color='#5555FF'><</font><font color='#0000FF'><u>void</u></font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>></font><font color='#5555FF'>&</font> event_handler_,
unichar hk <font color='#5555FF'>=</font> <font color='#979000'>0</font>
<font face='Lucida Console'>)</font> :
text<font face='Lucida Console'>(</font>convert_wstring_to_utf32<font face='Lucida Console'>(</font>str<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>,
f<font face='Lucida Console'>(</font>default_font::get_font<font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>,
hotkey<font face='Lucida Console'>(</font>hk<font face='Lucida Console'>)</font>
<b>{</b>
<font color='#BB00BB'>initialize</font><font face='Lucida Console'>(</font>event_handler_, hk<font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'>template</font> <font color='#5555FF'><</font><font color='#0000FF'>typename</font> T<font color='#5555FF'>></font>
<b><a name='menu_item_text'></a>menu_item_text</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> dlib::ustring<font color='#5555FF'>&</font> str,
T<font color='#5555FF'>&</font> object,
<font color='#0000FF'><u>void</u></font> <font face='Lucida Console'>(</font>T::<font color='#5555FF'>*</font>event_handler_<font face='Lucida Console'>)</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>,
unichar hk <font color='#5555FF'>=</font> <font color='#979000'>0</font>
<font face='Lucida Console'>)</font> :
text<font face='Lucida Console'>(</font>str<font face='Lucida Console'>)</font>,
f<font face='Lucida Console'>(</font>default_font::get_font<font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>,
hotkey<font face='Lucida Console'>(</font>hk<font face='Lucida Console'>)</font>
<b>{</b>
<font color='#BB00BB'>initialize</font><font face='Lucida Console'>(</font><font color='#BB00BB'>make_mfp</font><font face='Lucida Console'>(</font>object, event_handler_<font face='Lucida Console'>)</font>, hk<font face='Lucida Console'>)</font>;
<b>}</b>
<b><a name='menu_item_text'></a>menu_item_text</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> dlib::ustring<font color='#5555FF'>&</font> str,
<font color='#0000FF'>const</font> any_function<font color='#5555FF'><</font><font color='#0000FF'><u>void</u></font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>></font><font color='#5555FF'>&</font> event_handler_,
unichar hk <font color='#5555FF'>=</font> <font color='#979000'>0</font>
<font face='Lucida Console'>)</font> :
text<font face='Lucida Console'>(</font>str<font face='Lucida Console'>)</font>,
f<font face='Lucida Console'>(</font>default_font::get_font<font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>,
hotkey<font face='Lucida Console'>(</font>hk<font face='Lucida Console'>)</font>
<b>{</b>
<font color='#BB00BB'>initialize</font><font face='Lucida Console'>(</font>event_handler_, hk<font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'>virtual</font> unichar <b><a name='get_hot_key'></a>get_hot_key</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font> <b>{</b> <font color='#0000FF'>return</font> hotkey; <b>}</b>
<font color='#0000FF'>virtual</font> rectangle <b><a name='get_middle_size'></a>get_middle_size</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>
<b>{</b>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> width, height;
f<font color='#5555FF'>-</font><font color='#5555FF'>></font><font color='#BB00BB'>compute_size</font><font face='Lucida Console'>(</font>text,width,height<font face='Lucida Console'>)</font>;
<font color='#0000FF'>return</font> <font color='#BB00BB'>rectangle</font><font face='Lucida Console'>(</font>width,height<font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'>virtual</font> <font color='#0000FF'><u>void</u></font> <b><a name='draw_background'></a>draw_background</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> canvas<font color='#5555FF'>&</font> c,
<font color='#0000FF'>const</font> rectangle<font color='#5555FF'>&</font> rect,
<font color='#0000FF'>const</font> <font color='#0000FF'><u>bool</u></font> enabled,
<font color='#0000FF'>const</font> <font color='#0000FF'><u>bool</u></font> is_selected
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>
<b>{</b>
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>c.<font color='#BB00BB'>intersect</font><font face='Lucida Console'>(</font>rect<font face='Lucida Console'>)</font>.<font color='#BB00BB'>is_empty</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>
<font color='#0000FF'>return</font>;
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>enabled <font color='#5555FF'>&</font><font color='#5555FF'>&</font> is_selected<font face='Lucida Console'>)</font>
<b>{</b>
<font color='#BB00BB'>fill_rect_with_vertical_gradient</font><font face='Lucida Console'>(</font>c, rect,<font color='#BB00BB'>rgb_alpha_pixel</font><font face='Lucida Console'>(</font><font color='#979000'>0</font>,<font color='#979000'>200</font>,<font color='#979000'>0</font>,<font color='#979000'>100</font><font face='Lucida Console'>)</font>, <font color='#BB00BB'>rgb_alpha_pixel</font><font face='Lucida Console'>(</font><font color='#979000'>0</font>,<font color='#979000'>0</font>,<font color='#979000'>0</font>,<font color='#979000'>100</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
<font color='#BB00BB'>draw_rectangle</font><font face='Lucida Console'>(</font>c, rect,<font color='#BB00BB'>rgb_alpha_pixel</font><font face='Lucida Console'>(</font><font color='#979000'>0</font>,<font color='#979000'>0</font>,<font color='#979000'>0</font>,<font color='#979000'>100</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
<b>}</b>
<b>}</b>
<font color='#0000FF'>virtual</font> <font color='#0000FF'><u>void</u></font> <b><a name='draw_middle'></a>draw_middle</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> canvas<font color='#5555FF'>&</font> c,
<font color='#0000FF'>const</font> rectangle<font color='#5555FF'>&</font> rect,
<font color='#0000FF'>const</font> <font color='#0000FF'><u>bool</u></font> enabled,
<font color='#0000FF'>const</font> <font color='#0000FF'><u>bool</u></font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>
<b>{</b>
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>c.<font color='#BB00BB'>intersect</font><font face='Lucida Console'>(</font>rect<font face='Lucida Console'>)</font>.<font color='#BB00BB'>is_empty</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>
<font color='#0000FF'>return</font>;
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>char</u></font> color <font color='#5555FF'>=</font> <font color='#979000'>0</font>;
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>enabled <font color='#5555FF'>=</font><font color='#5555FF'>=</font> <font color='#979000'>false</font><font face='Lucida Console'>)</font>
color <font color='#5555FF'>=</font> <font color='#979000'>128</font>;
f<font color='#5555FF'>-</font><font color='#5555FF'>></font><font color='#BB00BB'>draw_string</font><font face='Lucida Console'>(</font>c,rect,text,color<font face='Lucida Console'>)</font>;
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>underline_p1 <font color='#5555FF'>!</font><font color='#5555FF'>=</font> underline_p2<font face='Lucida Console'>)</font>
<b>{</b>
point <font color='#BB00BB'>base</font><font face='Lucida Console'>(</font>rect.<font color='#BB00BB'>left</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>,rect.<font color='#BB00BB'>top</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
<font color='#BB00BB'>draw_line</font><font face='Lucida Console'>(</font>c, base<font color='#5555FF'>+</font>underline_p1, base<font color='#5555FF'>+</font>underline_p2, color<font face='Lucida Console'>)</font>;
<b>}</b>
<b>}</b>
<font color='#0000FF'>virtual</font> <font color='#0000FF'><u>void</u></font> <b><a name='on_click'></a>on_click</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>
<b>{</b>
<font color='#BB00BB'>action</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'>virtual</font> <font color='#0000FF'><u>bool</u></font> <b><a name='has_click_event'></a>has_click_event</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font> <b>{</b> <font color='#0000FF'>return</font> <font color='#979000'>true</font>; <b>}</b>
<font color='#0000FF'>private</font>:
dlib::ustring text;
<font color='#0000FF'>const</font> std::shared_ptr<font color='#5555FF'><</font>font<font color='#5555FF'>></font> f;
any_function<font color='#5555FF'><</font><font color='#0000FF'><u>void</u></font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>></font> action;
unichar hotkey;
point underline_p1;
point underline_p2;
<b>}</b>;
<font color='#009900'>// ----------------------------------------------------------------------------------------
</font>
<font color='#0000FF'>class</font> <b><a name='menu_item_separator'></a>menu_item_separator</b> : <font color='#0000FF'>public</font> menu_item
<b>{</b>
<font color='#0000FF'>public</font>:
<font color='#0000FF'>virtual</font> rectangle <b><a name='get_middle_size'></a>get_middle_size</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>
<b>{</b>
<font color='#0000FF'>return</font> <font color='#BB00BB'>rectangle</font><font face='Lucida Console'>(</font><font color='#979000'>10</font>,<font color='#979000'>4</font><font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'>virtual</font> <font color='#0000FF'><u>void</u></font> <b><a name='draw_background'></a>draw_background</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> canvas<font color='#5555FF'>&</font> c,
<font color='#0000FF'>const</font> rectangle<font color='#5555FF'>&</font> rect,
<font color='#0000FF'>const</font> <font color='#0000FF'><u>bool</u></font> ,
<font color='#0000FF'>const</font> <font color='#0000FF'><u>bool</u></font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>
<b>{</b>
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>c.<font color='#BB00BB'>intersect</font><font face='Lucida Console'>(</font>rect<font face='Lucida Console'>)</font>.<font color='#BB00BB'>is_empty</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>
<font color='#0000FF'>return</font>;
point <font color='#BB00BB'>p1</font><font face='Lucida Console'>(</font>rect.<font color='#BB00BB'>left</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>,rect.<font color='#BB00BB'>top</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>+</font>rect.<font color='#BB00BB'>height</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>/</font><font color='#979000'>2</font><font color='#5555FF'>-</font><font color='#979000'>1</font><font face='Lucida Console'>)</font>;
point <font color='#BB00BB'>p2</font><font face='Lucida Console'>(</font>rect.<font color='#BB00BB'>right</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>,rect.<font color='#BB00BB'>top</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>+</font>rect.<font color='#BB00BB'>height</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>/</font><font color='#979000'>2</font><font color='#5555FF'>-</font><font color='#979000'>1</font><font face='Lucida Console'>)</font>;
point <font color='#BB00BB'>p3</font><font face='Lucida Console'>(</font>rect.<font color='#BB00BB'>left</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>,rect.<font color='#BB00BB'>top</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>+</font>rect.<font color='#BB00BB'>height</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>/</font><font color='#979000'>2</font><font face='Lucida Console'>)</font>;
point <font color='#BB00BB'>p4</font><font face='Lucida Console'>(</font>rect.<font color='#BB00BB'>right</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>,rect.<font color='#BB00BB'>top</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>+</font>rect.<font color='#BB00BB'>height</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>/</font><font color='#979000'>2</font><font face='Lucida Console'>)</font>;
<font color='#BB00BB'>draw_line</font><font face='Lucida Console'>(</font>c, p1,p2,<font color='#979000'>128</font><font face='Lucida Console'>)</font>;
<font color='#BB00BB'>draw_line</font><font face='Lucida Console'>(</font>c, p3,p4,<font color='#979000'>255</font><font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'>virtual</font> <font color='#0000FF'><u>void</u></font> <b><a name='draw_middle'></a>draw_middle</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> canvas<font color='#5555FF'>&</font> ,
<font color='#0000FF'>const</font> rectangle<font color='#5555FF'>&</font> ,
<font color='#0000FF'>const</font> <font color='#0000FF'><u>bool</u></font> ,
<font color='#0000FF'>const</font> <font color='#0000FF'><u>bool</u></font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>
<b>{</b>
<b>}</b>
<b>}</b>;
<font color='#009900'>// ----------------------------------------------------------------------------------------
</font>
<font color='#0000FF'>class</font> <b><a name='popup_menu'></a>popup_menu</b> : <font color='#0000FF'>public</font> base_window
<b>{</b>
<font color='#009900'>/*!
INITIAL VALUE
- pad == 2
- item_pad == 3
- cur_rect == rectangle(pad,pad,pad-1,pad-1)
- left_width == 0
- middle_width == 0
- selected_item == 0
- submenu_open == false
- items.size() == 0
- item_enabled.size() == 0
- left_rects.size() == 0
- middle_rects.size() == 0
- right_rects.size() == 0
- line_rects.size() == 0
- submenus.size() == 0
- hide_handlers.size() == 0
CONVENTION
- pad = 2
- item_pad = 3
- all of the following arrays have the same size:
- items.size()
- item_enabled.size()
- left_rects.size()
- middle_rects.size()
- right_rects.size()
- line_rects.size()
- submenus.size()
- win_rect == a rectangle that is the exact size of this window and with
its upper left corner at (0,0)
- cur_rect == the rect inside which all the menu items are drawn
- if (a menu_item is supposed to be selected) then
- selected_item == the index in menus of the menu_item
- else
- selected_item == submenus.size()
- if (there is a selected submenu and it is currently open) then
- submenu_open == true
- else
- submenu_open == false
- for all valid i:
- items[i] == a pointer to the ith menu_item
- item_enabled[i] == true if the ith menu_item is enabled, false otherwise
- left_rects[i] == the left rectangle for the ith menu item
- middle_rects[i] == the middle rectangle for the ith menu item
- right_rects[i] == the right rectangle for the ith menu item
- line_rects[i] == the rectangle for the entire line on which the ith menu
item appears.
- if (submenus[i] != 0) then
- the ith menu item has a submenu and it is pointed to by submenus[i]
- hide_handlers == an array of all the on_hide events registered for
this popup_menu
!*/</font>
<font color='#0000FF'>public</font>:
<b><a name='popup_menu'></a>popup_menu</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'>template</font> <font color='#5555FF'><</font>
<font color='#0000FF'>typename</font> menu_item_type
<font color='#5555FF'>></font>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> <b><a name='add_menu_item'></a>add_menu_item</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> menu_item_type<font color='#5555FF'>&</font> new_item
<font face='Lucida Console'>)</font>
<b>{</b>
auto_mutex <font color='#BB00BB'>M</font><font face='Lucida Console'>(</font>wm<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>bool</u></font> t <font color='#5555FF'>=</font> <font color='#979000'>true</font>;
std::unique_ptr<font color='#5555FF'><</font>menu_item<font color='#5555FF'>></font> <font color='#BB00BB'>item</font><font face='Lucida Console'>(</font><font color='#0000FF'>new</font> <font color='#BB00BB'>menu_item_type</font><font face='Lucida Console'>(</font>new_item<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
items.<font color='#BB00BB'>push_back</font><font face='Lucida Console'>(</font>item<font face='Lucida Console'>)</font>;
item_enabled.<font color='#BB00BB'>push_back</font><font face='Lucida Console'>(</font>t<font face='Lucida Console'>)</font>;
<font color='#009900'>// figure out how big the window should be now and what not
</font> rectangle left <font color='#5555FF'>=</font> new_item.<font color='#BB00BB'>get_left_size</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
rectangle middle <font color='#5555FF'>=</font> new_item.<font color='#BB00BB'>get_middle_size</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
rectangle right <font color='#5555FF'>=</font> new_item.<font color='#BB00BB'>get_right_size</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>bool</u></font> recalc_rect_positions <font color='#5555FF'>=</font> <font color='#979000'>false</font>;
<font color='#0000FF'>const</font> rectangle all <font color='#5555FF'>=</font> left<font color='#5555FF'>+</font>middle<font color='#5555FF'>+</font>right;
<font color='#009900'>// make sure left_width contains the max of all the left rectangles
</font> <font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>left.<font color='#BB00BB'>width</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font> <font color='#5555FF'>></font> left_width<font face='Lucida Console'>)</font>
<b>{</b>
left_width <font color='#5555FF'>=</font> left.<font color='#BB00BB'>width</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
recalc_rect_positions <font color='#5555FF'>=</font> <font color='#979000'>true</font>;
<b>}</b>
<font color='#009900'>// make sure middle_width contains the max of all the middle rectangles
</font> <font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>middle.<font color='#BB00BB'>width</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font> <font color='#5555FF'>></font> middle_width<font face='Lucida Console'>)</font>
<b>{</b>
middle_width <font color='#5555FF'>=</font> middle.<font color='#BB00BB'>width</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
recalc_rect_positions <font color='#5555FF'>=</font> <font color='#979000'>true</font>;
<b>}</b>
<font color='#009900'>// make the current rectangle wider if necessary
</font> <font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>cur_rect.<font color='#BB00BB'>width</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font> <font color='#5555FF'><</font> left_width <font color='#5555FF'>+</font> middle_width <font color='#5555FF'>+</font> right.<font color='#BB00BB'>width</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font> <font color='#5555FF'>+</font> <font color='#979000'>2</font><font color='#5555FF'>*</font>item_pad<font face='Lucida Console'>)</font>
<b>{</b>
cur_rect <font color='#5555FF'>=</font> <font color='#BB00BB'>resize_rect_width</font><font face='Lucida Console'>(</font>cur_rect, left_width <font color='#5555FF'>+</font> middle_width <font color='#5555FF'>+</font> right.<font color='#BB00BB'>width</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font> <font color='#5555FF'>+</font> <font color='#979000'>2</font><font color='#5555FF'>*</font>item_pad<font face='Lucida Console'>)</font>;
recalc_rect_positions <font color='#5555FF'>=</font> <font color='#979000'>true</font>;
<b>}</b>
<font color='#0000FF'>const</font> <font color='#0000FF'><u>long</u></font> y <font color='#5555FF'>=</font> cur_rect.<font color='#BB00BB'>bottom</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>+</font><font color='#979000'>1</font> <font color='#5555FF'>+</font> item_pad;
<font color='#0000FF'>const</font> <font color='#0000FF'><u>long</u></font> x <font color='#5555FF'>=</font> cur_rect.<font color='#BB00BB'>left</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font> <font color='#5555FF'>+</font> item_pad;
<font color='#009900'>// make the current rectangle taller to account for this new menu item
</font> cur_rect.<font color='#BB00BB'>set_bottom</font><font face='Lucida Console'>(</font>cur_rect.<font color='#BB00BB'>bottom</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>+</font>all.<font color='#BB00BB'>height</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font> <font color='#5555FF'>+</font> <font color='#979000'>2</font><font color='#5555FF'>*</font>item_pad<font face='Lucida Console'>)</font>;
<font color='#009900'>// adjust all the saved rectangles since the width of the window changed
</font> <font color='#009900'>// or left_width changed
</font> <font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>recalc_rect_positions<font face='Lucida Console'>)</font>
<b>{</b>
<font color='#0000FF'><u>long</u></font> y <font color='#5555FF'>=</font> cur_rect.<font color='#BB00BB'>top</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font> <font color='#5555FF'>+</font> item_pad;
<font color='#0000FF'>for</font> <font face='Lucida Console'>(</font><font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> i <font color='#5555FF'>=</font> <font color='#979000'>0</font>; i <font color='#5555FF'><</font> left_rects.<font color='#BB00BB'>size</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>; <font color='#5555FF'>+</font><font color='#5555FF'>+</font>i<font face='Lucida Console'>)</font>
<b>{</b>
middle_rects[i] <font color='#5555FF'>=</font> <font color='#BB00BB'>move_rect</font><font face='Lucida Console'>(</font>middle_rects[i], x<font color='#5555FF'>+</font>left_width, y<font face='Lucida Console'>)</font>;
right_rects[i] <font color='#5555FF'>=</font> <font color='#BB00BB'>move_rect</font><font face='Lucida Console'>(</font>right_rects[i], x<font color='#5555FF'>+</font>cur_rect.<font color='#BB00BB'>width</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>-</font>right_rects[i].<font color='#BB00BB'>width</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>-</font>item_pad, y<font face='Lucida Console'>)</font>;
line_rects[i] <font color='#5555FF'>=</font> <font color='#BB00BB'>resize_rect_width</font><font face='Lucida Console'>(</font>line_rects[i], cur_rect.<font color='#BB00BB'>width</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
y <font color='#5555FF'>+</font><font color='#5555FF'>=</font> line_rects[i].<font color='#BB00BB'>height</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
<b>}</b>
<b>}</b>
<font color='#009900'>// save the rectangles for later use. Also position them at the
</font> <font color='#009900'>// right spots
</font> left <font color='#5555FF'>=</font> <font color='#BB00BB'>move_rect</font><font face='Lucida Console'>(</font>left,x,y<font face='Lucida Console'>)</font>;
middle <font color='#5555FF'>=</font> <font color='#BB00BB'>move_rect</font><font face='Lucida Console'>(</font>middle,x<font color='#5555FF'>+</font>left_width,y<font face='Lucida Console'>)</font>;
right <font color='#5555FF'>=</font> <font color='#BB00BB'>move_rect</font><font face='Lucida Console'>(</font>right,x<font color='#5555FF'>+</font>cur_rect.<font color='#BB00BB'>width</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>-</font>right.<font color='#BB00BB'>width</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>-</font>item_pad,y<font face='Lucida Console'>)</font>;
rectangle <font color='#BB00BB'>line</font><font face='Lucida Console'>(</font><font color='#BB00BB'>move_rect</font><font face='Lucida Console'>(</font><font color='#BB00BB'>rectangle</font><font face='Lucida Console'>(</font>cur_rect.<font color='#BB00BB'>width</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>,all.<font color='#BB00BB'>height</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>+</font><font color='#979000'>2</font><font color='#5555FF'>*</font>item_pad<font face='Lucida Console'>)</font>, x<font color='#5555FF'>-</font>item_pad, y<font color='#5555FF'>-</font>item_pad<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
<font color='#009900'>// make sure the left, middle, and right rectangles are centered in the
</font> <font color='#009900'>// line.
</font> <font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>left.<font color='#BB00BB'>height</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font> <font color='#5555FF'><</font> all.<font color='#BB00BB'>height</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>
left <font color='#5555FF'>=</font> <font color='#BB00BB'>translate_rect</font><font face='Lucida Console'>(</font>left,<font color='#979000'>0</font>, <font face='Lucida Console'>(</font>all.<font color='#BB00BB'>height</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>-</font>left.<font color='#BB00BB'>height</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font><font color='#5555FF'>/</font><font color='#979000'>2</font><font face='Lucida Console'>)</font>;
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>middle.<font color='#BB00BB'>height</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font> <font color='#5555FF'><</font> all.<font color='#BB00BB'>height</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>
middle <font color='#5555FF'>=</font> <font color='#BB00BB'>translate_rect</font><font face='Lucida Console'>(</font>middle,<font color='#979000'>0</font>, <font face='Lucida Console'>(</font>all.<font color='#BB00BB'>height</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>-</font>middle.<font color='#BB00BB'>height</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font><font color='#5555FF'>/</font><font color='#979000'>2</font><font face='Lucida Console'>)</font>;
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>right.<font color='#BB00BB'>height</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font> <font color='#5555FF'><</font> all.<font color='#BB00BB'>height</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>
right <font color='#5555FF'>=</font> <font color='#BB00BB'>translate_rect</font><font face='Lucida Console'>(</font>right,<font color='#979000'>0</font>, <font face='Lucida Console'>(</font>all.<font color='#BB00BB'>height</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>-</font>right.<font color='#BB00BB'>height</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font><font color='#5555FF'>/</font><font color='#979000'>2</font><font face='Lucida Console'>)</font>;
left_rects.<font color='#BB00BB'>push_back</font><font face='Lucida Console'>(</font>left<font face='Lucida Console'>)</font>;
middle_rects.<font color='#BB00BB'>push_back</font><font face='Lucida Console'>(</font>middle<font face='Lucida Console'>)</font>;
right_rects.<font color='#BB00BB'>push_back</font><font face='Lucida Console'>(</font>right<font face='Lucida Console'>)</font>;
line_rects.<font color='#BB00BB'>push_back</font><font face='Lucida Console'>(</font>line<font face='Lucida Console'>)</font>;
popup_menu<font color='#5555FF'>*</font> junk <font color='#5555FF'>=</font> <font color='#979000'>0</font>;
submenus.<font color='#BB00BB'>push_back</font><font face='Lucida Console'>(</font>junk<font face='Lucida Console'>)</font>;
win_rect.<font color='#BB00BB'>set_right</font><font face='Lucida Console'>(</font>cur_rect.<font color='#BB00BB'>right</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>+</font>pad<font face='Lucida Console'>)</font>;
win_rect.<font color='#BB00BB'>set_bottom</font><font face='Lucida Console'>(</font>cur_rect.<font color='#BB00BB'>bottom</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>+</font>pad<font face='Lucida Console'>)</font>;
<font color='#BB00BB'>set_size</font><font face='Lucida Console'>(</font>win_rect.<font color='#BB00BB'>width</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>,win_rect.<font color='#BB00BB'>height</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
<font color='#009900'>// make it so that nothing is selected
</font> selected_item <font color='#5555FF'>=</font> submenus.<font color='#BB00BB'>size</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
<font color='#0000FF'>return</font> items.<font color='#BB00BB'>size</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>-</font><font color='#979000'>1</font>;
<b>}</b>
<font color='#0000FF'>template</font> <font color='#5555FF'><</font>
<font color='#0000FF'>typename</font> menu_item_type
<font color='#5555FF'>></font>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> <b><a name='add_submenu'></a>add_submenu</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> menu_item_type<font color='#5555FF'>&</font> new_item,
popup_menu<font color='#5555FF'>&</font> submenu
<font face='Lucida Console'>)</font>
<b>{</b>
auto_mutex <font color='#BB00BB'>M</font><font face='Lucida Console'>(</font>wm<font face='Lucida Console'>)</font>;
submenus[<font color='#BB00BB'>add_menu_item</font><font face='Lucida Console'>(</font>new_item<font face='Lucida Console'>)</font>] <font color='#5555FF'>=</font> <font color='#5555FF'>&</font>submenu;
submenu.<font color='#BB00BB'>set_on_hide_handler</font><font face='Lucida Console'>(</font><font color='#5555FF'>*</font><font color='#0000FF'>this</font>,<font color='#5555FF'>&</font>popup_menu::on_submenu_hide<font face='Lucida Console'>)</font>;
<font color='#0000FF'>return</font> items.<font color='#BB00BB'>size</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>-</font><font color='#979000'>1</font>;
<b>}</b>
<font color='#0000FF'><u>void</u></font> <b><a name='enable_menu_item'></a>enable_menu_item</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> idx
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='disable_menu_item'></a>disable_menu_item</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> idx
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>size_t</u></font> <b><a name='size'></a>size</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='clear'></a>clear</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='show'></a>show</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='hide'></a>hide</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'>template</font> <font color='#5555FF'><</font><font color='#0000FF'>typename</font> T<font color='#5555FF'>></font>
<font color='#0000FF'><u>void</u></font> <b><a name='set_on_hide_handler'></a>set_on_hide_handler</b> <font face='Lucida Console'>(</font>
T<font color='#5555FF'>&</font> object,
<font color='#0000FF'><u>void</u></font> <font face='Lucida Console'>(</font>T::<font color='#5555FF'>*</font>event_handler<font face='Lucida Console'>)</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>
<font face='Lucida Console'>)</font>
<b>{</b>
auto_mutex <font color='#BB00BB'>M</font><font face='Lucida Console'>(</font>wm<font face='Lucida Console'>)</font>;
member_function_pointer<font color='#5555FF'><</font><font color='#5555FF'>></font> temp;
temp.<font color='#BB00BB'>set</font><font face='Lucida Console'>(</font>object,event_handler<font face='Lucida Console'>)</font>;
<font color='#009900'>// if this handler isn't already registered then add it
</font> <font color='#0000FF'><u>bool</u></font> found_handler <font color='#5555FF'>=</font> <font color='#979000'>false</font>;
<font color='#0000FF'>for</font> <font face='Lucida Console'>(</font><font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> i <font color='#5555FF'>=</font> <font color='#979000'>0</font>; i <font color='#5555FF'><</font> hide_handlers.<font color='#BB00BB'>size</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>; <font color='#5555FF'>+</font><font color='#5555FF'>+</font>i<font face='Lucida Console'>)</font>
<b>{</b>
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>hide_handlers[i] <font color='#5555FF'>=</font><font color='#5555FF'>=</font> temp<font face='Lucida Console'>)</font>
<b>{</b>
found_handler <font color='#5555FF'>=</font> <font color='#979000'>true</font>;
<font color='#0000FF'>break</font>;
<b>}</b>
<b>}</b>
<font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>found_handler <font color='#5555FF'>=</font><font color='#5555FF'>=</font> <font color='#979000'>false</font><font face='Lucida Console'>)</font>
<b>{</b>
hide_handlers.<font color='#BB00BB'>push_back</font><font face='Lucida Console'>(</font>temp<font face='Lucida Console'>)</font>;
<b>}</b>
<b>}</b>
<font color='#0000FF'><u>void</u></font> <b><a name='select_first_item'></a>select_first_item</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>bool</u></font> <b><a name='forwarded_on_keydown'></a>forwarded_on_keydown</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> key,
<font color='#0000FF'><u>bool</u></font> is_printable,
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> state
<font face='Lucida Console'>)</font>;
<font color='#0000FF'>private</font>:
<font color='#0000FF'><u>void</u></font> <b><a name='on_submenu_hide'></a>on_submenu_hide</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='on_window_resized'></a>on_window_resized</b><font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='on_mouse_up'></a>on_mouse_up</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> btn,
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font>,
<font color='#0000FF'><u>long</u></font> x,
<font color='#0000FF'><u>long</u></font> y
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='on_mouse_move'></a>on_mouse_move</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> state,
<font color='#0000FF'><u>long</u></font> x,
<font color='#0000FF'><u>long</u></font> y
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='close_submenu'></a>close_submenu</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>bool</u></font> <b><a name='display_selected_submenu'></a>display_selected_submenu</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#009900'>/*!
ensures
- if (submenus[selected_item] isn't null) then
- displays the selected submenu
- returns true
- else
- returns false
!*/</font>
<font color='#0000FF'><u>void</u></font> <b><a name='on_mouse_leave'></a>on_mouse_leave</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='paint'></a>paint</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> canvas<font color='#5555FF'>&</font> c
<font face='Lucida Console'>)</font>;
<font color='#0000FF'>const</font> <font color='#0000FF'><u>long</u></font> pad;
<font color='#0000FF'>const</font> <font color='#0000FF'><u>long</u></font> item_pad;
rectangle cur_rect;
rectangle win_rect;
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> left_width;
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> middle_width;
array<font color='#5555FF'><</font>std::unique_ptr<font color='#5555FF'><</font>menu_item<font color='#5555FF'>></font> <font color='#5555FF'>></font> items;
array<font color='#5555FF'><</font><font color='#0000FF'><u>bool</u></font><font color='#5555FF'>></font> item_enabled;
array<font color='#5555FF'><</font>rectangle<font color='#5555FF'>></font> left_rects;
array<font color='#5555FF'><</font>rectangle<font color='#5555FF'>></font> middle_rects;
array<font color='#5555FF'><</font>rectangle<font color='#5555FF'>></font> right_rects;
array<font color='#5555FF'><</font>rectangle<font color='#5555FF'>></font> line_rects;
array<font color='#5555FF'><</font>popup_menu<font color='#5555FF'>*</font><font color='#5555FF'>></font> submenus;
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> selected_item;
<font color='#0000FF'><u>bool</u></font> submenu_open;
array<font color='#5555FF'><</font>member_function_pointer<font color='#5555FF'><</font><font color='#5555FF'>></font> <font color='#5555FF'>></font> hide_handlers;
<font color='#009900'>// restricted functions
</font> <b><a name='popup_menu'></a>popup_menu</b><font face='Lucida Console'>(</font>popup_menu<font color='#5555FF'>&</font><font face='Lucida Console'>)</font>; <font color='#009900'>// copy constructor
</font> popup_menu<font color='#5555FF'>&</font> <b><a name='operator'></a>operator</b><font color='#5555FF'>=</font><font face='Lucida Console'>(</font>popup_menu<font color='#5555FF'>&</font><font face='Lucida Console'>)</font>; <font color='#009900'>// assignment operator
</font> <b>}</b>;
<font color='#009900'>// ----------------------------------------------------------------------------------------
</font>
<font color='#0000FF'>class</font> <b><a name='zoomable_region'></a>zoomable_region</b> : <font color='#0000FF'>public</font> drawable
<b>{</b>
<font color='#009900'>/*!
INITIAL VALUE
- min_scale == 0.15
- max_scale == 1.0
- zoom_increment_ == 0.02
- scale == 1.0
- mouse_drag_screen == false
CONVENTION
- zoom_increment() == zoom_increment_
- min_zoom_scale() == min_scale
- max_zoom_scale() == max_scale
- zoom_scale() == scale
- if (the user is currently dragging the graph around via the mouse) then
- mouse_drag_screen == true
- else
- mouse_drag_screen == false
- max_graph_point() == lr_point
- display_rect() == display_rect_
- gui_to_graph_space(point(display_rect.left(),display_rect.top())) == gr_orig
!*/</font>
<font color='#0000FF'>public</font>:
<b><a name='zoomable_region'></a>zoomable_region</b> <font face='Lucida Console'>(</font>
drawable_window<font color='#5555FF'>&</font> w,
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> events <font color='#5555FF'>=</font> <font color='#979000'>0</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'>virtual</font> ~<b><a name='zoomable_region'></a>zoomable_region</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font><font color='#5555FF'>=</font> <font color='#979000'>0</font>;
<font color='#0000FF'>virtual</font> <font color='#0000FF'><u>void</u></font> <b><a name='set_pos'></a>set_pos</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>long</u></font> x,
<font color='#0000FF'><u>long</u></font> y
<font face='Lucida Console'>)</font>;
<font color='#0000FF'>template</font> <font color='#5555FF'><</font>
<font color='#0000FF'>typename</font> style_type
<font color='#5555FF'>></font>
<font color='#0000FF'><u>void</u></font> <b><a name='set_style'></a>set_style</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> style_type<font color='#5555FF'>&</font> style_
<font face='Lucida Console'>)</font>
<b>{</b>
auto_mutex <font color='#BB00BB'>M</font><font face='Lucida Console'>(</font>m<font face='Lucida Console'>)</font>;
style.<font color='#BB00BB'>reset</font><font face='Lucida Console'>(</font><font color='#0000FF'>new</font> <font color='#BB00BB'>style_type</font><font face='Lucida Console'>(</font>style_<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
hsb.<font color='#BB00BB'>set_style</font><font face='Lucida Console'>(</font>style_.<font color='#BB00BB'>get_horizontal_scroll_bar_style</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
vsb.<font color='#BB00BB'>set_style</font><font face='Lucida Console'>(</font>style_.<font color='#BB00BB'>get_vertical_scroll_bar_style</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
<font color='#009900'>// do this just so that everything gets redrawn right
</font> <font color='#BB00BB'>set_size</font><font face='Lucida Console'>(</font>rect.<font color='#BB00BB'>width</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>, rect.<font color='#BB00BB'>height</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'><u>void</u></font> <b><a name='set_zoom_increment'></a>set_zoom_increment</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>double</u></font> zi
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>double</u></font> <b><a name='zoom_increment'></a>zoom_increment</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='set_max_zoom_scale'></a>set_max_zoom_scale</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>double</u></font> ms
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='set_min_zoom_scale'></a>set_min_zoom_scale</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>double</u></font> ms
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>double</u></font> <b><a name='min_zoom_scale'></a>min_zoom_scale</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>;
<font color='#0000FF'><u>double</u></font> <b><a name='max_zoom_scale'></a>max_zoom_scale</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>;
<font color='#0000FF'>virtual</font> <font color='#0000FF'><u>void</u></font> <b><a name='set_size'></a>set_size</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> width,
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> height
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='show'></a>show</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='hide'></a>hide</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='enable'></a>enable</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='disable'></a>disable</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='set_z_order'></a>set_z_order</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>long</u></font> order
<font face='Lucida Console'>)</font>;
<font color='#0000FF'>protected</font>:
<font color='#0000FF'>virtual</font> <font color='#0000FF'><u>void</u></font> <b><a name='on_view_changed'></a>on_view_changed</b> <font face='Lucida Console'>(</font><font face='Lucida Console'>)</font> <b>{</b><b>}</b>
point <b><a name='graph_to_gui_space'></a>graph_to_gui_space</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> vector<font color='#5555FF'><</font><font color='#0000FF'><u>double</u></font>,<font color='#979000'>2</font><font color='#5555FF'>></font><font color='#5555FF'>&</font> p
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>;
vector<font color='#5555FF'><</font><font color='#0000FF'><u>double</u></font>,<font color='#979000'>2</font><font color='#5555FF'>></font> <b><a name='gui_to_graph_space'></a>gui_to_graph_space</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> point<font color='#5555FF'>&</font> p
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>;
point <b><a name='max_graph_point'></a>max_graph_point</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>;
rectangle <b><a name='display_rect'></a>display_rect</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>;
<font color='#0000FF'><u>double</u></font> <b><a name='zoom_scale'></a>zoom_scale</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='set_zoom_scale'></a>set_zoom_scale</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>double</u></font> new_scale
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='center_display_at_graph_point'></a>center_display_at_graph_point</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> vector<font color='#5555FF'><</font><font color='#0000FF'><u>double</u></font>,<font color='#979000'>2</font><font color='#5555FF'>></font><font color='#5555FF'>&</font> p
<font face='Lucida Console'>)</font>;
<font color='#009900'>// ----------- event handlers ---------------
</font>
<font color='#0000FF'><u>void</u></font> <b><a name='on_wheel_down'></a>on_wheel_down</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> state
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='on_wheel_up'></a>on_wheel_up</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> state
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='on_mouse_move'></a>on_mouse_move</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> state,
<font color='#0000FF'><u>long</u></font> x,
<font color='#0000FF'><u>long</u></font> y
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='on_mouse_up'></a>on_mouse_up</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> btn,
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> state,
<font color='#0000FF'><u>long</u></font> x,
<font color='#0000FF'><u>long</u></font> y
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='on_mouse_down'></a>on_mouse_down</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> btn,
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> state,
<font color='#0000FF'><u>long</u></font> x,
<font color='#0000FF'><u>long</u></font> y,
<font color='#0000FF'><u>bool</u></font> is_double_click
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='draw'></a>draw</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> canvas<font color='#5555FF'>&</font> c
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>;
<font color='#0000FF'>private</font>:
<font color='#0000FF'><u>void</u></font> <b><a name='on_h_scroll'></a>on_h_scroll</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='on_v_scroll'></a>on_v_scroll</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='redraw_graph'></a>redraw_graph</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='adjust_origin'></a>adjust_origin</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> point<font color='#5555FF'>&</font> gui_p,
<font color='#0000FF'>const</font> vector<font color='#5555FF'><</font><font color='#0000FF'><u>double</u></font>,<font color='#979000'>2</font><font color='#5555FF'>></font><font color='#5555FF'>&</font> graph_p
<font face='Lucida Console'>)</font>;
<font color='#009900'>/*!
ensures
- adjusts gr_orig so that we are as close to the following as possible:
- graph_to_gui_space(graph_p) == gui_p
- gui_to_graph_space(gui_p) == graph_p
!*/</font>
vector<font color='#5555FF'><</font><font color='#0000FF'><u>double</u></font>,<font color='#979000'>2</font><font color='#5555FF'>></font> gr_orig; <font color='#009900'>// point in graph space such that it's gui space point is the upper left of display_rect_
</font> vector<font color='#5555FF'><</font><font color='#0000FF'><u>double</u></font>,<font color='#979000'>2</font><font color='#5555FF'>></font> lr_point; <font color='#009900'>// point in graph space such that it is at the lower right corner of the screen at max zoom
</font>
<font color='#0000FF'>mutable</font> std::ostringstream sout;
<font color='#0000FF'><u>double</u></font> scale; <font color='#009900'>// 0 < scale <= 1
</font> <font color='#0000FF'><u>double</u></font> min_scale;
<font color='#0000FF'><u>double</u></font> max_scale;
<font color='#0000FF'><u>double</u></font> zoom_increment_;
rectangle display_rect_;
<font color='#0000FF'><u>bool</u></font> mouse_drag_screen; <font color='#009900'>// true if the user is dragging the white background area
</font> vector<font color='#5555FF'><</font><font color='#0000FF'><u>double</u></font>,<font color='#979000'>2</font><font color='#5555FF'>></font> drag_screen_point; <font color='#009900'>// the starting point the mouse was at in graph space for the background area drag
</font>
scroll_bar vsb;
scroll_bar hsb;
std::unique_ptr<font color='#5555FF'><</font>scrollable_region_style<font color='#5555FF'>></font> style;
<font color='#009900'>// restricted functions
</font> <b><a name='zoomable_region'></a>zoomable_region</b><font face='Lucida Console'>(</font>zoomable_region<font color='#5555FF'>&</font><font face='Lucida Console'>)</font>; <font color='#009900'>// copy constructor
</font> zoomable_region<font color='#5555FF'>&</font> <b><a name='operator'></a>operator</b><font color='#5555FF'>=</font><font face='Lucida Console'>(</font>zoomable_region<font color='#5555FF'>&</font><font face='Lucida Console'>)</font>; <font color='#009900'>// assignment operator
</font>
<b>}</b>;
<font color='#009900'>// ----------------------------------------------------------------------------------------
</font>
<font color='#0000FF'>class</font> <b><a name='scrollable_region'></a>scrollable_region</b> : <font color='#0000FF'>public</font> drawable
<b>{</b>
<font color='#009900'>/*!
INITIAL VALUE
- hscroll_bar_inc == 1
- vscroll_bar_inc == 1
- h_wheel_scroll_bar_inc == 1
- v_wheel_scroll_bar_inc == 1
- mouse_drag_enabled_ == false
- user_is_dragging_mouse == false
CONVENTION
- mouse_drag_enabled() == mouse_drag_enabled_
- horizontal_scroll_increment() == hscroll_bar_inc
- vertical_scroll_increment() == vscroll_bar_inc
- horizontal_mouse_wheel_scroll_increment() == h_wheel_scroll_bar_inc
- vertical_mouse_wheel_scroll_increment() == v_wheel_scroll_bar_inc
- vertical_scroll_pos() == vsb.slider_pos()
- horizontal_scroll_pos() == hsb.slider_pos()
- total_rect() == total_rect_
- display_rect() == display_rect_
- if (the user is currently dragging the total_rect around with a mouse drag) then
- user_is_dragging_mouse == true
- drag_origin == the point the mouse was at, with respect to total_rect,
when the dragging started
- else
- user_is_dragging_mouse == false
!*/</font>
<font color='#0000FF'>public</font>:
<b><a name='scrollable_region'></a>scrollable_region</b> <font face='Lucida Console'>(</font>
drawable_window<font color='#5555FF'>&</font> w,
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> events <font color='#5555FF'>=</font> <font color='#979000'>0</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'>virtual</font> ~<b><a name='scrollable_region'></a>scrollable_region</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#5555FF'>=</font> <font color='#979000'>0</font>;
<font color='#0000FF'>template</font> <font color='#5555FF'><</font>
<font color='#0000FF'>typename</font> style_type
<font color='#5555FF'>></font>
<font color='#0000FF'><u>void</u></font> <b><a name='set_style'></a>set_style</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> style_type<font color='#5555FF'>&</font> style_
<font face='Lucida Console'>)</font>
<b>{</b>
auto_mutex <font color='#BB00BB'>M</font><font face='Lucida Console'>(</font>m<font face='Lucida Console'>)</font>;
style.<font color='#BB00BB'>reset</font><font face='Lucida Console'>(</font><font color='#0000FF'>new</font> <font color='#BB00BB'>style_type</font><font face='Lucida Console'>(</font>style_<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
hsb.<font color='#BB00BB'>set_style</font><font face='Lucida Console'>(</font>style_.<font color='#BB00BB'>get_horizontal_scroll_bar_style</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
vsb.<font color='#BB00BB'>set_style</font><font face='Lucida Console'>(</font>style_.<font color='#BB00BB'>get_vertical_scroll_bar_style</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
<font color='#009900'>// do this just so that everything gets redrawn right
</font> <font color='#BB00BB'>set_size</font><font face='Lucida Console'>(</font>rect.<font color='#BB00BB'>width</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>, rect.<font color='#BB00BB'>height</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
<b>}</b>
<font color='#0000FF'><u>void</u></font> <b><a name='show'></a>show</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='hide'></a>hide</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='enable'></a>enable</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='disable'></a>disable</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='set_z_order'></a>set_z_order</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>long</u></font> order
<font face='Lucida Console'>)</font>;
<font color='#0000FF'>virtual</font> <font color='#0000FF'><u>void</u></font> <b><a name='set_size'></a>set_size</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> width,
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> height
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> <b><a name='horizontal_mouse_wheel_scroll_increment'></a>horizontal_mouse_wheel_scroll_increment</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>;
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> <b><a name='vertical_mouse_wheel_scroll_increment'></a>vertical_mouse_wheel_scroll_increment</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='set_horizontal_mouse_wheel_scroll_increment'></a>set_horizontal_mouse_wheel_scroll_increment</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> inc
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='set_vertical_mouse_wheel_scroll_increment'></a>set_vertical_mouse_wheel_scroll_increment</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> inc
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> <b><a name='horizontal_scroll_increment'></a>horizontal_scroll_increment</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>;
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> <b><a name='vertical_scroll_increment'></a>vertical_scroll_increment</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='set_horizontal_scroll_increment'></a>set_horizontal_scroll_increment</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> inc
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='set_vertical_scroll_increment'></a>set_vertical_scroll_increment</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> inc
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>long</u></font> <b><a name='horizontal_scroll_pos'></a>horizontal_scroll_pos</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>;
<font color='#0000FF'><u>long</u></font> <b><a name='vertical_scroll_pos'></a>vertical_scroll_pos</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='set_horizontal_scroll_pos'></a>set_horizontal_scroll_pos</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>long</u></font> pos
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='set_vertical_scroll_pos'></a>set_vertical_scroll_pos</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>long</u></font> pos
<font face='Lucida Console'>)</font>;
<font color='#0000FF'>virtual</font> <font color='#0000FF'><u>void</u></font> <b><a name='set_pos'></a>set_pos</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>long</u></font> x,
<font color='#0000FF'><u>long</u></font> y
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>bool</u></font> <b><a name='mouse_drag_enabled'></a>mouse_drag_enabled</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='enable_mouse_drag'></a>enable_mouse_drag</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='disable_mouse_drag'></a>disable_mouse_drag</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'>protected</font>:
<font color='#0000FF'>virtual</font> <font color='#0000FF'><u>void</u></font> <b><a name='on_view_changed'></a>on_view_changed</b> <font face='Lucida Console'>(</font><font face='Lucida Console'>)</font> <b>{</b><b>}</b>
<font color='#0000FF'>const</font> rectangle<font color='#5555FF'>&</font> <b><a name='display_rect'></a>display_rect</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='set_total_rect_size'></a>set_total_rect_size</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> width,
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> height
<font face='Lucida Console'>)</font>;
<font color='#0000FF'>const</font> rectangle<font color='#5555FF'>&</font> <b><a name='total_rect'></a>total_rect</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='scroll_to_rect'></a>scroll_to_rect</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> rectangle<font color='#5555FF'>&</font> r_
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='on_wheel_down'></a>on_wheel_down</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> state
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='on_mouse_move'></a>on_mouse_move</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> state,
<font color='#0000FF'><u>long</u></font> x,
<font color='#0000FF'><u>long</u></font> y
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='on_mouse_down'></a>on_mouse_down</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> btn,
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> state,
<font color='#0000FF'><u>long</u></font> x,
<font color='#0000FF'><u>long</u></font> y,
<font color='#0000FF'><u>bool</u></font> is_double_click
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='on_mouse_up'></a>on_mouse_up</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> btn,
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> state,
<font color='#0000FF'><u>long</u></font> x,
<font color='#0000FF'><u>long</u></font> y
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='on_wheel_up'></a>on_wheel_up</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> state
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='draw'></a>draw</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> canvas<font color='#5555FF'>&</font> c
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>;
<font color='#0000FF'>private</font>:
<font color='#0000FF'><u>bool</u></font> <b><a name='need_h_scroll'></a>need_h_scroll</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>;
<font color='#0000FF'><u>bool</u></font> <b><a name='need_v_scroll'></a>need_v_scroll</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='on_h_scroll'></a>on_h_scroll</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='on_v_scroll'></a>on_v_scroll</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
rectangle total_rect_;
rectangle display_rect_;
scroll_bar hsb;
scroll_bar vsb;
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> hscroll_bar_inc;
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> vscroll_bar_inc;
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> h_wheel_scroll_bar_inc;
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> v_wheel_scroll_bar_inc;
<font color='#0000FF'><u>bool</u></font> mouse_drag_enabled_;
<font color='#0000FF'><u>bool</u></font> user_is_dragging_mouse;
point drag_origin;
std::unique_ptr<font color='#5555FF'><</font>scrollable_region_style<font color='#5555FF'>></font> style;
<b>}</b>;
<font color='#009900'>// ----------------------------------------------------------------------------------------
</font><font color='#009900'>// ----------------------------------------------------------------------------------------
</font> <font color='#009900'>// class popup_menu_region
</font><font color='#009900'>// ----------------------------------------------------------------------------------------
</font><font color='#009900'>// ----------------------------------------------------------------------------------------
</font>
<font color='#0000FF'>class</font> <b><a name='popup_menu_region'></a>popup_menu_region</b> : <font color='#0000FF'>public</font> drawable
<b>{</b>
<font color='#009900'>/*!
CONVENTION
popup_menu_visible() == popup_menu_shown
!*/</font>
<font color='#0000FF'>public</font>:
<b><a name='popup_menu_region'></a>popup_menu_region</b><font face='Lucida Console'>(</font>
drawable_window<font color='#5555FF'>&</font> w
<font face='Lucida Console'>)</font>;
<font color='#0000FF'>virtual</font> ~<b><a name='popup_menu_region'></a>popup_menu_region</b><font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='set_size'></a>set_size</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> width,
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> height
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='set_rect'></a>set_rect</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> rectangle<font color='#5555FF'>&</font> new_rect
<font face='Lucida Console'>)</font>;
popup_menu<font color='#5555FF'>&</font> <b><a name='menu'></a>menu</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='hide'></a>hide</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='disable'></a>disable</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>bool</u></font> <b><a name='popup_menu_visible'></a>popup_menu_visible</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font> <b>{</b> auto_mutex <font color='#BB00BB'>M</font><font face='Lucida Console'>(</font>m<font face='Lucida Console'>)</font>; <font color='#0000FF'>return</font> popup_menu_shown; <b>}</b>
<font color='#0000FF'>protected</font>:
<font color='#0000FF'><u>void</u></font> <b><a name='on_keydown'></a>on_keydown</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> key,
<font color='#0000FF'><u>bool</u></font> is_printable,
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> state
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='on_focus_lost'></a>on_focus_lost</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='on_focus_gained'></a>on_focus_gained</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='on_window_moved'></a>on_window_moved</b><font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='on_mouse_down'></a>on_mouse_down</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> btn,
<font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> state,
<font color='#0000FF'><u>long</u></font> x,
<font color='#0000FF'><u>long</u></font> y,
<font color='#0000FF'><u>bool</u></font> is_double_click
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='on_menu_becomes_hidden'></a>on_menu_becomes_hidden</b> <font face='Lucida Console'>(</font>
<font face='Lucida Console'>)</font>;
<font color='#0000FF'><u>void</u></font> <b><a name='draw'></a>draw</b> <font face='Lucida Console'>(</font>
<font color='#0000FF'>const</font> canvas<font color='#5555FF'>&</font>
<font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>;
<font color='#0000FF'>private</font>:
popup_menu menu_;
<font color='#0000FF'><u>bool</u></font> popup_menu_shown;
<font color='#009900'>// restricted functions
</font> <b><a name='popup_menu_region'></a>popup_menu_region</b><font face='Lucida Console'>(</font>popup_menu_region<font color='#5555FF'>&</font><font face='Lucida Console'>)</font>; <font color='#009900'>// copy constructor
</font> popup_menu_region<font color='#5555FF'>&</font> <b><a name='operator'></a>operator</b><font color='#5555FF'>=</font><font face='Lucida Console'>(</font>popup_menu_region<font color='#5555FF'>&</font><font face='Lucida Console'>)</font>; <font color='#009900'>// assignment operator
</font> <b>}</b>;
<font color='#009900'>// ----------------------------------------------------------------------------------------
</font>
<b>}</b>
<font color='#0000FF'>#ifdef</font> NO_MAKEFILE
<font color='#0000FF'>#include</font> "<a style='text-decoration:none' href='base_widgets.cpp.html'>base_widgets.cpp</a>"
<font color='#0000FF'>#endif</font>
<font color='#0000FF'>#endif</font> <font color='#009900'>// DLIB_BASE_WIDGETs_
</font>
</pre></body></html> |