[r8770]: ooDialog / branches / 4.2.1 / doc / oodialog / en-US / monthcalendar.xml Maximize Restore History

Download this file

monthcalendar.xml    4467 lines (4150 with data), 163.3 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
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
<?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="clsMonthCalendar" xreflabel="MonthCalendar"><title>Month Calendar Controls</title>
<indexterm><primary>MonthCalendar class</primary></indexterm>
<para>
A month calendar control provides an easy to use interface that allows users to select or enter dates. The control has
the appearence of a typical calendar. The month calendar interface allows the user to select a date from the displayed
days or change the control's display in various ways. The appearence of month calendar controls differ slightly
between different versions of Windows.
</para>
<para>
The <computeroutput>MonthCalendar</computeroutput> object can not be used for dates prior to 1601 because Windows does
not support dates prior to 1601. The month calendar control is based on the Gregorian calendar, which was introduced
in 1753. It will not calculate dates that are consistent with the Julian calendar that was in use prior to 1753.
</para>
<para>
The <computeroutput>MonthCalendar</computeroutput> class provides methods that allow access to all the capabilities of
the underlying Windows month calendar control, including the features available only on Windows Vista and Windows 7.
To use the Windows Vista features, the Rexx program must be running on Vista or later. Likewise, to use Windows 7
features, the Rexx program must be running a Windows 7, or later, system.
</para>
<para>
In addition to the methods of the class itself, the following methods from other classes in the ooDialog framework are
needed, or are useful, when working with month calendar controls:
<variablelist>
<varlistentry><term><emphasis role="bold">Instantiation:</emphasis></term>
<listitem>
<para>
Use the <xref linkend="mthNewMonthCalendar"/> method to retrieve an object of the
<computeroutput>MonthCalendar</computeroutput> class.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Dynamic Definition:</emphasis></term>
<listitem>
<para>
To dynamically create a month calendar control in the template of an <xref linkend="clsUserDialog"/>, use the
<xref linkend="mthCreateMonthCalendar"/> method.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Event Notification</emphasis></term>
<listitem>
<para>
To receive notification of month calendar events use the
<xref linkend="mthConnectMonthCalendarEvent"/>) method.
</para>
<para>
One of the month calendar event notifications, the <xref linkend="evtMonthCalendarGETDAYSTATE"/>
notification, requires that a buffer of day states be returned in reply. The Rexx programmer can not construct the
proper buffer in Rexx code. The <xref linkend="clsDayState"/> and <xref linkend="clsDayStates"/> classes are
provided to help manage day states and to construct the proper buffer.
</para>
</listitem></varlistentry>
</variablelist>
</para>
<section id="sctMethodsMonthCalendar"><title>Method Table</title>
<para>
The following table provides links to the documentation for the primary methods and attributes used in working
with <computeroutput>MonthCalendar</computeroutput> objects, including other relevant classes and methods from other
classes:
</para>
<table id="tblMonthCalendarMethods" frame="all">
<title>MonthCalendar Methods and Attributes</title>
<tgroup cols="2">
<colspec colwidth="2*"/>
<colspec colwidth="7*" />
<thead>
<row>
<entry>Method</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry align="center"><emphasis role="bold">Useful External Classes</emphasis></entry>
<entry align="center"><emphasis role="bold"></emphasis></entry>
</row>
<row>
<entry><xref linkend="clsDayState"/></entry>
<entry>Represents the state of each day in a month.</entry>
</row>
<row>
<entry><xref linkend="clsDayStates"/></entry>
<entry>Manages <computeroutput>DayState</computeroutput> objects and constructs buffers of day states.</entry>
</row>
<row>
<entry align="center"><emphasis role="bold">Useful External Methods</emphasis></entry>
<entry align="center"><emphasis role="bold"></emphasis></entry>
</row>
<row>
<entry><xref linkend="tmthNewMonthCalendar"/></entry>
<entry>Obtains a MonthCalendar object that represents a control in a dialog.</entry>
</row>
<row>
<entry><xref linkend="tmthCreateMonthCalendar"/></entry>
<entry>Creates a MontCalendar control in an <xref linkend="clsUserDialog"/></entry>
</row>
<row>
<entry><xref linkend="tmthConnectMonthCalendarEvent"/></entry>
<entry>Connects MonthCalendar event notifications to a Rexx dialog method.</entry>
</row>
<row>
<entry align="center"><emphasis role="bold">Attributes</emphasis></entry>
<entry align="center"><emphasis role="bold"></emphasis></entry>
</row>
<row>
<entry><xref linkend="atrDate"/></entry>
<entry>Reflects the currently selected date in the calendar.</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="mthAddStyleClsMC"/></entry>
<entry>Adds the specified month calendar style(s) to the control.</entry>
</row>
<row>
<entry><xref linkend="mthGetCalendarBorder"/></entry>
<entry>Retrieves the month calendar's border, in pixels.</entry>
</row>
<row>
<entry><xref linkend="mthGetCalendarCount"/></entry>
<entry>Gets the number of calendars currently displayed in the month calendar control.</entry>
</row>
<row>
<entry><xref linkend="mthGetCALID"/></entry>
<entry>Returns a keyword specifying the current calendar ID for the month calendar control.</entry>
</row>
<row>
<entry><xref linkend="mthGetColor"/></entry>
<entry>Retrieves the color for a given portion of a month calendar control.</entry>
</row>
<row>
<entry><xref linkend="mthGetCurrentView"/></entry>
<entry>Returns a keyword specifying the current view for the month calendar control.</entry>
</row>
<row>
<entry><xref linkend="mthGetFirstDayOfWeek"/></entry>
<entry>Returns the first day of the week, as a whole number, for the month calendar control.</entry>
</row>
<row>
<entry><xref linkend="mthGetGridInfo"/></entry>
<entry>Gets information about a calendar grid in the month calendar control.</entry>
</row>
<row>
<entry><xref linkend="mthGetMaxSelection"/></entry>
<entry>Retrieves the maximum date range that can be selected in the month calendar control.</entry>
</row>
<row>
<entry><xref linkend="mthGetMaxTodayWidth"/></entry>
<entry>Retrieves the maximum width of the <emphasis role="italic">today</emphasis> string in the month calendar control</entry>
</row>
<row>
<entry><xref linkend="mthGetMinRect"/></entry>
<entry>Fills in a <xref linkend="clsRect"/> object with the minimum size required to display a full month in the month calendar control.</entry>
</row>
<row>
<entry><xref linkend="mthGetMonthDelta"/></entry>
<entry>Returns the scroll rate for the month calendar control.</entry>
</row>
<row>
<entry><xref linkend="mthGetMonthRange"/></entry>
<entry>Retrieves date information that represents the high and low limits of a month calendar control's display.</entry>
</row>
<row>
<entry><xref linkend="mthGetRangeClsMC"/></entry>
<entry>Gets the current minimum and maximum allowable dates for the month calendar control.</entry>
</row>
<row>
<entry><xref linkend="mthGetSelectionRange"/></entry>
<entry>Retrieves date information for the upper and lower limits of the current range selected by the user in a multi-selection month calendar control.</entry>
</row>
<row>
<entry><xref linkend="mthGetStyleClsMC"/></entry>
<entry>Returns the current style of the specified month calendar control as list of style keywords.</entry>
</row>
<row>
<entry><xref linkend="mthGetToday"/></entry>
<entry>Retrieves the date information for the date specified as <emphasis role="italic">today</emphasis> for the month calendar control.</entry>
</row>
<row>
<entry><xref linkend="mthHitTestClsMonthCalendar"/></entry>
<entry>Determines which portion of a month calendar control is at a given point on the screen.</entry>
</row>
<row>
<entry><xref linkend="mthRemoveStyleClsMC"/></entry>
<entry>Removes the specified month calendar style(s) from the control.</entry>
</row>
<row>
<entry><xref linkend="mthReplaceStyleClsMC"/></entry>
<entry>Removes some existing month calendar style(s) and adds some new style(s).</entry>
</row>
<row>
<entry><xref linkend="mthSetCalendarBorder"/></entry>
<entry>Sets the size, in pixels, of the month calendar control's border.</entry>
</row>
<row>
<entry><xref linkend="mthSetCALID"/></entry>
<entry>Sets the calendar ID for the calendar control.</entry>
</row>
<row>
<entry><xref linkend="mthSetColorClsMonthCalendar"/></entry>
<entry>Sets the color for a given part of a month calendar control.</entry>
</row>
<row>
<entry><xref linkend="mthSetCurrentView"/></entry>
<entry>Sets the view for the month calendar control.</entry>
</row>
<row>
<entry><xref linkend="mthSetDayState"/></entry>
<entry>Sets the day states for all months that are currently visible within a month calendar control.</entry>
</row>
<row>
<entry><xref linkend="mthSetDayStateQuick"/></entry>
<entry>Sets the day states for 3 months that are currently visible within a month calendar control.</entry>
</row>
<row>
<entry><xref linkend="mthSetFirstDayOfWeek"/></entry>
<entry>Sets the first day of the week for a month calendar control.</entry>
</row>
<row>
<entry><xref linkend="mthSetMaxSelection"/></entry>
<entry>Sets the maximum number of days that can be selected in a multi-selection month calendar control</entry>
</row>
<row>
<entry><xref linkend="mthSetMonthDelta"/></entry>
<entry>Sets the number of months that the month calendar control moves its display when the user clicks a scroll button.</entry>
</row>
<row>
<entry><xref linkend="mthSetRangeClsMC"/></entry>
<entry>Sets the minimum and maximum allowable dates for a month calendar control.</entry>
</row>
<row>
<entry><xref linkend="mthSetSelectionRange"/></entry>
<entry>Sets the selection for a month calendar control to a given date range.</entry>
</row>
<row>
<entry><xref linkend="mthSetToday"/></entry>
<entry>Sets the <emphasis role="italic">today</emphasis> selection for a month calendar control.</entry>
</row>
<row>
<entry><xref linkend="mthSizeRectToMin"/></entry>
<entry>Calculates how many calendars will fit in the given rectangle and returns the minimum size a rectangle needs to be to fit the calendars.</entry>
</row>
</tbody></tgroup>
</table>
</section>
<section id="tmthNewMonthCalendar" xreflabel="new"><title>newMonthCalendar (dialog object method)</title>
<para>
<computeroutput>MonthCalendar</computeroutput> objects can not be instantiated by the programmer from Rexx code using
a <emphasis role="italic">new</emphasis>() method. Rather, a month calendar object is obtained by using the
<xref linkend="mthNewMonthCalendar"/> method of the <xref linkend="chpDialogObject"/> object. The syntax is:
<programlisting>
<![CDATA[
>>-newMonthCalendar(--id--+-------------+--)-----><
+-,--category-+
]]>
</programlisting>
</para>
</section> <!-- End Dialog::newMonthCalendar() (dialog object method) -->
<section id="tmthCreateMonthCalendar" xreflabel="createMonthCalendar"><title>createMonthCalendar (UserDialog method)</title>
<para>
A <computeroutput>MonthCalendar</computeroutput> object can be added to the dialog template in a <xref
linkend="clsUserDialog"/> through the <xref linkend="mthCreateMonthCalendar"/> method. The basic syntax is:
<programlisting>
<![CDATA[
>>-createMonthCalendar(-id-,--x-,--y-,--cx-,--cy-+----------+-+-------------+--><
+-,--style-+ +-,--attrName-+
]]>
</programlisting>
</para>
</section> <!-- End UserDialog::createMonthCalendar() (UserDialog method) -->
<section id="tmthConnectMonthCalendarEvent" xreflabel="connectMonthCalendarEvent">
<title>connectMonthCalendarEvent (dialog object method)</title>
<para>
To connect event notifications from a month calendar control use the
<xref linkend="mthConnectMonthCalendarEvent"/> method of the
<xref linkend="chpDialogObject"/> object. The basic syntax is:
<programlisting> <![CDATA[
>>-connectMonthCalendarEvent(--id--,--event--+----------------+--)-------------><
+--,-methodName--+
]]>
</programlisting>
</para>
</section> <!-- End EventNotification::ConnectMonthCalendarEvent() (dialog object method) -->
<section id="atrDate" xreflabel="date"><title>date (Attribute)</title>
<indexterm><primary>date</primary></indexterm>
<indexterm><primary>MonthCalendar class</primary><secondary>date</secondary></indexterm>
<programlisting>
<![CDATA[
>>--date-----------------------------------------><
>>--date=varName---------------------------------><
]]>
</programlisting>
<para>
The <emphasis role="italic">date</emphasis> attribute reflects the currently selected date in the month calendar
control.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">date get:</emphasis></term>
<listitem>
<para>
The value of the <emphasis role="italic">date</emphasis> attribute is a <computeroutput>DateTime</computeroutput>
object that reflects the currently selected date in the control. The time portion of the
<computeroutput>DateTime</computeroutput> object has no meaning. For multi-selection month calendar controls, the
date is the first selected date in the range of selected dates.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">date set:</emphasis></term>
<listitem>
<para>
A <computeroutput>DateTime</computeroutput> object must be used to set the <emphasis role="italic">date</emphasis>
attribute. The time portion of the <computeroutput>DateTime</computeroutput> object is ignored. When the <emphasis
role="italic">date</emphasis> attribute is assigned a new value, the currently selected date in the underlying
control is updated to reflect the value of the attribute. With multi-selection month calendar controls, when the
<emphasis role="italic">date</emphasis> attribute is assigned a new value, both the start and end of the selected
range are updated to reflect the new value.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
The <emphasis role="italic">date</emphasis> attribute is most useful when used with single-selection month calendar
controls. For multi-selection controls, use the <xref linkend="mthGetSelectionRange"/> and
<xref linkend="mthSetSelectionRange"/> methods to work with the full range of selected dates.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
Raises syntax errors if incorrect usage is detected.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example initializes a month calendar control with a currently selected date 10 years prior to the current
day.
<programlisting>
<![CDATA[
::method initDialog
mc = self~newMonthCalendar(IDC_MC)
mc~date = .DateTime~new~addYears(-10)
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End MonthCalendar::date() [attribute] -->
<section id="mthAddStyleClsMC" xreflabel="addStyle"><title>addStyle</title>
<indexterm><primary>addStyle</primary><secondary>MonthCalendar class</secondary></indexterm>
<indexterm><primary>MonthCalendar class</primary><secondary>addStyle</secondary></indexterm>
<programlisting>
<![CDATA[
>>--addStyle(--styles--)-------------------------><
]]>
</programlisting>
<para>
Adds the specified month calendar style(s) to the control.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The single argument is:
<variablelist>
<varlistentry><term>style [required]</term>
<listitem>
<para>
A list of 1 or more of the following month calendar style keywords, separated by spaces, case is not significant:
</para>
<para>
<simplelist type='vert' columns='3'>
<member>DAYSTATE </member>
<member>MULTI </member>
<member>NOTODAY </member>
<member>NOCIRCLE </member>
<member>WEEKNUMBERS</member>
<member>NOTRAILING </member>
<member>SHORTDAYS </member>
<member>NOSELCHANGE</member>
</simplelist>
<variablelist>
<varlistentry><term>DAYSTATE</term>
<listitem>
<para>
The month calendar will send the GETDAYSTATE <xref linkend="ovvEvents"/> notification to request
information about which days should be displayed in bold. Use the
<xref linkend="mthConnectMonthCalendarEvent"/> method to connect this notification
with a method in the Rexx dialog object.
</para>
</listitem></varlistentry>
<varlistentry><term>MULTI</term>
<listitem>
<para>
This style allows the user to select a range of dates within the control. By default, the maximum range is one
week. The programmer changes the maximum range that can be selected by using the
<xref linkend="mthSetRangeClsDTP"/> method.
</para>
</listitem></varlistentry>
<varlistentry><term>NOTODAY</term>
<listitem>
<para>
The month calendar control will not display the <emphasis role="italic">today</emphasis> date at the bottom of the control.
</para>
</listitem></varlistentry>
<varlistentry><term>NOCIRCLE</term>
<listitem>
<para>
The month calendar control will not circle the <emphasis role="italic">today</emphasis> date at the bottom of
the control.
</para>
</listitem></varlistentry>
<varlistentry><term>WEEKNUMBERS</term>
<listitem>
<para>
The month calendar displays week numbers (1-52) to the left of each row of days. Week 1 is defined by
Microsoft as the first week that contains at least four days.
</para>
</listitem></varlistentry>
<varlistentry><term>NOTRAILING</term>
<listitem>
<para>
<emphasis role="bold">Requires Windows Vista or later</emphasis>. This style disables displaying the dates
from the previous / next month in the current calendar.
</para>
</listitem></varlistentry>
<varlistentry><term>SHORTDAYS</term>
<listitem>
<para>
<emphasis role="bold">Requires Windows Vista or later</emphasis>. With this style, the month calendar uses the
shortest day name for the label of the day of the week column header.
</para>
</listitem></varlistentry>
<varlistentry><term>NOSELCHANGE</term>
<listitem>
<para>
<emphasis role="bold">Requires Windows Vista or later</emphasis>. With this style the selection does not
change when the user navigates to the next or previous month in the calendar. This style is needed for the
user to be able to select a range greater than what is currently displayed.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
A list of month calendar style keywords, separated by spaces, that was the style of the month calendar control
before the <emphasis role="italic">replaceStyle</emphasis> method was invoked. The list could be empty if the
previous style was the default month calendar style.
</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>
This example adds the NOSELCHANGE style to the calendar, provide the Rexx program is running on Vista or later.
<programlisting>
<![CDATA[
::method initDialog
...
if .OS~isAtLeastVista then do
mc = self~newMonthCalendar(IDC_MC)
mc~addStyle("NOSELCHANGE")
end
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End MonthCalendar::addStyle() -->
<section id="mthGetCalendarBorder" xreflabel="getCalendarBorder"><title>getCalendarBorder</title>
<indexterm><primary>getCalendarBorder</primary></indexterm>
<indexterm><primary>MonthCalendar class</primary><secondary>getCalendarBorder</secondary></indexterm>
<programlisting>
<![CDATA[
>>--getCalendarBorder----------------------------><
]]>
</programlisting>
<para>
Retrieves the month calendar's border, in pixels.
</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 return is the width of the month calendar border in pixels.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
<emphasis role="bold">Requires Windows Vista or later</emphasis>.
</para>
<para>
Raises syntax errors if incorrect usage is detected.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End MonthCalendar::getCalendarBorder() -->
<section id="mthGetCalendarCount" xreflabel="getCalendarCount"><title>getCalendarCount</title>
<indexterm><primary>getCalendarCount</primary></indexterm>
<indexterm><primary>MonthCalendar class</primary><secondary>getCalendarCount</secondary></indexterm>
<programlisting>
<![CDATA[
>>--getCalendarCount-----------------------------><
]]>
</programlisting>
<para>
Gets the number of calendars currently displayed in the month calendar control.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
This method does not use any arguments.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
Returns the number of calendars displayed.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
<emphasis role="bold">Requires Windows Vista or later</emphasis>.
</para>
<para>
Raises syntax errors if incorrect usage is detected.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End MonthCalendar::getCalendarCount() -->
<section id="mthGetCALID" xreflabel="getCALID"><title>getCALID</title>
<indexterm><primary>getCalID</primary></indexterm>
<indexterm><primary>MonthCalendar class</primary><secondary>getCalID</secondary></indexterm>
<programlisting>
<![CDATA[
>>--getCalID-------------------------------------><
]]>
</programlisting>
<para>
Returns a keyword specifying the current calendar ID for the month calendar control.
</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>
A calendar ID keyword. The possible keywords and Microsoft's explanations for the keywords are listed in the Remarks
section.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
This table lists the keywords that might be returned from this method:
</para>
<table id="tblCalendarIDs" frame="all">
<title>Calendar IDs</title>
<tgroup cols="2">
<colspec colwidth="1*" />
<colspec colwidth="2*" />
<thead>
<row>
<entry>ID Keyword</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>GREGORIAN</entry>
<entry>Gregorian (localized)</entry>
</row>
<row>
<entry>GREGORIAN_US</entry>
<entry>Gregorian (English strings always</entry>
</row>
<row>
<entry>JAPAN</entry>
<entry>Japanese Emperor Era</entry>
</row>
<row>
<entry>TAIWAN</entry>
<entry>Taiwan calendar</entry>
</row>
<row>
<entry>KOREA</entry>
<entry>Korean Tangun Era</entry>
</row>
<row>
<entry>HIJRI</entry>
<entry>Hijri (Arabic Lunar)</entry>
</row>
<row>
<entry>THAI</entry>
<entry>Thai</entry>
</row>
<row>
<entry>HEBREW</entry>
<entry>Hebrew (Lunar)</entry>
</row>
<row>
<entry>GREGORIAN_ME_FRENCH</entry>
<entry>Gregorian Middle East French</entry>
</row>
<row>
<entry>GREGORIAN_ARABIC</entry>
<entry>Gregorian Arabic</entry>
</row>
<row>
<entry>CAL_GREGORIAN_XLIT_ENGLISH</entry>
<entry>Gregorian transliterated English</entry>
</row>
<row>
<entry>CAL_GREGORIAN_XLIT_FRENCH</entry>
<entry>Gregorian transliterated French</entry>
</row>
<row>
<entry>UMALQURA</entry>
<entry>Um Al Qura (Arabic lunar) calendar </entry>
</row>
</tbody></tgroup>
</table>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
<emphasis role="bold">Requires Windows Vista or later</emphasis>.
</para>
<para>
Raises syntax errors if incorrect usage is detected.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End MonthCalendar::getCalID() -->
<section id="mthGetColor" xreflabel="getColor"><title>getColor</title>
<indexterm><primary>getColor</primary></indexterm>
<indexterm><primary>MonthCalendar class</primary><secondary>getColor</secondary></indexterm>
<programlisting>
<![CDATA[
>>--getColor(--calendarPart--)-------------------><
]]>
</programlisting>
<para>
Retrieves the color for a given portion of a month calendar control.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The single argument is:
<variablelist>
<varlistentry><term>calendarPart [required]</term>
<listitem>
<para>
A single keyword specifying which part of the calendar to get the color for, case is not significant. The valid
keywords are:
</para>
<para>
<simplelist type='vert' columns='3'>
<member>BACKGROUND </member>
<member>MONTHBK </member>
<member>TEXT </member>
<member>TITLEBK </member>
<member>TITLETEXT </member>
<member>TRAILINGTEXT</member>
<member></member>
</simplelist>
<variablelist>
<varlistentry><term>BACKGROUND</term>
<listitem>
<para>
Retrieves the background color displayed between months.
</para>
</listitem></varlistentry>
<varlistentry><term>MONTHBK</term>
<listitem>
<para>
Retrieves the background color displayed within the month.
</para>
</listitem></varlistentry>
<varlistentry><term>TEXT</term>
<listitem>
<para>
Retrieves the color used to display text within a month.
</para>
</listitem></varlistentry>
<varlistentry><term>TITLEBK</term>
<listitem>
<para>
Retrieves the background color displayed in the calendar's title.
</para>
</listitem></varlistentry>
<varlistentry><term>TITLETEXT</term>
<listitem>
<para>
Retrieves the color used to display text within the calendar's title.
</para>
</listitem></varlistentry>
<varlistentry><term>TRAILINGTEXT</term>
<listitem>
<para>
Retrieves the color used to display header day and trailing day text. Header and trailing days are the days
from the previous and following months that appear on the current month calendar.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
On success, returns a COLORREF representing the color setting for the part of the month calendar control specified.
returns CLR_INVALID on error.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
The <xref linkend="clsImage"/> class has a number of convenience methods for working with COLORREFs,
including the <xref linkend="mthColorRef"/> method that explains what a COLORREF is.
</para>
<para>
The <emphasis role="italic">colorRef</emphasis> method can be used to test the return for error. I.e.:
<computeroutput>.Image~colorRef(CLR_INVALID)</computeroutput>. (An error is not very likely.)
</para>
<para>
Note that many of the underlying dialog controls ignore their color settings when visual themes are enabled, unless
the theme is Windows Clasic. This is the case for the month calendar control.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
Raises syntax errors if incorrect usage is detected.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example gets the color for the head and trailing day text, and checks for an error.
<programlisting>
<![CDATA[
monthCalendar = self~newMonthCalendar(IDC_MC)
invalid = .Image~colorRef(CLR_INVALID)
color = monthCalendar~getColor("TRAILINGTEXT")
if color == invalid then do
-- Fill in with some error routine.
end
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End MonthCalendar::getColor() -->
<section id="mthGetCurrentView" xreflabel="getCurrentView"><title>getCurrentView</title>
<indexterm><primary>getCurrentView</primary></indexterm>
<indexterm><primary>MonthCalendar class</primary><secondary>getCurrentView</secondary></indexterm>
<programlisting>
<![CDATA[
>>--getCurrentView-------------------------------><
]]>
</programlisting>
<para>
Returns a keyword specifying the current view for the month calendar control.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
This method does not have any arguments.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The return will be exactly one of the following keywords describing the current view: <emphasis
role="italic">Monthly</emphasis>, <emphasis role="italic">Annual</emphasis>, <emphasis
role="italic">Decade</emphasis>, or <emphasis role="italic">Century</emphasis>.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
<emphasis role="bold">Requires Windows Vista or later</emphasis>.
</para>
<para>
Raises syntax errors if incorrect usage is detected.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End MonthCalendar::getCurrentView() -->
<section id="mthGetFirstDayOfWeek" xreflabel="getFirstDayOfWeek"><title>getFirstDayOfWeek</title>
<indexterm><primary>getFirstDayOfWeek</primary></indexterm>
<indexterm><primary>MonthCalendar class</primary><secondary>getFirstDayOfWeek</secondary></indexterm>
<programlisting>
<![CDATA[
>>--getFirstDayOfWeek(--+--------+--)------------><
+--info--+
]]>
</programlisting>
<para>
Returns the first day of the week, as a whole number, for the month calendar control.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The single argument is:
<variablelist>
<varlistentry><term>info [optional]</term>
<listitem>
<para>
A <computeroutput>Directory</computeroutput> object in which additional information is returned.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
Returns a whole number that represents the first day of the week, where 0 is Monday, 1 is Tuesday, and so on.
</para>
<para>
If the optional <emphasis role="italic">info</emphasis> argument is supplied, the
<computeroutput>Directory</computeroutput> object will contain the following indexes on return:
</para>
<variablelist>
<varlistentry><term>DAY</term>
<listitem>
<para>
The numerical first day of the week. This is the same value as the return value of the method.
</para>
</listitem></varlistentry>
<varlistentry><term>USINGLOCALE</term>
<listitem>
<para>
True if the calendar is using the localized first day of the week, false if the first day of the week has been set
to something other than the localized first day of the week.
</para>
</listitem></varlistentry>
<varlistentry><term>DAYNAME</term>
<listitem>
<para>
The english name of the day corresponding to first day of the week.
</para>
</listitem></varlistentry>
</variablelist>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect arguments are detected.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End MonthCalendar::getFirstDayOfWeek() -->
<section id="mthGetGridInfo" xreflabel="getGridInfo"><title>getGridInfo</title>
<indexterm><primary>getGridInfo</primary></indexterm>
<indexterm><primary>MonthCalendar class</primary><secondary>getGridInfo</secondary></indexterm>
<programlisting>
<![CDATA[
>>--getGridInfo(--info--)------------------------><
]]>
</programlisting>
<para>
Gets information about a calendar grid in the month calendar control. A <computeroutput>Directory</computeroutput>
object with indexes specifying the information requested is passed into the method. On return, the
<computeroutput>Directory</computeroutput> object contains indexes with the information requested.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The single argument is:
<variablelist>
<varlistentry><term>info [required] [in / out]</term>
<listitem>
<para>
A <computeroutput>Directory</computeroutput> object. On input, the object contains the following indexes
specifying the information needed:
</para>
<variablelist>
<varlistentry><term>PART [required]</term>
<listitem>
<para>
A single keyword, specifying which part of the calendar the information is requested for. The following keywords
are accepted, case is not significant:
</para>
<para>
<simplelist type='vert' columns='3'>
<member>CONTROL </member>
<member>NEXT </member>
<member>PREV </member>
<member>FOOTER </member>
<member>CALENDAR</member>
<member>HEADER </member>
<member>BODY </member>
<member>ROW </member>
<member>CELL </member>
</simplelist>
<variablelist>
<varlistentry><term>CONTROL</term>
<listitem>
<para>
The entire month calendar control, which may include up to 12 calendars.
</para>
</listitem></varlistentry>
<varlistentry><term>NEXT</term>
<listitem>
<para>
The next button.
</para>
</listitem></varlistentry>
<varlistentry><term>PREV</term>
<listitem>
<para>
The previous button.
</para>
</listitem></varlistentry>
<varlistentry><term>FOOTER</term>
<listitem>
<para>
The footer.
</para>
</listitem></varlistentry>
<varlistentry><term>CALENDAR</term>
<listitem>
<para>
One specific calendar. The value of the INDEX index specifies which calendar.
</para>
</listitem></varlistentry>
<varlistentry><term>HEADER</term>
<listitem>
<para>
The calendar header. The value of the INDEX index specifies which calendar.
</para>
</listitem></varlistentry>
<varlistentry><term>BODY</term>
<listitem>
<para>
The calendar body. The value of the INDEX index specifies which calendar.
</para>
</listitem></varlistentry>
<varlistentry><term>ROW</term>
<listitem>
<para>
A given calendar row. The value of the INDEX index specifies which calendar.
</para>
</listitem></varlistentry>
<varlistentry><term>CELL</term>
<listitem>
<para>
A given calendar cell. The value of the INDEX index specifies which calendar.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term>WHAT [required]</term>
<listitem>
<para>
A list of one or more of the following keywords, specifying what information (what indexes) will be filled in
for the calendar part specified in the PART index. Case is not significant:
</para>
<para>
<simplelist type='vert' columns='3'>
<member>DATE </member>
<member>RECT </member>
<member>NAME </member>
</simplelist>
<variablelist>
<varlistentry><term>DATE</term>
<listitem>
<para>
The STARTDATE and ENDDATE indexes will be present and contain valid values.
</para>
</listitem></varlistentry>
<varlistentry><term>RECT</term>
<listitem>
<para>
The RECT index will be present.
</para>
</listitem></varlistentry>
<varlistentry><term>NAME</term>
<listitem>
<para>
The NAME index will be present.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term>INDEX [optional]</term>
<listitem>
<para>
Specifies the one-based index of the calendar the requested information is for. Used when the PART index
specifies CALENDAR, HEADER, BODY, ROW, or CELL. If omitted, the default is 1.
</para>
</listitem></varlistentry>
<varlistentry><term>ROW [optional]</term>
<listitem>
<para>
If the PART keyword is ROW, specifies the row for which to return information.
</para>
</listitem></varlistentry>
<varlistentry><term>COL [optional]</term>
<listitem>
<para>
If the PART keyword is CELL, specifies the column of the cell for which to return information. The ROW index
provides the row of the cell for which to return information.
</para>
</listitem></varlistentry>
</variablelist>
<para>
On a successful return the <computeroutput>Directory</computeroutput> object contains the following indexes,
dependent on the information requested:
</para>
<variablelist>
<varlistentry><term>SELECTED</term>
<listitem>
<para>
If PART is CELL, indicates if the cell described by the values in the ROW and COL is currently selected. The
value of the SELECTED index will be <computeroutput>.true</computeroutput> if the cell is selected and
<computeroutput>.false</computeroutput> if it is not.
</para>
</listitem></varlistentry>
<varlistentry><term>STARTDATE</term>
<listitem>
<para>
Contains a <computeroutput>DateTime</computeroutput> object representing the start date of the Calendar
specified by INDEX index. Only valid when the WHAT index contains the DATE keyword.
</para>
</listitem></varlistentry>
<varlistentry><term>ENDDATE</term>
<listitem>
<para>
Contains a <computeroutput>DateTime</computeroutput> object representing the end date of the Calendar
specified by INDEX index. Only set when the WHAT index contains the DATE keyword.
</para>
</listitem></varlistentry>
<varlistentry><term>RECT</term>
<listitem>
<para>
A <xref linkend="clsRect"/> object containing the dimensions of the calendar part specified in the
PART index. Only set when the WHAT index contains the RECT keyword.
</para>
</listitem></varlistentry>
<varlistentry><term>NAME</term>
<listitem>
<para>
Set only if the WHAT index contains the NAME keyword, and only for the following PART keywords:
</para>
<variablelist>
<varlistentry><term>CALENDAR:</term>
<listitem>
<para>
Returns the text of the selected dates. In the case of multiple selection, returns the text for the date at
the start of the selection.
</para>
</listitem></varlistentry>
<varlistentry><term>CELL:</term>
<listitem>
<para>
Returns the text of the cell indicated by ROW and COL indexes, for instance <emphasis
role="italic">15</emphasis>, if the 15th day was specified.
</para>
</listitem></varlistentry>
<varlistentry><term>HEADER:</term>
<listitem>
<para>
Returns the text in the calendar header, for instance <emphasis role="italic">March 1951</emphasis>.
</para>
</listitem></varlistentry>
</variablelist>
</listitem></varlistentry>
</variablelist>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
True on success, otherwise false.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
<emphasis role="bold">Requires Windows Vista or later</emphasis>.
</para>
<para>
Raises syntax errors when incorrect usage is detected.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This contrived example determines the date of the cell at row 2, column 3 in the second displayed calendar, if there
is a second calendar. It also determines if the cell is selected and its dimensions:
<programlisting>
<![CDATA[
if .OS~isAtLeastVista then do
mc = self~newMonthCalendar
if mc~getCalendarCount >= 2 then do
info = .directory~new
info~part = "CELL"
info~what = "RECT NAME"
info~index = 2
info~row = 2
info~col = 3
if mc~getGridInfo(info) then do
selectedWords = "is not selected,"
if info~selected then selectedWords = "is selected."
width = info~rect~right - info~rect~left
height = info~rect~bottom - info~rect~top
say "The date of the day at row 2, column 3 in the second calendar is" info~name"."
say "The day" selectedWords
say "The day is at ("info~rect~left"," info~rect~top")" on the screen."
say "It is" width "pixels wide and" height "pixels high."
end
else do
say "Unexpected failure of getGridInfo()."
end
end
end
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End MonthCalendar::getGridInfo() -->
<section id="mthGetMaxSelection" xreflabel="getMaxSelection"><title>getMaxSelection</title>
<indexterm><primary>getMaxSelection</primary></indexterm>
<indexterm><primary>MonthCalendar class</primary><secondary>getMaxSelection</secondary></indexterm>
<programlisting>
<![CDATA[
>>--getMaxSelection------------------------------><
]]>
</programlisting>
<para>
Retrieves the maximum date range that can be selected in the month calendar control.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
There are no arguments for this method.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
Returns the total number of days that can be selected for the month calendar control.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
The maximum date range that can be selected can be changed by using the
<xref linkend="mthSetMaxSelection"/> method.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End MonthCalendar::getMaxSelection() -->
<section id="mthGetMaxTodayWidth" xreflabel="getMaxTodayWidth"><title>getMaxTodayWidth</title>
<indexterm><primary>getMaxTodayWidth</primary></indexterm>
<indexterm><primary>MonthCalendar class</primary><secondary>getMaxTodayWidth</secondary></indexterm>
<programlisting>
<![CDATA[
>>--getMaxTodayWidth-----------------------------><
]]>
</programlisting>
<para>
Retrieves the maximum width of the <emphasis role="italic">today</emphasis> string in the month calendar control,
which includes the date and label text.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
This method does not have any arguments.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
Returns the width of the today string in pixels
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End MonthCalendar::getMaxTodayWidth() -->
<section id="mthGetMinRect" xreflabel="getMinRect"><title>getMinRect</title>
<indexterm><primary>getMinRect</primary></indexterm>
<indexterm><primary>MonthCalendar class</primary><secondary>getMinRect</secondary></indexterm>
<programlisting>
<![CDATA[
>>--getMinRect(--rect--)-------------------------><
]]>
</programlisting>
<para>
Fills in a <xref linkend="clsRect"/> object with the minimum size required to display a full month in the
month calendar control.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The single argument is:
<variablelist>
<varlistentry><term>rect [required]</term>
<listitem>
<para>
A <computeroutput>Rect</computeroutput> object in which to return the minimum size.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
If the method succeeds, <computeroutput>.true</computeroutput> is returned, otherwise
<computeroutput>.false</computeroutput>.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
The minimum required size for the month calendar control depends on things like the current font, the style in
effect for the month calendar, etc.. If the application changes anything that will affect the minimum size, the
programmer should use the <emphasis role="italic">getMinRect</emphasis> method to recalculate the minimum size.
</para>
<para>
<emphasis role="bold">Note</emphasis> that the rectangle returned will not include the width of the <emphasis
role="italic">Today</emphasis> string. If the month calendar does not have the NOTODAY style set, the programmer
should also get the <emphasis role="italic">Today</emphasis> string width by using the
<xref linkend="mthGetMaxTodayWidth"/> method. For the width portion of the minimum required size,
use the larger of the value reported by <emphasis role="italic">getMaxTodayWidth</emphasis> and the value reported
by <emphasis role="italic">getMinRect</emphasis>. This will ensure that the <emphasis role="italic">
Today</emphasis> string is not clipped..
</para>
<para>
The <emphasis role="italic">top</emphasis> and <emphasis role="italic">left</emphasis> of the
<computeroutput>Rect</computeroutput> object will always be 0. The <emphasis role="italic">right</emphasis> and
<emphasis role="italic">bottom</emphasis> of the <computeroutput>Rect</computeroutput> object will contain the
minimum width and height required for the month calendar.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect arguments are detected.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example resizes a month calendar control to the minimum required size. The position of the control, i.e., the
upper left hand corner, remains unchanged.
<programlisting>
<![CDATA[
::method sizeCalendar private
use strict arg calendar
r = .Rect~new
if calendar~getMinRect(r) then calendar~resizeTo(.Size~new(r~right, r~bottom))
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End MonthCalendar::getMinRect() -->
<section id="mthGetMonthDelta" xreflabel="getMonthDelta"><title>getMonthDelta</title>
<indexterm><primary>getMonthDelta</primary></indexterm>
<indexterm><primary>MonthCalendar class</primary><secondary>getMonthDelta</secondary></indexterm>
<programlisting>
<![CDATA[
>>--getMonthDelta--------------------------------><
]]>
</programlisting>
<para>
Returns the scroll rate for the month calendar control. The scroll rate is the number of months that the control moves
its display when the user clicks a scroll button.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
This method does not use any arguments.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
When the scroll rate has been previously set through the <xref linkend="mthSetMonthDelta"/>
method, the return is a whole number specifying the current scroll rate. If, the scroll rate has not been previously
set, of it it has been reset to the default, the return is a whole number specifying the number of months currently
being displayed by the month calendar control.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End MonthCalendar::getMonthDelta() -->
<section id="mthGetMonthRange" xreflabel="getMonthRange"><title>getMonthRange</title>
<indexterm><primary>getMonthRange</primary></indexterm>
<indexterm><primary>MonthCalendar class</primary><secondary>getMonthRange</secondary></indexterm>
<programlisting>
<![CDATA[
>>--getMonthRange(--range--+---------+--)--------><
+-,-span--+
]]>
</programlisting>
<para>
Retrieves date information (using <computeroutput>DateTime</computeroutput> objects) that represents the high and low
limits of a month calendar control's display.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The arguments are:
<variablelist>
<varlistentry><term>range [required] [IN/OUT]</term>
<listitem>
<para>
An <computeroutput>Array</computeroutput> object in which the range is returned. The lower limit will be
returned at index 1 and the upper limit will be returned at index 2. Both the values at the indexes will be
<computeroutput>DateTime</computeroutput> objects.
</para>
</listitem></varlistentry>
<varlistentry><term>range [optional]</term>
<listitem>
<para>
A keyword specifying whether the range should include only months that are ENTIRELY displayed or to include
trailing and following months that are only PARTIALLY displayed. The default if omitted is PARTIALLY. Only the
first letter of ENTIRELY or PARTIALLY are required and case is insignificant.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The return is a whole number representing the span of months of the lower and upper limits returned in the <emphasis
role="italic">range</emphasis> argument.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect usage is detected.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End MonthCalendar::getMonthRange() -->
<section id="mthGetRangeClsMC" xreflabel="getRange"><title>getRange</title>
<indexterm><primary>getRange</primary><secondary>MonthCalendar class</secondary></indexterm>
<indexterm><primary>MonthCalendar class</primary><secondary>getRange</secondary></indexterm>
<programlisting>
<![CDATA[
>>--getRange(--range--)--------------------------><
]]>
</programlisting>
<para>
Gets the current minimum and maximum allowable dates for the month calendar control.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The single argument is:
<variablelist>
<varlistentry><term>range [required] [IN/OUT]</term>
<listitem>
<para>
An <computeroutput>Array</computeroutput> object in which the minimum and maximum dates are returned as
<computeroutput>DateTime</computeroutput> objects. The minimum date will be at index 1 and the maximum
at index 2. If the value at either index is set to zero, then no corresponding limit is set for the month
calendar control.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
A keyword indicating which, if any, of the limits have been set. The keyword will be exactly one of the following:
<variablelist>
<varlistentry><term><emphasis role="bold">none</emphasis></term>
<listitem>
<para>
The month calendar has neither a minimum nor maximum date set.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">min</emphasis></term>
<listitem>
<para>
The month calendar has a minimum allowable date set, but no maximum date is set.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">max</emphasis></term>
<listitem>
<para>
The month calendar has a maximum allowable date set, but no minimum date is set.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">none</emphasis></term>
<listitem>
<para>
The month calendar has both a minimum and a maximum allowable date set.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">error</emphasis></term>
<listitem>
<para>
An error occurred, the values at index 1 and 2 of the <emphasis role="italic">range</emphasis> argument are
undefined. It is unlikely that an error will occur.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
Additional comments.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect arguments are detected.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example checks for minimum and maximum allowable dates and displays the results:
<programlisting>
<![CDATA[
mc = self~newMonthCalendar(IDC_MC)
range = .array~new(2)
result = mc~getRange(range)
select
when result == 'none' then say "No minimum or maximum allowable dates set."
when result == 'min' then do
say "There is no maximum allowable date set."
say "The minimum allowable date is" self~formatDate(range[1])"."
end
when result == 'max' then do
say "There is no minimum allowable date set."
say "The maximum allowable date is" self~formatDate(range[2])"."
end
when result == 'both' then do
say "The minimum allowable date is" self~formatDate(range[1])"."
say "The maximum allowable date is" self~formatDate(range[2])"."
end
when result == 'error' then do
say "An error occurred."
say "Hang the documentation author!!!"
end
end
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End MonthCalendar::getRange() -->
<section id="mthGetSelectionRange" xreflabel="getSelectionRange"><title>getSelectionRange</title>
<indexterm><primary>getSelectionRange</primary></indexterm>
<indexterm><primary>MonthCalendar class</primary><secondary>getSelectionRange</secondary></indexterm>
<programlisting>
<![CDATA[
>>--getSelectionRange(--range--)-----------------><
]]>
</programlisting>
<para>
Retrieves date information that represents the upper and lower limits of the date range currently selected by the
user in a multi-selection month calendar control.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The single argument is:
<variablelist>
<varlistentry><term>range [required] [IN/OUT]</term>
<listitem>
<para>
An <computeroutput>Array</computeroutput> object in which the lower and upper limits of the selection are
returned as <computeroutput>DateTime</computeroutput> objects. The lower bound of the selection will be at
index 1 and the upper bound at index 2.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
Returns <computeroutput>.true</computeroutput> on success, otherwise <computeroutput>.false</computeroutput>.
</para>
<para>
On success index 1 of the <emphasis role="italic">range</emphasis> array argument will contain a
<computeroutput>DateTime</computeroutput> object whose date portion is the lower limit of the selection range.
Likewise, index 2 will contain a <computeroutput>DateTime</computeroutput> object whose date portion is the upper
limit of the selection. On error, the <emphasis role="italic">range</emphasis> argument is unchanged.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
The <emphasis role="italic">getSelectionRange</emphasis> method is for month calendar controls that have the MULTI
(multi-selection) style. If the month calendar is a single-selection calendar this method returns
<computeroutput>.false</computeroutput>. For a single-selection month calendar the <xref linkend="atrDate"/>
attribute will reflect the current selection.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect arguments are detected.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End MonthCalendar::getSelectionRange() -->
<section id="mthGetStyleClsMC" xreflabel="getStyle"><title>getStyle</title>
<indexterm><primary>getStyle</primary><secondary>MonthCalendar class</secondary></indexterm>
<indexterm><primary>MonthCalendar class</primary><secondary>getStyle</secondary></indexterm>
<programlisting>
<![CDATA[
>>--getStyle-------------------------------------><
]]>
</programlisting>
<para>
Returns the current style of the specified month calendar control as list of style keywords.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
This method has no arguments.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
A list of month calendar style keywords, separated by spaces. The list could be empty if the previous style was the
default month calendar style. Otherwise, the list will contain one or more of the following keywords:
</para>
<para>
<simplelist type='vert' columns='3'>
<member>DAYSTATE </member>
<member>MULTI </member>
<member>NOTODAY </member>
<member>NOCIRCLE </member>
<member>WEEKNUMBERS</member>
<member>NOTRAILING </member>
<member>SHORTDAYS </member>
<member>NOSELCHANGE</member>
</simplelist>
<variablelist>
<varlistentry><term>DAYSTATE</term>
<listitem>
<para>
The month calendar will send the GETDAYSTATE <xref linkend="ovvEvents"/> notification to request
information about which days should be displayed in bold. Use the <xref linkend="mthConnectMonthCalendarEvent"/>
method to connect this notification with a method in the Rexx dialog object.
</para>
</listitem></varlistentry>
<varlistentry><term>MULTI</term>
<listitem>
<para>
This style allows the user to select a range of dates within the control. By default, the maximum range is one
week. The programmer changes the maximum range that can be selected by using the <xref linkend="mthSetRangeClsDTP"/>
method.
</para>
</listitem></varlistentry>
<varlistentry><term>NOTODAY</term>
<listitem>
<para>
The month calendar control will not display the <emphasis role="italic">today</emphasis> date at the bottom of the control.
</para>
</listitem></varlistentry>
<varlistentry><term>NOCIRCLE</term>
<listitem>
<para>
The month calendar control will not circle the <emphasis role="italic">today</emphasis> date at the bottom of
the control.
</para>
</listitem></varlistentry>
<varlistentry><term>WEEKNUMBERS</term>
<listitem>
<para>
The month calendar displays week numbers (1-52) to the left of each row of days. Week 1 is defined by
Microsoft as the first week that contains at least four days.
</para>
</listitem></varlistentry>
<varlistentry><term>NOTRAILING</term>
<listitem>
<para>
<emphasis role="bold">Requires Windows Vista or later</emphasis>. This style disables displaying the dates
from the previous / next month in the current calendar.
</para>
</listitem></varlistentry>
<varlistentry><term>SHORTDAYS</term>
<listitem>
<para>
<emphasis role="bold">Requires Windows Vista or later</emphasis>. With this style, the month calendar uses the
shortest day name for the label of the day of the week column header.
</para>
</listitem></varlistentry>
<varlistentry><term>NOSELCHANGE</term>
<listitem>
<para>
<emphasis role="bold">Requires Windows Vista or later</emphasis>. With this style the selection does not
change when the user navigates to the next or previous month in the calendar. This style is needed for the
user to be able to select a range greater than what is currently displayed.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example displays the current style of a month calendar control:
<programlisting>
<![CDATA[
::method printStyle private
mc = self~newMonthCalendar(IDC_MC_HOLIDAYS
say 'The holidays month calendar has this style:' mc~getStyle
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End MonthCalendar::addStyle() -->
<section id="mthGetToday" xreflabel="getToday"><title>getToday</title>
<indexterm><primary>getToday</primary></indexterm>
<indexterm><primary>MonthCalendar class</primary><secondary>getToday</secondary></indexterm>
<programlisting>
<![CDATA[
>>--getToday-------------------------------------><
]]>
</programlisting>
<para>
Retrieves the date information for the date specified as <emphasis role="italic">today</emphasis> for a month calendar
control.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
This method does not have any arguments.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
On success, the return is a <computeroutput>DateTime</computeroutput> object whose date portion is the date of the
<emphasis role="italic">Today</emphasis> date for the month calendar. On error the
<computeroutput>.nil</computeroutput> object is returned.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End MonthCalendar::getToday() -->
<section id="mthHitTestClsMonthCalendar" xreflabel="hitTest"><title>hitTest</title>
<indexterm><primary>hitTest</primary><secondary>MonthCalendary class</secondary></indexterm>
<indexterm><primary>MonthCalendar class</primary><secondary>hitTest</secondary></indexterm>
<programlisting>
<![CDATA[
>>--hitTest(--screenPoint--)---------------------><
]]>
</programlisting>
<para>
Determines which portion of a month calendar control is at a given point on the screen.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The single argument is:
<variablelist>
<varlistentry><term>screenPoint [required]</term>
<listitem>
<para>
A <xref linkend="clsPoint"/> object containing the point to test.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The return is a <computeroutput>directory</computeroutput> object containing information on the point hit-tested.
The <computeroutput>directory</computeroutput> will contain some or all of the following indexes, depending on the
results of the hit test:
<variablelist>
<varlistentry><term>HIT:</term>
<listitem>
<para>
This index will always be present. Its value will be exactly one of the following keywords:
<variablelist>
<varlistentry><term>CalendarBackground:</term>
<listitem>
<para>
The point, <emphasis role="italic">screenPoint</emphasis>, was in the calendar's background.
</para>
</listitem></varlistentry>
<varlistentry><term>CalendarControl:</term>
<listitem>
<para>
The point, <emphasis role="italic">screenPoint</emphasis>, is outside of any calendar but within the
calendar controls rectangle.
</para>
</listitem></varlistentry>
<varlistentry><term>CalendarDate:</term>
<listitem>
<para>
The point, <emphasis role="italic">screenPoint</emphasis>, was on a particular date within the calendar. The
DATE index of the <computeroutput>directory</computeroutput> object is set to the date at the given point.
</para>
</listitem></varlistentry>
<varlistentry><term>CalendarDateMin:</term>
<listitem>
<para>
The point, <emphasis role="italic">screenPoint</emphasis>, was over the minimum date(s) in the calendar.
</para>
</listitem></varlistentry>
<varlistentry><term>CalendarDateMax:</term>
<listitem>
<para>
The point, <emphasis role="italic">screenPoint</emphasis>, was over the maximum date(s) in the calendar.
</para>
</listitem></varlistentry>
<varlistentry><term>CalendarDateNext:</term>
<listitem>
<para>
The point, <emphasis role="italic">screenPoint</emphasis>, was over a date from the next month (partially
displayed at the end of the currently displayed month). If the user clicks here, the month calendar will
scroll its display to the next month or set of months.
</para>
</listitem></varlistentry>
<varlistentry><term>CalendarDatePrev:</term>
<listitem>
<para>
The point, <emphasis role="italic">screenPoint</emphasis>, was over a date from the previous month
(partially displayed at the end of the currently displayed month). If the user clicks here, the month
calendar will scroll its display to the previous month or set of months.
</para>
</listitem></varlistentry>
<varlistentry><term>CalendarDay:</term>
<listitem>
<para>
The point, <emphasis role="italic">screenPoint</emphasis>, was over a day abbreviation, like <emphasis
role="italic">Fri</emphasis>, for example. The DATE index of the <computeroutput>directory</computeroutput>
object is set to the corresponding date in the top row.
</para>
</listitem></varlistentry>
<varlistentry><term>CalendarWeekNum:</term>
<listitem>
<para>
The point, <emphasis role="italic">screenPoint</emphasis>, was over a week number. This only applies when
the month calendar has the WEEKNUMBERS style. The DATE index of the
<computeroutput>directory</computeroutput> object is set to the the corresponding date in the leftmost
column.
</para>
</listitem></varlistentry>
<varlistentry><term>NoWhere:</term>
<listitem>
<para>
The point, <emphasis role="italic">screenPoint</emphasis>, was not on the month calendar control, or it was
in an inactive portion of the control.
</para>
</listitem></varlistentry>
<varlistentry><term>TitleBackground:</term>
<listitem>
<para>
The point, <emphasis role="italic">screenPoint</emphasis>, was over the background of a month's title.
</para>
</listitem></varlistentry>
<varlistentry><term>TitleButtonNext:</term>
<listitem>
<para>
The point, <emphasis role="italic">screenPoint</emphasis>, was over the button at the top right corner of
the control. If the user clicks here, the month calendar will scroll its display to the next month or set of
months.
</para>
</listitem></varlistentry>
<varlistentry><term>TitleButtonPrev:</term>
<listitem>
<para>
The point, <emphasis role="italic">screenPoint</emphasis>, was over the button at the top left corner of the
control. If the user clicks here, the month calendar will scroll its display to the previous month or set of
months.
</para>
</listitem></varlistentry>
<varlistentry><term>TitleMonth:</term>
<listitem>
<para>
The point, <emphasis role="italic">screenPoint</emphasis>, was in a month's title bar, over a month name.
</para>
</listitem></varlistentry>
<varlistentry><term>TitleYear:</term>
<listitem>
<para>
The point, <emphasis role="italic">screenPoint</emphasis>, was in a month's title bar, over the year value.
</para>
</listitem></varlistentry>
<varlistentry><term>TodayLink:</term>
<listitem>
<para>
The point, <emphasis role="italic">screenPoint</emphasis>, was on the <emphasis
role="italic">today</emphasis> link at the bottom of the month calendar control.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term>DATE:</term>
<listitem>
<para>
When set, the DATE index will contain a <computeroutput>DateTime</computeroutput> object that reflects the date
as specified by the HIT index above. That is, for CalendarDate, CalendarDay, and CalendarWeekNum. The index is
not set for any other hit.
</para>
</listitem></varlistentry>
<varlistentry><term>RECT:</term>
<listitem>
<para>
<emphasis role="bold">Vista or later only:</emphasis> The index will be a <xref linkend="clsRect"/>
object that specifies the rectangle of the hit-tested location.
</para>
</listitem></varlistentry>
<varlistentry><term>OFFSET:</term>
<listitem>
<para>
<emphasis role="bold">Vista or later only:</emphasis> The OFFSET index is the one-based offset of the calendar
at the hit-teste point. This is primarily for use when more than one calendar is displayed.
</para>
</listitem></varlistentry>
<varlistentry><term>ROW:</term>
<listitem>
<para>
<emphasis role="bold">Vista or later only:</emphasis> The one-based index of the row in the calendar grid that
<emphasis role="italic">screenPoint</emphasis> is over. When the point is over the calendar <emphasis
role="italic">grid</emphasis>, which is the grid of dates, both the ROW and COLUMN indexes are set. In addition,
if the hit test is <emphasis role="italic">CalendarWeekNum</emphasis> the ROW index is set, but the COLUMN index
is not set.
</para>
</listitem></varlistentry>
<varlistentry><term>COLUMN:</term>
<listitem>
<para>
<emphasis role="bold">Vista or later only:</emphasis> The one-based index of the column in the calendar grid
that <emphasis role="italic">screenPoint</emphasis> is over. When the point is over the calendar <emphasis
role="italic">grid</emphasis>, which is the grid of dates, both the ROW and COLUMN indexes are set. In addition,
if the hit test is <emphasis role="italic">CalendarDay</emphasis> the COLUMN index is set, but the ROW index
is not set.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
Although the Microsoft documentation calls the point to be tested the point on the screen, experimentation shows
that the point must be in <xref linkend="defScreenCoordinates"/> coordinates of the dialog.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect arguments are detected.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example gets the current cursor position, hit tests that point, and then prints out the hit test information:
<programlisting>
<![CDATA[
::method onF7
expose calendar
pt = self~getCursorPos
calendar~screen2client(pt)
d = calendar~hitTest(pt)
say 'Hit: ' d~hit
say 'Date: ' d~date
if d~rect == .nil then say 'Rect: ' d~rect
else say 'Rect: ' '('d~rect~left',' d~rect~top',' d~rect~right',' d~rect~bottom')'
say 'Offset:' d~offset
say 'Row: ' d~row
say 'Column:' d~column
say
/* Output for 2 hit tests might for instance be:
Hit: CalendarDate
Date: 2011-10-12T00:00:00.000000
Rect: (116, 79, 147, 94)
Offset: 1
Row: 3
Column: 4
Hit: TodayLink
Date: The NIL object
Rect: (63, 139, 184, 156)
Offset: 1
Row: The NIL object
Column: The NIL object
*/
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End MonthCalendar::hitTest() -->
<section id="mthRemoveStyleClsMC" xreflabel="removeStyle"><title>removeStyle</title>
<indexterm><primary>removeStyle</primary><secondary>MonthCalendar class</secondary></indexterm>
<indexterm><primary>MonthCalendar class</primary><secondary>removeStyle</secondary></indexterm>
<programlisting>
<![CDATA[
>>--removeStyle(--styles-)-----------------------><
]]>
</programlisting>
<para>
Removes the specified month calendar style(s) from the control.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The single argument is:
<variablelist>
<varlistentry><term>style [required]</term>
<listitem>
<para>
A list of 1 or more of the following month calendar style keywords, separated by spaces, case is not significant:
</para>
<para>
<simplelist type='vert' columns='3'>
<member>DAYSTATE </member>
<member>MULTI </member>
<member>NOTODAY </member>
<member>NOCIRCLE </member>
<member>WEEKNUMBERS</member>
<member>NOTRAILING </member>
<member>SHORTDAYS </member>
<member>NOSELCHANGE</member>
</simplelist>
<variablelist>
<varlistentry><term>DAYSTATE</term>
<listitem>
<para>
The month calendar will send the GETDAYSTATE <xref linkend="ovvEvents"/> notification to request
information about which days should be displayed in bold. Use the
<xref linkend="mthConnectMonthCalendarEvent"/> method to connect this notification
with a method in the Rexx dialog object.
</para>
</listitem></varlistentry>
<varlistentry><term>MULTI</term>
<listitem>
<para>
This style allows the user to select a range of dates within the control. By default, the maximum range is one
week. The programmer changes the maximum range that can be selected by using the
<xref linkend="mthSetRangeClsDTP"/> method.
</para>
</listitem></varlistentry>
<varlistentry><term>NOTODAY</term>
<listitem>
<para>
The month calendar control will not display the <emphasis role="italic">today</emphasis> date at the bottom of the control.
</para>
</listitem></varlistentry>
<varlistentry><term>NOCIRCLE</term>
<listitem>
<para>
The month calendar control will not circle the <emphasis role="italic">today</emphasis> date at the bottom of
the control.
</para>
</listitem></varlistentry>
<varlistentry><term>WEEKNUMBERS</term>
<listitem>
<para>
The month calendar displays week numbers (1-52) to the left of each row of days. Week 1 is defined by
Microsoft as the first week that contains at least four days.
</para>
</listitem></varlistentry>
<varlistentry><term>NOTRAILING</term>
<listitem>
<para>
<emphasis role="bold">Requires Windows Vista or later</emphasis>. This style disables displaying the dates
from the previous / next month in the current calendar.
</para>
</listitem></varlistentry>
<varlistentry><term>SHORTDAYS</term>
<listitem>
<para>
<emphasis role="bold">Requires Windows Vista or later</emphasis>. With this style, the month calendar uses the
shortest day name for the label of the day of the week column header.
</para>
</listitem></varlistentry>
<varlistentry><term>NOSELCHANGE</term>
<listitem>
<para>
<emphasis role="bold">Requires Windows Vista or later</emphasis>. With this style the selection does not
change when the user navigates to the next or previous month in the calendar. This style is needed for the
user to be able to select a range greater than what is currently displayed.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
A list of month calendar style keywords, separated by spaces, that was the style of the month calendar control
before the <emphasis role="italic">removeStyle</emphasis> method was invoked. The list could be empty if the
previous style was the default month calendar style.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
Sets the <xref linkend="dotSystemErrorCode"/>.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End MonthCalendar::removeStyle() -->
<section id="mthReplaceStyleClsMC" xreflabel="replaceStyle"><title>replaceStyle</title>
<indexterm><primary>replaceStyle</primary><secondary>MonthCalendar class</secondary></indexterm>
<indexterm><primary>MonthCalendar class</primary><secondary>replaceStyle</secondary></indexterm>
<programlisting>
<![CDATA[
>>--replaceStyle(--oldStyles--,--newStyles--)----><
]]>
</programlisting>
<para>
The <emphasis role="italic">replaceStyle</emphasis> method removes some existing month calendar styles and adds some
new styles.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The arguments are:
<variablelist>
<varlistentry><term>oldStyles [required]</term>
<listitem>
<para>
A list of 1 or more of the following month calendar style keywords, separated by spaces, case is not significant.
The styles specified will be removed from the month calendar.
</para>
<para>
<simplelist type='vert' columns='3'>
<member>DAYSTATE </member>
<member>MULTI </member>
<member>NOTODAY </member>
<member>NOCIRCLE </member>
<member>WEEKNUMBERS</member>
<member>NOTRAILING </member>
<member>SHORTDAYS </member>
<member>NOSELCHANGE</member>
</simplelist>
<variablelist>
<varlistentry><term>DAYSTATE</term>
<listitem>
<para>
The month calendar will send the GETDAYSTATE <xref linkend="ovvEvents"/> notification to request
information about which days should be displayed in bold. Use the
<xref linkend="mthConnectMonthCalendarEvent"/> method to connect this notification
with a method in the Rexx dialog object.
</para>
</listitem></varlistentry>
<varlistentry><term>MULTI</term>
<listitem>
<para>
This style allows the user to select a range of dates within the control. By default, the maximum range is one
week. The programmer changes the maximum range that can be selected by using the
<xref linkend="mthSetRangeClsDTP"/> method.
</para>
</listitem></varlistentry>
<varlistentry><term>NOTODAY</term>
<listitem>
<para>
The month calendar control will not display the <emphasis role="italic">today</emphasis> date at the bottom of the control.
</para>
</listitem></varlistentry>
<varlistentry><term>NOCIRCLE</term>
<listitem>
<para>
The month calendar control will not circle the <emphasis role="italic">today</emphasis> date at the bottom of
the control.
</para>
</listitem></varlistentry>
<varlistentry><term>WEEKNUMBERS</term>
<listitem>
<para>
The month calendar displays week numbers (1-52) to the left of each row of days. Week 1 is defined by
Microsoft as the first week that contains at least four days.
</para>
</listitem></varlistentry>
<varlistentry><term>NOTRAILING</term>
<listitem>
<para>
<emphasis role="bold">Requires Windows Vista or later</emphasis>. This style disables displaying the dates
from the previous / next month in the current calendar.
</para>
</listitem></varlistentry>
<varlistentry><term>SHORTDAYS</term>
<listitem>
<para>
<emphasis role="bold">Requires Windows Vista or later</emphasis>. With this style, the month calendar uses the
shortest day name for the label of the day of the week column header.
</para>
</listitem></varlistentry>
<varlistentry><term>NOSELCHANGE</term>
<listitem>
<para>
<emphasis role="bold">Requires Windows Vista or later</emphasis>. With this style the selection does not
change when the user navigates to the next or previous month in the calendar. This style is needed for the
user to be able to select a range greater than what is currently displayed.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term>newStyles [required]</term>
<listitem>
<para>
A list of 1 or more month calendar style keywords, separated by spaces, case is not significant. The styles
specified will be added to the month calendar. The acceptable keywords are the same as those for the <emphasis
role="italic">oldStyles</emphasis> argument above.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
A list of month calendar style keywords, separated by spaces, that was the style of the month calendar control
before the <emphasis role="italic">replaceStyle</emphasis> method was invoked. The list could be empty if the
previous style was the default month calendar style.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
The <emphasis role="italic">replaceStyle</emphasis> method is essentially a combination of the
<xref linkend="mthRemoveStyleClsMC"/> and <xref linkend="mthAddStyleClsMC"/> methods into
one convenience method.
</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>
This example checks if the Rexx program is running on a Vista or later system. If it is, it removes the NOTODAY and
NOCIRCLE styles and adds the Vista specific, NOSELCHANGE, SHORTDAYS, and NOTRAILING styles.
<programlisting>
<![CDATA[
::method initDialog
...
if .OS~isAtLeastVista then do
mc = self~newMonthCalendar(IDC_MC)
mc~replaceStyle("NOTODAY NOCIRCLE", "NOSELCHANGE SHORTDAYS NOTRAILING")
end
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End MonthCalendar::replaceStyle() -->
<section id="mthSetCalendarBorder" xreflabel="setCalendarBorder"><title>setCalendarBorder</title>
<indexterm><primary>setCalendarBorder</primary></indexterm>
<indexterm><primary>MonthCalendar class</primary><secondary>setCalendarBorder</secondary></indexterm>
<programlisting>
<![CDATA[
>>--setCalendarBorder(--+----------+--)----------><
+--pixels--+
]]>
</programlisting>
<para>
Sets the size, in pixels, of the month calendar's border.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The single argument is:
<variablelist>
<varlistentry><term>pixels [optional]</term>
<listitem>
<para>
The size to set the border to, in pixels. If <emphasis role="italic">pixels</emphasis> is omitted, the border is
set to the default value specified by the theme, or zero if themes are not being used.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
Returns 0, always.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
<emphasis role="bold">Requires Windows Vista or later</emphasis>.
</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 sets the calendar border to a very large size and then resizes the calendar to its optimal size:
<programlisting>
<![CDATA[
::method sizeCalendar private
use strict arg calendar
calendar~setCalendarBorder(32)
r = .Rect~new
if \ calendar~getMinRect(r) then return 0
calendar~resizeTo(.Size~new(r~right, r~bottom))
...
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End MonthCalendar::setCalendarBorder() -->
<section id="mthSetCALID" xreflabel="setCALID"><title>setCALID</title>
<indexterm><primary>setCALID</primary></indexterm>
<indexterm><primary>MonthCalendar class</primary><secondary>setCALID</secondary></indexterm>
<programlisting>
<![CDATA[
>>--setCALID(--calID--)--------------------------><
]]>
</programlisting>
<para>
Sets the calendar ID for the calendar.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The single argument is:
<variablelist>
<varlistentry><term>calID [required]</term>
<listitem>
<para>
A single keyword specifying the calendar ID to use. The keywords are case insensitive. The keywords are listed in
the following table:
</para>
<table id="tblCalendarIDKeywords" frame="all">
<title>Calendar ID Keywords</title>
<tgroup cols="2">
<colspec colwidth="1*" />
<colspec colwidth="2*" />
<thead>
<row>
<entry>ID Keyword</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>GREGORIAN</entry>
<entry>Gregorian (localized)</entry>
</row>
<row>
<entry>GREGORIAN_US</entry>
<entry>Gregorian (English strings always</entry>
</row>
<row>
<entry>JAPAN</entry>
<entry>Japanese Emperor Era</entry>
</row>
<row>
<entry>TAIWAN</entry>
<entry>Taiwan calendar</entry>
</row>
<row>
<entry>KOREA</entry>
<entry>Korean Tangun Era</entry>
</row>
<row>
<entry>HIJRI</entry>
<entry>Hijri (Arabic Lunar)</entry>
</row>
<row>
<entry>THAI</entry>
<entry>Thai</entry>
</row>
<row>
<entry>HEBREW</entry>
<entry>Hebrew (Lunar)</entry>
</row>
<row>
<entry>GREGORIAN_ME_FRENCH</entry>
<entry>Gregorian Middle East French</entry>
</row>
<row>
<entry>GREGORIAN_ARABIC</entry>
<entry>Gregorian Arabic</entry>
</row>
<row>
<entry>CAL_GREGORIAN_XLIT_ENGLISH</entry>
<entry>Gregorian transliterated English</entry>
</row>
<row>
<entry>CAL_GREGORIAN_XLIT_FRENCH</entry>
<entry>Gregorian transliterated French</entry>
</row>
<row>
<entry>UMALQURA</entry>
<entry>Um Al Qura (Arabic lunar) calendar </entry>
</row>
</tbody></tgroup>
</table>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
Returns 0, always.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
<emphasis role="bold">Requires Windows Vista or later</emphasis>.
</para>
<para>
Raises syntax errors when incorrect arguments are detected.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End MonthCalendar::setCALID() -->
<section id="mthSetColorClsMonthCalendar" xreflabel="setColor"><title>setColor</title>
<indexterm><primary>setColor</primary></indexterm>
<indexterm><primary>MonthCalendar class</primary><secondary>setColor</secondary></indexterm>
<programlisting>
<![CDATA[
>>--setColor(--which--,--color--)----------------><
]]>
</programlisting>
<para>
Sets the color for a given part of a month calendar control.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The arguments are:
<variablelist>
<varlistentry><term>which [required]</term>
<listitem>
<para>
Specifies which part of the calendar will have its coler set. Exactly one of the following keywords must be used,
case is not significant:
</para>
<para>
<simplelist type='vert' columns='3'>
<member>BACKGROUND </member>
<member>MONTHBK </member>
<member>TEXT </member>
<member>TITLEBK </member>
<member>TITLETEXT </member>
<member>TRAILINGTEXT</member>
</simplelist>
<variablelist>
<varlistentry><term>BACKGROUND</term>
<listitem>
<para>
Set the background color displayed between months.
</para>
</listitem></varlistentry>
<varlistentry><term>MONTHBK</term>
<listitem>
<para>
Set the background color displayed within the month.
</para>
</listitem></varlistentry>
<varlistentry><term>TEXT</term>
<listitem>
<para>
Set the color used to display text within a month.
</para>
</listitem></varlistentry>
<varlistentry><term>TITLEBK</term>
<listitem>
<para>
Set the background color displayed in the calendar's title.
</para>
</listitem></varlistentry>
<varlistentry><term>TITLETEXT</term>
<listitem>
<para>
Set the color used to display text within the calendar's title.
</para>
</listitem></varlistentry>
<varlistentry><term>TRAILINGTEXT</term>
<listitem>
<para>
Set the color used to display header day and trailing day text. Header and trailing days are the days
from the previous and following months that appear on the current month calendar.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term>color [required]</term>
<listitem>
<para>
The color, specified as a COLORREF, to set the specified calendar part.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
On success, returns the previouse color, as a COLORREF, for the part of the month calendar control specified.
Returns CLR_INVALID on error.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
The <xref linkend="clsImage"/> class has a number of convenience methods for working with COLORREFs,
including the <xref linkend="mthColorRef"/> method that explains what a COLORREF is.
</para>
<para>
The <emphasis role="italic">colorRef</emphasis> method can be used to test the return for error. I.e.:
<computeroutput>.Image~colorRef(CLR_INVALID)</computeroutput>. (An error is not very likely.)
</para>
<para>
Note that many of the underlying dialog controls ignore their color settings when visual themes are enabled, unless
the theme is Windows Clasic. This is the case for the month calendar control. Setting any of the calendar part
colors will have no effect, except in the Windows Classic theme.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect arguments are detected.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example sets the color for the TEXT calendar part to blue and prints out the RGB values for the previous color.
<programlisting>
<![CDATA[
monthCalendar = self~newMonthCalendar(IDC_MC_HOLIDAYS)
invalid = .Image~colorRef(CLR_INVALID)
-- Blue
color = .Image~colorRef(255, 0, 0)
oldColor = monthCalendar~setColor("TEXT", color)
if oldColor == invalid then do
-- Fill in with some error routine.
say 'setColor() failed.'
end
else do
R = .Image~getRValue(oldColor)
G = .Image~getGValue(oldColor)
B = .Image~getBValue(oldColor)
say 'The old color for "TEXT" was:('R',' G',' B')'
end
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End MonthCalendar::setColor() -->
<section id="mthSetCurrentView" xreflabel="setCurrentView"><title>setCurrentView</title>
<indexterm><primary>setCurrentView</primary></indexterm>
<indexterm><primary>MonthCalendar class</primary><secondary>setCurrentView</secondary></indexterm>
<programlisting>
<![CDATA[
>>--setCurrentView(--view--)---------------------><
]]>
</programlisting>
<para>
Sets the view for a month calendar control.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The single required argument is:
<variablelist>
<varlistentry><term>view [required]</term>
<listitem>
<para>
The <emphasis role="italic">view</emphasis> argument must be exactly one of the following keywords, case is not
significant:
</para>
<para>
<simplelist type='vert' columns='4'>
<member>MONTHLY</member>
<member>ANNUAL </member>
<member>DECADE </member>
<member>CENTURY</member>
</simplelist>
<variablelist>
<varlistentry><term>MONTHLY</term>
<listitem>
<para>
Monthly view.
</para>
</listitem></varlistentry>
<varlistentry><term>ANNUAL</term>
<listitem>
<para>
Annual view.
</para>
</listitem></varlistentry>
<varlistentry><term>DECADE</term>
<listitem>
<para>
Decade view.
</para>
</listitem></varlistentry>
<varlistentry><term>CENTURY</term>
<listitem>
<para>
Century view.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
Returns true on success, false on error.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect arguments are detected.
</para>
<para>
<emphasis role="bold">Requires Windows Vista or later</emphasis>.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End MonthCalendar::setCurrentView() -->
<section id="mthSetDayState" xreflabel="setDayState"><title>setDayState</title>
<indexterm><primary>setDayState</primary></indexterm>
<indexterm><primary>MonthCalendar class</primary><secondary>setDayState</secondary></indexterm>
<programlisting>
<![CDATA[
>>--setDayState(--dayStates--)-------------------><
]]>
</programlisting>
<para>
Sets the day states for all months that are currently visible within a month calendar control.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The single argument is:
<variablelist>
<varlistentry><term>dayStates [required]</term>
<listitem>
<para>
An array of <xref linkend="clsDayState"/> objects. The array must not be sparse and can not contain
more items than the number of currently visible months in the calendar. Index 1 in the array should contain the
<computeroutput>DayState</computeroutput> object for the first visible month in the calendar. Each consecutive
index contains the <computeroutput>DayState</computeroutput> object for the next visible month, with the last
index in the array containing the <computeroutput>DayState</computeroutput> object for the last visible month in
the calendar.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
Returns true on success, false on error.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
A month calendar uses a day state to determine how to display individual dates in a month. The day state specifies
which days should be bolded. The month calendar must have the <xref linkend="mthCreateMonthCalendar"/>
style or setting the day state has no effect. The programmer must use the
<xref linkend="clsDayState"/> class to create the day state objects.
</para>
<para>
The number of elements in <emphasis role="italic">dayStates</emphasis> must equal the return value from
<xref linkend="mthGetMonthRange"/> when used with the PARTIALLY keyword argument. That is, <emphasis
role="italic">dayStates</emphasis> must contain values that correspond with all months currently in the control's
display, in chronological order. This includes the two months that may be partially displayed before the first month
and after the last month.
</para>
<para>
Normally in a program using day states with a month calendar, the programmer will not have to continually invoke the
<emphasis role="italic">setDayState</emphasis> method as the user scrolls through the calendar. Rather he will
connect the <xref linkend="mthConnectMonthCalendar"/> event of the month calendar and return an array of day state
objects from the <xref linkend="evtMonthCalendarGETDAYSTATE"/> event handler. The month calendar then sets the day states
internally using the array.
</para>
<para>
However, the programmer will need to use the <emphasis role="italic">setDayState</emphasis> method to properly
display the dates when the dialog with a month caldendar is first shown.
</para> </listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect arguments are detected.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example sets the 15th and 30th of each month to be bolded in the month calendar when the dialog is first shown.
Notice that the day state for each month is the same (15th and 30th) so the code does not determine exactly which
months are showing, it only needs to determine how many months are showing.
<programlisting>
<![CDATA[
::method initDialog
expose calendar
calendar = self~newMonthCalendar(IDC_MC_PAYDAYS)
monthsShowing = .array~new
count = calendar~getMonthRange(monthsShowing, 'P')
dayStates = .array~new(count)
dayState = .DayState~new(15, 30)
do i = 1 to count
dayStates[i] = dayState
end
calendar~setDayState(dayStates)
...
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End MonthCalendar::setDayState() -->
<section id="mthSetDayStateQuick" xreflabel="setDayStateQuick"><title>setDayStateQuick</title>
<indexterm><primary>setDayStateQuick</primary></indexterm>
<indexterm><primary>MonthCalendar class</primary><secondary>setDayStateQuick</secondary></indexterm>
<programlisting>
<![CDATA[
>>--setDayStateQuick(--ds1-,-ds2-,-ds3--)--------><
]]>
</programlisting>
<para>
Sets the day states for 3 months that are currently visible (assumed) within a month calendar control. The <emphasis
role="italic">setDayStateQuick</emphasis> method is almost identical to the
<xref linkend="mthSetDayState"/> method except that the number of <xref linkend="clsDayState"/> state objects
is fixed at 3.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The arguments are:
<variablelist>
<varlistentry><term>ds1</term>
<listitem>
<para>
The <xref linkend="clsDayState"/> object for the first month.
</para>
</listitem></varlistentry>
<varlistentry><term>ds2</term>
<listitem>
<para>
The <xref linkend="clsDayState"/> object for the second month.
</para>
</listitem></varlistentry>
<varlistentry><term>ds3</term>
<listitem>
<para>
The <xref linkend="clsDayState"/> object for the third month.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
xx
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
A month calendar uses a day state to determine how to display individual dates in a month. The day state specifies
which days should be bolded. The month calendar must have the <xref linkend="mthCreateMonthCalendar"/>
style or setting the day state has no effect. The programmer must use the
<xref linkend="clsDayState"/> class to create the day state objects.
</para>
<para>
The most common use case for a month calendar is to display 1 month. In this case, when setting the day states for
the calendar, exactly 3 monts of day state objects are needed, (previouse, current, and next months.) The <emphasis
role="italic">setDayStateQuick</emphasis> is simply a short cut method to take advantage of this foreknowledge.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect arguments are detected.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example sets the day states for the month calendar when the dialog is initially displayed. Since the programmer
knows the calendar is set to only display 1 month, she knows that she need exactly 3 day state objects. 1 for the
displayed month, and 1 each for the leading and trailing days of the previous and next months:
<programlisting>
<![CDATA[
::method initDialog
expose calendar
calendar = self~newMonthCalendar(IDC_MC_PAYDAYS)
dayState = .DayState~new(15, 30)
calendar~setDayStateQuick(dayState, dayState, dayState)
...
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End MonthCalendar::setDayStateQuick() -->
<section id="mthSetFirstDayOfWeek" xreflabel="setFirstDayOfWeek"><title>setFirstDayOfWeek</title>
<indexterm><primary>setFirstDayOfWeek</primary></indexterm>
<indexterm><primary>MonthCalendar class</primary><secondary>setFirstDayOfWeek</secondary></indexterm>
<programlisting>
<![CDATA[
>>--setFirstDayOfWeek(--firstDay--)--------------><
]]>
</programlisting>
<para>
Sets the first day of the week for the month calendar control.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The single required argument is:
<variablelist>
<varlistentry><term>firstDay [required]</term>
<listitem>
<para>
Which day is to be the first day of the week. This can either be the name of the day (Monday, Tuesday, etc., case
insignificant) or the number of the day (0 for Monday, 1 for Tuesday, etc..)
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
A <computeroutput>Directory</computeroutput> object with information concerning the previous first day of the week.
This is the same information as returned by the <xref linkend="mthGetFirstDayOfWeek"/>
method.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
If the first day of the week is set to anything other than the default, which is the locale dependent first day of
the week, the control will no longer automatically update first-day-of-the-week changes based on locale changes.
</para>
<para>
The returned <computeroutput>Directory</computeroutput> object will contain the following indexes with information
concerning ther previous first day of the week:
</para>
<variablelist>
<varlistentry><term>DAY</term>
<listitem>
<para>
The numerical first day of the week (0 for Monday, 1 for Tuesday, etc..)
</para>
</listitem></varlistentry>
<varlistentry><term>USINGLOCALE</term>
<listitem>
<para>
True if the calendar is using the localized first day of the week, false if the first day of the week has been set
to something other than the localized first day of the week.
</para>
</listitem></varlistentry>
<varlistentry><term>DAYNAME</term>
<listitem>
<para>
The english name of the day corresponding to first day of the week.
</para>
</listitem></varlistentry>
</variablelist>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect arguments are detected.
</para>
<para>
Sets the <xref linkend="dotSystemErrorCode"/>.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End MonthCalendar::setFirstDayOfWeek() -->
<section id="mthSetMaxSelection" xreflabel="setMaxSelection"><title>setMaxSelection</title>
<indexterm><primary>setMaxSelection</primary></indexterm>
<indexterm><primary>MonthCalendar class</primary><secondary>setMaxSelection</secondary></indexterm>
<programlisting>
<![CDATA[
>>--setMaxSelection(--count--)-------------------><
]]>
</programlisting>
<para>
Sets the maximum number of days that can be selected in a month calendar control.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The single required argument is:
<variablelist>
<varlistentry><term>count [required]</term>
<listitem>
<para>
The maximum number of days that can be selected.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
Returns true on success, otherwise false.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
This method will fail if the month calendar control does not have the multi-select style.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect arguments are detected.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End MonthCalendar::setMaxSelection() -->
<section id="mthSetMonthDelta" xreflabel="setMonthDelta"><title>setMonthDelta</title>
<indexterm><primary>setMonthDelta</primary></indexterm>
<indexterm><primary>MonthCalendar class</primary><secondary>setMonthDelta</secondary></indexterm>
<programlisting>
<![CDATA[
>>--setMonthDelta(--amount--)--------------------><
]]>
</programlisting>
<para>
Sets the number of months that the month calendar control moves its display when the user clicks a scroll button. This
is called the scroll rate.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The single required argument is:
<variablelist>
<varlistentry><term>amount [required]</term>
<listitem>
<para>
The number of months to be set as the month calendar's scroll rate. If <emphasis role="italic">amount</emphasis>
is zero, the month delta is reset to the default. The defualt is the number of months displayed in the month
calendar control.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
Returns the previous scroll rate. If the scroll rate was not previously set, the return value is zero
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
The PAGE UP and PAGE DOWN keys, (<computeroutput>.VK~PRIOR</computeroutput> and
<computeroutput>.VK~NEXT</computeroutput> of the <xref linkend="clsVK"/> class,) change the selected month by one,
regardless of the number of months displayed or the value set by <emphasis role="italic">setMonthDelta</emphasis>.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect arguments are detected.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End MonthCalendar::setMonthDelta() -->
<section id="mthSetRangeClsMC" xreflabel="setRange"><title>setRange</title>
<indexterm><primary>setRange</primary><secondary>MonthCalendar class</secondary></indexterm>
<indexterm><primary>MonthCalendar class</primary><secondary>setRange</secondary></indexterm>
<programlisting>
<![CDATA[
>>--setRange(--dates--)--------------------------><
]]>
</programlisting>
<para>
Sets the minimum and maximum allowable dates for the month calendar control.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The single required argument is:
<variablelist>
<varlistentry><term>dates [required]</term>
<listitem>
<para>
An array of <computeroutput>DateTime</computeroutput> objects used to set the minimum and maximum dates. The
<computeroutput>DateTime</computeroutput> object at index 1 sets the minimum date and the
<computeroutput>DateTime</computeroutput> object at index 2 sets the maximum date.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
xx
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
The array must contain at least one of the indexes. If it contains neither, and exceptions is raised. If one of the
array indexes is empty, then the corresponding date is not set. The time portion of the
<computeroutput>DateTime</computeroutput> object(s) is ignored.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect arguments are detected.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example sets a month calendar to only show the months of 2011:
<programlisting>
<![CDATA[
::method initDialog
expose calendar
calendar = self~newMonthCalendar(IDC_MC_HOLIDAYS)
...
-- Restrict the calendar so that it only displays the year 2011.
start = .DateTime~fromStandardDate("20110101")
end = .DateTime~fromStandardDate("20111231")
calendar~setRange(.array~of(start, end))
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End MonthCalendar::setRange() -->
<section id="mthSetSelectionRange" xreflabel="setSelectionRange"><title>setSelectionRange</title>
<indexterm><primary>setSelectionRange</primary></indexterm>
<indexterm><primary>MonthCalendar class</primary><secondary>setSelectionRange</secondary></indexterm>
<programlisting>
<![CDATA[
>>--setSelectionRange(--dates--)-----------------><
]]>
</programlisting>
<para>
Sets the selection for a multi-selection month calendar control to a given date range.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The single required argument is:
<variablelist>
<varlistentry><term>dates [required]</term>
<listitem>
<para>
An <computeroutput>Array</computeroutput> object containg two <computeroutput>DateTime</computeroutput> objects.
The <computeroutput>DateTime</computeroutput> object at index 1 must be the starting date of the selection and the
<computeroutput>DateTime</computeroutput> object at index 2 must be the ending date of the selection. The time
portion of the <computeroutput>DateTime</computeroutput> object is ignored.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
Returns true on success, false on error.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
This method will fail if the month calendar does not have the multi-selection style.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect arguments are detected.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End MonthCalendar::setSelectionRange() -->
<section id="mthSetToday" xreflabel="setToday"><title>setToday</title>
<indexterm><primary>setToday</primary></indexterm>
<indexterm><primary>MonthCalendar class</primary><secondary>setToday</secondary></indexterm>
<programlisting>
<![CDATA[
>>--setToday(--+--------+--)---------------------><
+--date--+
]]>
</programlisting>
<para>
Sets the <emphasis role="italic">today</emphasis> selection for a month calendar control.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The single optional argument is:
<variablelist>
<varlistentry><term>date [optional]</term>
<listitem>
<para>
A <computeroutput>DateTime</computeroutput> object that contains the date to set the <emphasis
role="italic">today</emphasis> selection to. The time portion of the object is ignored. If this argument is
omitted, the month calendar reverts to the default setting for the <emphasis role="italic">today</emphasis>
selection.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
Returns 0, always.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
When <emphasis role="italic">today</emphasis> is set to anything other than the default, then these conditions
apply:
<itemizedlist>
<listitem>
<para>
The month calendar will not automatically update the <emphasis role="italic">today</emphasis> selection when time
passes midnight of the current day.
</para>
</listitem>
<listitem>
<para>
The month calendar will not automatically update its display based on locale changes.
</para>
</listitem>
</itemizedlist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect arguments are detected.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
The following example sets the <emphasis role="italic">today</emphasis> selection to tomorrow.
<programlisting>
<![CDATA[
calendar = self~newMonthCalendar(IDC_MC_PAYDAYS)
-- Pretend it is the day after tomorrow:
date = .DateTime~today
calendar~setToday(date~addDays(2))
...
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End MonthCalendar::setToday() -->
<section id="mthSizeRectToMin" xreflabel="sizeRectToMin"><title>sizeRectToMin</title>
<indexterm><primary>sizeRectToMin</primary></indexterm>
<indexterm><primary>MonthCalendar class</primary><secondary>sizeRectToMin</secondary></indexterm>
<programlisting>
<![CDATA[
>>--sizeRectToMin(--rect--)----------------------><
]]>
</programlisting>
<para>
Calculates how many calendars will fit in the given rectangle, and then returns the minimum size that a rectangle
needs to be to fit that number of calendars.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The single required argument is:
<variablelist>
<varlistentry><term>rext [required] [in / out]</term>
<listitem>
<para>
A <xref linkend="clsRect"/> object that, on entry, describes a region that is greater than or equal to
the size necessary to fit the desired number of calendars. When this method returns, the
<computeroutput>rect</computeroutput> object will contain the minimum size needed for this number of calendars.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
Returns 0, always.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect arguments are detected.
</para>
<para>
<emphasis role="bold">Requires Windows Vista or later</emphasis>.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End MonthCalendar::sizeRectToMin() -->
<section id="clsDayState" xreflabel="DayState"><title>DayState Class</title>
<indexterm><primary>DayState class</primary></indexterm>
<para>
A <computeroutput>DayState</computeroutput> object represents the state of each day in a month. It is a specialty
class used by the <xref linkend="clsMonthCalendar"/> class when the month calendar needs to reply
to the <xref linkend="evtMonthCalendarGETDAYSTATE"/> event.
</para>
<para>
Each <computeroutput>DayState</computeroutput> object contains a single value. The value encodes the state of each day
in a format understood by the <xref linkend="ovvUnderlying"/> Windows month calendar control. The
state of a single day is a binary value. I.e., on or off, true or false, special or not special, however it is
convenient for the programmer to think of. When the state of a day is on, the month calendar displays that day in
bold.
</para>
<section id="sctMethodsDayState"><title>Method Table</title>
<para>
The following table lists the class and instance methods of the <computeroutput>DayState</computeroutput> class:
<table id="tblMethodsDayState" frame="all"> <title>DayState Class Method Reference</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">Class Methods</emphasis></entry>
</row>
<row>
<entry><xref linkend="mthNewClsDayState"/></entry>
<entry>Instantiates a new <computeroutput>DayState</computeroutput> object and sets the state of each day.</entry>
</row>
<row>
<entry align="center"><emphasis role="bold">Instance Methods</emphasis></entry>
<entry align="center"><emphasis role="bold">Instance Methods</emphasis></entry>
</row>
<row>
<entry><xref linkend="mthValue"/></entry>
<entry>Returns the <emphasis role="italic">value</emphasis> of the <computeroutput>DayState</computeroutput> object.</entry>
</row>
</tbody></tgroup>
</table>
</para>
</section>
<section id="mthNewClsDayState" xreflabel="new"><title>new (Class Method)</title>
<indexterm><primary>new</primary><secondary>DayState class</secondary></indexterm>
<indexterm><primary>DayState class</primary><secondary>new</secondary></indexterm>
<programlisting>
<![CDATA[
+--,-----+
V |
>>--new(---dayNum--+--)--------------------------><
]]>
</programlisting>
<para>
Instantiates a new <computeroutput>DayState</computeroutput> object and sets the state of each day.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The arguments are:
<variablelist>
<varlistentry><term>dayNum [optional]</term>
<listitem>
<para>
A single <emphasis role="italic">dayNum</emphasis> argument is the number of a day within a month whose state
should be turned <emphasis role="italic">on</emphasis>. If there are no arguments, none of the days in the month
are turned on. The arguments can repeat any number of times, but each argument must be a whole number within the
range of 1 to 32, inclusive.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
A new <computeroutput>DayState</computeroutput> object.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect arguments are detected.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example constructs a day state for an application that displays the author's birth date in a
<xref linkend="clsMonthCalendar"/> calendar control in bold. All other days of the year are displayed
without emphasis.
<programlisting> <![CDATA[
::method getProperDayState private
use strict arg date
if date~orderedDate~substr(3, 2) == 07, date~orderedDate~right(2) == 14 then
return .DayState~new(14)
else
return .DayState~new
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End DayState::new() -->
<section id="mthValue" xreflabel="value"><title>value</title>
<indexterm><primary>value</primary></indexterm>
<indexterm><primary>DayState class</primary><secondary>value</secondary></indexterm>
<programlisting>
<![CDATA[
>>--value----------------------------------------><
]]>
</programlisting>
<para>
The <emphasis role="italic">value</emphasis> method returns the encoded value of the
<computeroutput>DayState</computeroutput> 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>
The return is a number that encodes the state of every day within a month.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
There is probably no practical use of this method for the programmer, other than perhaps curiosity. The method is
used by the interpreter to get the encoded numerical value of a <computeroutput>DayState</computeroutput> object and
send that number to the underlying month calendar control.
</para>
<para>
For those curious, the encoding is essentially a bit field. Each bit, 1 through 31 represents the state of the
corresponding day in a month. If the bit is on, the month calendar displays that day in bold. If the bit is not on,
the day is displayed normally.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect arguments are detected.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example is for the curious and displays the bit encoding of a day state value:
<programlisting>
<![CDATA[
dayState = .DayState~new(1, 4, 17)
say 'dayState value:' dayState~value 'binary form:' dayState~value~d2x~x2b
/* Output would be:
dayState value: 65545 binary form: 00010000000000001001
*/
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End DayState::value() -->
</section> <!-- End DayState Class -->
<section id="clsDayStates" xreflabel="DayStates"><title>DayStates Class</title>
<indexterm><primary>DayStates class</primary></indexterm>
<para>
A <computeroutput>DayStates</computeroutput> object is a sequential collection of
day <xref linkend="clsDayState"/> objects. It is a speciality class used to construct the proper reply
value for the <xref linkend="evtMonthCalendarGETDAYSTATE"/> event of the
<xref linkend="clsMonthCalendar"/> calendar control.
</para>
<para>
The primary purpose of the <computeroutput>DayStates</computeroutput> class is to supply the buffer of day states that
is used to reply to the get day state event. But, the class also has methods that allow the programmer to build a
cache of day state objects. Then during the get day state event, the programmer can request a buffer of some number of
the cached day states.
</para>
<section id="sctMethodsDayStates"><title>Method Table</title>
<para>
The following table lists the class and instance methods of the <computeroutput>DayStates</computeroutput> class:
<table id="tblMethodsDayStates" frame="all"> <title>DayStates Class Method Reference</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">Class Methods</emphasis></entry>
</row>
<row>
<entry><xref linkend="mthNewClsDayStates"/></entry>
<entry>Instantiates a new <computeroutput>DayStates</computeroutput> object with a cache of <computeroutput>DayState</computeroutput> objects.</entry>
</row>
<row>
<entry><xref linkend="mthMakeDayStateBuffer"/></entry>
<entry>Returns a buffer of the specified <computeroutput>DayState</computeroutput> objects</entry>
</row>
<row>
<entry><xref linkend="mthQuickDayStateBuffer"/></entry>
<entry>Returns a buffer constructed from the 3 <computeroutput>DayState</computeroutput> objects specified.</entry>
</row>
<row>
<entry align="center"><emphasis role="bold">Attributes</emphasis></entry>
<entry align="center"><emphasis role="bold">Attributes</emphasis></entry>
</row>
<row>
<entry><xref linkend="atrEndMonth"/></entry>
<entry>Reflects the last month in the cache of <computeroutput>DayState</computeroutput> objects.</entry>
</row>
<row>
<entry><xref linkend="atrStartMonth"/></entry>
<entry>Reflects the first month in the cache of <computeroutput>DayState</computeroutput> objects.</entry>
</row>
<row>
<entry align="center"><emphasis role="bold">Instance Methods</emphasis></entry>
<entry align="center"><emphasis role="bold">Instance Methods</emphasis></entry>
</row>
<row>
<entry><xref linkend="mthPutMonth"/></entry>
<entry>Puts a single <computeroutput>DayState</computeroutput> object in the cache.</entry>
</row>
<row>
<entry><xref linkend="mthPutYear"/></entry>
<entry>Puts an entire year of <computeroutput>DayState</computeroutput> objects in the cache.</entry>
</row>
<row>
<entry><xref linkend="mthGetDayState"/></entry>
<entry>Returns the specified <computeroutput>DayState</computeroutput> object from the cache.</entry>
</row>
<row>
<entry><xref linkend="mthGetDayStateBuffer"/></entry>
<entry>Returns a day state buffer constructed from the specified months in the cache</entry>
</row>
</tbody></tgroup>
</table>
</para>
</section>
<section id="mthMakeDayStateBuffer" xreflabel="makeDayStateBuffer"><title>makeDayStateBuffer (Class method)</title>
<indexterm><primary>makeDayStateBuffer</primary></indexterm>
<indexterm><primary>DayStates class</primary><secondary>makeDayStateBuffer</secondary></indexterm>
<programlisting>
<![CDATA[
>>--makeDayStateBuffer(--dayStates--)------------><
]]>
</programlisting>
<para>
Returns a buffer of the specified day states. This buffer can be used for the return from the event handler for a
<xref linkend="evtMonthCalendarGETDAYSTATE"/> event.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The single argument is:
<variablelist>
<varlistentry><term>dayStates [required]</term>
<listitem>
<para>
An array of <xref linkend="clsDayState"/> objects.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The return is a day states buffer. The buffer is only useful as the reply to the GETDAYSTATE event of the month
calendar control.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
The <emphasis role="italic">dayStates</emphasis> array can not be sparse. The day state objects are assumed to be
sequential by the underlying month calendar control.
</para> </listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect arguments are detected.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example shows part of the implementation for a GETDAYSTATE event handler. Start with the month of the start
date requested, and then, for the number of months requested, a day state object is created and put into an array.
The <emphasis role="italic">makeDayStateBuffer</emphasis> method is invoked to get the proper buffer, which is
returned from the event handler.
<programlisting>
<![CDATA[
::method onGetDayState unguarded
use arg startDate, count, id, hwnd
-- Create the array to hold the .DayState objects.
dayStates = .array~new(count)
-- The calendar is restricted to a single year. We
-- know for our application, the month calendar always
-- requests 3 months, the partial month prior to the
-- current month showing, the current month, and the
-- partial month following the current month.
--
-- So, if the starting month is December, it can only
-- be the December prior to January of the current
-- year. It can not be the December of this year because
-- the calendar will not display January of next year.
-- Setting the month to 0 will produce a day state with
-- no days turned on, exactly what we want.
month = startDate~month
if month == 12 then month = 0
do i = 1 to count
dayStates[i] = self~getDayState(month + i - 1)
end
buffer = .DayStates~makeDayStateBuffer(dayStates)
return buffer
::method getDayState private
use strict arg month
select
when month == 1 then ds = .DayState~new(17)
when month == 2 then ds = .DayState~new(21)
when month == 3 then ds = .DayState~new
...
otherwise ds = .DayState~new
end
-- End select
return ds
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End DayStates::makeDayStateBuffer() -->
<section id="mthNewClsDayStates" xreflabel="new"><title>new (Class Method)</title>
<indexterm><primary>new</primary><secondary>DayStates class</secondary></indexterm>
<indexterm><primary>DayStates class</primary><secondary>new</secondary></indexterm>
<programlisting>
<![CDATA[
>>--new(--+-------------+--+---------+--)--------><
+--startYear--+ +-,-count-+
]]>
</programlisting>
<para>
Instantiates a new <computeroutput>DayStates</computeroutput> object and initalizes the cache of
<xref linkend="clsDayState"/> objects. Each day state in the is initialized with the state of every day
turned off.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The arguments are:
<variablelist>
<varlistentry><term>startYear [optional]</term>
<listitem>
<para>
Specifies the starting year for the cache. The default if this argument is omitted is two years prior to the
current year. The <emphasis role="italic">startYear</emphasis> is specified as the whole number year value,
e.g., 2011, 1988, 1492, etc..
</para>
</listitem></varlistentry>
<varlistentry><term>count [optional]</term>
<listitem>
<para>
The number of years to initialize the cache with. The default is 3 years.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The return is a new <computeroutput>DayStates</computeroutput> object.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
The cache of day state values in a day states object is always a whole number of years in size, and is always
sequential. I.e., 12 day state values for each year. As indicated, initially the state of every day is turned off.
The <xref linkend="mthPutMonth"/> and <xref linkend="mthPutYear"/> methods are used set
the day state values in the cache to values with the state of days turned on.
</para>
<para>
The <xref linkend="mthMakeDayStateBuffer"/> and
<xref linkend="mthQuickDayStateBuffer"/> class methods can be used to obtain a day states
buffer without initializing or using a cache.
</para> </listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details</emphasis></term>
<listitem>
<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 new <computeroutput>DayStates</computeroutput> object and initializes the cache to 10
years, with the start year one year prior to the current date. It then sets the state of July 4th of every year to
on:
<programlisting>
<![CDATA[
yr = (.DateTime~today~year - 1)
dayStates = .DayStates~new(yr, 10)
dayState = .DayState~new(4)
do 10
dayStates~putMonth(yr, 7, dayState)
yr += 1
end
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End DayStates::new() -->
<section id="mthQuickDayStateBuffer" xreflabel="quickDayStateBuffer"><title>quickDayStateBuffer (Class method)</title>
<indexterm><primary>quickDayStateBuffer</primary></indexterm>
<indexterm><primary>DayStates class</primary><secondary>quickDayStateBuffer</secondary></indexterm>
<programlisting>
<![CDATA[
>>--quickDayStateBuffer(--dayState1--,--dayState2--,--dayState3--)-------------><
]]>
</programlisting>
<para>
Returns a buffer for the 3 specified day states. This buffer can be used for the return from the event handler for a
<xref linkend="evtMonthCalendarGETDAYSTATE"/> event.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The arguments are the 3 <computeroutput>DayState</computeroutput> objects used to construct the buffer.
<variablelist>
<varlistentry><term>dayState1 [required]</term>
<listitem>
<para>
The first day state in the sequence of day states.
</para>
</listitem></varlistentry>
<varlistentry><term>dayState2 [required]</term>
<listitem>
<para>
The second day state in the sequence of day states.
</para>
</listitem></varlistentry>
<varlistentry><term>dayState3 [required]</term>
<listitem>
<para>
The third day state in the sequence of day states.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The return is a day states buffer. The buffer is only useful as the reply to the GETDAYSTATE event of the month
calendar control.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
Normally the month calendar control is sized to only display 1 month. With this display, a week prior to the month
and a week after the month are also shown. For this situation, when the underlying month calendar requests
information on how to display individual days through the
<xref linkend="evtMonthCalendarGETDAYSTATE"/> notification, it will always request 3 months. The
<emphasis role="italic">quickDayStateBuffer</emphasis> is a convenience method for this situation, which is the most
common request.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect arguments are detected.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example shows the event handler for the GETDAYSTATE notification in an application that shows the 1st and the
15th of each month in bold. The application always sizes the month calendar with 1 full month displayed. Because of
this, we know the count will be 3.
<programlisting>
<![CDATA[
::method onGetDayState unguarded
use arg startDate, count, id, hwnd
-- All months are the same, so we can ignore the start date.
ds = .DayState~new(1, 15)
return .DayStates~quickDayStateBuffer(ds, ds, ds)
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End DayStates::quickDayStateBuffer() -->
<section id="atrEndMonth" xreflabel="endMonth"><title>endMonth (Attribute)</title>
<indexterm><primary>endMonth</primary></indexterm>
<indexterm><primary>DayStates class</primary><secondary>endMonth</secondary></indexterm>
<programlisting>
<![CDATA[
>>--endMonth-------------------------------------><
]]>
</programlisting>
<para>
The <emphasis role="italic">endMonth</emphasis> attribute reflects the last month in the cache of
<xref linkend="clsDayState"/> objects. Its value is a <computeroutput>DateTime</computeroutput> object
whose date is the first of the last month and last year in the cache.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">endMonth get:</emphasis></term>
<listitem>
<para>
Returns a <computeroutput>DateTime</computeroutput> object whose date is the last month in the cache.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">endMonth set:</emphasis></term>
<listitem>
<para>
The <emphasis role="italic">endMonth</emphasis> attribute can not be set by the programmer. It is set internally by
the class.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
Since the cache always contains whole years, the date of the <emphasis role="italic">endMonth</emphasis> attribute
is always going to be 12/01. The real information will be the year of the <emphasis
role="italic">endMonth</emphasis> date. I.e., if the <xref linkend="atrStartMonth"/> attribute is
1/1/1990 and the <emphasis role="italic">endMonth</emphasis> attribute is 12/01/2010 then the cache contains 21
complete years of <computeroutput>DayState</computeroutput> objects.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End DayStates::endMonth() [attribute] -->
<section id="atrStartMonth" xreflabel="startMonth"><title>startMonth (Attribute)</title>
<indexterm><primary>startMonth</primary></indexterm>
<indexterm><primary>DayStates class</primary><secondary>startMonth</secondary></indexterm>
<programlisting>
<![CDATA[
>>--startMonth-----------------------------------><
]]>
</programlisting>
<para>
The <emphasis role="italic">startMonth</emphasis> attribute reflects the first month in the cache of
<xref linkend="clsDayState"/> objects. Its value is a <computeroutput>DateTime</computeroutput> object
whose date is the first of January of the first year in the cache.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">startMonth get:</emphasis></term>
<listitem>
<para>
Returns a <computeroutput>DateTime</computeroutput> object whose date is the first month in the cache.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">startMonth set:</emphasis></term>
<listitem>
<para>
The programmer can not set the <emphasis role="italic">startMonth</emphasis> attribute. It is set internally by the
class.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
Since the cache always contains whole years, the date of the <emphasis role="italic">startMonth</emphasis> attribute
is always going to be 1/1. The real information will be the year of the <emphasis
role="italic">startMonth</emphasis> date. I.e., if the <emphasis role="italic">startMonth</emphasis> attribute is
1/1/2010 and the <xref linkend="atrEndMonth"/> attribute is 12/01/2011 then the cache contains 2
complete years of <computeroutput>DayState</computeroutput> objects.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End DayStates::startMonth() [attribute] -->
<section id="mthGetDayState" xreflabel="getDayState"><title>getDayState</title>
<indexterm><primary>getDayState</primary></indexterm>
<indexterm><primary>DayStates class</primary><secondary>getDayState</secondary></indexterm>
<programlisting>
<![CDATA[
>>--getDayState(--dateTime--)--------------------><
]]>
</programlisting>
<para>
Retrieves the cached <xref linkend="clsDayState"/> object for the date specified.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The single argument is:
<variablelist>
<varlistentry><term>dateTime</term>
<listitem>
<para>
A <computeroutput>DateTime</computeroutput> object that specifies which <computeroutput>DayState</computeroutput>
object to retrieve. Only the month and the year of <emphasis role="italic">dateTime</emphasis> are relevant, the
day is ignored.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The value returned is the <computeroutput>DayState</computeroutput> object in the cache for the date specified, or
<computeroutput>.nil</computeroutput> if there is no day state in the cache for the date.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
Normally there is no need to get specific day state objects from the cache, the programmer usually wants a <emphasis
role="italic">buffer</emphasis> of day state objects. However this method can be of use in debugging by checking
what values are actually in the cache.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example expands on the example for the <xref linkend="mthPutYear"/> method by checking the values
of the <xref linkend="atrStartMonth"/> and <xref linkend="atrEndMonth"/> day state
objects.
<programlisting>
<![CDATA[
dayStates = .DayStates~new(2010, 3)
dayState = .DayState~new(7, 14, 21, 28)
do i = 2010 to 2012
year = .DateTime~fromStandardDate(i || 0101)
a = .array~new(12)
do j = 1 to 12
a[j] = dayState
end
dayStates~putYear(year, a)
end
s = dayStates~startMonth
e = dayStates~endMonth
say 'Start month day state value:' dayStates~getDayState(s)~value~d2x~x2b
say 'End month day state value: ' dayStates~getDayState(e)~value~d2x~x2b
::requires 'ooDialog.cls'
/* Output to the console would be:
Start month day state value: 1000000100000010000001000000
End month day state value: 1000000100000010000001000000
*/
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End DayStates::getDayState() -->
<section id="mthGetDayStateBuffer" xreflabel="getDayStateBuffer"><title>getDayStateBuffer</title>
<indexterm><primary>getDayStateBuffer</primary></indexterm>
<indexterm><primary>DayStates class</primary><secondary>getDayStateBuffer</secondary></indexterm>
<programlisting>
<![CDATA[
>>--getDayStateBuffer(--dateTime--,--count--)----><
]]>
</programlisting>
<para>
Creates a buffer from the cached <xref linkend="clsDayState"/> objects using the specified date and
<emphasis role="italic">count</emphasis>. This buffer can be used for the return from the event handler for a
<xref linkend="evtMonthCalendarGETDAYSTATE"/> event.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The arguments are:
<variablelist>
<varlistentry><term>dateTime [required]</term>
<listitem>
<para>
A <computeroutput>DateTime</computeroutput> object whose date is used as the starting point in the cache to fetch
the <computeroutput>DayState</computeroutput> objects.
</para>
</listitem></varlistentry>
<varlistentry><term>count [required]</term>
<listitem>
<para>
The number of <computeroutput>DayState</computeroutput> objects to use in the returned buffer.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The return is a day states buffer. The buffer is only useful as the reply to the GETDAYSTATE event of the month
calendar control.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
If some, or all, of the day state objects requested for the buffer are not in the cache, then a new
<computeroutput>DayState</computeroutput> object is create with the start of all days turned off and used. The cache
is not updated, it remains the same after the method returns.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example sets up a cache of <computeroutput>DayState</computeroutput> objects before the application dialog is
displayed. It then gets buffers from this cache during the
<xref linkend="evtMonthCalendarGETDAYSTATE"/> event to return from the event handler.
<programlisting> <![CDATA[
::class 'PaidHolidaysDlg' subclass ResDialog
::method init
expose dayStates
forward class (super) continue
dayStates = self~createDayStateCache
self~connectMonthCalendarEvent(IDC_MC_HOLIDAYS, "GETDAYSTATE", onGetDayState)
...
::method onGetDayState unguarded
expose dayStates
use arg startDate, count, id, hwnd
return dayStates~getDayStateBuffer(startDate, count)
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End DayStates::getDayStateBuffer() -->
<section id="mthPutMonth" xreflabel="putMonth"><title>putMonth</title>
<indexterm><primary>putMonth</primary></indexterm>
<indexterm><primary>DayStates class</primary><secondary>putMonth</secondary></indexterm>
<programlisting>
<![CDATA[
>>--putMonth(--dateTime--,--dayState--)----------><
]]>
</programlisting>
<para>
Puts a single <xref linkend="clsDayState"/> object into the cache.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The arguments are:
<variablelist>
<varlistentry><term>dateTime [required]</term>
<listitem>
<para>
A <computeroutput>DateTime</computeroutput> object whose date specifies the month in the cache to put the
<emphasis role="italic">dayState</emphasis>.
</para>
</listitem></varlistentry>
<varlistentry><term>dayState [required]</term>
<listitem>
<para>
The <computeroutput>DayState</computeroutput> object to put in the cache.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
There is no return value from this method.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
If a day state object already exists for the month specified, it is replaced by <emphasis
role="italic">dayState</emphasis>.
</para>
<para>
If the month specified by the <emphasis role="italic">dateTime</emphasis> argument does not yet exist in the cache,
then the cache is extended to include the year specified by <emphasis role="italic">dateTime</emphasis>. The month
specified is assigned the <emphasis role="italic">dayState</emphasis> argument and all other months in the extension
are assigned a <computeroutput>DayState</computeroutput> object with a value of 0, (all days are turned off.)
</para> </listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example shows how <emphasis role="italic">putMonth</emphasis> works. A
<computeroutput>DateTime</computeroutput> object with the date of 7/1/2012 is used for the month and a
<computeroutput>DayState</computeroutput> object is created with the 4th turned on. That will display July 4th 2012
bolded.
</para>
<para>
The output shows that before <emphasis role="italic">putMonth</emphasis> is invoked, the end month of the
day states object was December 2011. After <emphasis role="italic">putMonth</emphasis> is invoked, the end month is
December 2012. Adding July 2012 to the cache extended the entire year of 2012. All months other than July will have
all days in the month turned off.
<programlisting>
<![CDATA[
dayStates = .DayStates~new(2010, 2)
say "Day states end month:" dayStates~endMonth~standardDate
month = .DateTime~fromStandardDate(20120701)
dayState = .DayState~new(4)
dayStates~putMonth(month, dayState)
say "Day states end month:" dayStates~endMonth~standardDate
::requires "ooDialog.cls"
/* Output would be:
Day states end month: 20111201
Day states end month: 20121201
*/
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End DayStates::putMonth() -->
<section id="mthPutYear" xreflabel="putYear"><title>putYear</title>
<indexterm><primary>putYear</primary></indexterm>
<indexterm><primary>DayStates class</primary><secondary>putYear</secondary></indexterm>
<programlisting>
<![CDATA[
>>--putYear(--dateTime--,--dayStates--)----------><
]]>
</programlisting>
<para>
The <emphasis role="italic">putYear</emphasis> method adds a year of <xref linkend="clsDayState"/>
objects to the cache.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The arguments are:
<variablelist>
<varlistentry><term>dateTime [required]</term>
<listitem>
<para>
A <computeroutput>DateTime</computeroutput> object that specifies the year being added. Only the year portion of
the date is relevant. The day and month of the date are ignored.
</para>
</listitem></varlistentry>
<varlistentry><term>dayStates [required]</term>
<listitem>
<para>
An <computeroutput>array</computeroutput> of <computeroutput>DayState</computeroutput> objects that are the day
states for the months of the year being added. Only the indexes 1 through 12 are looked at. If the index contains
a day state object, that day state object is assigned to the corresponding month. If an index does not have a
value, then a day state object with a value of 0, (no days are turned on,) is assigned to the corresponding month.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
There is no return from this method.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
If the year specified already exists in the cache then that year is replaced by the day state objects specified int
the <emphasis role="italic">dayStates</emphasis> array.
</para>
<para>
If the year does not exist yet in the cache it is added. If adding the new year creates a gap in the sequential
order of years in the cache, then the gap is filled in using years with the state of all days turned off. In other
words, if the cache currently consists of the years 2008 through 2012 and the <emphasis
role="italic">putYear</emphasis> method is used to put the year 2016 in the cache, then the cache is also filled
with the years 2013 through 2015. Each year 2013 through 2015 have day state objects with the state of all days
turned off.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example creates a <computeroutput>DayStates</computeroutput> object with 3 years cached. In the application
that uses this, all months have the 7th, 14th, 21st, and 28th days displayed in bold. After instantiating the new
<computeroutput>DayStates</computeroutput> object, each year in the cache is updated with a
<computeroutput>DayState</computeroutput> object that turns the state of the 7th, 14th, 21st, and 28th on.
<programlisting>
<![CDATA[
dayStates = .DayStates~new(2010, 3)
dayState = .DayState~new(7, 14, 21, 28)
do i = 2010 to 2012
year = .DateTime~fromStandardDate(i || 0101)
a = .array~new(12)
do j = 1 to 12
a[j] = dayState
end
dayStates~putYear(year, a)
end
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End DayStates::putYear() -->
</section> <!-- End DayStates Class -->
</chapter> <!-- End MonthCalendar class -->