[r9764]: docs / trunk / oodialog / en-US / resources.xml Maximize Restore History

Download this file

resources.xml    3381 lines (3109 with data), 130.0 kB

   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
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
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % BOOK_ENTITIES SYSTEM "oodialog.ent">
%BOOK_ENTITIES;
]>
<!--#########################################################################
#
# Description: Open Object Rexx: ooDialog Reference XML file.
#
# Copyright (c) 2005-2013 Rexx Language Association. All rights reserved.
# Portions Copyright (c) 2004, IBM Corporation. All rights reserved.
#
# This program and the accompanying materials are made available under
# the terms of the Common Public License v1.0 which accompanies this
# distribution. A copy is also available at the following address:
# http://www.oorexx.org/license.html
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the distribution.
#
# Neither the name of Rexx Language Association nor the names
# of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
# TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#########################################################################
-->
<chapter id="chapResources" xreflabel="resources"><title>Resources</title>
<indexterm><primary>Resources</primary></indexterm>
<para>
In the Windows OS, a <emphasis role="italic">resource</emphasis>, is binary data used by a
Windows-based application. Usually, the binary data is attached to one of the application's executable
files (*.exe or *.dll.) However, the binary data can also be generated dynamically in memory. (Which
is common in ooDialog, for example the dialog template for a UserDialog is generated in memory.)
</para>
<para>
The data in standard resources describes things familar to ooDialog programmers like, dialog boxes,
icons, menus, cursors, bitmaps, fonts, etc. The standard resources also include accelerator tables,
string-table entries, message-table entries, and other resourcess that ooDialog does not currently have
support for, but may support in the future.
</para>
<para>
This chapter describes ooDialog classes that provide access to Windows resources. The classes allow
the oodialog programmer to use and manipulate resources in their ooDialog programs. This is an area of
ooDialog that is slated for future improvements.
</para>
<section id="sctResourceClasses"><title>Resource Classes</title>
<para> The classes listed in the following table are documented in this chapter:
<table id="tblResourcesClasses" frame="all"> <title>ooDialog Resource Classes</title>
<tgroup cols="2">
<colspec colwidth="1*" /><colspec colwidth="4*" />
<thead>
<row>
<entry>Class</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>Image <xref linkend="clsImage"/></entry>
<entry>Objects used to work with and manipulate images.</entry>
</row>
<row>
<entry>ImageList <xref linkend="clsImageList"/></entry>
<entry>Objects used to efficiently manage large sets of images.</entry>
</row>
<row>
<entry>Mouse <xref linkend="clsMouse"/></entry>
<entry>Objects used to efficiently manage large sets of images.</entry>
</row>
<row>
<entry>ResourceImage <xref linkend="clsResourceImage"/></entry>
<entry>Objects used to represent modules that contain resources.</entry>
</row>
</tbody></tgroup>
</table>
</para>
</section>
<section id="clsImage" xreflabel="Image"><title>Image Class</title>
<indexterm><primary>Image class</primary></indexterm>
<para>
The Image class is used to work with and manipulate images. Currently, the image types supported include bitmaps,
icons, cursors (cusors are a type of icon,) and enhanced metafiles. The enhanced metafile support is very limited at
this time.
</para>
<para>
The class supports loading images from files, from resources contained in any executable files (*.exe and *.dll,) from
the files associated with the ooDialog program, and from the generally available system resources.
</para>
<para>
<emphasis role="bold">Note:</emphasis> The <computeroutput>.Image</computeroutput> class is the future direction that
ooDialog will take for working with images, including bitmaps. This is a more flexible approach than the older bitmap
methods used when ooDialog was first developed. It will allow access to more of the modern features of the Windows
user interface than the older approach does. The older bitmap methods were designed to work with Windows 3.1 and have
a number of limitations. The ooDialog programmer is strongly encouraged to migrate her code towards the .Image
class. The older bitmap methods should be considered depracated, to a degree. Unfortunately, replacement methods for
all of the older bitmap methods have not as yet been implmented. So, the older methods may still be necessary for
some situations.
</para>
<para id="paraClsImageRelease">
A loaded image takes up some small part of the systems's resources. It is common to release an image
when the programmer is done with it. The .Image class has the
<xref linkend="mthReleaseClsImage"/> method to allow the programmer to release the image, if
desired. It is <emphasis role="bold">important</emphasis> to note that when the ooDialog program ends,
that is when the ooRexx interpreter process ends, the Windows operating system cleans up all the system
resources associated with any images used in the ooDialog program. Not releasing images does no harm
and the ooDialog programmer should not be unduly worried about this aspect of images.
</para>
<para>
In addition, when images are loaded as shared, the operating system completely manages them. Shared
images should not be released. The .Image class tracks which images are loaded as shared and will not
call the underlying API to release a shared image. So, again, the ooDialog programmer does not need to
worry about mistakenly releasing a shared image. Once an image is released, it is no longer valid and
the object can not be used as an argument to methods requiring a valid image. This applies to shared
images also, even though they are not actually released.
</para>
<para>
Why then would the ooDialog programmer want to release images? The main reason would be to minimize
the memory footprint of an application. In a normal ooDialog program, with five to ten images,
releasing the images would have no noticeable impact on the memory footprint. However, in a long
running Rexx program that opened and closed a lot of dialogs that used images, releasing the images as
the dialogs were closed would make a difference in the long run. The operating system would not clean
up the resources used by the images until the main Rexx program ended. If the main program ran for
days, or maybe was never intended to be shut down, it would make sense to release images that were no
longer needed.
</para>
<section id="sctMethodsImageClass"><title>Method Table</title>
<para>
Instances of the <computeroutput>Image</computeroutput> class implement the methods listed in the following table:
</para>
<table id="tblImageMethods" frame="all">
<title>Methods of the <computeroutput>Image</computeroutput> Class</title>
<tgroup cols="2">
<colspec colwidth="1*" /><colspec colwidth="4*" />
<thead>
<row>
<entry>Method</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry align="center"><emphasis role="bold">Class Methods</emphasis></entry>
<entry align="center"><emphasis role="bold"></emphasis></entry>
</row>
<row>
<entry><xref linkend="mthColorRef"/></entry>
<entry>Provides a way to construct a COLORREF from the red, green, and blue values of a color.</entry>
</row>
<row>
<entry><xref linkend="mthFromFilesClsImage"/></entry>
<entry>Returns an array of <computeroutput>.Image</computeroutput> objects when given an array of file names.</entry>
</row>
<row>
<entry><xref linkend="mthFromIDsClsImage"/></entry>
<entry>Uses an array of resource IDs to instantiate and return an array of <computeroutput>.Image</computeroutput> objects.</entry>
</row>
<row>
<entry><xref linkend="mthGetBValue"/></entry>
<entry>Returns the blue component of a RGB color.</entry>
</row>
<row>
<entry><xref linkend="mthGetGValue"/></entry>
<entry>Returns the green component of a RGB color.</entry>
</row>
<row>
<entry><xref linkend="mthGetImageClsImage"/></entry>
<entry>Instantiates a new <computeroutput>.Image</computeroutput> object from either an image file or from one of the system images.</entry>
</row>
<row>
<entry><xref linkend="mthGetRValue"/></entry>
<entry>Returns the red component of a RGB color.</entry>
</row>
<row>
<entry><xref linkend="mthNewClsImage"/></entry>
<entry>Image objects can not be instantiated from Rexx code using the <emphasis role="italic">new</emphasis>, other class methods are used.</entry>
</row>
<row>
<entry><xref linkend="mthToIDClsImage"/></entry>
<entry>Used to translate a symbolic name to its integer value</entry>
</row>
<row>
<entry><xref linkend="mthUserIcon"/></entry>
<entry>Returns a new image object from an icon resource added to the Rexx dialog object.</entry>
</row>
<row>
<entry align="center"><emphasis role="bold">Instance Methods</emphasis></entry>
<entry align="center"><emphasis role="bold"></emphasis></entry>
</row>
<row>
<entry><xref linkend="mthHandleClsImage"/></entry>
<entry>Returns the Windows system handle to the image this object represents.</entry>
</row>
<row>
<entry><xref linkend="mthIsNullClsImage"/></entry>
<entry>Tests if the image object is valid.</entry>
</row>
<row>
<entry><xref linkend="mthReleaseClsImage"/></entry>
<entry>Releases the operating system resources used for the image.</entry>
</row>
<row>
<entry><xref linkend="mthSystemErrorCodeClsImage"/></entry>
<entry>Reflects any system error codes that are detected while working with an image object.</entry>
</row>
</tbody></tgroup>
</table>
</section>
<section id="mthColorRef" xreflabel="colorRef"><title>colorRef (Class Method)</title>
<indexterm><primary>colorRef</primary></indexterm>
<programlisting>
<![CDATA[
>>-.Image~colorRef(--+---+--+-----+--+-----+--)-----------------><
+-R-+ +-,-G-+ +-,-B-+
]]>
</programlisting>
<para>
The Windows API uses a COLORREF to specify a RGB color. This is a 32-bit number with a
hexidecimal format of: <computeroutput>0x00bbggrr</computeroutput>. The
<computeroutput>colorRef</computeroutput>() method provides a way to construct a COLORREF from the red,
green, and blue values. Each color value (red, green, or blue) is a whole number in the range of 0 to
255 inclusive.
</para>
<para>
Windows also defines 2 special values for a COLORREF, CLR_NONE and CLR_DEFAULT. To get the numeric
value for either of these values use CLR_NONE or CLR_DEFAULT for the R argument. E.g.,
<computeroutput>ref = .Image~colorRef("CLR_NONE")</computeroutput>.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
All the arguments are optional, with 0 being the default for any omitted argument.
<variablelist>
<varlistentry><term>R</term>
<listitem>
<para>
The red component of the RGB color, or one of the CLR_NONE / CLR_DEFAULT keywords. Case is not
significant for either of the two keywords.
</para>
</listitem></varlistentry>
<varlistentry><term>G</term>
<listitem>
<para>
The green component of the RGB value.
</para>
</listitem></varlistentry>
<varlistentry><term>B</term>
<listitem>
<para>
The blue component of the RGB value.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The return is a valid RGB color, specified as a COLORREF. Some method arguments related to images
or colors require a COLORREF.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<programlisting>
<![CDATA[
ref = .Image~colorRef(245, 89, 255)
say 'A fancy purple:' ref '(0x' || ref~d2x~right(8, '0')')'
say
::requires 'oodPlain.cls'
/* Output:
A fancy purple: 16734709 (0x00FF59F5)
*/
]]>
</programlisting>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Image::colorRef() [class method] -->
<section id="mthFromFilesClsImage" xreflabel="fromFiles"><title>fromFiles (Class method)</title>
<indexterm><primary>fromFiles</primary>
<secondary>Image class</secondary></indexterm>
<programlisting>
<![CDATA[
>>--fromFiles(--files--+--------+--+--------+--+---------+--)---><
+-,-type-+ +-,-size-+ +-,-flags-+
]]>
</programlisting>
<para>
Gets an array of .Image objects, using an array of file names. This method is useful to load more
than one image at a time, when all the images have the same specifications, type, size, and flags.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<variablelist>
<varlistentry><term>files</term>
<listitem>
<para>
An array of file names to use to instantiate the .Image objects. The array can contain any
number of file names, but it can not be sparse. That is, each index of the array must contain
a file name. If an incorrect item is detected in the array, then a syntax error is raised and
no images are returned.
</para>
<para>
On the other hand, if there is an error with the Win32 API loading an image, then no syntax
error is raised. The index in the array for that image is left empty. One way to check for
this type of error is to compare the number of items in the returned array with the number of
items in file name array.
</para>
</listitem></varlistentry>
<varlistentry><term>type</term>
<listitem>
<para>
Specifies the type of the image, bitmap, icon, or cursor. You can use
the <xref linkend="mthToIDClsImage"/> method of the <xref linkend="clsImage"/> class to get the correct numeric
value for one of the following symbols:
<simplelist type='horiz' columns='2'>
<member>IMAGE_BITMAP</member> <member>IMAGE_ICON</member>
<member>IMAGE_CURSOR</member>
</simplelist>
</para>
<para>
The default is IMAGE_BITMAP.
</para>
</listitem></varlistentry>
<varlistentry><term>size</term>
<listitem>
<para>
A <xref linkend="clsSize"/> object that specifies the size of the image. The default
is a size of 0x0. Under most circumstances this indicates that the actual size of the image
should be used. However, the MSDN <xref linkend="defWindowsDoc"/> documentation should
be consulted for other meanings.
</para>
</listitem></varlistentry>
<varlistentry><term>flags</term>
<listitem>
<para>
The load resource flags for the LoadImage() API. The flags are one or more of the following
symbols. You can use the <xref linkend="mthToIDClsImage"/> method of the <xref linkend="clsImage"/> class to get the correct numeric
value for any of the following symbols. The <xref linkend="mthOrClsDlgUtil"/> method of
the <xref linkend="clsDlgUtil"/> class can be used to combine more than one of the
symbols if needed.
<simplelist type='horiz' columns='2'>
<member>LR_DEFAULTCOLOR</member> <member>LR_CREATEDIBSECTION</member>
<member>LR_DEFAULTSIZE</member> <member>LR_LOADFROMFILE</member>
<member>LR_LOADMAP3DCOLORS</member> <member>LR_LOADTRANSPARENT</member>
<member>LR_MONOCHROME</member> <member>LR_SHARED</member>
<member>LR_VGACOLOR</member>
</simplelist>
</para>
<para>
The default is LR_LOADFROMFILE.
</para>
</listitem></varlistentry>
</variablelist>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The method returns an array of .Image objects, one object for each image that was loaded from a
file successfully.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
Sets the <xref linkend="dotSystemErrorCode"/>.
</para>
<para>
Raises syntax errors when incorrect arguments are detected.
</para>
<para>
Provides an interface to the Win32 API: <computeroutput>LoadImage()</computeroutput>. Use the
MSDN <xref linkend="defWindowsDoc"/> documentation to get more information on the arguments to
this method.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<programlisting>
<![CDATA[
]]>
</programlisting>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Image::fromFiles() [class method] -->
<section id="mthFromIDsClsImage" xreflabel="fromIDs"><title>fromIDs (Class method)</title>
<indexterm><primary>fromIDs</primary>
<secondary>Image class</secondary></indexterm>
<programlisting>
<![CDATA[
>>--fromIDs(--ids,--+--------+--+--------+--+---------+--)------><
+-,-type-+ +-,-size-+ +-,-flags-+
]]>
</programlisting>
<para>
Uses an array of resource IDs to instantiate and return an array of .Image objects. This method loads
the system image resources referenced by the resource IDs in the array. The images must all be the
same type and size, and use the same load flags.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<variablelist>
<varlistentry><term>ids</term>
<listitem>
<para>
An array of resource IDs to use to instantiate the .Image objects. The array can contain any
number of IDs, but it can not be sparse. That is, each index of the array must contain a
number. If an incorrect item is detected in the array, then a syntax error is raised and no
images are returned.
</para>
<para>
On the other hand, if there is an error with the Win32 API loading an image, then no syntax
error is raised. The index in the array for that image is left empty. One way to check for
this type of error is to compare the number of items in the returned array with the number of
items in ID array.
</para>
</listitem></varlistentry>
<varlistentry><term>type</term>
<listitem>
<para>
Specifies the type of the image: bitmap, icon, or cursor. You can use
the <xref linkend="mthToIDClsImage"/> method of the <xref linkend="clsImage"/> class to get the correct numeric value for one of the
following symbols:
<simplelist type='horiz' columns='2'>
<member>IMAGE_BITMAP</member> <member>IMAGE_ICON</member>
<member>IMAGE_CURSOR</member>
</simplelist>
</para>
<para>
The default is IMAGE_ICON
</para>
</listitem></varlistentry>
<varlistentry><term>size</term>
<listitem>
<para>
A <xref linkend="clsSize"/> object that specifies the size of the image. The default
is a size of 0x0. Under most circumstances this indicates that the actual size of the image
should be used. However, the MSDN <xref linkend="defWindowsDoc"/> documentation should
be consulted for other meanings.
</para>
</listitem></varlistentry>
<varlistentry><term>flags</term>
<listitem>
<para>
The load resource flags for the LoadImage() API. The flags are one or more of the following
symbols. You can use the <xref linkend="mthToIDClsImage"/> method of the <xref linkend="clsImage"/> class to get the correct numeric
value for any of the following symbols. The <xref linkend="mthOrClsDlgUtil"/> method of
the <xref linkend="clsDlgUtil"/> class can be used to combine more than one of the
symbols if needed.
<simplelist type='horiz' columns='2'>
<member>LR_DEFAULTCOLOR</member> <member>LR_CREATEDIBSECTION</member>
<member>LR_DEFAULTSIZE</member> <member>LR_LOADFROMFILE</member>
<member>LR_LOADMAP3DCOLORS</member> <member>LR_LOADTRANSPARENT</member>
<member>LR_MONOCHROME</member> <member>LR_SHARED</member>
<member>LR_VGACOLOR</member>
</simplelist>
</para>
<para>
The default is LR_SHARED | LR_DEFAULTSIZE.
</para>
</listitem></varlistentry>
</variablelist>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The method returns an array of .Image objects, one object for each system image that was loaded
successfully.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
Sets the <xref linkend="dotSystemErrorCode"/>.
</para>
<para>
Raises syntax errors when incorrect arguments are detected.
</para>
<para>
Provides an interface to the Win32 API: <computeroutput>LoadImage()</computeroutput>. Use the
MSDN <xref linkend="defWindowsDoc"/> documentation to get more information on the arguments to
this method.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<programlisting>
<![CDATA[
]]>
</programlisting>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Image::fromIDs() [class method] -->
<section id="mthGetBValue" xreflabel="getBValue"><title>getBValue (Class Method)</title>
<indexterm><primary>getRValue</primary></indexterm>
<programlisting>
<![CDATA[
>>-.Image~getBValue(--colorRef--)----------------><
]]>
</programlisting>
<para>
Returns the blue component of a RGB color.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The single argument is:
<variablelist>
<varlistentry><term>colorRef</term>
<listitem>
<para>
A RGB color, a COLORREF. See the <xref linkend="mthColorRef"/> method for a brief discussion of these terms.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The return is the blue component of the specified RGB color.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
See the <link linkend="exampleGetRValueClsImage">example</link> for the <emphasis role="italic">getRValue</emphasis>
method.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Image::getBValue() [class method] -->
<section id="mthGetGValue" xreflabel="getGValue"><title>getGValue (Class Method)</title>
<indexterm><primary>getRValue</primary></indexterm>
<programlisting>
<![CDATA[
>>-.Image~getGValue(--colorRef--)----------------><
]]>
</programlisting>
<para>
Returns the green component of a RGB color.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The single argument is:
<variablelist>
<varlistentry><term>colorRef</term>
<listitem>
<para>
A RGB color, a COLORREF. See the <xref linkend="mthColorRef"/>() method for a
brief discussion of these terms.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The return is the green component of the specified RGB color.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
See the <link linkend="exampleGetRValueClsImage">example</link> for the <emphasis role="italic">getRValue</emphasis>
method.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Image::getGValue() [class method] -->
<section id="mthGetImageClsImage" xreflabel="getImage"><title>getImage (Class method)</title>
<indexterm><primary>getImage</primary>
<secondary>Image class</secondary></indexterm>
<programlisting>
<![CDATA[
>>--getImage(--id--+--------+--+--------+--+---------+--)-------><
+-,-type-+ +-,-size-+ +-,-flags-+
]]>
</programlisting>
<para>
Instantiates a new .Image object from either an image file or from one of the system images. When id
is a number then the corresponding system image is used. Otherwise, id is taken to be the name of an
image file. File names can be either relative or absolute.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<variablelist>
<varlistentry><term>id</term>
<listitem>
<para>
If not a number, then id must be the name of a stand-alone image file.
</para>
<para>
If id is a number than it is taken to be the resource id of an image provided by the system. The
following are the symbolic names for all the system images. You can use
the <xref linkend="mthToIDClsImage"/> method of the <xref linkend="clsImage"/> class to get the correct numeric value for any of the
following symbols:
<simplelist type='vert' columns='4'>
<member>IDI_APPLICATION</member> <member>IDI_HAND</member> <member>IDI_QUESTION</member>
<member>IDI_EXCLAMATION</member> <member>IDI_ASTERISK</member> <member>IDI_WINLOGO</member>
<member></member> <member></member> <member></member>
<member></member> <member></member> <member></member>
<member></member>
<member>OCR_NORMAL</member> <member>OCR_IBEAM</member> <member>OCR_WAIT</member>
<member>OCR_CROSS</member> <member>OCR_UP</member> <member>OCR_SIZENWSE</member>
<member>OCR_SIZENESW</member> <member>OCR_SIZEWE</member> <member>OCR_SIZENS</member>
<member>OCR_SIZEALL</member> <member>OCR_NO</member> <member>OCR_HAND</member>
<member>OCR_APPSTARTING</member>
<member>OBM_CLOSE</member> <member>OBM_UPARROW</member> <member>OBM_DNARROW</member>
<member>OBM_RGARROW</member> <member>OBM_LFARROW</member> <member>OBM_REDUCE</member>
<member>OBM_ZOOM</member> <member>OBM_RESTORE</member> <member>OBM_REDUCED</member>
<member>OBM_ZOOMD</member> <member>OBM_RESTORED</member> <member>OBM_UPARROWD</member>
<member>OBM_DNARROWD</member>
<member>OBM_RGARROWD</member> <member>OBM_LFARROWD</member> <member>OBM_MNARROW</member>
<member>OBM_COMBO</member> <member>OBM_UPARROWI</member> <member>OBM_DNARROWI</member>
<member>OBM_RGARROWI</member> <member>OBM_LFARROWI</member> <member>OBM_SIZE</member>
<member>OBM_BTSIZE</member> <member>OBM_CHECK</member> <member>OBM_CHECKBOXES</member>
<member>OBM_BTNCORNERS</member>
</simplelist>
</para>
</listitem></varlistentry>
<varlistentry><term>type</term>
<listitem>
<para>
A number between 0 and 255 that specifies the type of the image: bitmap, icon, or cursor. You can use
the <xref linkend="mthToIDClsImage"/> method of the <xref linkend="clsImage"/> class to get the correct numeric value for one of the
following symbols:
<simplelist type='horiz' columns='2'>
<member>IMAGE_BITMAP</member> <member>IMAGE_ICON</member>
<member>IMAGE_CURSOR</member>
</simplelist>
</para>
<para>
The default is IMAGE_BITMAP.
</para>
</listitem></varlistentry>
<varlistentry><term>size</term>
<listitem>
<para>
A <xref linkend="clsSize"/> object that specifies the size of the image.
</para>
<para>
The default is a size of 0x0. Under most circumstances this indicates that the actual size of
the image should be used. However, the MSDN <xref linkend="defWindowsDoc"/>
documentation should be consulted for other meanings.
</para>
</listitem></varlistentry>
<varlistentry><term>flags</term>
<listitem>
<para>
The load resource flags for the LoadImage() API. The flags are one or more of the following
symbols. You can use the <xref linkend="mthToIDClsImage"/> method of the <xref linkend="clsImage"/> class to get the correct numeric
value for any of the following symbols. The <xref linkend="mthOrClsDlgUtil"/> method of
the <xref linkend="clsDlgUtil"/> class can be used to combine more than one of the
symbols if needed.
<simplelist type='horiz' columns='2'>
<member>LR_DEFAULTCOLOR</member> <member>LR_CREATEDIBSECTION</member>
<member>LR_DEFAULTSIZE</member> <member>LR_LOADFROMFILE</member>
<member>LR_LOADMAP3DCOLORS</member> <member>LR_LOADTRANSPARENT</member>
<member>LR_MONOCHROME</member> <member>LR_SHARED</member>
<member>LR_VGACOLOR</member>
</simplelist>
</para>
<para>
When id specifies a file name, the default flags are LR_LOADFROMFILE, othewise the default flags
are LR_SHARED | LR_DEFAULTSIZE. Note that the system images must be loaded as shared.
</para>
</listitem></varlistentry>
</variablelist>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
A .Image object that represents the image specified. If an error happened, the object may not be
valid. Use the <xref linkend="mthIsNullClsImage"/> method to check if the image is
valid. If there was an error, <xref linkend="dotSystemErrorCode"/> may help
to determine the error.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
Sets the <xref linkend="dotSystemErrorCode"/>.
</para>
<para>
Raises syntax errors when incorrect arguments are detected.
</para>
<para>
Provides an interface to the Win32 API: <computeroutput>LoadImage()</computeroutput>. Use the
MSDN <xref linkend="defWindowsDoc"/> documentation to get more information on the arguments to
this method.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<programlisting>
<![CDATA[
flags = .DlgUtil~or(.Image~toID(LR_DEFAULTSIZE), .Image~toID(LR_SHARED), -
.Image~toID(LR_LOADMAP3DCOLORS))
questionIcon = .Image~getImage(.Image~toID(IDI_QUESTION), -
.Image~toID(IMAGE_ICON), -
.Size~new(0, 0), flags)
if questionIcon~isNull then do
say 'Error getting the question icon. Error code:' .systemErrorCode
end
/* Note that you can always use the raw numeric value for the args.
* This works just as well:
*/
questionIcon = .Image~getImage(32514, 1, .Size~new(0, 0), 36928)
if questionIcon~isNull then do
say 'Error getting the question icon. Error code:' .systemErrorCode
end
]]>
</programlisting>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Image::getImage() [class method] -->
<section id="mthGetRValue" xreflabel="getRValue"><title>getRValue (Class Method)</title>
<indexterm><primary>getRValue</primary></indexterm>
<programlisting>
<![CDATA[
>>-.Image~getRValue(--colorRef--)----------------><
]]>
</programlisting>
<para>
Returns the red component of a RGB color.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The single argument is:
<variablelist>
<varlistentry><term>colorRef</term>
<listitem>
<para>
A RGB color, a COLORREF. See the <xref linkend="mthColorRef"/>() method for a
brief discussion of these terms.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The return is the red component of the specified RGB color.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<programlisting id="exampleGetRValueClsImage">
<![CDATA[
progressBar = self~newProgressBar("IDC_PB_FILES")
if progressBar <> .nil then do
purple = .Image~colorRef(245, 89, 255)
say 'Going to set the background color for the progress bar'
oldColor = progressBar~backgroundColor(purple)
say 'Old background color was:' oldColor '(0x'oldColor~d2x')'
say ' Red: ' .Image~getRValue(oldColor)
say ' Green:' .Image~getGValue(oldColor)
say ' Blue: ' .IMage~getBValue(oldColor)
say
end
/* Output might be:
Going to set the background color for the progress bar
Old background color was: 11460781 (0xAEE0AD)
Red: 173
Green: 224
Blue: 174
*/
]]>
</programlisting>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Image::getRValue() [class method] -->
<section id="mthNewClsImage" xreflabel="new"><title>new (Class method)</title>
<indexterm><primary>new</primary>
<secondary>Image class</secondary></indexterm>
<para>
The Image class does not allow new Image objects to be instantiated from Rexx code using the new()
method. New Image objects are obtained through one of the other Image class methods, or they are
returned from methods of other classes.
</para>
<para>
These methods are used to create new Image object(s).
<simplelist type='horiz' columns='1'>
<member>Image (class) method:<xref linkend="mthGetImageClsImage"/></member>
<member>Image (class) method:<xref linkend="mthFromFilesClsImage"/></member>
<member>Image (class) method:<xref linkend="mthFromIDsClsImage"/></member>
<member>Image (class) method:<xref linkend="mthUserIcon"/></member>
<member>ResourceImage (instance) method:<xref linkend="mthGetImageClsResourceImage"/></member>
<member>ResourceImage (instance) method:<xref linkend="mthGetImagesClsResourceImage"/></member>
</simplelist>
</para>
</section> <!-- End Image::new() [class method] -->
<section id="mthToIDClsImage" xreflabel="toID"><title>toID (Class method)</title>
<indexterm><primary>id</primary>
<secondary>Image class</secondary></indexterm>
<programlisting>
<![CDATA[
>>--toID(--symbolicName--)-----------------------><
]]>
</programlisting>
<para>
The <emphasis role="italic">toID</emphasis> method is used to translate a symbolic name to its
integer value. In general the symbolic name is related to images or color. Many of the arguments to
the methods of classes related to images use the integer value of a symbolic ID in the Windows API.
This method allows the programmer to use the symbolic ID without knowing what the actual integer value
is.
</para>
<para>
Take for example the task of retrieving the 'Question' icon resource from the system using the
<xref linkend="mthGetImageClsImage"/> method. The ooDialog programmer could
either use the numerical value of 32514 or use the <emphasis role="italic">toID</emphasis> method as
follows. Note that the two invocations of getImage() are equivalent:
</para>
<programlisting>
<![CDATA[
qIcon = .Image~getImage(.Image~toID(IDI_QUESTION))
qIcon = .Image~getImage(32514)
]]>
</programlisting>
<para>
The symbolic ID keywords are spelled exactly as Microsoft spells them in the
MSDN <xref linkend="defWindowsDoc"/> which allows the ooDialog to easily look up the meaning
of any single ID while at the same time reducing the documentation task for the ooDialog
developers. The keywords are case sensitive and must be all in upper-case.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The single required argument is:
<variablelist>
<varlistentry><term>symbolicName</term>
<listitem>
<para>
The symbolic name whose numeric value is desired. There any number of symbolic names
and they are not listed here. Rather the symbolic names are listed in the documentation
for the methods they are applicable to.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The return value is the numeric value of the symbol.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<programlisting>
<![CDATA[
say 'The numeric value of the IDI_WINLOGO symbol is:' .Image~toID(IDI_WINLOGO)
/*
Output on the console would be:
The numeric value of the IDI_WINLOGO symbol is: 32517
*/
]]>
</programlisting>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Image::id() [class method] -->
<section id="mthUserIcon" xreflabel="userIcon"><title>userIcon (Class method)</title>
<indexterm><primary>userIcon</primary></indexterm>
<indexterm><primary>userIcon</primary><secondary>Image class</secondary></indexterm>
<programlisting>
<![CDATA[
>>--userIcon(--dlg--,--id--+---------+--+---------+--)----------><
+-,-size--+ +-,-opts--+
]]>
</programlisting>
<para>
Returns a new <computeroutput>Image</computeroutput> object from an icon resource added to the dialog through the
<xref linkend="mthAddIconResource"/>() method.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The arguments are:
<variablelist>
<varlistentry><term>dlg [required]</term>
<listitem>
<para>
The Rexx dialog object to which the user icon was added.
</para>
</listitem></varlistentry>
<varlistentry><term>id [required]</term>
<listitem>
<para>
The resource ID of the icon. Can be numeric or <xref linkend="defSymbolicId"/>.
</para>
</listitem></varlistentry>
<varlistentry><term>size [optional]</term>
<listitem>
<para>
A <xref linkend="clsSize"/> object that specifies the size of the image.
</para>
<para>
If this argument is omitted, a size of 0 is used. Under most circumstances this indicates that the actual size of
the icon should be used. However, if LR_DEFAULTSIZE is used as one of the flags in the <emphasis
role="italic">opts</emphasis> argument, then the width and height specified by the system metric values for icons
is used.
</para>
</listitem></varlistentry>
<varlistentry><term>opts [optional]</term>
<listitem>
<para>
A whole number that specifies the flags that control how the operating system loads the icon. The flags are one or
more of the following symbols. You can use the <xref linkend="mthToIDClsImage"/> method of the <xref linkend="clsImage"/> class to get the correct
numeric value for any of the following symbols. The <xref linkend="mthOrClsDlgUtil"/> method of the
<xref linkend="clsDlgUtil"/> class can be used to combine more than one of the symbols if needed.
<simplelist type='horiz' columns='2'>
<member>LR_DEFAULTCOLOR</member> <member>LR_CREATEDIBSECTION</member>
<member>LR_DEFAULTSIZE</member> <member>LR_LOADFROMFILE</member>
<member>LR_LOADMAP3DCOLORS</member> <member>LR_LOADTRANSPARENT</member>
<member>LR_MONOCHROME</member> <member>LR_SHARED</member>
<member>LR_VGACOLOR</member>
</simplelist>
</para>
<para>
The default value is LR_LOADFROMFILE. The flags for this method, must include LR_LOADFROMFILE and can not contain
LR_SHARED. If this argument is specified by the programmer, the value is checked, and corrected if necessary. See
the remarks section for some additional comments.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
An image object, which may be a <xref linkend="mthIsNullClsImage"/> image on error.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
For most usage, the Rexx programmer would do one of the following things:
<itemizedlist>
<listitem>
<para>
Omit the <emphasis role="italic">size</emphasis> and <emphasis role="italic">flags</emphasis> arguments. This
would load the icon using the actual size of the icon. If multiple icon images are included in the file, then the
first image found would be used.
</para>
</listitem>
<listitem>
<para>
Omit the <emphasis role="italic">size</emphasis> and include the LR_DEFAULTSIZE flag in the <emphasis
role="italic">flags</emphasis>. This would load the using the system metric values for icons.
</para>
</listitem>
<listitem>
<para>
Specify the size for the loaded image and omit the <emphasis role="italic">flags</emphasis> argument.
</para>
</listitem>
</itemizedlist>
</para>
<para>
This method uses the LoadImage() Windows API to actually load the icon image. For more advanced uses of this method,
consult the MSDN <xref linkend="defWindowsDoc"/> documentation.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect arguments are detected. This includes an invalid sybmbolic ID.
</para>
<para>
Sets the <xref linkend="dotSystemErrorCode"/>.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example adds an icon resource to the dialog through the
<xref linkend="mthAddIconResource"/> method and then uses that icon for the image in a
<xref linkend="clsStatic"/> image control.
<programlisting>
<![CDATA[
dlg = .SimpleDialog~new("Simple.rc", IDD_DIALOG1, , 'Simple.h')
if dlg~initCode = 0 then do
dlg~addIconResource(IDI_ENHANCED_QUESTION_MARK, 'fancyQuestion.ico')
dlg~execute("SHOWTOP", IDI_CORPORATE_IMAGE)
end
::method initDialog
expose iconControl
iconControl = self~newStatic(IDC_ICON_QUESTION)
if iconControl <> .nil then do
questionMark = .Image~userIcon(self, IDI_ENHANCED_QUESTION_MARK, .Size~new(64, 64) )
if \ questionMark~isNull then iconControl~setIcon(questionMark)
end
self~connectButtonEvent(IDC_PB_YES, "CLICKED", onYes)
self~connectButtonEvent(IDC_PB_NO, "CLICKED", onNo)
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Image::userIcon() [class method] -->
<section id="mthHandleClsImage" xreflabel="handle"><title>handle</title>
<indexterm><primary>handle</primary>
<secondary>Image class</secondary></indexterm>
<programlisting>
<![CDATA[
>>--handle---------------------------------------><
]]>
</programlisting>
<para>
Returns the Windows system handle to the image this object represents. It is an error to invoke this
method if the image is null, or after the image has been released.
</para>
<para>
Currently, the handle is only useful for display. In the ooDialog framework, methods that use images
for arguments, use the .Image object, not the image handle. Older methods that use a bitmap handle
for a argument will not work with this handle.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The method does not have an argument.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The return is the handle to the image.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<programlisting>
<![CDATA[
hIcon = .Image~getImage(.Image~toID(IDI_QUESTION), .Image~toID(IMAGE_ICON))
say 'hIcon: ' hIcon
say ' handle:' hIcon~handle
/* Output to the console might be (on a 64-bit Windows system)
hIcon: an Image
handle: 0x000000000001002B
*/
]]>
</programlisting>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Image::handle() -->
<section id="mthReleaseClsImage" xreflabel="release"><title>release</title>
<indexterm><primary>release</primary>
<secondary>Image class</secondary></indexterm>
<programlisting>
<![CDATA[
>>--release--------------------------------------><
]]>
</programlisting>
<para>
Releases the image. This will free up operating system resources used for the image. See the
introduction to the <link linkend="paraClsImageRelease">Image</link> class for some discussion on releasing an image.
</para>
<para>
Once an image object has been released, it is an error to use the object. However, the
<xref linkend="mthIsNullClsImage"/> and
<xref linkend="mthSystemErrorCodeClsImage"/> methods can always be used. The isNull()
method will return <computeroutput>.true</computeroutput> after an image object has been released.
Shared images should not be released, the operating system manages them. To prevent the programmer
from accidentally releasing a shared image, the .Image object tracks which images are loaded as shared
and does not release a shared image if the programmer requests it.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
There are no arguments.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The possible return values are:
<variablelist>
<varlistentry><term>0</term>
<listitem>
<para>
No error detected.
</para>
</listitem></varlistentry>
<varlistentry><term>non-zero</term>
<listitem>
<para>
The operating system error code.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
Sets the <xref linkend="dotSystemErrorCode"/>.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
In this example, when the user presses the Test button, the current image for the static control is
replaced by the system question mark image. The old image is no longer needed and it is released.
<programlisting>
<![CDATA[
::method onTest
iconControl = self~newStatic(IDC_ICON_QUESTION)
if iconControl <> .nil then do
hQuestion = .Image~getImage(.Image~toID(IDI_QUESTION), .Image~toID(IMAGE_ICON))
say 'Question icon:' hQuestion~handle
if hQuestion~isNull then do
say 'errror code:' .systemErrorCode
end
else do
image = iconControl~setImage(hQuestion)
say 'Swapped images:'
say ' new icon:' hQuestion~handle
say ' old icon:' image~handle
-- The old image is no longer needed.
ret = image~release
say 'Released old image return:' ret '.SystemErrorCode:' .systemErrorCode
end
end
/* Output on the screen, on a 64-bit system, might be:
Question icon: 0x000000000001002B
Swapped images:
new icon: 0x000000000001002B
old icon: 0x0000000001120639
Released old image return: 0 .SystemErrorCode: 0
*/
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Image::release() -->
<section id="mthIsNullClsImage" xreflabel="isNull"><title>isNull</title>
<indexterm><primary>isNull</primary>
<secondary>Image class</secondary></indexterm>
<programlisting>
<![CDATA[
>>--isNull---------------------------------------><
]]>
</programlisting>
<para>
The isNull() method tests if the image object is valid. The image will be null if an error occurred
when it was loaded, or if the image has been released.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
There are no arguments.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The method returns <computeroutput>.true</computeroutput> if the image is not valid, is null, and
<computeroutput>.false</computeroutput> if the image is not null.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
In this example the programmer wanted to load the system question mark icon, but used the wrong
image type. (He uses IMAGE_BITMAP instead of IMAGE_ICON.) The system will refuse to load the
image. To test if the image was loaded okay, use the isNull() method. Note that the getImage()
method set the .SystemErrorCode. As in all software, the error codes are not always that
informative.
<programlisting>
<![CDATA[
hQuestion = .Image~getImage(.Image~toID(IDI_QUESTION), .Image~toID(IMAGE_BITMAP))
if hQuestion~isNull then do
say 'System Errror code:' .systemErrorCode
say ' System message: ' SysGetErrorText(.systemErrorCode)
end
/* Output would be:
System Errror code: 1814
System message: The specified resource name cannot be found in the image file.
*/
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Image::isNull() -->
<section id="mthSystemErrorCodeClsImage" xreflabel="systemErrorCode"><title>systemErrorCode</title>
<indexterm><primary>systemErrorCode</primary>
<secondary>Image class</secondary></indexterm>
<programlisting>
<![CDATA[
>>--systemErrorCode------------------------------><
]]>
</programlisting>
<para>
The systemErrorCode attribute of the image object will reflect any system error codes that are detected
while working with an image object. This is the same error code as the
<xref linkend="dotSystemErrorCode"/> is set to. This can be useful if the programmer
wants to check for an error code at some point when it is possible that .systemErrorCode has been
reset. (See the example below.)
</para>
<para>
Like the <xref linkend="mthIsNullClsImage"/> method this method can be invoked even when
the image is not valid. However, it should not be used to check if the image is valid because it is
possible for the value to be 0 and the image to be null.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
There are no arguments to this method
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The value is usually 0, but may be a system error code if one was detected.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
In this example the system error code attribute for an image is checked at a point in the
life-cycle of the application when checking the <computeroutput>.systemErrorCode</computeroutput>
would be meaningless:
<programlisting>
<![CDATA[
::method onYes
expose hIcon
-- Need to release the icon image, but it is not always valid.
if \ hIcon~isNull then hIcon~release
else do
say 'The icon image is not valid.'
say ' Error when it was loaded:' hIcon~systemErrorCode
say ' System message: ' SysGetErrorText(hIcon~systemErrorCode)
end
return self~ok:super
/* Output might be:
The icon image is not valid.
Error when it was loaded: 2
System message: The system cannot find the file specified.
*/
/* Note that the below was the error that caused the above. The file name
* is actually 'shaveIce.ico' not shavedIce.ico.
*/
if iconControl <> .nil then do
hIcon = .Image~getImage("shavedIce.ico", .Image~toID(IMAGE_ICON))
...
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Image::systemErrorCode() -->
</section> <!-- End Image class -->
<section id="clsImageList" xreflabel="ImageList"><title>ImageList Class</title>
<indexterm><primary>ImageList class</primary></indexterm>
<para>
An image list is a object used to efficiently manage large sets of images. Either icons or bitmaps.
In an image list, all images are the same size and are accessed by a zero-based index. The images are
in screen device format. Optionally, each image in the list can have a matching monochrome bitmap that
is used as a mask to draw the image transparently.
</para>
<para>
The .ImageList object acts as an interface to the underlying operating system Image List, which
Microsoft calls a control. Although Microsoft calls the Image List a control and documents it with the
other dialog controls, it is not a control in the same sense as button, edit, or list-view controls. It
is not a window, all dialog controls are windows. It does not send or receive window messages. Use the
MSDN <xref linkend="defWindowsDoc"/> documentation to get more information on exactly how
Image Lists work.
</para>
<para>
When an image list is no longer needed, it can be released. This frees up the system resources used
for the images and the image list. The programmer releases an image list by using the
<xref linkend="mthReleaseClsImageList"/> method. Once an image list is released it can no
longer be used. It is an error to invoke any method on the released object, except for the
<xref linkend="mthIsNullClsImageList"/> method. The isNull() method can be invoked any time to
test if an image list is valid or not. It should go without saying that a programmer should not release
an image list that is in use.
</para>
<para>
Future versions of the .ImageList are intended to provide a complete interface to the underlying Image
List control. At this time not all functionality is implemented.
</para>
<section id="sctMethodsImageListClass"><title>Method Table</title>
<para>
Instances of the ImageList class implement the methods listed in the following table:
</para>
<table id="tblImageListMethods" frame="all">
<title>Image Instance Methods</title>
<tgroup cols="2">
<colspec colwidth="1*" /><colspec colwidth="4*" />
<thead>
<row>
<entry>Method</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry align="center"><emphasis role="bold">Class Methods</emphasis></entry>
<entry align="center"><emphasis role="bold"></emphasis></entry>
</row>
<row>
<entry><xref linkend="mthCreateClsImageList"/></entry>
<entry>Creates a new empty image list of the type specified.</entry>
</row>
<row>
<entry><xref linkend="mthNewClsImageList"/></entry>
<entry>Currently it is not intended for the ooDialog programmer to instantiate an image list object directly using the new method.</entry>
</row>
<row>
<entry align="center"><emphasis role="bold">Instance Methods</emphasis></entry>
<entry align="center"><emphasis role="bold"></emphasis></entry>
</row>
<row>
<entry><xref linkend="mthAddClsImageList"/></entry>
<entry>Adds one or more bitmap images to the image list.</entry>
</row>
<row>
<entry><xref linkend="mthAddIcon"/></entry>
<entry>Adds an icon or cursor image to the image list.</entry>
</row>
<row>
<entry><xref linkend="mthAddImagesClsImageList"/></entry>
<entry>Adds a number of images to the image list.</entry>
</row>
<row>
<entry><xref linkend="mthAddMaskedClsImageList"/></entry>
<entry>Adds one or more bitmap images, along with a mask to the image list.</entry>
</row>
<row>
<entry><xref linkend="mthDuplicateClsImageList"/></entry>
<entry>Creates a duplicate image list.</entry>
</row>
<row>
<entry><xref linkend="mthGetCountClsImageList"/></entry>
<entry>Determines the number of images in the image list.</entry>
</row>
<row>
<entry><xref linkend="mthGetImageSizeClsImageList"/></entry>
<entry>Determines the size of the images in the image list.</entry>
</row>
<row>
<entry><xref linkend="mthHandleClsImageList"/></entry>
<entry>Returns the Windows system handle to the image list this object represents.</entry>
</row>
<row>
<entry><xref linkend="mthIsNullClsImageList"/></entry>
<entry>Used to check if an image list is valid.</entry>
</row>
<row>
<entry><xref linkend="mthRemoveClsImageList"/></entry>
<entry>Removes the image at the specified index from the image list.</entry>
</row>
<row>
<entry><xref linkend="mthRemoveAllClsImageList"/></entry>
<entry>Removes all images from the image list.</entry>
</row>
<row>
<entry><xref linkend="mthReleaseClsImageList"/></entry>
<entry>Releases the resource module so that the operating system can reclaim the system resources used by the image list.</entry>
</row>
</tbody></tgroup>
</table>
</section>
<section id="mthCreateClsImageList" xreflabel="create"><title>create (Class method)</title>
<indexterm><primary>create</primary>
<secondary>ImageList class</secondary></indexterm>
<programlisting>
<![CDATA[
>>--create(--+--------+-+---------+-+---------+-+--------+--)---><
+--size--+ +-,-flags-+ +-,-count-+ +-,-grow-+
]]>
</programlisting>
<para>
Creates a new empty image list of the type specified.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>The arguments are:
<variablelist>
<varlistentry><term>size [optional]</term>
<listitem>
<para>
A <xref linkend="clsSize"/> object that specifies the size of a single image in the
image list. All images in an image list have the same size. The size is specified in pixels.
</para>
<para>
If this argument is omitted the system default size for an icon is used. This size can vary
depending on which version of Windows is running and whether the user has selected to use large
icons or not. A typical size is 32 x 32 (in pixels.)
</para>
</listitem></varlistentry>
<varlistentry><term>flags [optional]</term>
<listitem>
<para>
The flags that specify the type of image list to create. The flags are one or more of the following
symbols, but can include only one ILC_COLOR* value. You can use
the <xref linkend="mthToIDClsImage"/> method of the <xref linkend="clsImage"/> class to get the correct numeric value for any of the
following symbols. The <xref linkend="mthOrClsDlgUtil"/> method of the
<xref linkend="clsDlgUtil"/> class can be used to combine the symbols.
</para>
<para>
<simplelist type='horiz' columns='2'>
<member>ILC_MASK</member> <member>ILC_COLOR24</member>
<member>ILC_COLOR</member> <member>ILC_COLOR32</member>
<member>ILC_COLORDDB</member> <member>ILC_PALETTE</member>
<member>ILC_COLOR4</member> <member>ILC_MIRROR</member>
<member>ILC_COLOR8</member> <member>ILC_PERITEMMIRROR</member>
<member>ILC_COLOR16</member>
</simplelist>
<variablelist>
<varlistentry><term>ILC_MASK</term>
<listitem>
<para>
The image list contains two bitmaps, one of which is used as a mask. The mask is a monochrome bitmap. If
this value is omitted, the image list contains only one bitmap.
</para>
</listitem></varlistentry>
<varlistentry><term>ILC_COLOR</term>
<listitem>
<para>
Indicates to use the default image list type when none of the other ILC_COLOR* flags are used. Usually the
default is ILC_COLOR4. However, with older display drivers the default may be ILC_COLORDDB.
</para>
</listitem></varlistentry>
<varlistentry><term>ILC_COLORDDB</term>
<listitem>
<para>
The image list uses a device-dependent bitmap.
</para>
</listitem></varlistentry>
<varlistentry><term>ILC_COLOR4</term>
<listitem>
<para>
The image list uses a 4-bit, 16-color, device-independent bitmap, DIB, section for the bitmap
</para>
</listitem></varlistentry>
<varlistentry><term>ILC_COLOR8</term>
<listitem>
<para>
The image list uses an 8-bit DIB section. The color table use the same colors as the halftone palette.
</para>
</listitem></varlistentry>
<varlistentry><term>ILC_COLOR16</term>
<listitem>
<para>
Use a 16-bit (32/64k-color) DIB section.
</para>
</listitem></varlistentry>
<varlistentry><term>ILC_COLOR24</term>
<listitem>
<para>
Use a 24-bit DIB section.
</para>
</listitem></varlistentry>
<varlistentry><term>ILC_COLOR32</term>
<listitem>
<para>
Use a 32-bit DIB section.
</para>
</listitem></varlistentry>
<varlistentry><term>ILC_PALETTE</term>
<listitem>
<para>
Microsoft has this flag but it is not implemented. ooDialog accepts the flag in case it is implemented in
future versions of Windows.
</para>
</listitem></varlistentry>
<varlistentry><term>ILC_MIRROR</term>
<listitem>
<para>
Languages such as Hebrew or Arabic that read right-to-left can be mirrored by Windows. When an image list
is created on a mirrored version of Windows, the images are mirrored. I.e.,, they are flipped to display
from right to left. This flag on mirrored versions of Windows instructs to OS to not automatically mirror
the images.
</para>
</listitem></varlistentry>
<varlistentry><term>ILC_PERITEMMIRROR</term>
<listitem>
<para>
This flag is ignored unless ILC_MIRROR is also used. It should be used when the image list contains a
strip of images.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term>count [optional]</term>
<listitem>
<para>
The initial size for the image list. The size is the number of images the image list contains. When this
argument is omitted the default is 6.
</para>
</listitem></varlistentry>
<varlistentry><term>grow [optional]</term>
<listitem>
<para>
The amount by which the image list can grow if the operating system needs to resize the image list to make
room for more images. The default value when omitted is 0.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
A new, empty, image list is returned.
</para>
<para>
<emphasis role="bold">Note:</emphasis> It is theoretical possible for this method to fail and the returned image
list to be null. However, in practice, it is virtually impossible to cause a failure. Using a size of 0 x 0 seems
about the only way.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect arguments are detected.
</para>
<para>
Provides an interface to the <computeroutput>ImageList_Create()</computeroutput> API. Use the
MSDN <xref linkend="defWindowsDoc"/> documentation to get more information on the arguments to
this method.
</para>
<para>
The ILC_MIRROR and ILC_PERITEMMIRROR flags require
Common Control <xref linkend="ovvComctl32"/> version 6.0 or later. If necessary use the
<xref linkend="mthComCtl32Version"/>() method to determine the current version of
the library.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<programlisting>
<![CDATA[
-- We set the flags to create a 24 bit color, masked image list.
flags = .DlgUtil~or(.Image~toID(ILC_COLOR24), .Image~toID(ILC_MASK))
-- Create an empty .ImageList object:
imageList = .ImageList~create(.Size~new(61, 46), flags, 10, 10);
]]>
</programlisting>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ImageList::create() [class method] -->
<section id="mthNewClsImageList" xreflabel="new"><title>new (Class method)</title>
<indexterm><primary>new</primary>
<secondary>ImageList class</secondary></indexterm>
<para>
Currently it is not intended for the ooDialog programmer to instantiate an image list object directly
using the new method. This may change in the future and will be documented at that time, if the
intention changes. .ImageList objects are instantiated using the
<xref linkend="mthCreateClsImageList"/> method.
</para>
</section> <!-- End ImageList::new() [class method] -->
<section id="mthAddClsImageList" xreflabel="add"><title>add</title>
<indexterm><primary>add</primary>
<secondary>ImageList class</secondary></indexterm>
<programlisting>
<![CDATA[
>>--add(--image-+---------+--)-------------------><
+-,-mask--+
]]>
</programlisting>
<para>
Adds a bitmap image or images to the image list. The number of images is inferred from the width of
the added bitmap. Optionally adds the mask for the bitmap(s). If the image list does not use a mask,
the mask argument is ignored, even if it is present.
</para>
<para>
Internally the image list makes a copy of the bitmap. After the method returns, the original image can
be released if it is not needed anymore.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>The arguments are:
<variablelist>
<varlistentry><term>image</term>
<listitem>
<para>
The .Image object that represents the image to add. This must be a bitmap image. The width of
the image determines the number of images added. (Remember all images in a image list are the
same size.)
</para>
</listitem></varlistentry>
<varlistentry><term>mask</term>
<listitem>
<para>
The mask(s) to use with the image(s). This must be a bitmap image.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
On success, the index of the first image added is returned, otherwise -1 is returned.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect arguments are detected or if the image list is null.
</para>
<para>
Provides an interface to the <computeroutput>ImageList_Add()</computeroutput> API. The
MSDN <xref linkend="defWindowsDoc"/> documentation can provide more information on this method.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example sets the image list for a list-view control. The images are loaded from psdemolv.bmp
which is a bitmap 16 pixels high by 64 pixels wide, containing 4 individual images. Since the
image list is created with a size of 16 x 16, when the add() method is used, the image list infers
that the bitmap is 4 images.
<programlisting>
<![CDATA[
-- Set the images for the items in the list-view.
image = .Image~getImage("bmp\psdemolv.bmp")
imageList = .ImageList~create(.Size~new(16, 16), .Image~toID(ILC_COLOR8), 4, 0)
if \image~isNull, \imageList~isNull then do
imageList~add(image)
lc~setImageList(imageList, .Image~toID(LVSIL_SMALL))
-- The image list makes a copy of the bitmap, so we can release it now.
image~release
end
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ImageList::add() -->
<section id="mthAddIcon" xreflabel="addIcon"><title>addIcon</title>
<indexterm><primary>addIcon</primary>
<secondary>ImageList class</secondary></indexterm>
<programlisting>
<![CDATA[
>>--addIcon(--image--)---------------------------><
]]>
</programlisting>
<para>
Adds an icon or cursor image to the image list. If the image list is masked, then both the image and
mask bitmaps of the icon or cursor are copied. If it is not masked, then only the image bitmap is
copied.
</para>
<para>
Internally the image list makes a copy of the bitmap. After the method returns, the original image can
be released if it is not needed anymore.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>The only argument is:
<variablelist>
<varlistentry><term>image</term>
<listitem>
<para>
The .Image object that represents the image to add. This must be an icon or cursor image.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
This method returns the index of the added icon or cursor on success, otherwise -1 is returned.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect arguments are detected or if the image list is null.
</para>
<para>
Provides an interface to the <computeroutput>ImageList_AddIcon()</computeroutput> API. The
MSDN <xref linkend="defWindowsDoc"/> documentation can provide more information on this method.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
Here the system icon images are loaded and then displayed in a list-view. Each icon will show in
the list-view with the text for the icon being its numeric resource ID. Since the system icons are
shared, the icon images are not released after they are added to the image list.
<programlisting>
<![CDATA[
ids = .array~new()
ids[ 1] = .Image~toID(IDI_APPLICATION)
ids[ 2] = .Image~toID(IDI_HAND)
ids[ 3] = .Image~toID(IDI_QUESTION)
ids[ 4] = .Image~toID(IDI_EXCLAMATION)
ids[ 5] = .Image~toID(IDI_ASTERISK)
ids[ 6] = .Image~toID(IDI_WINLOGO)
flags = .DlgUtil~or(.Image~toID(ILC_COLOR8), .Image~toID(ILC_MASK))
imageList = .ImageList~create(.Size~new(32, 32), flags, 20, 10)
do i = 1 to ids~items
image = .Image~getImage(ids[i], .Image~toID(IMAGE_ICON))
imageList~addIcon(image)
end
list~setImageList(imageList, .Image~toID(LVSIL_NORMAL))
do i = 1 to ids~items
list~add(ids[i], i - 1)
end
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ImageList::addIcon() -->
<section id="mthAddImagesClsImageList" xreflabel="addImages"><title>addImages</title>
<indexterm><primary>addImages</primary>
<secondary>ImageList class</secondary></indexterm>
<programlisting>
<![CDATA[
>>--addImages(--images--+---------+--)-----------><
+-,-cRef--+
]]>
</programlisting>
<para>
Adds a number of images to the image list. The images are supplied in a non-sparse array and must all
be of the same type.
</para>
<para>
The images are added to the image list in the same order as they exist in the array. If an error
occurs in the middle of processing the images, the method returns at that point. This means that
images prior to the error will exist in the image list, but no images in the array after the error will
be placed in the image list. Which images were placed in the image list can be determined by the
return value of this method.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect arguments are detected or if the image list is null.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>The arguments are:
<variablelist>
<varlistentry><term>images</term>
<listitem>
<para>
An array of non-null .Image objects. The array must not be sparse, that is each index in the
array must contain an .Image ojbect. The images can be bitmaps, icons, or cursors, but each
image in the array must be the same type. (Remember that curors are icons, so that the array
can contain a mixture of icons and cursors.) Bitmaps can not be mixed with icons or cursors.
</para>
</listitem></varlistentry>
<varlistentry><term>cRef</term>
<listitem>
<para>
A <xref linkend="mthColorRef"/> that is used to generate the mask if the image
list is a masked image list. See the
<xref linkend="mthAddMaskedClsImageList"/> method for more details on this argument.
This argument is ignored if the images are not bitmaps, or if the image list is not masked.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
This method returns the image list index of the last successfully added image, or -1 if no images
were added.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example creates an image list from a number icons and then displays them in a list-view
control in a dialog.
<programlisting>
<![CDATA[
list = self~newListView(IDC_LV_IMAGES)
files1 = .array~new()
files1[ 1] = "Bee.ico"
files1[ 2] = "Camera.ico"
files1[ 3] = "Camera1.ico"
files1[ 4] = "Default.ico"
files1[ 5] = "Disabled.ico"
files1[ 6] = "Hot.ico"
files1[ 7] = "Lamp.ico"
files1[ 8] = "Mountain.ico"
files1[ 9] = "Normal.ico"
files1[10] = "Penquin.ico"
files1[11] = "Picture.ico"
files1[12] = "Pushed.ico"
files1[13] = "Question32.ico"
files1[14] = "Search32.ico"
files1[15] = "Skull.ico"
files1[16] = "Stolen.ico"
files1[17] = "Window.ico"
size = .Size~new(32, 32)
images = .Image~fromFiles(files1, .Image~toID(IMAGE_ICON), size)
if images~items <> files1~items then do
say 'Error loading images.'
say ' System error:' .systemErrorCode
say ' Message: ' SysGetErrorText(.systemErrorCode)
return
end
count = images~items
flags = .DlgUtil~or(.Image~toID(ILC_COLOR24), .Image~toID(ILC_MASK))
imageList = .ImageList~create(size, flags, 20, 10);
lastAdded = imageList~addImages(images)
if lastAdded <> (count - 1) then do
-- Not all images were added. We just ignore this and display
-- in the list-view what was added.
end
-- Set the image list for the list-view's normal icons.
list~setImageList(imageList, .Image~toID(LVSIL_NORMAL))
-- Add an item to the list-view for each image. The
-- text for each item will be the icon file name and
-- the icon will be the image we loaded.
do i = 0 to lastAdded
list~add(files1[i + 1], i)
end
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ImageList::addImages() -->
<section id="mthAddMaskedClsImageList" xreflabel="addMasked"><title>addMasked</title>
<indexterm><primary>addMasked</primary>
<secondary>ImageList class</secondary></indexterm>
<programlisting>
<![CDATA[
>>--addMasked(--image-,-cRef--)------------------><
]]>
</programlisting>
<para>
Adds a bitmap image, or images, to the image list. The COLOREF cRef is used to generate the mask.
</para>
<para>
Internally the image list makes a copy of the bitmap. After the method returns, the original image can
be released if it is not needed anymore.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>The arguments are:
<variablelist>
<varlistentry><term>image</term>
<listitem>
<para>
The .Image object that represents the image to add. This must be a bitmap image. The width of
the image determines the number of images added. (Remember all images in a image list are the
same size.)
</para>
</listitem></varlistentry>
<varlistentry><term>cRef</term>
<listitem>
<para>
The <xref linkend="mthColorRef"/> to use to generate the mask. In the added image,
each pixel that matches this color is changed to black, and the corresponding bit in the mask
is set to 1.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
On success, the index of the first added image is returned, otherwise -1 is returned.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect arguments are detected or if the image list is null.
</para>
<para>
Provides an interface to the <computeroutput>ImageList_AddMasked()</computeroutput> API. The
MSDN <xref linkend="defWindowsDoc"/> documentation can provide more information on this method.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example comes from a dialog with a Tab control. An image list is used to set an icon for each
tab. Each icon is a colored letter on a white background. Using a white color to generate the
mask causes the image to be drawn tranparently. The colored letter itself shows, and the rest of
the image lets the underlying color show through.
<programlisting>
<![CDATA[
-- Add all the tabs, including the index into the image list for an icon for
-- each tab.
tc~addFullSeq("Red", 0, ,"Green", 1, , "Moss", 2, , "Blue", 3, , -
"Purple", 4, , "Cyan", 5, , "Gray", 6)
-- Create a COLORREF (pure white) and load our bitmap.
cRef = .Image~colorRef(255, 255, 255)
image = .Image~getImage("bmp\psdemoTab.bmp")
-- Create our image list, as a masked image list.
imageList = .ImageList~create(.Size~new(16, 16), -
.DlgUtil~or(.Image~toID(ILC_COLOR24), -
.Image~toID(ILC_MASK)), -
10, 0)
if \image~isNull, \imageList~isNull then do
imageList~addMasked(image, cRef)
tc~setImageList(imageList)
image~release
end
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ImageList::addMasked() -->
<section id="mthDuplicateClsImageList" xreflabel="duplicate"><title>duplicate</title>
<indexterm><primary>duplicate</primary>
<secondary>ImageList class</secondary></indexterm>
<programlisting>
<![CDATA[
>>--duplicate------------------------------------><
]]>
</programlisting>
<para>
Creates a duplicate image list. All information in the original image list is copied to the new image
list. (Overlay images are not copied, but ooDialog does not have support for image list overlay images
at this time.) The two image lists are independent. Adding, or removing, images from one image list
has no effect on the other.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
There are no arguments.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The return is a copy of the image list.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
Raises a syntax error if the image list is null.
</para>
<para>
Provides an interface to the <computeroutput>ImageList_Duplcate()</computeroutput> API. The
MSDN <xref linkend="defWindowsDoc"/> documentation can provide more information on this method.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This fictious example is from a point-of-sale application for a restaurant. The customer is
presented with a list-view of menu items, each list-view item has a colorful icon depicting the
selection. The customers place their orders through the application and wait-people then bring
them their meal when it is ready. The dinner menu has all the items that the lunch menu does, plus
some more. The customer can choose whether to order from the lunch menu or the dinner menu, so the
lunch menu image list has to remain unchanged.
<programlisting>
<![CDATA[
::method getDinnerImageList private
use strict arg lunchImageList
dinnerList = lunchImageList~duplicate
fileArray = self~getDinnerImageFiles
dinnerList~addImages(fileArray)
return dinnerList
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ImageList::duplicate() -->
<section id="mthGetCountClsImageList" xreflabel="getCount"><title>getCount</title>
<indexterm><primary>getCount</primary>
<secondary>ImageList class</secondary></indexterm>
<programlisting>
<![CDATA[
>>--getCount-------------------------------------><
]]>
</programlisting>
<para>
Determines the number of images in the image list.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
There are no arguments.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
Returns the number of images currently in the image list.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
Raises a syntax error if the image list is null.
</para>
<para>
Provides an interface to the <computeroutput>ImageList_ImageCount()</computeroutput> API. The
MSDN <xref linkend="defWindowsDoc"/> documentation can provide more information on this method.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<programlisting>
<![CDATA[
::method displayImageListCount private
use strict arg imageList
say 'Image list:' imageList~handle 'has' imagelist~getCount 'images.'
/*
Possible output on a Windows 64-bit system:
Image list: 0x00000000000ED420 has 17 images.
*/
]]>
</programlisting>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ImageList::getCount() -->
<section id="mthGetImageSizeClsImageList" xreflabel="getImageSize"><title>getImageSize</title>
<indexterm><primary>getImageSize</primary>
<secondary>ImageList class</secondary></indexterm>
<programlisting>
<![CDATA[
>>--getImageSize---------------------------------><
]]>
</programlisting>
<para>
Determines the size of the images in the image list. All images in any single image list have the same
size.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>There are no arguments.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The size of the images in the image list is returned in a <xref linkend="clsSize"/>
object.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
Raises a syntax error if the image list is null.
</para>
<para>
Provides an interface to the <computeroutput>ImageList_IconSize()</computeroutput> API. The
MSDN <xref linkend="defWindowsDoc"/> documentation can provide more information on this method.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<programlisting>
<![CDATA[
::method displayImageListSize private
use strict arg imageList
s = imageList~getImageSize
h = s~height 'pixels high'
w = s~width 'pixels wide'
say 'Image list:' imageList~handle 'contains images' h 'by' w
/*
Possible output on a Windows 64-bit system:
Image list: 0x00000000000DCB20 contains images 32 pixels high by 32 pixels wide
*/
]]>
</programlisting>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ImageList::getImageSize() -->
<section id="mthHandleClsImageList" xreflabel="handle"><title>handle</title>
<indexterm><primary>handle</primary>
<secondary>ImageList class</secondary></indexterm>
<programlisting>
<![CDATA[
>>--handle---------------------------------------><
]]>
</programlisting>
<para>
Returns the Windows system handle to the image list this object represents. It is an error to invoke
this method if the image list is null, or after the image has been released.
</para>
<para>
At this time, the handle is only useful for display. In the ooDialog framework, methods that use
image lists for arguments, use the .ImageList object, not the image list handle.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
There is no argument to this method.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The return is the image list handle.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<programlisting>
<![CDATA[
::method displayImageList private
use strict arg imageList
say 'Currently using this image list:' imageList~handle
/*
Possible output on a Windows 64-bit system:
Currently using this image list: 0x00000000000DCB20
*/
]]>
</programlisting>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ImageList::handle() -->
<section id="mthIsNullClsImageList" xreflabel="isNull"><title>isNull</title>
<indexterm><primary>isNull</primary>
<secondary>ImageList class</secondary></indexterm>
<programlisting>
<![CDATA[
>>--isNull---------------------------------------><
]]>
</programlisting>
<para>
Used to check if an image list is valid. This method can be invoked on any image list, even after it
has been released. An image list will always be null after it has been released. It is conceivable
that, if an error occurs during an image list creation, the returned image list might be null.
However, this is extemely unlikely. Therefor, for all practical purposes, an image list will only be
null after it has been released.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
There are no arguments to this method.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
This method returns true if the image list is null, otherwise false.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example comes from some test code.
<programlisting>
<![CDATA[
-- See if we can create an image list with no size.
imageList = .ImageList~create(.Size~new(0, 0), .Image~toID(ILC_COLOR24), 20, 10)
if imageList~isNull then do
say 'Can not create a 0 x 0 image list.'
return .false
end
return .true
/*
Output will be:
Can not create a 0 x 0 image list.
*/
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ImageList::isNull() -->
<section id="mthReleaseClsImageList" xreflabel="release"><title>release</title>
<indexterm><primary>release</primary>
<secondary>ImageList class</secondary></indexterm>
<programlisting>
<![CDATA[
>>--release--------------------------------------><
]]>
</programlisting>
<para>
Releases the image list allowing the operating system to reclaim the resources used by the image list.
Once the image list has been released, it can no longer be used.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
There are no arguments to this method.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
This method always returns 0.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example comes from a program that runs continuously. During the life-cycle of the application
it displays and then closes a dialog that creates some image lists. The image lists are always
different depending on the state of things. Each time the dialog closes, it releases the image
lists it created to free up the operating system resources.
<programlisting>
<![CDATA[
::method ok
self~cleanUp
return self~ok:super
::method cancel
self~cleanUp
return self~cancel:super
::method cleanUp private
expose coolTempImages warningImages buidingStatusImages
if coolTempImages \== .nil then coolTempImages~release
if warningImages \== .nil then warningImages~release
if buildingStatusImages \== .nil then buildStatusImages~release
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ImageList::release() -->
<section id="mthRemoveClsImageList" xreflabel="remove"><title>remove</title>
<indexterm><primary>remove</primary>
<secondary>ImageList class</secondary></indexterm>
<programlisting>
<![CDATA[
>>--remove(--index--)----------------------------><
]]>
</programlisting>
<para>
Removes the image at <emphasis role="italic">index</emphasis> from the image list. When the image is
removed, all the indexes in the list are adjusted. I.e., if the image at index 2 is removed, the image
at index 3 becomes index 2, the image at index 4 becomes index 3, etc..
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>The single argument is:
<variablelist>
<varlistentry><term>index</term>
<listitem>
<para>
The one-based index of the image to remove.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
This method returns true on success, otherwise false.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect arguments are detected or if the image list is null.
</para>
<para>
Provides an interface to the <computeroutput>ImageList_Remove()</computeroutput> API. The
MSDN <xref linkend="defWindowsDoc"/> documentation can provide more information on this method.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example comes from the fictious point-of-sale application for a restaurant. Sometimes the
chef runs out of a menu item and the item is then removed from the list-view so that the customers
can no longer order it. (Rigorous error checking is not done because the application was written
by one of the waiters.)
<programlisting>
<![CDATA[
::method removeFromMenu private
use strict arg index
menu = self~newListView(IDC_LV_MENU)
bigIcons = menu~getImageList(.Image~toID(LVSIL_NORMAL))
bigIcons~remove(index)
smallIcons = menu~getImageList(.Image~toID(LVSIL_SMALL))
smallIcons~remove(index)
stateIcons = menu~getImageList(.Image~toID(LVSIL_STATE))
stateIcons~remove(index)
menu~delete(index)
return 0
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ImageList::remove() -->
<section id="mthRemoveAllClsImageList" xreflabel="removeAll"><title>removeAll</title>
<indexterm><primary>removeAll</primary>
<secondary>ImageList class</secondary></indexterm>
<programlisting>
<![CDATA[
>>--removeAll------------------------------------><
]]>
</programlisting>
<para>
Removes all images from the image list.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
There are no arguments to this method.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The method returns true on success, false otherwise.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
Raises a syntax error if the image list is null.
</para>
<para>
Provides an interface to the <computeroutput>ImageList_RemoveAll()</computeroutput> API. The
MSDN <xref linkend="defWindowsDoc"/> documentation can provide more information on this method.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example is a continuation of the fictious restaurant point-of-sale application. The waiter
that wrote the application did not like to work past the normal closing time. The application has
a feature that removes all the menu items as it gets near closing time to prevent customers from
ordering something they do not have time to finish eating. (However, the waiter noticed that he
often got huge tips from customers that had drinks after their meal.)
<programlisting>
<![CDATA[
::method stopOrders private
menu = self~newListView(IDC_LV_MENU)
bigIcons = menu~getImageList(.Image~toID(LVSIL_NORMAL))
bigIcons~removeAll
smallIcons = menu~getImageList(.Image~toID(LVSIL_SMALL))
smallIcons~removeAll
stateIcons = menu~getImageList(.Image~toID(LVSIL_STATE))
stateIcons~removeAll
menu~deleteAll
self~addAfterDinnerDrinks(menu)
return 0
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ImageList::removeAll() -->
</section> <!-- End ImageList class -->
<section id="clsResourceImage" xreflabel="ResourceImage"><title>ResourceImage Class</title>
<indexterm><primary>ResourceImage class</primary></indexterm>
<para>
Resource Images represent modules that contain resources. These modules are binary executable files,
which on Windows are for all practical purposes .exe and .dll files. Before an application can use a
resource in a module, the resource must be loaded from the module into memory. Once in memory, the
application needs a handle to the specific resource in order to work with it.
</para>
<para>
The ResourceImage class contains methods and function to assist in the loading of resources into memory
and obtaining handles to the desired resources. ooDialog has always had, limited, access to resources
in modules through the <xref linkend="clsResDialog"/> class. The ResourceImage class
expands that access, both improving it and making the access avaiable in any ooDialog program, with or
without ResDialog objects. The class supports the loading of, and obtaining handles to, resources from
any binary executable file.
</para>
<para>
The class provides the <xref linkend="mthReleaseClsResourceImage"/> method to free up
system resources if a module containing the resources is no longer needed. The
general <link linkend="paraClsImageRelease">remarks</link> concerning freeing the
<xref linkend="clsImage"/> class are applicable here. The release() method will ignore requests
to release the module when it is known absoulutely that the module should not be released, such as in
the case the module is the <computeroutput>oodialog.dll</computeroutput>. In other cases only the
programmer can know if the module should or shouldn't be released. In those cases, the ResourceImage
class will do as requested. As with the images that the .Image class represents, the system resources
used by the module the ResourceImage class represents will be automatically cleaned up when the
interpreter process ends. The <link linkend="paraClsImageRelease">comments</link> about why would a programmer want to
release resources in the <computeroutput>Image</computeroutput> class remarks are equally apropos here.
</para>
<para>
<emphasis role="bold">Note:</emphasis> The <computeroutput>ResourceImage</computeroutput> class is new in ooDialog as of
ooRexx version 4.0.0. Its first implementation supports image resources and provides the basic framework upon which to
expand in the future.
</para>
<section id="sctMethodsResourceImageClass"><title>Method Table</title>
<para>
Instances of the ResourceImage class implement the methods listed in the following table:
</para>
<table id="tblResourceImageMethods" frame="all">
<title>ResourceImage Instance Methods</title>
<tgroup cols="2">
<thead>
<row>
<entry>Method</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry align="center"><emphasis role="bold">Class Methods</emphasis></entry>
<entry align="center"><emphasis role="bold"></emphasis></entry>
</row>
<row>
<entry><xref linkend="mthNewClsResourceImage"/></entry>
<entry>Instantiates a new resource image that represents the module specified by the specified file name.</entry>
</row>
<row>
<entry align="center"><emphasis role="bold">Instance Methods</emphasis></entry>
<entry align="center"><emphasis role="bold"></emphasis></entry>
</row>
<row>
<entry><xref linkend="mthGetImageClsResourceImage"/></entry>
<entry>Loads the specified image resource in the module and returns a new <computeroutput>.Image</computeroutput> object.</entry>
</row>
<row>
<entry><xref linkend="mthGetImagesClsResourceImage"/></entry>
<entry>Loads a number of image resources from the module.</entry>
</row>
<row>
<entry><xref linkend="mthHandleClsResourceImage"/></entry>
<entry>Returns the Windows system handle for the resource module.</entry>
</row>
<row>
<entry><xref linkend="mthIsNullClsResourceImage"/></entry>
<entry>Determines if the resource image is valid.</entry>
</row>
<row>
<entry><xref linkend="mthReleaseClsResourceImage"/></entry>
<entry>Releases the resource module so that the operating system can reclaim the system resources.</entry>
</row>
<row>
<entry><xref linkend="mthSystemErrorCodeClsResourceImage"/></entry>
<entry>Reflects any system error codes that are detected while working with an image object.</entry>
</row>
</tbody></tgroup>
</table>
</section>
<section id="mthNewClsResourceImage" xreflabel="new"><title>new (Class method)</title>
<indexterm><primary>new</primary>
<secondary>ResouceImage class</secondary></indexterm>
<programlisting>
<![CDATA[
>>--new(--fileOrDlg--)---------------------------><
]]>
</programlisting>
<para>
Instantiates a new resource image that represents the executable module specified by <emphasis
role="italic">fileOrDlg</emphasis>.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>The arguments are:
<variablelist>
<varlistentry><term>fileName</term>
<listitem>
<para>
Specifies the file name of the module containing resources that the ooDialog program wants to
access. If the module is in the path, (or the current directory,) the file name alone is
sufficent. The operating system will search the path for the file as it normally does when a
program is executed. If the module is not in the path then a full, or relative, file name is
required.
</para>
</listitem></varlistentry>
<varlistentry><term>dlg</term>
<listitem>
<para>
The second optional <emphasis role="italic">dlg</emphasis> argument is a dialog object in the
current program. It specifies that the module containing the resources that the ooDialog
program wants to acess is one of the modules already avalable to the program. That is, either
the <computeroutput>oodialog.dll</computeroutput> module, or the module used for instantiating a
<xref linkend="mthNewClsResDialog"/> <computeroutput>ResDialog</computeroutput> object.
</para>
<para>
To specify the <computeroutput>oodialog.dll</computeroutput> module, the file name must be
oodialog.dll and the dialog object can be any instantiated dialog in the current program.
</para>
<para>
To specify the module used with a ResDialog, the dialog object must be the instantiated
ResDialog dialog object.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
Returns a new ResourceImage object. This object may be null if an error occurred. Use the
<xref linkend="mthIsNullClsResourceImage"/> method to check for this. Both the
<xref linkend="dotSystemErrorCode"/> or the
<xref linkend="mthSystemErrorCodeClsResourceImage"/> method should contain an
error code if the object is null.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
Sets the <xref linkend="dotSystemErrorCode"/>.
</para>
<para>
Raises syntax errors when incorrect arguments are detected.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>This example instantiates a resource image using the oodialog.dll module and uses it to load
the generally available icon resources from that module. The icons are then displayed in a
list-view control.
<programlisting>
<![CDATA[
::method initDialog
expose list
list = self~newListView(IDC_LV_IMAGES)
ids = .array~new()
ids[1] = self~constDir[IDI_DLG_OODIALOG]
ids[2] = self~constDir[IDI_DLG_APPICON]
ids[3] = self~constDir[IDI_DLG_APPICON2]
ids[4] = self~constDir[IDI_DLG_OOREXX]
size = .Size~new(.SM~cxIcon, .SM~cyIcon)
oodModule = .ResourceImage~new(self)
icons = oodModule~getImages(ids, .Image~toID(IMAGE_ICON), size)
flags = .DlgUtil~or(.Image~toID(ILC_COLOR24), .Image~toID(ILC_MASK))
imageList = .ImageList~create(size, flags, 4, 0)
imageList~addImages(icons)
list~setImageList(imageList, .Image~toID(LVSIL_NORMAL))
names = .array~new()
names[1] = "IDI_DLG_OODIALOG"
names[2] = "IDI_DLG_APPICON"
names[3] = "IDI_DLG_APPICON2"
names[4] = "IDI_DLG_OOREXX"
do i = 1 to ids~items
list~add(names[i] '('ids[i]')', i - 1)
end
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Resource::new() [class method] -->
<section id="mthGetImageClsResourceImage" xreflabel="getImage"><title>getImage</title>
<indexterm><primary>getImage</primary>
<secondary>ResourceImage class</secondary></indexterm>
<programlisting>
<![CDATA[
>>--getImage(--id--+--------+--+--------+--+---------+--)-------><
+-,-type-+ +-,-size-+ +-,-flags-+
]]>
</programlisting>
<para>
Loads the specified image resource in the module and returns a new
<xref linkend="clsImage"/> object.
</para>
<para>
<emphasis role="bold">Note:</emphasis> <computeroutput>LoadImage()</computeroutput> is the underlying Windows API used
here. This method is very similar to the <xref linkend="mthGetImageClsImage"/> method of the .Image
class. The documentation for that method may provide additional insight.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>The arguments are:
<variablelist>
<varlistentry><term>id</term>
<listitem>
<para>
The resource id of the image in the module.
</para>
<para>
<emphasis role="bold">Note:</emphasis> At this time symbolic IDs are not supported for this argument. That
restriction may be lifted in a furture version of ooDialog.
</para>
</listitem></varlistentry>
<varlistentry><term>type</term>
<listitem>
<para>
Specifies the type of the image: bitmap, icon, or cursor. You can use
the <xref linkend="mthToIDClsImage"/> method of the <xref linkend="clsImage"/> class to get the correct numeric value for one of the
following symbols:
<simplelist type='horiz' columns='2'>
<member>IMAGE_BITMAP</member> <member>IMAGE_ICON</member>
<member>IMAGE_CURSOR</member>
</simplelist>
</para>
<para>
The default is IMAGE_BITMAP
</para>
</listitem></varlistentry>
<varlistentry><term>size</term>
<listitem>
<para>
A <xref linkend="clsSize"/> object that specifies the size of the image. The default
is a size of 0x0. Under most circumstances this indicates that the actual size of the image
should be used. However, the MSDN <xref linkend="defWindowsDoc"/> documentation for
<computeroutput>LoadImage()</computeroutput> should be consulted for other meanings.
</para>
</listitem></varlistentry>
<varlistentry><term>flags</term>
<listitem>
<para>
The load resource flags for the LoadImage() API. The flags are one or more of the following
symbols. You can use the <xref linkend="mthToIDClsImage"/> method of the <xref linkend="clsImage"/> class to get the correct numeric
value for any of the following symbols. The <xref linkend="mthOrClsDlgUtil"/> method of
the <xref linkend="clsDlgUtil"/> class can be used to combine more than one of the
symbols if needed.
<simplelist type='horiz' columns='2'>
<member>LR_DEFAULTCOLOR</member> <member>LR_CREATEDIBSECTION</member>
<member>LR_DEFAULTSIZE</member> <member>LR_LOADFROMFILE</member>
<member>LR_LOADMAP3DCOLORS</member> <member>LR_LOADTRANSPARENT</member>
<member>LR_MONOCHROME</member> <member>LR_SHARED</member>
<member>LR_VGACOLOR</member>
</simplelist>
</para>
<para>
The default is LR_SHARED.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
This method returns an .Image object that represents the specified image resource in the module.
The image may be null if an error occurred, for instance if no image resource was found.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
Raises a syntax error if the resource image is null.
</para>
<para>
Sets the <xref linkend="dotSystemErrorCode"/>.
</para>
<para>
Raises syntax errors when incorrect arguments are detected.
</para>
<para>
Provides an interface to the Win32 API: <computeroutput>LoadImage()</computeroutput>. Use the
MSDN <xref linkend="defWindowsDoc"/> documentation to get more information on the arguments to
this method.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example uses a ResDialog with a static control that displays a bitmap image. The image for
the static control is obtained from the resource-only DLL used by the ResDialog.
<programlisting>
<![CDATA[
::class SimpleDialog subclass ResDialog
...
::method initDialog
...
resources = .ResourceImage~new("simpleImage.dll", self)
image = resources~getImage(self~constDir[ID_BMP_IMAGE1])
...
picture = self~newStatic(IDC_BMP_PICTURE)
oldImage = picture~setImage(image)
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ResourceImage::getImage() [class method?] -->
<section id="mthGetImagesClsResourceImage" xreflabel="getImages"><title>getImages</title>
<indexterm><primary>getImages</primary>
<secondary>ResourceImage class</secondary></indexterm>
<programlisting>
<![CDATA[
>>--getImages(--ids,--+--------+--+--------+--+---------+--)----><
+-,-type-+ +-,-size-+ +-,-flags-+
]]>
</programlisting>
<para>
Loads a number of image resources from the module. An array of resource IDs is used to specify which
image resources. All the image resources must have the same characteristics. That is they must all be
the same type and use the same flags. If the type is bitmap, and the flags include LR_DEFAULTSIZE, and
the size is 0 x 0, then the size of the image will be the actual resource size. Otherwise, all the
images also need to be the same size.
</para>
<para>
<emphasis role="bold">Note:</emphasis> <computeroutput>LoadImage()</computeroutput> is the underlying Windows API
used here. This method is very similar to the <xref linkend="mthFromIDsClsImage"/> method of the
.Image class. The documentation for that method can provide additional information.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>The arguments are:
<variablelist>
<varlistentry><term>ids</term>
<listitem>
<para>
An array of the resource IDs of the image resources in the module. The array can contain
any number of IDs, but it can not be sparse. That is, each index of the array must contain a
number. If an incorrect item is detected in the array, then a syntax error is raised and no
images are returned.
</para>
<para>
If there is an error with an individual image resource, then the index in the array for that
image is left empty. One way to check for this type of error is to compare the number of items
in the returned array with the number of items in ID array.
</para>
</listitem></varlistentry>
<varlistentry><term>type</term>
<listitem>
<para>
Specifies the type of the image: bitmap, icon, or cursor. You can use
the <xref linkend="mthToIDClsImage"/> method of the <xref linkend="clsImage"/> class to get the correct numeric value for one of the
following symbols:
<simplelist type='horiz' columns='2'>
<member>IMAGE_BITMAP</member> <member>IMAGE_ICON</member>
<member>IMAGE_CURSOR</member>
</simplelist>
</para>
<para>
The default is IMAGE_BITMAP.
</para>
</listitem></varlistentry>
<varlistentry><term>size</term>
<listitem>
<para>
A <xref linkend="clsSize"/> object that specifies the size of the image. The default
is a size of 0x0. Under most circumstances this indicates that the actual size of the image
should be used. However, the MSDN <xref linkend="defWindowsDoc"/> documentation should
be consulted for other meanings.
</para>
</listitem></varlistentry>
<varlistentry><term>flags</term>
<listitem>
<para>
The load resource flags for the LoadImage() API. The flags are one or more of the following
symbols. You can use the <xref linkend="mthToIDClsImage"/> method of the <xref linkend="clsImage"/> class to get the correct numeric
value for any of the following symbols. The <xref linkend="mthOrClsDlgUtil"/> method of
the <xref linkend="clsDlgUtil"/> class can be used to combine more than one of the
symbols if needed.
<simplelist type='horiz' columns='2'>
<member>LR_DEFAULTCOLOR</member> <member>LR_CREATEDIBSECTION</member>
<member>LR_DEFAULTSIZE</member> <member>LR_LOADFROMFILE</member>
<member>LR_LOADMAP3DCOLORS</member> <member>LR_LOADTRANSPARENT</member>
<member>LR_MONOCHROME</member> <member>LR_SHARED</member>
<member>LR_VGACOLOR</member>
</simplelist>
</para>
<para>
The default is LR_SHARED.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The return will be an array of .Image objects, one for each resource ID specified in the
<computeroutput>ids</computeroutput> array, if there is no error. If there is an error loading the
image of any specified ID, the corresponding index in the returned array will be empty.
</para>
<para>
If there is an error, both the <xref linkend="dotSystemErrorCode"/> and the
<xref linkend="mthSystemErrorCodeClsResourceImage"/> attribute of this
resource image will be set (to the same code.) It is conceivable that an error could occur where
the system does not set an error code, but unlikely.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
Raises a syntax error if the resource image is null.
</para>
<para>
Sets the <xref linkend="dotSystemErrorCode"/>.
</para>
<para>
Raises syntax errors when incorrect arguments are detected.
</para>
<para>
Provides an interface to the Win32 API: <computeroutput>LoadImage()</computeroutput>. You can use
the MSDN <xref linkend="defWindowsDoc"/> documentation to get more information on the
interaction between the flags, size, and type arguments.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
The following is a complete working dialog. Four bitmap images are used. Each time the user
clicks the next button, the next image is displayed.
</para>
<para>
An array is constructed containing the resource IDs of the 4 images. A new resource image object
is instantiated from the <computeroutput>images.dll</computeroutput> module. The getImages()
method is then used to get an array of 4 .Image objects, using the array of resource IDs.
<programlisting>
<![CDATA[
/* Simple Dialog to display some images */
dlg = .SimpleDialog~new( , 'simpleImage.h')
if dlg~initCode = 0 then do
dlg~createCenter(200, 247, "Simple Image Viewer", "", , "MS Shell Dlg 2", 8)
dlg~execute("SHOWTOP", 14)
end
return 0
-- End of entry point.
::requires "ooDialog.cls"
::class SimpleDialog subclass UserDialog
::method defineDialog
self~createStatic(IDC_BMP_PICTURE, 10, 10, 20, 17, "BITMAP REALSIZEIMAGE")
self~createStatic(IDC_ST_DESCRIPTION, 14, 190, 176, 20, "TEXT LEFT", "Description")
self~createPushButton(IDC_PB_NEXT, 10, 223, 50, 14, , "Next", onNext)
self~createPushButton(IDOK, 140, 223, 50, 14, "DEFAULT", "Ok")
::method initDialog
expose picture images description descriptions nextImage
ids = .array~new
ids[ 1] = self~constDir[ID_BMP_IMAGE1]
ids[ 2] = self~constDir[ID_BMP_IMAGE2]
ids[ 3] = self~constDir[ID_BMP_IMAGE3]
ids[ 4] = self~constDir[ID_BMP_IMAGE4]
descriptions = .array~new
descriptions[1] = "Conrad, King of the Hill"
descriptions[2] = "Berk, Squint Eye"
descriptions[3] = "Cienna, Deer in the Headlights"
descriptions[4] = "Vail, The Flower Child"
picture = self~newStatic(IDC_BMP_PICTURE)
description = self~newStatic(IDC_ST_DESCRIPTION)
self~connectButtonEvent(IDC_PB_NEXT, "CLICKED", onNext)
nextImage = 1
module = .ResourceImage~new("images.dll")
images = module~getImages(ids)
self~onNext
::method onNext
expose picture description images descriptions nextImage
if nextImage > images~items then nextImage = 1
picture~setImage(images[nextImage])
description~setText(descriptions[nextImage])
nextImage += 1
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ResourceImage::getImages() -->
<section id="mthHandleClsResourceImage" xreflabel="handle"><title>handle</title>
<indexterm><primary>handle</primary>
<secondary>ResourceImage class</secondary></indexterm>
<programlisting>
<![CDATA[
>>--handle---------------------------------------><
]]>
</programlisting>
<para>
Returns the Windows system handle for the resource module. It is an error to invoke this method if the
resource image is null, or after the resource image has been released.
</para>
<para>
At this time, the handle is only useful for display.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
There are no arguments.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The return is the handle for the module the resource image represents.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example ...
<programlisting>
<![CDATA[
::method showHandles
oodMod = .ResourceImage~new("oodialog.dll", self)
resMod = .ResourceImage~new("simpleImage.dll", self)
say 'The oodialog.dll module handle is: ' oodMod~handle
say 'The resource module for this ResDialog is:' resMod~handle
/* The output, for a ResDialog, might be:
The oodialog.dll module handle is: 0x009E0000
The resource module for this ResDialog is: 0x00AF0000
*/
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ResourceImage::handle() -->
<section id="mthIsNullClsResourceImage" xreflabel="isNull"><title>isNull</title>
<indexterm><primary>isNull</primary>
<secondary>ResourceImage class</secondary></indexterm>
<programlisting>
<![CDATA[
>>--isNull---------------------------------------><
]]>
</programlisting>
<para>
Determines if the resource image is valid. <computeroutput>isNull()</computeroutput> will always
return <computeroutput>.true</computeroutput> after the resource image has been released. It will also
return <computeroutput>.true</computeroutput> if there was an error instantiating a new resource image
object.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
There are no arguments.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
Returns <computeroutput>.true</computeroutput> if the object is null, otherwise
<computeroutput>.false</computeroutput>.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
It is a good idea to check that a new resource image object is valid before using it.
<programlisting>
<![CDATA[
::method initDialog
...
resourceModule = .ResourceImage~new("simpleImage.dll", self)
if \ resourceModule~isNull the do
image = resources~getImage(self~constDir[ID_BMP_IMAGE1])
else do
-- Some error handling here.
end
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ResourceImage::isNull() -->
<section id="mthReleaseClsResourceImage" xreflabel="release"><title>release</title>
<indexterm><primary>release</primary>
<secondary>ResourceImage class</secondary></indexterm>
<programlisting>
<![CDATA[
>>--release--------------------------------------><
]]>
</programlisting>
<para>
Releases the resource module so that the operating system can reclaim the system resources. After the
resource image has been released it can no longer be used. The programmer should not release the
resource image while resources loaded from the module are still in use.
</para>
<para>
If the resource image represents the <computeroutput>oodialog.dll</computeroutput> module, or the
module used for a ResDialog, then the resource image should never be released. The
<computeroutput>release()</computeroutput> method will ignore release requests in those sitautions.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>There are no arguments.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
This method return the system error code, which will be zero if there is no error, and non-zero if
there is an error. The <xref linkend="dotSystemErrorCode"/> is also set to
this value.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
Raises a syntax error if the resource image is null.
</para>
<para>
Sets the <xref linkend="dotSystemErrorCode"/>.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
In this example, the images for an image list are loaded from a resource module. The resource
module is no longer needed after the image list is created. Since an image list makes a copy of the
images added to it, once the image list has all the images added to it, the resource image can be
released.
<programlisting>
<![CDATA[
::method getImages private
use strict arg resourceIDs, size, ilFlags
imageList = .ImageList~create(size, ilFlags, 20, 10);
module = .ResourceImage~new("zooImages.dll")
images = module~getImages(resourceIDs)
imageList~addImages(images)
do i = 1 to images~items
images[i]~release
end
module~release
return imageList
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ResourceImage::release() -->
<section id="mthSystemErrorCodeClsResourceImage" xreflabel="systemErrorCode"><title>systemErrorCode</title>
<indexterm><primary>systemErrorCode</primary>
<secondary>ResourceImage class</secondary></indexterm>
<programlisting>
<![CDATA[
>>--systemErrorCode------------------------------><
]]>
</programlisting>
<para>
When a method for a resource image is invoked that sets the
<xref linkend="dotSystemErrorCode"/>, the systemErrorCode attribute of the resource
image object is also set. This can be useful if the programmer wants to check for an error code at some
point when it is possible that .systemErrorCode has been reset.
</para>
<para>
This method can always be invoked, even if the resource image is null. It is very similar to the
<xref linkend="mthSystemErrorCodeClsImage"/> method of the .Image class and the
documentation for that method is generally applicable here.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
This method does not take any arguments.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The return is a system error code, which will usually be 0, no error.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example uses the <computeroutput>systemErrorCode</computeroutput> attribute to get more
information on a possbile error, rather than the <computeroutput>.systemErrorCode</computeroutput>.
<programlisting>
<![CDATA[
::method initDialog
...
mod = .ResourceImage~new("simpleImage.dll", self)
if mod~isNull the do
self~writeToLog("Error with resource module simpleImage.dll")
self~writeToLog(" RC: " mod~systemErrorCode)
self~writeToLog(" msg:" SysGetErrorText(mod~systemErrorCode)
return
end
image = resources~getImage(self~constDir[ID_BMP_IMAGE1])
...
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ResourceImage::systemErrorCode() -->
</section> <!-- End ResourceImage class -->
</chapter>