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

Download this file

mouse.xml    3572 lines (3322 with data), 135.5 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
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE section 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.
#
#########################################################################
-->
<section id="clsMouse" xreflabel="Mouse"><title>Mouse Class</title>
<indexterm><primary>Mouse class</primary></indexterm>
<para>
In Windows the mouse is one of the important user input devices for programs. A program receives mouse input in the
form of <xref linkend="ovvWindowMessages"/>s that are sent or posted to the windows of the program. In
addition the operating system provides a number of functions to work with the mouse. These functions allow the
programmer to change the mouse behavior, configure the mouse, change its appearence, etc..
</para>
<para>
<emphasis role="bold">Mouse Cursor:</emphasis> As the user moves the mouse across the screen, the operating system
paints a bitmap on the screen that gives the user feedback as to the position of the mouse. This bitmap is called the
<emphasis role="italic">mouse cursor</emphasis>. The cusor has a single pixel point in the bitmap called the <emphasis
role="italic">hot spot</emphasis>. The position of the hot spot is considered to be the position of the mouse. All
mouse messages are, normally, sent to the window beneath the hot spot, whether or not that window is acitve or has the
keyboard focus.
</para>
<para>
In the ooDialog framework, the <computeroutput>Mouse</computeroutput> class provides all the methods to work with the
mouse and the mouse cursor. Because all mouse messages are sent by the operating system to a single window, in
ooDialog each instantiated mouse object is affiliated with a specific window object. I.e., a specific dialog or dialog
control object.
</para>
<section id="sctMethodsMouse"><title>Method Table</title>
<para>
The following table lists the class and instance methods of the <computeroutput>Mouse</computeroutput> class:
<table id="tblMethodsMouse" frame="all"> <title>Mouse 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><link linkend="sctMouseConstantMethods">Constant Methods</link></entry>
<entry>The <computeroutput>Mouse</computeroutput> class provides a single <emphasis role="italic">constant</emphasis> value through the <computeroutput>::constant</computeroutput>directive.</entry>
</row>
<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="mthNewClsMouse"/></entry>
<entry>Instantiates a new mouse object.</entry>
</row>
<row>
<entry><xref linkend="mthDoubleClickTime"/></entry>
<entry>Retrieves the current double-click time for the mouse.</entry>
</row>
<row>
<entry><xref linkend="mthLoadCursor"/></entry>
<entry>Returns one of the shared pre-defined system cursors.</entry>
</row>
<row>
<entry><xref linkend="mthLoadCursorFromFile"/></entry>
<entry>Creates a cursor based on data from a file.</entry>
</row>
<row>
<entry><xref linkend="mthSetDoubleClickTime"/></entry>
<entry>Sets the double-click time for the mouse.</entry>
</row>
<row>
<entry><xref linkend="mthSwapButton"/></entry>
<entry>Reverses or restores the meaning of the left and right mouse buttons.</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="mthAppStarting"/></entry>
<entry>Sets the mouse cursor to the system's default <emphasis role="italic">application starting</emphasis> cursor, which is usually the standard arrow with a small hourglass.</entry>
</row>
<row>
<entry><xref linkend="mthArrow"/></entry>
<entry>Sets the mouse cursor to the system's <emphasis role="italic">default</emphasis> cursor, which is usually the arrow cursor.</entry>
</row>
<row>
<entry><xref linkend="mthCapture"/></entry>
<entry>Sets the mouse capture to the window of this mouse instance.</entry>
</row>
<row>
<entry><xref linkend="mthClipCursor"/></entry>
<entry>Restricts the cursor position to a rectangular area on the screen.</entry>
</row>
<row>
<entry><xref linkend="mthConnectEvent"/></entry>
<entry>Connects mouse related <xref linkend="ovvEvents"/> notifications to a method in the Rexx dialog.</entry>
</row>
<row>
<entry><xref linkend="mthCross"/></entry>
<entry>Sets the mouse cursor to the system's default <emphasis role="italic">high precision</emphasis> cursor, which is usually the crosshair cursor.</entry>
</row>
<row>
<entry><xref linkend="mthDragDetect"/></entry>
<entry>Used to determine if the user has started a drag operation.</entry>
</row>
<row>
<entry><xref linkend="mthGetCapture"/></entry>
<entry>Retrieves the window handle, if any, that currently has captured the mouse.</entry>
</row>
<row>
<entry><xref linkend="mthGetClipCursor"/></entry>
<entry>Retrieves the screen coordinates of the rectangular area to which the cursor is confined.</entry>
</row>
<row>
<entry><xref linkend="mthGetCursorPos"/></entry>
<entry>Retrieves the current cursor position in pixels as a <computeroutput>Point</computeroutput> object.</entry>
</row>
<row>
<entry><xref linkend="mthIsButtonDown"/></entry>
<entry>Determines if a mouse button is pressed.</entry>
</row>
<row>
<entry><xref linkend="mthNo"/></entry>
<entry>Sets the mouse cursor to the system's default <emphasis role="italic">not allowed</emphasis> cursor, which is usually a circle with a slash across it.</entry>
</row>
<row>
<entry><xref linkend="mthReleaseClipCursor"/></entry>
<entry>Releases the cursor so that it is free to move anywhere on the screen.</entry>
</row>
<row>
<entry><xref linkend="mthReleaseCapture"/></entry>
<entry>Releases the mouse capture from the window which had previously captured the mouse.</entry>
</row>
<row>
<entry><xref linkend="mthRestoreCursor"/></entry>
<entry>Restores the cursor for the window of this mouse instance.</entry>
</row>
<row>
<entry><xref linkend="mthSetCursor"/></entry>
<entry>Sets the cursor for the window of this mouse instance.</entry>
</row>
<row>
<entry><xref linkend="mthSetCursorPos"/></entry>
<entry>Moves the mouse cursor to the specified position.</entry>
</row>
<row>
<entry><xref linkend="mthShowCursor"/></entry>
<entry>Displays or hides the cursor.</entry>
</row>
<row>
<entry><xref linkend="mthTrackEvent"/></entry>
<entry>Initiates, or queries, mouse tracking behavior.</entry>
</row>
<row>
<entry><xref linkend="mthWait"/></entry>
<entry>Sets the mouse cursor to the system's default <emphasis role="italic">busy</emphasis> cursor, which is usually the hourglass cursor.</entry>
</row>
</tbody></tgroup>
</table>
</para>
</section>
<section id="sctMouseConstantMethods"><title>Constant Methods</title>
<indexterm><primary>constant methods</primary><secondary>Mouse class</secondary></indexterm>
<para>
The <computeroutput>Mouse</computeroutput> class provides a single <emphasis role="italic">constant</emphasis> value
through the use of the <computeroutput>::constant</computeroutput> directive. The constant is listed in the following
table.
</para>
<table id="tblConstantsMouse" frame="all"> <title>Mouse Class Constant Reference</title>
<tgroup cols="2">
<colspec colwidth="1*" /><colspec colwidth="3*" />
<thead>
<row>
<entry>Constant Symbol</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>HOVER_DEFAULT</entry>
<entry>The default hover time out. Can be used for the <emphasis role="italic">hoverTime</emphasis> argument in the <xref linkend="mthTrackEvent"/> method.</entry>
</row>
</tbody></tgroup>
</table>
</section>
<section id="mthNewClsMouse" xreflabel="new"><title>new (Class Method)</title>
<indexterm><primary>new</primary><secondary>Mouse class</secondary></indexterm>
<indexterm><primary>Mouse class</primary><secondary>new</secondary></indexterm>
<programlisting>
<![CDATA[
>>--new(--windowObj--)---------------------------><
]]>
</programlisting>
<para>
Instantiates a new <computeroutput>Mouse</computeroutput> object. Each mouse object is associated with a single
<xref linkend="ovvUnderlying"/> window, the window of the Rexx object used to instantiate the mouse
object.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The single argument is:
<variablelist>
<varlistentry><term>windowObj [required]</term>
<listitem>
<para>
A Rexx object that has an underlying Windows window. In all practical terms this is either a Rexx <xref
linkend="chpDialogObject"/> object or a Rexx dialog <xref linkend="chpDialogControlObject"/> object.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The return is a new <computeroutput>Mouse</computeroutput> object.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
The operating system sends all mouse related <xref linkend="ovvWindowMessages"/>s to the window the
mouse is over. Because of this, each Rexx mouse object is assoicated with a specific window. This is important for
the programmer to understand, especially when connecting mouse event notifications. Since all dialog controls are
windows, when the mouse is over a dialog, most messages go to one of the dialog controls that make up the dialog.
Therefore, if the programmer is interested is the mouse event notifications, much of the time the programmer will
need to use a mouse object associated with a dialog control, not a mouse associated with the dialog.
</para>
<para>
All mouse event notifications are connected through the <xref linkend="mthConnectEvent"/> method
of the <computeroutput>Mouse</computeroutput> class, not through one of the connect event methods 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 constructs a mouse object using the dialog object and then connects the double click mouse event to a
method in the dialog. When the user double clicks the primary mouse button on the background of the dialog, not on a
dialog control, the event handler is invoked:
<programlisting>
<![CDATA[
::method init
...
mouse = .Mouse~new(self)
mouse~connectEvent('LBUTTONDBLCLK', onDoubleClick)
...
::method onDoubleClick unguarded
use arg state, position, mouse
-- Do something ...
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Mouse::new() -->
<section id="mthDoubleClickTime" xreflabel="doubleClickTime"><title>doubleClickTime (Class Mehod)</title>
<indexterm><primary>doubleClickTime</primary></indexterm>
<indexterm><primary>Mouse class</primary><secondary>doubleClickTime</secondary></indexterm>
<programlisting>
<![CDATA[
>>--doubleClickTime------------------------------><
]]>
</programlisting>
<para>
Retrieves the current double-click time for the mouse.
</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>
The return is the current double-click time in milliseconds.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
A double-click is a series of two clicks of the mouse button, the second occurring within a specified time after the
first. The double-click time is the maximum number of milliseconds that may occur between the first and second click
of a double-click. The double-click time is a system-wide parameter.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This simple example prints the double-click time to the screen:
<programlisting>
<![CDATA[
::method showDoubleClkTime
say 'The system-wide mouse double-click time is:' .Mouse~doubleClickTime 'milliseconds.'
/* Output might be:
The system-wide mouse double-click time is: 340 milliseconds.
/*
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Mouse::doubleClickTime() -->
<section id="mthLoadCursor" xreflabel="loadCursor"><title>loadCursor (Class Method)</title>
<indexterm><primary>loadCursor</primary></indexterm>
<indexterm><primary>Mouse class</primary><secondary>loadCursor</secondary></indexterm>
<programlisting>
<![CDATA[
>>--loadCursor(--cursorName--)-------------------><
]]>
</programlisting>
<para>
Returns one of the shared pre-defined system cursors.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The single argument is:
<variablelist>
<varlistentry><term>cursorName [required]</term>
<listitem>
<para>
Exactly one of the following keywords to indicate which system cursor is desired, case is not significant:
</para>
<para>
<simplelist type='vert' columns='3'>
<member>APPSTARTING</member>
<member>ARROW </member>
<member>CROSS </member>
<member>HAND </member>
<member>HELP </member>
<member>IBEAM </member>
<member>NO </member>
<member>SIZEALL </member>
<member>SIZENESW </member>
<member>SIZENS </member>
<member>SIZENWSE </member>
<member>SIZEWE </member>
<member>UPARROW </member>
<member>WAIT </member>
</simplelist>
<variablelist>
<varlistentry><term>APPSTARTING</term>
<listitem>
<para>
Standard arrow and small hourglass.
</para>
</listitem></varlistentry>
<varlistentry><term>ARROW</term>
<listitem>
<para>
Standard arrow.
</para>
</listitem></varlistentry>
<varlistentry><term>CROSS</term>
<listitem>
<para>
Crosshair.
</para>
</listitem></varlistentry>
<varlistentry><term>HAND</term>
<listitem>
<para>
Hand.
</para>
</listitem></varlistentry>
<varlistentry><term>HELP</term>
<listitem>
<para>
Arrow and question mark.
</para>
</listitem></varlistentry>
<varlistentry><term>IBEAM</term>
<listitem>
<para>
I-beam.
</para>
</listitem></varlistentry>
<varlistentry><term>NO</term>
<listitem>
<para>
Slashed circle.
</para>
</listitem></varlistentry>
<varlistentry><term>SIZEALL</term>
<listitem>
<para>
Four-pointed arrow pointing north, south, east, and west.
</para>
</listitem></varlistentry>
<varlistentry><term>SIZENESW</term>
<listitem>
<para>
Double-pointed arrow pointing northeast and southwest.
</para>
</listitem></varlistentry>
<varlistentry><term>SIZENS</term>
<listitem>
<para>
Double-pointed arrow pointing north and south.
</para>
</listitem></varlistentry>
<varlistentry><term>SIZENWSE</term>
<listitem>
<para>
Double-pointed arrow pointing northwest and southeast.
</para>
</listitem></varlistentry>
<varlistentry><term>SIZEWE</term>
<listitem>
<para>
Double-pointed arrow pointing west and east.
</para>
</listitem></varlistentry>
<varlistentry><term>UPARROW</term>
<listitem>
<para>
Vertical arrow.
</para>
</listitem></varlistentry>
<varlistentry><term>WAIT</term>
<listitem>
<para>
Hourglass.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The requested cursor as a <xref linkend="clsImage"/> object on success, or 0 on error.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
The returned <computeroutput>Image</computeroutput> object is a shared image and should not be released. The
ooDialog framework will ignore any requests to release the object.
</para>
<para>
Note that the description for the system cursors is the description for the default pre-defined cursors. The user
has the ability to change any of the default cursors to a custom cursor.
</para>
<para>
The loaded cursor is suitable to use in the <xref linkend="mthSetCursor"/> method. Note that the
system cursors can also be loaded directly using the <xref linkend="clsImage"/> class's
<xref linkend="mthGetImageClsImage"/> method.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect usage is detected.
</para>
<para>
Sets the <xref linkend="dotSystemErrorCode"/>.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example loads the <emphasis role="italic">No</emphasis> system cursor and checks for error. In reality, there
is almost no chance of failure provided the correct keyword is used.
<programlisting>
<![CDATA[
::method init
...
noDropCursor = .Mouse~loadCursor("NO")
if noDropCursor == 0 then do
msg = 'Error loading No Drop Cursor, system error code: ' || -
.systemErrorCode SysGetErrortext(.systemErrorCode)
title = 'Drag N Drop Rexx - Unrecoverable Error'
ret = MessageDialog(msg, , title, 'OK', "EXCLAMATION")
self~initCode = 1
return self~initCode
end
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Mouse::loadCursor() -->
<section id="mthLoadCursorFromFile" xreflabel="loadCursorFromFile"><title>loadCursorFromFile (Class Method)</title>
<indexterm><primary>loadCursorFromFile</primary></indexterm>
<indexterm><primary>Mouse class</primary><secondary>loadCursorFromFile</secondary></indexterm>
<programlisting>
<![CDATA[
>>--loadCursorFromFile(--fileName--)-------------><
]]>
</programlisting>
<para>
Creates a cursor based on data from a file.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The single argument is:
<variablelist>
<varlistentry><term>fileName [required]</term>
<listitem>
<para>
The name of the file containing the cursor data. This argument can either be a fully qualified or a relative
file name.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The requested cursor as a <xref linkend="clsImage"/> object on success, or 0 on error.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
<emphasis role="bold">Note</emphasis> that the source file for the cursor must actually be a cursor file or the OS
will refuse to load it. E.g., the file can not be simply any image file, trying to load a bitmap, or even an icon
file, as a cursor will fail.
</para>
<para>
The returned <xref linkend="clsImage"/> object is not a shared image and can be released when no longer
needed, if desired to free up some (small) amount of system resources.
</para>
<para>
The loaded cursor is suitable to use in the <xref linkend="mthSetCursor"/> method. Note that the
system cursors can also be loaded directly using the <xref linkend="clsImage"/> class's
<xref linkend="mthGetImageClsImage"/> method.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect usage is detected.
</para>
<para>
Sets the <xref linkend="dotSystemErrorCode"/>.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example is similar to the <xref linkend="mthLoadCursor"/>, but it loads a custom cursor from a
file:
<programlisting>
<![CDATA[
::method init
...
dropOkCursor = .Mouse~loadCursorFromFile("dragging.cur")
if dropOkCursor == 0 then do
msg = 'Error loading Drop Ok Cursor, system error code: ' || -
.systemErrorCode SysGetErrortext(.systemErrorCode)
title = 'Drag N Drop Rexx - Unrecoverable Error'
ret = MessageDialog(msg, , title, 'OK', "EXCLAMATION")
self~initCode = 1
return self~initCode
end
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Mouse::loadCursorFromFile() -->
<section id="mthSetDoubleClickTime" xreflabel="setDoubleClickTime"><title>setDoubleClickTime (Class Method)</title>
<indexterm><primary>setDoubleClickTime</primary></indexterm>
<indexterm><primary>Mouse class</primary><secondary>setDoubleClickTime</secondary></indexterm>
<programlisting>
<![CDATA[
>>--setDoubleClickTime(--+------------+--)-------><
+-,-interval-+
]]>
</programlisting>
<para>
Sets the double-click time for the mouse.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The single argument is:
<variablelist>
<varlistentry><term>interval [optional]</term>
<listitem>
<para>
The time in milliseconds to set the double-click time to. If this is 0, the default system double-click time is
restored, which is 500 milliseconds. If omitted the default for <emphasis role="italic">interval</emphasis> is
0.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
True on success, false on error.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
A double-click is a series of two clicks of the mouse button, the second occurring within a specified time after the
first. The double-click time is the maximum number of milliseconds that may occur between the first and second click
of a double-click. The double-click time is a system-wide parameter.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect usage is detected.
</para>
<para>
Sets the <xref linkend="dotSystemErrorCode"/>.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example checks the current double-click time and if it is below 500 milliseconds, it resets the the time to the
usual system default.
<programlisting>
<![CDATA[
::method resetDefaults private
...
if .Mouse~doubleClickTime > 500 then .Mouse~setDoubleClickTime
...
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Mouse::setDoubleClickTime() -->
<section id="mthSwapButton" xreflabel="swapButton"><title>swapButton (Class Method)</title>
<indexterm><primary>swapButton</primary></indexterm>
<indexterm><primary>Mouse class</primary><secondary>swapButton</secondary></indexterm>
<programlisting>
<![CDATA[
>>--swapButton(--+--------+--)-------------------><
+--swap--+
]]>
</programlisting>
<para>
Reverses or restores the meaning of the left and right mouse buttons.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The single argument is:
<variablelist>
<varlistentry><term>swap [optional]</term>
<listitem>
<para>
Specifies whether the meaning of the mouse buttons are reversed or restored.
</para>
<para>
If true, the left button generates right-button messages and the right button generates left-button messages. If
false, the buttons are restored to their original meanings. The default is true.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
If the buttons were swapped before this method is invoked, the return is true, if the buttons were not swapped, the
return is false.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
Button swapping is provided by Windows as a convenience to people who use the mouse with their left hands. The
button swapping functionality is usually done through the Control Panel only. Although any application is free to
use this functionality, the mouse is a shared resource and reversing the meaning of its buttons affects the entire
system.
</para>
<para>
Note that the way the operating system handles button swapping makes this mostly transparent to the programmer. When
the programmer is interested in receiving a mouse event notification, say the left mouse button clicked event, then
he just needs to connect the LBUTTONDOWN event and not worry about whether the user has swapped buttons or not. If
the user has swapped the mouse buttons, the operating system will generate the LBUTTONDOWN event when the user
presses the right hand button.
</para>
<para>
Arguably, it might be better to call the left physical mouse button the <emphasis role="italic">primary</emphasis>
button or <emphasis role="italic">button1</emphasis>, Windows does not do this and this documentation uses the
Windows naming conventions.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect usage is detected.
</para>
<para>
Sets the <xref linkend="dotSystemErrorCode"/> to 0, but there are no system errors
that would change the value from 0.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example comes from a program my nephew wrote and set to automatically run at 12:01 am, April 1st on his
brother's computer. He thought it was hilarious, his brother was not amused.
<programlisting>
<![CDATA[
/* aprilFools.rex */
.Mouse~swapButton
return 0
::requires 'ooDialog.cls'
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Mouse::swapButton() -->
<section id="mthAppStarting" xreflabel="appStarting"><title>appStarting</title>
<indexterm><primary>appStarting</primary></indexterm>
<indexterm><primary>Mouse class</primary><secondary>appStarting</secondary></indexterm>
<programlisting>
<![CDATA[
>>--appStarting----------------------------------><
]]>
</programlisting>
<para>
Sets the cursor for the window of this mouse instance to the operating system's predefined <emphasis
role="italic">application starting</emphasis> cursor.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
This method takes no arguments.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
Returns the previous cursor on success, or 0 on error. An error is unlikely.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
The <emphasis role="italic">appStarting</emphasis> method is convenience method. It is exactly equivalent to using
the <xref linkend="mthSetCursor"/> method with the APPSTARTING keyword.
</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 sets the cursor to the application starting cursor for 2 seconds, then restores it. This could be done,
for instance, while the application is displaying a splash screen when it starts up. (A practice that used to be
very common in Windows, but you don't see that often anymore.)
<programlisting>
<![CDATA[
::method initDialog
self~startingUp
::method startingUp private unguarded
reply 0
mouse = .Mouse~new(self)
-- This sets the mouse position to a point we know is
-- not over a dialog control. If the mouse is over a
-- dialog control, changing the cursor will have no
-- effect, unless the user moves it over the dialog
-- background during the 2 seconds.
p = .Point~new(30, 30)
self~client2screen(p)
mouse~setCursorPos(p)
oldCursor = mouse~appStarting
-- Jiggle the mouse so that it repaints immediately
p = mouse~getCursorPos
p~incr
mouse~setCursorPos(p)
j = SysSleep(2)
mouse~setCursor(oldCursor)
-- Jiggle ...
p = mouse~getCursorPos
p~decr
mouse~setCursorPos(p)
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Mouse::appStarting() -->
<section id="mthArrow" xreflabel="arrow"><title>arrow</title>
<indexterm><primary>arrow</primary></indexterm>
<indexterm><primary>Mouse class</primary><secondary>arrow</secondary></indexterm>
<programlisting>
<![CDATA[
>>--arrow----------------------------------------><
]]>
</programlisting>
<para>
Sets the cursor for the window of this mouse instance to the operating system's predefined <emphasis
role="italic">normal</emphasis> cursor, which is usually the standard arrow.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
This method takes no arguments.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
Returns the previous cursor on success, or 0 on error.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
The <emphasis role="italic">arrow</emphasis> method is convenience method. It is exactly equivalent to using
the <xref linkend="mthSetCursor"/> method with the ARROW keyword.
</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 just shows syntax, the method is not difficult to understand:
<programlisting>
<![CDATA[
mouse = .Mouse~new(self)
oldCursor = mouse~arrow
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Mouse::arrow() -->
<section id="mthCapture" xreflabel="capture"><title>capture</title>
<indexterm><primary>capture</primary></indexterm>
<indexterm><primary>Mouse class</primary><secondary>capture</secondary></indexterm>
<programlisting>
<![CDATA[
>>--capture--------------------------------------><
]]>
</programlisting>
<para>
Sets the mouse capture to this mouse's window. Once a window has captured the mouse, all mouse input is directed to
the window even when the mouse is moved outside the boundaries of the window.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The method takes no arguments.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The handle to the window that previously captured the mouse, or 0 if the mouse was not captured before.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
The mouse capture functions work with windows of the same thread. For ooDialog, this means the dialog window and the
dialog control windows that belong to the same dialog as this mouse's window. The <emphasis
role="italic">capture</emphasis> method can capture mouse input either when the mouse is over the dialog this
mouse's window belongs to, or when the mouse button was pressed while the mouse was over that dialog, and the button
is still down. Only one window at a time can capture the mouse.
</para>
<para>
If the mouse cursor is over a window created by another thread, the system will direct mouse input to the specified
window only if a mouse button is down.
</para>
<para>
Only the foreground window, or a window belonging to the foreground window, can capture the mouse. Also, even if the
foreground window has captured the mouse, the user can still click another window, bringing it to the foreground.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details</emphasis></term>
<listitem>
<para>
Raises syntax errors if incorrect usage is detected.
</para>
<para>
Sets the <xref linkend="dotSystemErrorCode"/> to 0, but there are no operating system
errors that would change the varible.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example shows a method that initiates a drag and drop operation. It captures the mouse so that all mouse
messages are directed to the same window and the program can monitor both the current position of the mouse, and
when the mouse button is released:
<programlisting>
<![CDATA[
::method doDrag private
expose oldCursor noDropCursor cursorIsNoDrop dragging
use arg listView, index, p, mouse
mouse~capture
oldCursor = mouse~setCursor(noDropCursor)
dragItem = .DragItem~new(listView, index, p, mouse)
cursorIsNoDrop = .true
dragging = .true
return dragItem
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Mouse::capture() -->
<section id="mthClipCursor" xreflabel="clipCursor"><title>clipCursor</title>
<indexterm><primary>clipCursor</primary></indexterm>
<indexterm><primary>Mouse class</primary><secondary>clipCursor</secondary></indexterm>
<programlisting>
<![CDATA[
>>--clipCursor(--rect--)-------------------------><
]]>
</programlisting>
<para>
The <emphasis role="italic">clipCursor</emphasis> function restricts the cursor position to a rectangular area on the
screen. When, or if, a subsequent cursor position (set by the <xref linkend="mthSetCursorPos"/>
method or a mouse movement) would be outside the rectangle, the operating system automatically adjusts the position to
keep the cursor inside the rectangular area
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The single argument is:
<variablelist>
<varlistentry><term>rect</term>
<listitem>
<para>
A <link linkend="ovvRectangleCoordinates">bounding</link> rectangle specified as a
<xref linkend="clsRect"/> object that defines the area the cursor is confined to.
</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>
The cursor is a shared resource. If an application confines the cursor, it must release the cursor at some point by
using <xref linkend="mthReleaseClipCursor"/> before the user can move to another application
using the mouse.
</para>
<para>
However, although the MSDN documentation does not explicity state this, experimentation shows that if the user
brings up the Alt-Tab switching dialog and moves to another application in that manner, the cursor is no longer
confined. If the user closes the dialog, the mouse is no longer confined.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect usage is detected.
</para>
<para>
Sets the <xref linkend="dotSystemErrorCode"/>.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example confines the cursor to the client area of the dialog:
<programlisting>
<![CDATA[
r = self~clientRect
self~client2screen(r)
mouse~clipCursor(r)
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Mouse::clipCursor() -->
<section id="mthConnectEvent" xreflabel="connectEvent"><title>connectEvent</title>
<indexterm><primary>connectEvent</primary></indexterm>
<indexterm><primary>Mouse class</primary><secondary>connectEvent</secondary></indexterm>
<programlisting>
<![CDATA[
>>--connectEvent(--event--+------------+--+-------------+--+--------+--)-------><
+-,-methName-+ +-,-willReply-+ +-,-opts-+
]]>
</programlisting>
<para>
Connects mouse related Windows <xref linkend="ovvEvents"/> notifications to a method in the Rexx dialog.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The arguments are:
<variablelist>
<varlistentry><term>event [required]</term>
<listitem>
<para>
Specifies which event to connect. Use exactly one of the following keywords, case is not significant:
</para>
<para>
<simplelist type='vert' columns='3'>
<member>CAPTURECHANGED</member>
<member>LBUTTONDBLCLK </member>
<member>LBUTTONDOWN </member>
<member>LBUTTONUP </member>
<member>MBUTTONDOWN </member>
<member>MBUTTONUP </member>
<member>MBUTTONDBLCLK </member>
<member>MOUSEHOVER </member>
<member>MOUSELEAVE </member>
<member>MOUSEMOVE </member>
<member>MOUSEWHEEL </member>
<member>RBUTTONDBLCLK </member>
<member>RBUTTONDOWN </member>
<member>RBUTTONUP </member>
</simplelist>
<variablelist>
<varlistentry><term>CAPTURECHANGED</term>
<listitem>
<para>
This event notification is sent to the window that is losing the mouse capture. The
<xref linkend="evtCAPTURCHANGED"/> Event Handler contains information on coding the event handler.
</para> </listitem></varlistentry>
<varlistentry><term>LBUTTONDBLCLK</term>
<listitem>
<para>
The event notification is sent when the user double-clicks the left mouse button while the cursor is in the
client area of the window. The <xref linkend="evtGeneralMouseEvent"/> Mouse Event Handler
contains information on coding the event handler.
</para>
</listitem></varlistentry>
<varlistentry><term>LBUTTONDOWN</term>
<listitem>
<para>
The event notification is sent when the user presses the left mouse button while the cursor is in the client
area of the window. The <xref linkend="evtGeneralMouseEvent"/> Mouse Event Handler contains
information on coding the event handler.
</para>
</listitem></varlistentry>
<varlistentry><term>LBUTTONUP</term>
<listitem>
<para>
The event notification is sent when the user releases the left mouse button while the cursor is in the
client area of the window. The <xref linkend="evtGeneralMouseEvent"/> Mouse Event Handler
contains information on coding the event handler.
</para>
</listitem></varlistentry>
<varlistentry><term>MBUTTONDBLCLK</term>
<listitem>
<para>
The event notification is sent when the user double-clicks the middle mouse button while the cursor is in
the client area of the window. The <xref linkend="evtGeneralMouseEvent"/> Mouse Event Handler
contains information on coding the event handler.
</para>
</listitem></varlistentry>
<varlistentry><term>MBUTTONDOWN</term>
<listitem>
<para>
The event notification is sent when the user presses the middle mouse button while the cursor is in the
client area of the window. The <xref linkend="evtGeneralMouseEvent"/> Mouse Event Handler
contains information on coding the event handler.
</para>
</listitem></varlistentry>
<varlistentry><term>MBUTTONUP</term>
<listitem>
<para>
The event notification is sent when the user releases the middle mouse button while the cursor is in the
client area of the window. The <xref linkend="evtGeneralMouseEvent"/> Mouse Event Handler
contains information on coding the event handler.
</para>
</listitem></varlistentry>
<varlistentry><term>MOUSEHOVER</term>
<listitem>
<para>
The event notification is sent when the cursor hovers over the client area of the window for the period of
time specified in a prior call to the <xref linkend="mthTrackEvent"/> method. The
<xref linkend="evtGeneralMouseEvent"/> Mouse Event Handler contains information on coding the event
handler.
</para>
</listitem></varlistentry>
<varlistentry><term>MOUSELEAVE</term>
<listitem>
<para>
The event notification is sent when the cursor leaves the client area of the window specified in a prior
call to the <xref linkend="mthTrackEvent"/> method. The
<xref linkend="evtMOUSELEAVE"/> Event Handler contains information on coding the event handler.
</para> </listitem></varlistentry>
<varlistentry><term>MOUSEMOVE</term>
<listitem>
<para>
The event notification is sent when the cursor moves. The
<xref linkend="evtGeneralMouseEvent"/> Mouse Event Handler contains information on coding the event
handler.
</para>
</listitem></varlistentry>
<varlistentry><term>MOUSEWHEEL</term>
<listitem>
<para>
The event notification is sent when the mouse wheel is rotated. The
<xref linkend="evtMOUSEWHEEL"/> Event Handler contains information on coding the event handler.
</para>
</listitem></varlistentry>
<varlistentry><term>NCMOUSEHOVER</term>
<listitem>
<para>
The event notification is sent when the cursor hovers over the
non-<xref linkend="defClientArea"/> of the window for the period of time specified in a prior
call to the <xref linkend="mthTrackEvent"/> method. The
<xref linkend="evtNCMOUSEHOVER"/> Mouse Event Handler contains information on coding the event handler.
</para> </listitem></varlistentry>
<varlistentry><term>NCMOUSELEAVE</term>
<listitem>
<para>
The event notification is sent when the cursor leaves the non-<xref linkend="defClientArea"/>
area of the window specified in a prior call to the <xref linkend="mthTrackEvent"/> method. The <xref
linkend="evtMOUSELEAVE"/> Event Handler contains information on coding the event handler.
</para> </listitem></varlistentry>
<varlistentry><term>RBUTTONDBLCLK</term>
<listitem>
<para>
The event notification is sent when the user double-clicks the right mouse button while the cursor is in
the client area of the window. The <xref linkend="evtGeneralMouseEvent"/> Mouse Event Handler
contains information on coding the event handler.
</para>
</listitem></varlistentry>
<varlistentry><term>RBUTTONDOWN</term>
<listitem>
<para>
The event notification is sent when the user presses the right mouse button while the cursor is in the
client area of the window. The <xref linkend="evtGeneralMouseEvent"/> Mouse Event Handler
contains information on coding the event handler.
</para>
</listitem></varlistentry>
<varlistentry><term>RBUTTONUP</term>
<listitem>
<para>
The event notification is sent when the user releases the right mouse button while the cursor is in the
client area of the window. The <xref linkend="evtGeneralMouseEvent"/> Mouse Event Handler
contains information on coding the event handler.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term>methName [optional]</term>
<listitem>
<para>
The name of the method in the Rexx dialog that is to be invoked when the event notification is generated. If
this argument is omitted, the method name is constructed automatically by the ooDialog framework. The method
name is constructed by prepending the word <emphasis role="italic">on</emphasis> to the event keyword. For
example, if the event is LBUTTONDOWN, the constructed method name would be <emphasis
role="italic">onLButtonDown</emphasis>. If the event is MOUSEHOVER, the constructed method name would be
<emphasis role="italic">onMouseHover</emphasis>, etc..
</para>
</listitem></varlistentry>
<varlistentry><term>willReply [optional]</term>
<listitem>
<para>
The <emphasis role="italic">willReply</emphasis> argument controls whether the interpreter
<link linkend="sctCodingEventHandlers">waits</link>) for the reply from the event handler. The default is
<computeroutput>.true</computeroutput>, the interpreter waits for the reply. If <emphasis
role="italic">willReply</emphasis> is <computeroutput>.false</computeroutput>, the interpreter does not wait for
the event handling method to return a value. See the Remarks section.
</para>
</listitem></varlistentry>
<varlistentry><term>opts [optional]</term>
<listitem>
<para>
Exactly one of the following keywords, case is not significant. The argument adds some control as to how the
ooDialog framework replies to the operating system for the specified event notification. This argument is only
applicapable in certain cases. See the Remarks section for further details.
</para>
<para>
<simplelist type='vert' columns='3'>
<member>REPLYFALSE </member>
<member>SENDTODLG </member>
<member>SENDTOCONTROL</member>
</simplelist>
<variablelist>
<varlistentry><term>REPLYFALSE</term>
<listitem>
<para>
When the mouse window is a dialog window and <emphasis role="italic">willReply</emphasis> is false, this
keyword will cause the reply to the operating system to indicate that the mouse event was not handled. By
default the reply to the operating system will indicate the event was handled.
</para>
</listitem></varlistentry>
<varlistentry><term>SENDTODLG</term>
<listitem>
<para>
When the mouse window is a dialog control window, this keyword indicates that the mouse event notification
message should be sent straight to the dialog. In this case, the <emphasis
role="italic">methodName</emphasis> and <emphasis role="italic">willReply</emphasis> arguments have no
effect. No method will be invoked. The event will be handled by the dialog window, if connected.
</para>
</listitem></varlistentry>
<varlistentry><term>SENDTOCONTROL</term>
<listitem>
<para>
When the mouse window is a dialog control window and <emphasis role="italic">willReply</emphasis> is false,
this keyword will cause the event notification to be passed on to the dialog control. This allows the dialog
control to handle the event as it normally would. By default, the reply to the operating system is that the
event was handled, and the dialog control never sees the event.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
True on success, false on error. An error is not likely.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
See the sections on <link linkend="sctConnectingEventHandlers">connecting</link> and <link
linkend="sctCodingEventHandlers">coding</link> event handlers for additional information on event handlers. Note that it
is not possible to instantiate a mouse object tied to a dialog control window until after the <xref
linkend="ovvUnderlying"/> dialog has been created. Therefore, for dialog control windows the <emphasis
role="italic">connectEvent</emphasis> method is normally invoked in the <xref linkend="mthInitDialog"/> method.
</para>
<para>
<emphasis role="bold">Note</emphasis> that to properly handle and process mouse event messages, it is usually
necessary for the interpreter to wait for the reply from the event handler. If the programmer specifies false for
the <emphasis role="italic">willReply</emphasis> argument, the event handler is likely to behave unpredictably. This
is particularily true for the the MOUSEMOVE event.
</para>
<para>
For mouse events, there are several possible ways for the ooDialog framework to reply to the operating system in
repsonse to the underlying notification message. The possible replies are dependent on which type of window the
mouse event is for, a dialog window or a dialog control window.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">dialog window:</emphasis></term>
<listitem>
<para>
When the mouse event is for a dialog window, ooDialog can reply to the operating system in these ways:
<orderedlist>
<listitem>
<para>
Tell the operating system the event was processed.
</para>
</listitem>
<listitem>
<para>
Tell the operating system the event was not processed.
</para>
</listitem>
</orderedlist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">dialog control window:</emphasis></term>
<listitem>
<para>
When the mouse event is for a dialog control window, ooDialog can reply to the operating system in these ways:
<orderedlist>
<listitem>
<para>
Tell the operating system the event was processed.
</para>
</listitem>
<listitem>
<para>
Have the operating system pass the message directly to the dialog.
</para>
</listitem>
<listitem>
<para>
Have the operating system pass the message to the dialog control it was originally intended for.
</para>
</listitem>
</orderedlist>
</para>
</listitem></varlistentry>
</variablelist>
<para>
The programmer specifies how ooDialog replies to the operating system through a combination of the <emphasis
role="italic">willReply</emphasis> argument, the <emphasis role="italic">opts</emphasis> argument, and the return
value of the event handler. The combinations are summarized in the following table:
<table id="tblReplyCombinationsMouse" frame="all"> <title>Possible Replies to the Operating System</title>
<tgroup cols="5">
<colspec colwidth="1*" />
<colspec colwidth="1*" />
<colspec colwidth="1*" />
<colspec colwidth="3*" />
<thead>
<row>
<entry>Event</entry><entry>Will</entry><entry>Reply</entry><entry>opts</entry><entry>Action</entry>
</row>
<row>
<entry>Window</entry><entry>Reply</entry><entry>Value</entry><entry>Argument</entry><entry>Taken</entry>
</row>
</thead>
<tbody>
<row>
<entry>dialog</entry><entry>true</entry><entry><computeroutput>.true</computeroutput></entry><entry>omitted</entry><entry>OS told event processed.</entry>
</row>
<row>
<entry>dialog</entry><entry>true</entry><entry><computeroutput>.false</computeroutput></entry><entry>omitted</entry><entry>OS told event not processed.</entry>
</row>
<row>
<entry>dialog</entry><entry>false</entry><entry><computeroutput>n/a</computeroutput></entry><entry>omitted</entry><entry>OS told event processed.</entry>
</row>
<row>
<entry>dialog</entry><entry>false</entry><entry><computeroutput>n/a</computeroutput></entry><entry>REPLYFALSE</entry><entry>OS told event not processed.</entry>
</row>
<row>
<entry>dialog control</entry><entry>true</entry><entry><computeroutput>.true</computeroutput></entry><entry>omitted</entry><entry>OS told event processed.</entry>
</row>
<row>
<entry>dialog control</entry><entry>true</entry><entry><computeroutput>.false</computeroutput></entry><entry>omitted</entry><entry>Message passed to the dialog control.</entry>
</row>
<row>
<entry>dialog control</entry><entry>n/a</entry><entry><computeroutput>n/a</computeroutput></entry><entry>SENDTODLG</entry><entry>Message sent directly to the dialog.</entry>
</row>
<row>
<entry>dialog control</entry><entry>false</entry><entry><computeroutput>n/a</computeroutput></entry><entry>omitted</entry><entry>OS told event processed.</entry>
</row>
<row>
<entry>dialog control</entry><entry>false</entry><entry><computeroutput>n/a</computeroutput></entry><entry>SENDTOCONTROL</entry><entry>Message passed to the dialog control.</entry>
</row>
</tbody></tgroup>
</table>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect usage is detected.
</para>
<para>
Resets the <xref linkend="dotSystemErrorCode"/> to zero. There are no operating
system errors that would change the variable.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example connects the MOUSEWHEEL event for an edit control, using the SENDTODLG keyword for the <emphasis
role="italic">opts</emphasis> argument. Note that no MOUSEWHEEL event is connected to the dialog. This has the
effect of <emphasis role="italic">swallowing</emphasis> the event. The event notification is intercepted before it
reaches the edit control, and no method in the dialog is invoked. When the user scrolls the mouse wheel while over
the edit control, nothing happens.
<programlisting>
<![CDATA[
::method initDialog
edit = self~newEdit(IDC_EDIT_FILE)
mouse = .Mouse~new(edit)
mouse~connectEvent(MOUSEWHEEL, , , SENDTODLG)
...
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
<section id="evtCAPTURCHANGED" xreflabel="CAPTURECHANGED"><title>CaptureChanged Event Handler</title>
<indexterm><primary>Mouse class</primary><secondary>events</secondary><tertiary>CAPTURECHANGED</tertiary></indexterm>
<para>
The event handler for the capture changed event is invoked when the window assigned to the mouse object is losing the
capture. The event is received even if it is the mouse object itself that is
<xref linkend="mthReleaseCapture"/> the capture. Microsoft's documentation states that the event handler
should not attempt to <xref linkend="mthCapture"/> the mouse in response to this event.
</para>
<para>
The programmer specifies if the interpreter waits or not for the return from the event handler through the arguments
used in the <xref linkend="mthConnectEvent"/> method.
</para>
<programlisting>
<![CDATA[
::method onCaptureChanged unguarded
use arg hwnd, mouse
return .true
]]>
</programlisting>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The event handling method receives 2 arguments:
</para>
<variablelist>
<varlistentry><term>hwnd</term>
<listitem>
<para>
The window <xref linkend="defHandle"/> of the window gaining the mouse capture. This may be 0 if
there is no window gaining the capture.
</para>
</listitem></varlistentry>
<varlistentry><term>mouse</term>
<listitem>
<para>
The Rexx <xref linkend="clsMouse"/> object for the window that received the MOUSEWHEEL event
notification.
</para>
</listitem></varlistentry>
</variablelist>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return:</emphasis></term>
<listitem>
<para>
In general, return <computeroutput>.true</computeroutput> to indicate the event has been processed and
<computeroutput>.false</computeroutput> to indicate it was not processed. However, the correct response is dependent
on how the event was connected, and is summarized in the <link linkend="tblReplyCombinationsMouse">Remarks</link>
section for the <emphasis role="italic">connectEvent</emphasis> method.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End CaptureChanged Event Handler -->
<section id="evtGeneralMouseEvent" xreflabel="General"><title>General Mouse Event Handler</title>
<indexterm><primary>Mouse class</primary><secondary>events</secondary><tertiary>LBUTTONDOWN</tertiary></indexterm>
<indexterm><primary>Mouse class</primary><secondary>events</secondary><tertiary>LBUTTONUP</tertiary></indexterm>
<indexterm><primary>Mouse class</primary><secondary>events</secondary><tertiary>LBUTTONDBLCLK</tertiary></indexterm>
<indexterm><primary>Mouse class</primary><secondary>events</secondary><tertiary>MBUTTONDOWN</tertiary></indexterm>
<indexterm><primary>Mouse class</primary><secondary>events</secondary><tertiary>MBUTTONUP</tertiary></indexterm>
<indexterm><primary>Mouse class</primary><secondary>events</secondary><tertiary>MBUTTONDBLCLK</tertiary></indexterm>
<indexterm><primary>Mouse class</primary><secondary>events</secondary><tertiary>MOUSEHOVER</tertiary></indexterm>
<indexterm><primary>Mouse class</primary><secondary>events</secondary><tertiary>MOUSEMOVE</tertiary></indexterm>
<indexterm><primary>Mouse class</primary><secondary>events</secondary><tertiary>RBUTTONDOWN</tertiary></indexterm>
<indexterm><primary>Mouse class</primary><secondary>events</secondary><tertiary>RBUTTONUP</tertiary></indexterm>
<indexterm><primary>Mouse class</primary><secondary>events</secondary><tertiary>RBUTTONDBLCLK</tertiary></indexterm>
<para>
There are a number of mouse events where the event handler receives the same arguments and the reply from the event
handler is generally done in the same manner. These events are:
<itemizedlist>
<listitem><para>LButtonDown</para></listitem>
<listitem><para>LButtonUp</para></listitem>
<listitem><para>LButtonDBlClk</para></listitem>
<listitem><para>MButtonDown</para></listitem>
<listitem><para>MButtonUp</para></listitem>
<listitem><para>MButtonDBlClk</para></listitem>
<listitem><para>MouseHover</para></listitem>
<listitem><para>MouseMove</para></listitem>
<listitem><para>RButtonDown</para></listitem>
<listitem><para>RButtonUp</para></listitem>
<listitem><para>RButtonDBlClk</para></listitem>
</itemizedlist>
The handler for these events is discussed here. When each event is generated is described in the arugment description
for the <xref linkend="mthConnectEvent"/> method.
</para>
<para>
The programmer decides whether to have the interpreter wait, or not wait, in the message processing loop for the reply
from the event handler. This is done through the <xref linkend="mthConnectEvent"/> method. The reply
indicates if the event was processed or not. A common value to return would be <computeroutput>.true</computeroutput>.
</para>
<programlisting>
<![CDATA[
::method onMouseEvent unguarded
use arg state, pos, mouse
return .true
]]>
</programlisting>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The event handling method receives 3 arguments:
</para>
<variablelist>
<varlistentry><term>state</term>
<listitem>
<para>
A list of keywords that indicate the keyboard and mouse button modifiers. The list will contain 1 or more of the
following keywords separated by spaces. It will never be the empty string:
</para>
<para>
<simplelist type='vert' columns='3'>
<member>None </member>
<member>Control </member>
<member>lButton </member>
<member>mButton </member>
<member>rButton </member>
<member>Shift </member>
<member>xButton1</member>
<member>xButton2</member>
</simplelist>
<variablelist>
<varlistentry><term>None</term>
<listitem>
<para>
There are no modifiers. <emphasis role="italic">None</emphasis> will always be the only keyword if it is
present.
</para>
</listitem></varlistentry>
<varlistentry><term>Control</term>
<listitem>
<para>
The control key is down.
</para>
</listitem></varlistentry>
<varlistentry><term>lButton</term>
<listitem>
<para>
The left mouse button is down.
</para>
</listitem></varlistentry>
<varlistentry><term>mButton</term>
<listitem>
<para>
The middle mouse button is down.
</para>
</listitem></varlistentry>
<varlistentry><term>rButton</term>
<listitem>
<para>
The right mouse button is down.
</para>
</listitem></varlistentry>
<varlistentry><term>xButton1</term>
<listitem>
<para>
The first X button is down.
</para>
</listitem></varlistentry>
<varlistentry><term>xButton2</term>
<listitem>
<para>
The second X button is down.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term>pos</term>
<listitem>
<para>
A <xref linkend="clsPoint"/> object that contains the x and y coordinates of the position of the mouse,
relative to the upper-left corner of the screen.
</para>
</listitem></varlistentry>
<varlistentry><term>mouse</term>
<listitem>
<para>
The Rexx <xref linkend="clsMouse"/> object for the window that received the mouse event notification.
</para>
</listitem></varlistentry>
</variablelist>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return:</emphasis></term>
<listitem>
<para>
In general, return <computeroutput>.true</computeroutput> to indicate the event has been processed and
<computeroutput>.false</computeroutput> to indicate it was not processed. However, the correct response is dependent
on how the event was connected, and is summarized in the <link linkend="tblReplyCombinationsMouse">Remarks</link>
section for the <xref linkend="mthConnectEvent"/> method.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
Only windows that have the CS_DBLCLKS style can receive double click event notifications. The system generates the
notification whenever the user presses, releases, and again presses the mouse button within the system's
double-click time limit. Double-clicking a mouse button actually generates a sequence of four messages: mouse button
down, mouse button up, mouse button double click, and mouse button up.
</para>
<para>
To receive the mouse hover event, the programmer must first invoke the
<xref linkend="mthTrackEvent"/> method with the proper arguments. The mouse tracking is canceled when the
mouse hover notification is generated. To receive further mouse hover events, the <emphasis
role="italic">trackEvent</emphasis> method must be invoked again.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example</emphasis></term>
<listitem>
<para>
The following example uses the <xref linkend="mthConnectEvent"/> method to connect the mouse left
button down event sent to a list view window with the onLBDown method of the dialog.
<programlisting>
<![CDATA[
::method initDialog
expose listView
listView = self~newListView(IDC_LV_DATA)
mouse = .Mouse~new(listView)
mouse~connectEvent(LBUTTONDOWN, onLBDown)
...
::method onLBdown unguarded
expose listView
use arg keyState, p, mouse
index = listView~hitTestInfo(p)
if keyState \== 'lButton' | index = -1 then do
-- Pass the message on to the list view control.
return .false
end
-- Since the list view will not receive the left button
-- down event, we need to manually do the item selection
listView~assignFocus
listView~focus(index)
listView~select(index)
-- Do custom processing for left button down
...
-- Indicate the event was processed.
return .true
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End General Mouse Event Handler -->
<section id="evtNCMOUSEHOVER" xreflabel="NCMOUSEHOVER"><title>NcMouseHover Event Handler</title>
<indexterm><primary>Mouse class</primary><secondary>events</secondary><tertiary>NCMOUSEHOVER</tertiary></indexterm>
<para>
The event handler for the nc mouse leave event is invoked when the cursor leaves the
non-<xref linkend="defClientArea"/> of the window assigned to the mouse object. Normally, this event
notification is <emphasis role="italic">not</emphasis> generated. To receive the notification the
<xref linkend="mthTrackEvent"/> method must be invoked to set up the tracking behavior.
</para>
<para>
The programmer specifies if the interpreter waits or not for the return from the event handler through the arguments
used in the <xref linkend="mthConnectEvent"/> method.
</para>
<programlisting>
<![CDATA[
::method onNcMouseHover unguarded
use arg hit, pos, mouse
return .true
]]>
</programlisting>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The event handling method receives 3 argument:
</para>
<variablelist>
<varlistentry><term>hit</term>
<listitem>
<para>
A single keyword that indicates the result of the operating system's hit test of the mouse position. This defines
exactly where in the non-client area the mouse position is. Over the max button, on the border, etc.. The keyword
will be one of the words in the following table:
<table id="tblHitTestHover" frame="all"> <title>Possible <emphasis role="italic">hit</emphasis> Values</title>
<tgroup cols="2">
<colspec colwidth="1*" /><colspec colwidth="4*" />
<thead>
<row>
<entry>Keyword</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row><entry>ERROR"; </entry><entry>On the screen background or on a dividing line between windows (same as NOWHERE.)</entry></row>
<row><entry>TRANSPARENT</entry><entry>In a window currently covered by another window in the same thread.</entry></row>
<row><entry>NOWHERE"; </entry><entry>On the screen background or on a dividing line between windows.</entry></row>
<row><entry>CLIENT"; </entry><entry>In a client area.</entry></row>
<row><entry>CAPTION"; </entry><entry>In a title bar.</entry></row>
<row><entry>SYSMENU"; </entry><entry>In a window menu or in a Close button in a child window.</entry></row>
<row><entry>GROWBOX"; </entry><entry>In a size box.</entry></row>
<row><entry>MENU"; </entry><entry>In a menu.</entry></row>
<row><entry>HSCROLL"; </entry><entry>In a horizontal scroll bar.</entry></row>
<row><entry>VSCROLL"; </entry><entry>In the vertical scroll bar.</entry></row>
<row><entry>MINBUTTON";</entry><entry>In a Minimize button.</entry></row>
<row><entry>MAXBUTTON";</entry><entry>In a Maximize button.</entry></row>
<row><entry>LEFT"; </entry><entry>In the left border of a resizable window (the user can click the mouse to resize the window horizontally).</entry></row>
<row><entry>RIGHT"; </entry><entry>In the right border of a resizable window (the user can click the mouse to resize the window horizontally).</entry></row>
<row><entry>TOP"; </entry><entry>In the upper-horizontal border of a window.</entry></row>
<row><entry>TOPLEFT"; </entry><entry>In the upper-left corner of a window border.</entry></row>
<row><entry>TOPRIGHT"; </entry><entry>In the upper-right corner of a window border.</entry></row>
<row><entry>BOTTOM"; </entry><entry>In the lower-horizontal border of a resizable window (the user can click the mouse to resize the window vertically).</entry></row>
<row><entry>BOTTOMLEFT"</entry><entry>In the lower-left corner of a border of a resizable window (the user can click the mouse to resize the window diagonally).</entry></row>
<row><entry>BOTTOMRIGHT</entry><entry>In the lower-right corner of a border of a resizable window (the user can click the mouse to resize the window diagonally).</entry></row>
<row><entry>BORDER"; </entry><entry>In the border of a window that does not have a sizing border.</entry></row>
<row><entry>OBJECT"; </entry><entry>Microsoft does not describe what this means.</entry></row>
<row><entry>CLOSE"; </entry><entry>In a Close button.</entry></row>
<row><entry>HELP"; </entry><entry>In a Help button.</entry></row>
</tbody></tgroup>
</table>
</para>
</listitem></varlistentry>
<varlistentry><term>pos</term>
<listitem>
<para>
A <xref linkend="clsPoint"/> object that contains the x and y coordinates of the position of the mouse,
relative to the upper-left corner of the screen.
</para>
</listitem></varlistentry>
<varlistentry><term>mouse</term>
<listitem>
<para>
The Rexx <xref linkend="clsMouse"/> object for the window that received the MOUSELEAVE or NCMOUSELEAVE
event notification.
</para>
</listitem></varlistentry>
</variablelist>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return:</emphasis></term>
<listitem>
<para>
In general, return <computeroutput>.true</computeroutput> to indicate the event has been processed and
<computeroutput>.false</computeroutput> to indicate it was not processed. However, the correct response is dependent
on how the event was connected, and is summarized in the <link linkend="tblReplyCombinationsMouse">Remarks</link>
section for the <emphasis role="italic">connectEvent</emphasis> method.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
To receive either of the mouse leave events, the programmer must first invoke the
<xref linkend="mthTrackEvent"/> method with the proper arguments. The mouse tracking is canceled when the
mouse leave notification, (or the mouse hover notification,) is generated. To receive further mouse leave or mouse
hover events, the <emphasis role="italic">trackEvent</emphasis> method must be invoked again.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End MouseLeave Event Handler -->
<section id="evtMOUSELEAVE" xreflabel="MOUSELEAVE"><title>MouseLeave Event Handler</title>
<indexterm><primary>Mouse class</primary><secondary>events</secondary><tertiary>MOUSELEAVE</tertiary></indexterm>
<indexterm><primary>Mouse class</primary><secondary>events</secondary><tertiary>NCMOUSELEAVE</tertiary></indexterm>
<para>
This description for the mouse leave event handler pertains to both the <xref linkend="defClientArea"/>
mouse leave (MOUSELEAVE) and the <emphasis role="italic">non-client</emphasis> mouse leave (NCMOUSELEAVE) events. The
arguments received by event handler for both events are exactly the same, and the event handler should behave the same
for both events.
</para>
<para>
The event handler for the mouse leave event is invoked when the cursor leaves the client area (MOUSELEAVE) or the
non-client area (NCMOUSELEAVE) of the window assigned to the mouse object. Normally, these event notifications are
<emphasis role="italic">not</emphasis> generated. To receive these notifications the
<xref linkend="mthTrackEvent"/> method must be invoked to set up the tracking behavior.
</para>
<para>
The programmer specifies if the interpreter waits or not for the return from the event handler through the arguments
used in the <xref linkend="mthConnectEvent"/> method.
</para>
<programlisting>
<![CDATA[
::method onMouseLeave unguarded
use arg mouse
return .true
]]>
</programlisting>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The event handling method receives 1 argument:
</para>
<variablelist>
<varlistentry><term>mouse</term>
<listitem>
<para>
The Rexx <xref linkend="clsMouse"/> object for the window that received the MOUSELEAVE or NCMOUSELEAVE
event notification.
</para>
</listitem></varlistentry>
</variablelist>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return:</emphasis></term>
<listitem>
<para>
In general, return <computeroutput>.true</computeroutput> to indicate the event has been processed and
<computeroutput>.false</computeroutput> to indicate it was not processed. However, the correct response is dependent
on how the event was connected, and is summarized in the <link linkend="tblReplyCombinationsMouse">Remarks</link>
section for the <emphasis role="italic">connectEvent</emphasis> method.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
To receive either of the mouse leave events, the programmer must first invoke the
<xref linkend="mthTrackEvent"/> method with the proper arguments. The mouse tracking is canceled when the
mouse leave notification is generated. To receive further mouse leave, the <emphasis
role="italic">trackEvent</emphasis> method must be invoked again.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End MouseLeave Event Handler -->
<section id="evtMOUSEWHEEL" xreflabel="MOUSEWHEEL"><title>MouseWheel Event Handler</title>
<indexterm><primary>Mouse class</primary><secondary>events</secondary><tertiary>MOUSEWHEEL</tertiary></indexterm>
<para>
The event handler for the mouse wheel event is invoked each time the user scrolls the mouse wheel.
</para>
<para>
The programmer decides whether to have the interpreter wait, or not wait, in the message processing loop for the reply
from the event handler. This is done through the <xref linkend="mthConnectEvent"/> method. The reply
indicates if the event was processed or not. A common value to return would be <computeroutput>.true</computeroutput>.
</para>
<programlisting>
<![CDATA[
::method onMouseWheel unguarded
use arg state, pos, mouse, delta
return .true
]]>
</programlisting>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The event handling method receives 4 arguments:
</para>
<variablelist>
<varlistentry><term>state</term>
<listitem>
<para>
A list of keywords that indicate the keyboard and mouse button modifiers. The list will contain 1 or more of the
following keywords separated by spaces. It will never be the empty string:
</para>
<para>
<simplelist type='vert' columns='3'>
<member>None </member>
<member>Control </member>
<member>lButton </member>
<member>mButton </member>
<member>rButton </member>
<member>Shift </member>
<member>xButton1</member>
<member>xButton2</member>
</simplelist>
<variablelist>
<varlistentry><term>None</term>
<listitem>
<para>
There are no modifiers. <emphasis role="italic">None</emphasis> will always be the only keyword if it is
present.
</para>
</listitem></varlistentry>
<varlistentry><term>Control</term>
<listitem>
<para>
The control key is down.
</para>
</listitem></varlistentry>
<varlistentry><term>lButton</term>
<listitem>
<para>
The left mouse button is down.
</para>
</listitem></varlistentry>
<varlistentry><term>mButton</term>
<listitem>
<para>
The middle mouse button is down.
</para>
</listitem></varlistentry>
<varlistentry><term>rButton</term>
<listitem>
<para>
The right mouse button is down.
</para>
</listitem></varlistentry>
<varlistentry><term>xButton1</term>
<listitem>
<para>
The first X button is down.
</para>
</listitem></varlistentry>
<varlistentry><term>xButton2</term>
<listitem>
<para>
The second X button is down.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term>pos</term>
<listitem>
<para>
A <xref linkend="clsPoint"/> object that contains the x and y coordinates of the mouse position,
relative to the upper-left corner of the screen.
</para>
</listitem></varlistentry>
<varlistentry><term>mouse</term>
<listitem>
<para>
The Rexx <xref linkend="clsMouse"/> object for the window that received the MOUSEWHEEL event
notification.
</para>
</listitem></varlistentry>
<varlistentry><term>delta</term>
<listitem>
<para>
A whole number that represents the amount the scroll wheel was turned. The operating system alway sends a multiple
of 120. Microsoft says this is to allow for future expansion with hardware that has a finer grain of control. If
the number is positive, the user turned the wheel away from herself and indicates to scroll up. When negative
the user turned the wheel towards himself, and indicates to scroll down.
</para>
<para>
At this point in time (c. 2011) the OS sends the event notification for each notch of the scroll wheel. Therefore
delta is always 120 or -120.
</para>
</listitem></varlistentry>
</variablelist>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return:</emphasis></term>
<listitem>
<para>
In general, return <computeroutput>.true</computeroutput> to indicate the event has been processed and
<computeroutput>.false</computeroutput> to indicate it was not processed. However, the correct response is dependent
on how the event was connected, and is summarized in the <link linkend="tblReplyCombinationsMouse">Remarks</link>
section for the <xref linkend="mthConnectEvent"/> method.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
The mouse wheel event notification is sent by the operating system to the window with the current input focus. If
the window does not process the message, then the OS sends the message to the parent window of that window. This
continues on up the parent / child window chain until either a window does process the notification or the top of
the chain is reached. Most dialog controls do not process the mouse wheel notification, so the notification will
reach the dialog.
</para>
<para>
Multi-line edit controls <emphasis role="italic">do</emphasis> process the notification and normally handle their
own scrolling. If the programmer wants to implement some type of custom scrolling using the
<xref linkend="mthConnectEvent"/> method, the edit control's interception of the notification may
interfere with the custom scrolling. Forcing the edit control to ignore the notification allows it to reach the
dialog.
</para>
<para>
Additional information on the mouse wheel and handling mouse wheel events is found in the system parameters
information <xref linkend="clsSPI"/> class's <xref linkend="atrWheelScrollLines"/> attribute.
</para> </listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example</emphasis></term>
<listitem>
<para>
The following example uses the <xref linkend="mthConnectEvent"/> method to connect the mouse wheel
event sent to the edit control to a method in the Rexx dialog. This then allows the programmer to supply some custon
scrolling. Normally, a multi-line edit control handles the mouse wheel event itself and the notification message
will never reach the dialog.
<programlisting>
<![CDATA[
::method initDialog
expose eData
eData = self~newEdit(IDC_EDIT_DATA)
mouse = .Mouse~new(eData)
mouse~connectEvent(MOUSEWHEEL, onMouseWheel)
...
::method onMouseWheel unguarded
expose eData
use arg state, pos, mosue, delta
-- If the mouse is not over the edit control, do nothing and
-- return .true to indicate the event was processed.
if \ pos~inRect(eData~windowRect) then return .true
-- Mouse is over our edit control, do custom scrolling ...
if delta > 0 then direction = 'up'
else direction = 'down'
scrollLines = .SPI~wheelScrollLines
select
when state == 'None' then do
amt = scrollLines
if direction == 'up' then cmd = 'UP'
else cmd = 'DOWN'
end
when state~wordPos('Control') <> 0, state~wordPos('Shift') <> 0 then do
amt = 3
if direction == 'up' then cmd = 'PAGEUP'
else cmd = 'PAGEDOWN'
end
when state~wordPos('Control') <> 0 then do
amt = 1
if direction == 'up' then cmd = 'PAGEUP'
else cmd = 'PAGEDOWN'
end
when state~wordPos('Shift') <> 0 then do
amt = 3 * scrollLines
if direction == 'up' then cmd = 'UP'
else cmd = 'DOWN'
end
otherwise do
-- Some other modifier(s), we treat this
-- the same as 'None'
amt = scrollLines
if direction == 'up' then cmd = 'UP'
else cmd = 'DOWN'
end
end
eData~scrollCommand(cmd, amt)
-- Indicate the event was processed.
return .true
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End MouseWheel Event Handler -->
</section> <!-- End Mouse::connectEvent() -->
<section id="mthCross" xreflabel="cross"><title>cross</title>
<indexterm><primary>cross</primary></indexterm>
<indexterm><primary>Mouse class</primary><secondary>cross</secondary></indexterm>
<programlisting>
<![CDATA[
>>--cross----------------------------------------><
]]>
</programlisting>
<para>
Sets the mouse cursor to the system's default <emphasis role="italic">high precision</emphasis> cursor, which is
usually the crosshair cursor.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
This method takes no arguments.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
Returns the previous cursor on success, or 0 on error.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
The <emphasis role="italic">cross</emphasis> method is convenience method. It is exactly equivalent to using
the <xref linkend="mthSetCursor"/> method with the CROSS keyword.
</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 a simple method to use:
<programlisting>
<![CDATA[
mouse = .Mouse~new(self)
oldCursor = mouse~cross
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Mouse::cross() -->
<section id="mthDragDetect" xreflabel="dragDetect"><title>dragDetect</title>
<indexterm><primary>dragDetect</primary></indexterm>
<indexterm><primary>Mouse class</primary><secondary>dragDetect</secondary></indexterm>
<programlisting>
<![CDATA[
>>--dragDetect(--point--)------------------------><
]]>
</programlisting>
<para>
The <emphasis role="italic">dragDetect</emphasis> method is used to determine if the user has started a drag
operation.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The single argument is:
<variablelist>
<varlistentry><term>point [required]</term>
<listitem>
<para>
The initial position of the cursor, in screen <xref linkend="defScreenCoordinates"/>) coodinates, specified
as a <xref linkend="clsPoint"/> object. Recall that screen coordinates are always in pixels.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The return is true if the user is dragging and false otherwise.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
In a drag and drop enabled program it is not desirable to start a drag operation each time the user presses the left
mouse button. This results in the user moving something when they only wanted to click on it. The operating system
provides the drag detect functionality as a convenience to programmers.
</para>
<para>
A drag operation is detected when the user presses the mouse button and then moves the cursor outside of the
<emphasis role="italic">drag rectangle</emphasis>, while keeping the mouse button down. The drag rectangle is
configurable, allowing for smaller or larger rectangles. The size of the current drag rectangle, and changing the
size of the drag rectangle can be done through the <xref linkend="atrDragWidth"/> and
<xref linkend="atrDragHeight"/> attributes of the <xref linkend="clsSPI"/> (System Parameters
Information) class.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect usage is detected.
</para>
<para>
Resets the <xref linkend="dotSystemErrorCode"/> to 0. However, there are no system
errors that would change that value.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example shows the event handler for a left button down event. When the event occurs, the handler checks if the
user has started a drag operation. If so, the application initiates the operation and returns true. If not, the
handler simply returns:
<programlisting>
<![CDATA[
::method onLBdown unguarded
expose dragItem
use arg keyState, p, mouse
if mouse~dragDetect(p) then do
dragItem = self~doDrag(p, mouse)
return .true
end
return .false
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Mouse::dragDetect() -->
<section id="mthGetCapture" xreflabel="getCapture"><title>getCapture</title>
<indexterm><primary>getCapture</primary></indexterm>
<indexterm><primary>Mouse class</primary><secondary>getCapture</secondary></indexterm>
<programlisting>
<![CDATA[
>>--getCapture-----------------------------------><
]]>
</programlisting>
<para>
The <emphasis role="italic">getCapture</emphasis> method retrieves the window handle, if any, that currently has
captured the mouse. The window that has captured the mouse receives all mouse input regardless of whether the mouse
cursor is within the borders of the window or not.
</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>
The window <xref linkend="defHandle"/> of the window, belonging to the same dialog as this mouse's
window, that had previously captured the mouse, or 0 if no window previosly had the capture.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
The mouse capture functions work with windows of the same thread. For ooDialog, this means the dialog window and the
dialog control windows that belong to the same dialog as this mouse's window. Getting the mouse capture, can only
get the window handle of windows belonging to the same dialog as this mouse's window. If 0 is returned, it means
that no window in the same dialog as this mouse's window has the mouse capture. However, some window belonging to
another dialog could have the mouse capture.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect usage is detected.
</para>
<para>
Sets the <xref linkend="dotSystemErrorCode"/> to 0, but there are no system errors
that would change the variable from 0.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Mouse::getCapture() -->
<section id="mthGetClipCursor" xreflabel="getClipCursor"><title>getClipCursor</title>
<indexterm><primary>getClipCursor</primary></indexterm>
<indexterm><primary>Mouse class</primary><secondary>getClipCursor</secondary></indexterm>
<programlisting>
<![CDATA[
>>--getClipCursor(--rect--)----------------------><
]]>
</programlisting>
<para>
Retrieves the screen coordinates of the rectangular area to which the cursor is confined.
</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 <xref linkend="clsRect"/> object in which the coordinates are returned.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
True on success, false on error.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
If the cursor is not confined, i.e., it is <link linkend="mthClipCursor">clipped</link>/>, then on return <emphasis
role="italic">rect</emphasis> will contain the coordinates of the screen.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect usage is detected.
</para>
<para>
Sets the <xref linkend="dotSystemErrorCode"/>.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Mouse::getClipCursor() -->
<section id="mthGetCursorPos" xreflabel="getCursorPos"><title>getCursorPos</title>
<indexterm><primary>getCursorPos</primary></indexterm>
<indexterm><primary>Mouse class</primary><secondary>getCursorPos</secondary></indexterm>
<programlisting>
<![CDATA[
>>--getCursorPos---------------------------------><
]]>
</programlisting>
<para>
Retrieves the current position of the cursor.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
There are no arguments.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
Returns the postion, in screen <xref linkend="defScreenCoordinates"/>, as a <xref linkend="clsPoint"/> object.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details</emphasis></term>
<listitem>
<para>
Sets the <xref linkend="dotSystemErrorCode"/>.
</para>
<para>
Raises syntax errors when incorrect usage is detected.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
The setCursorPos <link linkend="exampleSetCursorPos">example</link> uses the <emphasis
role="italic">getCursorPos</emphasis> method.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Mouse::getCursorPos() -->
<section id="mthIsButtonDown" xreflabel="isButtonDown"><title>isButtonDown</title>
<indexterm><primary>isButtonDown</primary></indexterm>
<indexterm><primary>Mouse class</primary><secondary>isButtonDown</secondary></indexterm>
<programlisting>
<![CDATA[
>>--isMouseButtonDown(--+---------------+--)-----><
+--whichButton--+
]]>
</programlisting>
<para>
Retrieves information on whether a mouse button is pressed.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The single optional argument is:
<variablelist>
<varlistentry><term>whichButton [optional]</term>
<listitem>
<para>
If this argument is omitted the default keyword is LEFT. Otherwise, use exactly one of the following keywords,
case is not significant:
</para>
<para>
<simplelist type='vert' columns='3'>
<member>LEFT </member>
<member>RIGHT </member>
<member>MIDDLE </member>
<member>XBUTTON1</member>
<member>XBUTTON2</member>
</simplelist>
<variablelist>
<varlistentry><term>LEFT</term>
<listitem>
<para>
Determine if the primary mouse button is down. The primary mouse button may actually be the right physical
mouse button if the user has configured the system to swap the mouse buttons.
</para>
</listitem></varlistentry>
<varlistentry><term>RIGHT</term>
<listitem>
<para>
Determine if the secondary mouse button is down. The secondary mouse button may actually be the left
physical mouse button if the user has configured the system to swap the mouse buttons.
</para>
</listitem></varlistentry>
<varlistentry><term>MIDDLE</term>
<listitem>
<para>
Determine if the middle mouse button is down.
</para>
</listitem></varlistentry>
<varlistentry><term>XBUTTON1</term>
<listitem>
<para>
Determine if the first X button is down. XBUTTON1 and XBUTTON2 are used by the operating system to support
the Microsoft IntelliMouse Explorer.
</para>
</listitem></varlistentry>
<varlistentry><term>XBUTTON2</term>
<listitem>
<para>
Determine if the second X button is down. XBUTTON1 and XBUTTON2 are used by the operating system to support
the Microsoft IntelliMouse Explorer.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
Returns true if the specified button is being pressed, otherwise false.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details</emphasis></term>
<listitem>
<para>
Raises syntax errors if incorrect usage is detected.
</para>
<para>
Sets the <xref linkend="dotSystemErrorCode"/> to 0, but there are no operarting
system errors that would change it from 0.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example carries out some operation, does stuff, while either the right or the left mouse button, but not both
buttons, is pressed:
<programlisting>
<![CDATA[
lMB = self~isMouseButtonDown("LEFT")
rMB = self~isMouseButtonDown("RIGHT")
do while (lMB | rMB) & \(lMB & rMB)
-- do stuff
...
lMB = self~isMouseButtonDown("LEFT")
rMB = self~isMouseButtonDown("RIGHT")
end
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Mouse::isButtonDown() -->
<section id="mthNo" xreflabel="no"><title>no</title>
<indexterm><primary>no</primary></indexterm>
<indexterm><primary>Mouse class</primary><secondary>no</secondary></indexterm>
<programlisting>
<![CDATA[
>>--no-------------------------------------------><
]]>
</programlisting>
<para>
Sets the mouse cursor to the system's default <emphasis role="italic">not allowed</emphasis> cursor, which is usually
a circle with a slash across it.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
This method takes no arguments.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
Returns the previous cursor on success, or 0 on error.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
The <emphasis role="italic">no</emphasis> method is convenience method. It is exactly equivalent to usingthe
<xref linkend="mthSetCursor"/> method with the NO keyword.
</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 a simple method to use:
<programlisting>
<![CDATA[
mouse = .Mouse~new(self)
oldCursor = mouse~no
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Mouse::no() -->
<section id="mthReleaseCapture" xreflabel="releaseCapture"><title>releaseCapture</title>
<indexterm><primary>releaseCapture</primary></indexterm>
<indexterm><primary>Mouse class</primary><secondary>releaseCapture</secondary></indexterm>
<programlisting>
<![CDATA[
>>--releaseMouseCapture--------------------------><
]]>
</programlisting>
<para>
The <emphasis role="italic">releaseCapture</emphasis> method releases the mouse capture from the window, belonging to
the same dialog as this mouse's window, which had previously <xref linkend="mthCapture"/> the mouse.
Normal mouse input processing is then restored.
</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 0 on success, the mouse capture was released, or 1 on failure. On failure, the
<computeroutput>.systemErrorCode</computeroutput> will be set.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
The mouse capture functions work with windows of the same thread. For ooDialog, this means the dialog window and the
dialog control windows that belong to the same dialog as this mouse's window.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect usage is detected.
</para>
<para>
Sets the <xref linkend="dotSystemErrorCode"/>.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example is a snippet of code from a drag and drop enabled program. It is part of the processing of the left
button up event handler. If <emphasis role="italic">draggin</emphasis> is <computeroutput>.true</computeroutput>
then we know that the mouse was captured when the drag operation was initiated, so the capture is released. The
return from <emphasis role="italic">releaseCapture</emphasis> is not checked because it is unlikely to fail:
<programlisting>
<![CDATA[
if dragging then do
okayToDrop = (cusorIsNoDrop \== .true)
dragging = .false
cursorIsNoDrop = .false
mouse~releaseCapture
mouse~setCursor(oldCursor)
...
end
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Mouse::releaseCapture() -->
<section id="mthReleaseClipCursor" xreflabel="releaseClipCursor"><title>releaseClipCursor</title>
<indexterm><primary>releaseClipCursor</primary></indexterm>
<indexterm><primary>Mouse class</primary><secondary>releaseClipCursor</secondary></indexterm>
<programlisting>
<![CDATA[
>>--releaseClipCursor----------------------------><
]]>
</programlisting>
<para>
Releases the cursor so that it is free to move anywhere on the screen.
</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 true on success, false on error.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
The cursor is a shared resource. If an application confines the cursor through the
<xref linkend="mthClipCursor"/> method, it must release the cursor at some point by using
<emphasis role="italic">releaseClipCursor</emphasis> before the user can move to another application using the
mouse.
</para>
<para>
Although the MSDN documentation does not explicity state this, experimentation shows that if the user brings up the
Alt-Tab switching dialog and moves to another application in that manner, the cursor is no longer confined. If the
user closes the dialog, the mouse is no longer confined.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect usage is detected.
</para>
<para>
Sets the <xref linkend="dotSystemErrorCode"/>.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example releases the cursor from the clipped state.
<programlisting>
<![CDATA[
mouse = .Mouse~new(self)
mouse~releaseClipCursor
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Mouse::releaseClipCursor() -->
<section id="mthRestoreCursor" xreflabel="restoreCursor"><title>restoreCursor</title>
<indexterm><primary>restoreCursor</primary></indexterm>
<indexterm><primary>Mouse class</primary><secondary>restoreCursor</secondary></indexterm>
<programlisting>
<![CDATA[
>>--restoreCursor(--+----------+--)--------------><
+--cursor--+
]]>
</programlisting>
<para>
Restores the cursor. This is a convenience method, the same functionality can be achieved using the
<xref linkend="mthSetCursor"/> method.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The single argument is:
<variablelist>
<varlistentry><term>cursor [optional]</term>
<listitem>
<para>
A cursor <xref linkend="clsImage"/> object that will be set as the cursor for the window of this
mouse instance. If this argument is omitted then the operating system's pre-defined <emphasis
role="italic">normal</emphasis> cursor, which is usually the arrow cursor, is set as the cursor for the window.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
Returns the previous cursor on success, or 0 on error.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
Normal usage of this method would generally be to use a cursor saved using the return from the
<xref linkend="mthSetCursor"/> method as the <emphasis role="italic">cursor</emphasis> argument. Assuming
the previous cursor was the arrow cursor and omitting the <emphasis role="italic">cursor</emphasis> argument can be
wrong if the user has customized his system.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect usage is detected.
</para>
<para>
Sets the <xref linkend="dotSystemErrorCode"/>.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example calculates pi to 35 decimal places. While the calculation is being done the cursor is changed to the
busy cursor, and then restored when the calculation is finished:
<programlisting>
<![CDATA[
-- Get the current mouse position.
mouse = .Mouse~new(self)
oldCursorPos = mouse~getCursorPos
-- Set the cursor to the busy symbol and jiggle the
-- mouse so it repaints.
oldCursor = mouse~wait
oldCursorPos~incr
mouse~setCursorPos(oldCursorPos)
-- Calculate pi to 35 decimal places.
pi = self~calcPi(35)
-- Restore the cursor.
oldCursorPos~decr
mouse~restoreCursor(oldCusor)
mouse~setCursorPos(oldCursorPos)
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Mouse::restoreCursor() -->
<section id="mthSetCursor" xreflabel="setCursor"><title>setCursor</title>
<indexterm><primary>setCursor</primary></indexterm>
<indexterm><primary>Mouse class</primary><secondary>setCursor</secondary></indexterm>
<programlisting>
<![CDATA[
>>--setCursor(--cursor--)------------------------><
]]>
</programlisting>
<para>
Sets the cursor for the window of this mouse instance.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The single argument is:
<variablelist>
<varlistentry><term>cursor [required]</term>
<listitem>
<para>
This argument can either be a <xref linkend="clsImage"/> cursor object, in which case the image is
used for the new cursor, or a single keyword. When <emphasis role="italic">cursor</emphasis> is a keyword, the
new cursor is set to one of the shared pre-defined system cursors.
</para>
<para>
When using a keyword as the <emphasis role="italic">cursor</emphasis> argument, it must be exactly one of the
following to indicate which system cursor is desired, case is not significant:
</para>
<para>
<simplelist type='vert' columns='3'>
<member>APPSTARTING</member>
<member>ARROW </member>
<member>CROSS </member>
<member>HAND </member>
<member>HELP </member>
<member>IBEAM </member>
<member>NO </member>
<member>SIZEALL </member>
<member>SIZENESW </member>
<member>SIZENS </member>
<member>SIZENWSE </member>
<member>SIZEWE </member>
<member>UPARROW </member>
<member>WAIT </member>
</simplelist>
<variablelist>
<varlistentry><term>APPSTARTING</term>
<listitem>
<para>
Standard arrow and small hourglass.
</para>
</listitem></varlistentry>
<varlistentry><term>ARROW</term>
<listitem>
<para>
Standard arrow.
</para>
</listitem></varlistentry>
<varlistentry><term>CROSS</term>
<listitem>
<para>
Crosshair.
</para>
</listitem></varlistentry>
<varlistentry><term>HAND</term>
<listitem>
<para>
Hand.
</para>
</listitem></varlistentry>
<varlistentry><term>HELP</term>
<listitem>
<para>
Arrow and question mark.
</para>
</listitem></varlistentry>
<varlistentry><term>IBEAM</term>
<listitem>
<para>
I-beam.
</para>
</listitem></varlistentry>
<varlistentry><term>NO</term>
<listitem>
<para>
Slashed circle.
</para>
</listitem></varlistentry>
<varlistentry><term>SIZEALL</term>
<listitem>
<para>
Four-pointed arrow pointing north, south, east, and west.
</para>
</listitem></varlistentry>
<varlistentry><term>SIZENESW</term>
<listitem>
<para>
Double-pointed arrow pointing northeast and southwest.
</para>
</listitem></varlistentry>
<varlistentry><term>SIZENS</term>
<listitem>
<para>
Double-pointed arrow pointing north and south.
</para>
</listitem></varlistentry>
<varlistentry><term>SIZENWSE</term>
<listitem>
<para>
Double-pointed arrow pointing northwest and southeast.
</para>
</listitem></varlistentry>
<varlistentry><term>SIZEWE</term>
<listitem>
<para>
Double-pointed arrow pointing west and east.
</para>
</listitem></varlistentry>
<varlistentry><term>UPARROW</term>
<listitem>
<para>
Vertical arrow.
</para>
</listitem></varlistentry>
<varlistentry><term>WAIT</term>
<listitem>
<para>
Hourglass.
</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 the previous cursor for the window as an <computeroutput>Image</computeroutput> object. On error
returns 0.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect usage is detected.
</para>
<para>
Sets the <xref linkend="dotSystemErrorCode"/>.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example is similar to the example for the <xref linkend="mthRestoreCursor"/> method, but it
only uses the <emphasis role="italic">setCursor</emphasis> method:
<programlisting>
<![CDATA[
-- Get the current mouse position.
mouse = .Mouse~new(self)
oldCursorPos = mouse~getCursorPos
-- Set the cursor to the busy symbol and jiggle the
-- mouse so it repaints.
oldCursorPos~incr
oldCursor = mouse~setCursor("WAIT")
mouse~setCursorPos(oldCursorPos)
-- Calculate pi to 35 decimal places.
pi = self~calcPi(35)
-- Restore the cursor.
oldCursorPos~decr
mouse~setCursor(oldCusor)
mouse~setCursorPos(oldCursorPos)
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Mouse::setCursor() -->
<section id="mthSetCursorPos" xreflabel="setCursorPos"><title>setCursorPos</title>
<indexterm><primary>setCursorPos</primary></indexterm>
<indexterm><primary>Mouse class</primary><secondary>setCursorPos</secondary></indexterm>
<programlisting>
<![CDATA[
Form 1:
>>--setCursorPos(--point--)----------------------><
Form 2:
>>--setCursorPos(--x--,--y--)--------------------><
Generic form:
>>--setCursorPos(--newPosition--)----------------><
]]>
</programlisting>
<para>
The <emphasis role="italic">setCursorPos</emphasis> method moves the mouse cursor to the specified position. This
method can be used to force the repainting of the mouse cursor or to keep the mouse cursor within a specific
rectangle.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The argument(s) specify the (x, y) coordinates for the new position of the mouse cursor. These coordinates can be
specifed either as a <xref linkend="clsPoint"/> object or as 2 separate whole number arguments, as in
Form 2.
<variablelist>
<varlistentry><term>newPosition [required]</term>
<listitem>
<para>
Whether the coordinates are specified as a <computeroutput>point</computeroutput> object or in the x, y format
both coordinates are required. The coordinates are specified as
screen <xref linkend="defScreenCoordinates"/>) coordinates.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
Returns 0 on success or 1 on failure.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details</emphasis></term>
<listitem>
<para>
Sets the <xref linkend="dotSystemErrorCode"/>.
</para>
<para>
Raises syntax errors when incorrect arguments are detected.
</para>
</listitem></varlistentry>
<varlistentry id="exampleSetCursorPos"><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
The following example shows two methods: one indicating that processing has started and one indicating that
processing has completed. The method <emphasis role="italic">indicateBeginProcessing</emphasis> changes the mouse
cursor to the WAIT cursor and <emphasis role="italic">indicateEndProcessing</emphasis> restores the original mouse
cursor. Both methods retrieve the current position of the mouse and move it by one screen pixel in each direction
to force the repainting of the cursor.
</para>
<programlisting>
<![CDATA[
::method indicateBeginProcessing
expose oldCursor
mouse = .Mouse~new(self)
oldCursor = mouse~wait
p = mouse~getCursorPos
mouse~setCursorPos(p~incr)
::method indicateEndProcessing
expose oldCursor
mouse = .Mouse~new(self)
mouse~restoreCursor(oldCursor)
p = mouse~getCursorPos
mouse~setCursorPos(p~decr)
]]>
</programlisting>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Mouse::setCursorPos() -->
<section id="mthShowCursor" xreflabel="showCursor"><title>showCursor</title>
<indexterm><primary>showCursor</primary></indexterm>
<indexterm><primary>Mouse class</primary><secondary>showCursor</secondary></indexterm>
<programlisting>
<![CDATA[
>>--showCursor(--+--------+--)-------------------><
+--show--+
]]>
</programlisting>
<para>
Displays or hides the cursor.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The single argument is:
<variablelist>
<varlistentry><term>show [optional]</term>
<listitem>
<para>
Specifies whether the internal display counter, (see the Remarks section,) is to be incremented or decremented.
If .true, the display count is incremented by one. If <computeroutput>.false</computeroutput>, the display
count is decremented by one. The default is <computeroutput>.true</computeroutput>.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The new display count.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
The operating system maintains an internal display counter that determines whether the cursor should be displayed.
The cursor is displayed only if the display count is greater than or equal to 0. If a mouse is installed, the
initial display count is set to 0. If no mouse is installed, the display count is -1.
</para>
<para>
In early versions of Windows the internal counter was system wide, but now it is thread specific. What this means
in terms of ooDialog is that the cursor state, shown or hidden, will apply only to the dialog and all its child
windows. For a dialog, the child windows are the dialog control windows, and any
<xref linkend="clsControlDialog"/> windows, if present.
</para>
<para>
Note that this method does not hide or show the cursor, it changes the internal counter. This implies that if the
programmer invokes this method 10 times with <emphasis role="italic">show</emphasis> equal to
<computeroutput>.false</computeroutput>, it will take at least 10 invocations of the method with <emphasis
role="italic">show</emphasis> equal to <computeroutput>.true</computeroutput> to get the cursor to show.
</para>
</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"/> to 0. However, there are no system
errors that would change the variable from 0.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example is a code snippet from a program that hides the cursor while it is over one of the dialog windows in
the program and shows it when not over that dialog window
<programlisting>
<![CDATA[
::method hideCursor private
use strict arg obj
mouse = .Mouse~new(obj)
do while mouse~showCursor(.false) >= 0
nop
end
::method showCursor private
use strict arg obj
mouse = .Mouse~new(obj)
do while mouse~showCursor(.true) < 0
nop
end
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Mouse::showCursor() -->
<section id="mthTrackEvent" xreflabel="trackEvent"><title>trackEvent</title>
<indexterm><primary>trackEvent</primary></indexterm>
<indexterm><primary>Mouse class</primary><secondary>trackEvent</secondary></indexterm>
<programlisting>
<![CDATA[
>>--trackEvent(--+--------+--+-------------+--+----------+--)------------------><
+-event-+ +-,-hoverTime-+ +-,-answer-+
]]>
</programlisting>
<para>
The <emphasis role="italic">trackEvent</emphasis> method initiates mouse tracking behavior. It can also be used to
query the current tracking behavior. When mouse tracking is in effect mouse hover and mouse leave
<xref linkend="ovvEvents"/> notifications, depending on the type of tracking specified, will be generated.
Normally these event notifications are <emphasis role="italic">not</emphasis> generated.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The arguments are:
<variablelist>
<varlistentry><term>event [optional]</term>
<listitem>
<para>
A list of 1 or more of the following keywords separated by spaces, case is not significant. The keywords define
the tracking behavior to initiate. If this argument is omitted, the default list is <emphasis
role="italic">LEAVE</emphasis>:
</para>
<para>
<simplelist type='vert' columns='3'>
<member>CANCEL </member>
<member>HOVER </member>
<member>LEAVE </member>
<member>NONCLIENT</member>
<member>QUERY </member>
</simplelist>
<variablelist>
<varlistentry><term>CANCEL</term>
<listitem>
<para>
Cancel a prior tracking request. The type of tracking to be canceled should also be specified. For example,
to cancel hover tracking, the keyword list should be <emphasis role="italic">Cancel Hover</emphasis>. (Case
is not significant of course.)
</para>
</listitem></varlistentry>
<varlistentry><term>HOVER</term>
<listitem>
<para>
Hover notifications should be generated. The notification generated is the MOUSEHOVER notification, connect
this event using the <xref linkend="mthConnectEvent"/>method.
</para>
<para>
If hover tracking is requested while hover tracking is already active, the hover timer will be reset. The
operating system completely ignores this request if the mouse pointer is not over the window of this mouse
instance.
</para>
</listitem></varlistentry>
<varlistentry><term>LEAVE</term>
<listitem>
<para>
Leave notifications should be generated. The notification generated is the MOUSELEAVE notification, connect
this event using the <xref linkend="mthConnectEvent"/>method. If the mouse is not over
the window of this mouse instance, a leave notification is generated immediately and no further tracking is
performed.
</para>
</listitem></varlistentry>
<varlistentry><term>NONCLIENT</term>
<listitem>
<para>
Non-<xref linkend="defClientArea"/> hover and leave notifications should be generated. The
notifications generated are the NCMOUSELEAVE and NCMOUSEHOVER notifications, connect these events using the
<xref linkend="mthConnectEvent"/>method.
</para>
</listitem></varlistentry>
<varlistentry><term>QUERY</term>
<listitem>
<para>
Rather than treating this as a tracking request, the <emphasis role="italic">answer</emphasis> argument,
which must be a <computeroutput>.Directory</computeroutput> object, is filled in. The
<computeroutput>Directory</computeroutput> object will contain an EVENT and a HOVERTIME index. These indexs
will contain values such that, had they been used for the <emphasis role="italic">event</emphasis> and
<emphasis role="italic">hoverTime</emphasis> arguments to the <emphasis role="italic">trackEvent</emphasis>
method, the method would generate the current tracking.
</para>
<para>
The only anomaly is that the hover time out returned is always the actual time out and not
<link linkend="sctMouseConstantMethods">HOVER_DEFAULT</link>, if HOVER_DEFAULT was specified as <emphasis
role="italic">hoverTime</emphasis> during the original <emphasis role="italic">trackEvent</emphasis>
request.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term>hoverTime [optional]</term>
<listitem>
<para>
Specifies the hover time out, (if HOVER was specified in <emphasis role="italic">event</emphasis>,) in
milliseconds. The constant, <link linkend="sctMouseConstantMethods">HOVER_DEFAULT</link> can also be use to specify
the system default hover time out. The value of the system default hover time out can be determined, or changed,
through the <xref linkend="atrMouseHoverTime"/> attribute of the <xref linkend="clsSPI"/> (System Parameters
Infomation) class.
</para>
</listitem></varlistentry>
<varlistentry><term>answer [optional] [in / out]</term>
<listitem>
<para>
A <computeroutput>Directory</computeroutput> object in which the results of a QUERY request are returned. This
is required if the <emphasis role="italic">event</emphasis> argument contains the QUERY keyword, otherwise this
argument is ignored. On a successful return the <computeroutput>Directory</computeroutput> object will contain
the following indexes:
</para>
<variablelist>
<varlistentry><term>EVENT</term>
<listitem>
<para>
A keyword list, using the same keywords thar are listed for the <emphasis role="italic">event</emphasis>
argument. The keywords will reflect the current tracking. If the list had been used in a tracking request,
they would produce the current tracking.
</para>
</listitem></varlistentry>
<varlistentry><term>HOVERTIME</term>
<listitem>
<para>
The hover time out in effect for the current tracking. However, if HOVER_DEFAULT had been used for the
<emphasis role="italic">hoverTime</emphasis> argument in the tracking request, this value will be the actual
time out value, not the value of HOVER_DEFAULT.
</para>
</listitem></varlistentry>
</variablelist>
</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>
The mouse pointer is considered to be <emphasis role="italic">hovering</emphasis> when it stays within a specific
rectangle for a specific period of time. The <xref linkend="clsSPI"/> class has attributes that can be used
to retrieve (or change) the hover rectangle or hover time out value. The <xref linkend="atrMouseHoverWidth"/> and <xref
linkend="atrMouseHoverHeight"/> attributes reflect the hover rectangle. The <xref linkend="atrMouseHoverTime"/> attribute
reflects the hover time out.
</para>
<para>
The system default hover time out is initially the menu drop-down time, which is 400 milliseconds. The system
default hover rectangle is the same as the double-click rectangle. Hovever, these values may be changed / customized
by the user.
</para>
</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>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example connects the mouse move, leave, and hover events. The first time a mouse move is received, the
<emphasis role="italic">trackEvent</emphasis> method is used to request tracking for the leave and hover events.
When either one of the events is received, the tracking for that event is canceled. In order to receive further
events, a flag is set so that on the next mouse move event, the <emphasis role="italic">trackEvent</emphasis> method
is invoked again.
<programlisting>
<![CDATA[
::method init
...
mouse = .Mouse~new(self)
mouse~connectEvent('MOUSEMOVE')
mouse~connectEvent('MOUSELEAVE')
mouse~connectEvent('MOUSEHOVER')
-- so leave and hover tracking is requested on first mouse move
mouseEntered = .false
mouseHovering = .true
::method onMouseMove unguarded
expose mouseEntered mouseHovering
use arg keyState, p, mouse
if \ mouseEntered then do
if \ mouse~trackEvent("LEAVE") then do
say "trackEvent() failed. Error" .systemErrorCode ':' SysGetErrorText(.systemErrorCode)
end
mouseEntered = .true
end
if mouseHovering then do
if \ mouse~trackEvent("HOVER") then do
say "trackEvent() failed. Error" .systemErrorCode ':' SysGetErrorText(.systemErrorCode)
end
mouseHovering = .false
end
...
return .true
::method onMouseLeave unguarded
expose mouseEntered
use arg mouse
mouseEntered = .false
-- so hover tracking is started when mouse re-enters.
mouseHovering = .true
...
return .true
::method onMouseHover unguarded
expose mouseHovering
use arg keyState, mousePos, mouse
mouseHovering = .true
...
return .true
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Mouse::trackEvent() -->
<section id="mthWait" xreflabel="wait"><title>wait</title>
<indexterm><primary>wait</primary></indexterm>
<indexterm><primary>Mouse class</primary><secondary>wait</secondary></indexterm>
<programlisting>
<![CDATA[
>>--wait-----------------------------------------><
]]>
</programlisting>
<para>
Sets the mouse cursor to the system's default <emphasis role="italic">busy</emphasis> cursor, which is usually the
hourglass cursor.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
This method takes no arguments.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
Returns the previous cursor on success, or 0 on error.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
The <emphasis role="italic">wait</emphasis> method is convenience method. It is exactly equivalent to usingthe
<xref linkend="mthSetCursor"/> method with the WAIT keyword.
</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 a simple method to use:
<programlisting>
<![CDATA[
mouse = .Mouse~new(self)
oldCursor = mouse~wait
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Mouse::no() -->
</section> <!-- End Mouse Class -->