Source

wxPython / src / _event.i

Full commit
   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
/////////////////////////////////////////////////////////////////////////////
// Name:        _event.i
// Purpose:     SWIG interface for common event classes and event binders
//
// Author:      Robin Dunn
//
// Created:     24-May-1998
// RCS-ID:      $Id: _event.i 68414 2011-07-25 18:52:07Z RD $
// Copyright:   (c) 2003 by Total Control Software
// Licence:     wxWindows license
/////////////////////////////////////////////////////////////////////////////

// Not a %module


//---------------------------------------------------------------------------
// Include some extra python code here
%pythoncode "_event_ex.py"

//---------------------------------------------------------------------------
%newgroup;

// the predefined constants for the number of times we propagate event
// upwards window child-parent chain
enum wxEventPropagation
{
    // don't propagate it at all
    wxEVENT_PROPAGATE_NONE = 0,

    // propagate it until it is processed
    wxEVENT_PROPAGATE_MAX = INT_MAX
};


enum wxEventCategory
{
    // this is the category for those events which are generated to update
    // the appearance of the GUI but which (usually) do not comport data
    // processing, i.e. which do not provide input or output data
    // (e.g. size events, scroll events, etc).
    // They are events NOT directly generated by the user's input devices.
    wxEVT_CATEGORY_UI = 1,

    // this category groups those events which are generated directly from the
    // user through input devices like mouse and keyboard and usually result in
    // data to be processed from the application.
    // (e.g. mouse clicks, key presses, etc)
    wxEVT_CATEGORY_USER_INPUT = 2,

    // this category is for wxSocketEvent
    wxEVT_CATEGORY_SOCKET = 4,

    // this category is for wxTimerEvent
    wxEVT_CATEGORY_TIMER = 8,

    // this category is for any event used to send notifications from the
    // secondary threads to the main one or in general for notifications among
    // different threads (which may or may not be user-generated)
    wxEVT_CATEGORY_THREAD = 16,


    // implementation only

    // used in the implementations of DoYield()
    wxEVT_CATEGORY_UNKNOWN = 32,

    // a special category used as an argument to wxApp::Yield() to indicate that
    // Yield() should leave all wxEvents on the queue while emptying the native event queue
    // (native events will be processed but the wxEvents they generate will be queued)
    wxEVT_CATEGORY_CLIPBOARD = 64,


    // shortcut masks

    // this category groups those events which are emitted in response to
    // events of the native toolkit and which typically are not-"delayable".
    wxEVT_CATEGORY_NATIVE_EVENTS = wxEVT_CATEGORY_UI|wxEVT_CATEGORY_USER_INPUT,

    // used in wxApp::Yield to specify all event categories should be processed:
    wxEVT_CATEGORY_ALL =
        wxEVT_CATEGORY_UI|wxEVT_CATEGORY_USER_INPUT|wxEVT_CATEGORY_SOCKET| \
        wxEVT_CATEGORY_TIMER|wxEVT_CATEGORY_THREAD
};

//---------------------------------------------------------------------------
// Event types

wxEventType wxNewEventType();

%constant wxEventType wxEVT_ANY;

%constant wxEventType wxEVT_NULL;
%constant wxEventType wxEVT_FIRST;
%constant wxEventType wxEVT_USER_FIRST;

%constant wxEventType wxEVT_COMMAND_BUTTON_CLICKED;
%constant wxEventType wxEVT_COMMAND_CHECKBOX_CLICKED;
%constant wxEventType wxEVT_COMMAND_CHOICE_SELECTED;
%constant wxEventType wxEVT_COMMAND_LISTBOX_SELECTED;
%constant wxEventType wxEVT_COMMAND_LISTBOX_DOUBLECLICKED;
%constant wxEventType wxEVT_COMMAND_CHECKLISTBOX_TOGGLED;

%constant wxEventType wxEVT_COMMAND_MENU_SELECTED;
%constant wxEventType wxEVT_COMMAND_TOOL_CLICKED;
%constant wxEventType wxEVT_COMMAND_SLIDER_UPDATED;
%constant wxEventType wxEVT_COMMAND_RADIOBOX_SELECTED;
%constant wxEventType wxEVT_COMMAND_RADIOBUTTON_SELECTED;

%constant wxEventType wxEVT_COMMAND_SCROLLBAR_UPDATED;
%constant wxEventType wxEVT_COMMAND_VLBOX_SELECTED;
%constant wxEventType wxEVT_COMMAND_COMBOBOX_SELECTED;
%constant wxEventType wxEVT_COMMAND_TOOL_RCLICKED;
%constant wxEventType wxEVT_COMMAND_TOOL_ENTER;
%constant wxEventType wxEVT_COMMAND_TOOL_DROPDOWN_CLICKED;

%constant wxEventType wxEVT_COMMAND_COMBOBOX_DROPDOWN;
%constant wxEventType wxEVT_COMMAND_COMBOBOX_CLOSEUP;

%constant wxEventType wxEVT_THREAD;


// Mouse event types
%constant wxEventType wxEVT_LEFT_DOWN;
%constant wxEventType wxEVT_LEFT_UP;
%constant wxEventType wxEVT_MIDDLE_DOWN;
%constant wxEventType wxEVT_MIDDLE_UP;
%constant wxEventType wxEVT_RIGHT_DOWN;
%constant wxEventType wxEVT_RIGHT_UP;
%constant wxEventType wxEVT_MOTION;
%constant wxEventType wxEVT_ENTER_WINDOW;
%constant wxEventType wxEVT_LEAVE_WINDOW;
%constant wxEventType wxEVT_LEFT_DCLICK;
%constant wxEventType wxEVT_MIDDLE_DCLICK;
%constant wxEventType wxEVT_RIGHT_DCLICK;
%constant wxEventType wxEVT_SET_FOCUS;
%constant wxEventType wxEVT_KILL_FOCUS;
%constant wxEventType wxEVT_CHILD_FOCUS;
%constant wxEventType wxEVT_MOUSEWHEEL;
%constant wxEventType wxEVT_AUX1_DOWN;
%constant wxEventType wxEVT_AUX1_UP;
%constant wxEventType wxEVT_AUX1_DCLICK;
%constant wxEventType wxEVT_AUX2_DOWN;
%constant wxEventType wxEVT_AUX2_UP;
%constant wxEventType wxEVT_AUX2_DCLICK;

// Character input event type
%constant wxEventType wxEVT_CHAR;
%constant wxEventType wxEVT_CHAR_HOOK;
%constant wxEventType wxEVT_NAVIGATION_KEY;
%constant wxEventType wxEVT_KEY_DOWN;
%constant wxEventType wxEVT_KEY_UP;

%{
#if ! wxUSE_HOTKEY
#define wxEVT_HOTKEY -9999
#endif
%}

%constant wxEventType wxEVT_HOTKEY;


// Set cursor event
%constant wxEventType wxEVT_SET_CURSOR;

// wxScrollBar and wxSlider event identifiers
%constant wxEventType wxEVT_SCROLL_TOP;
%constant wxEventType wxEVT_SCROLL_BOTTOM;
%constant wxEventType wxEVT_SCROLL_LINEUP;
%constant wxEventType wxEVT_SCROLL_LINEDOWN;
%constant wxEventType wxEVT_SCROLL_PAGEUP;
%constant wxEventType wxEVT_SCROLL_PAGEDOWN;
%constant wxEventType wxEVT_SCROLL_THUMBTRACK;
%constant wxEventType wxEVT_SCROLL_THUMBRELEASE;
%constant wxEventType wxEVT_SCROLL_CHANGED;
%pythoncode { wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED }

// Scroll events from wxWindow
%constant wxEventType wxEVT_SCROLLWIN_TOP;
%constant wxEventType wxEVT_SCROLLWIN_BOTTOM;
%constant wxEventType wxEVT_SCROLLWIN_LINEUP;
%constant wxEventType wxEVT_SCROLLWIN_LINEDOWN;
%constant wxEventType wxEVT_SCROLLWIN_PAGEUP;
%constant wxEventType wxEVT_SCROLLWIN_PAGEDOWN;
%constant wxEventType wxEVT_SCROLLWIN_THUMBTRACK;
%constant wxEventType wxEVT_SCROLLWIN_THUMBRELEASE;

// System events
%constant wxEventType wxEVT_SIZE;
%constant wxEventType wxEVT_MOVE;
%constant wxEventType wxEVT_CLOSE_WINDOW;
%constant wxEventType wxEVT_END_SESSION;
%constant wxEventType wxEVT_QUERY_END_SESSION;
%constant wxEventType wxEVT_ACTIVATE_APP;
%constant wxEventType wxEVT_ACTIVATE;
%constant wxEventType wxEVT_CREATE;
%constant wxEventType wxEVT_DESTROY;
%constant wxEventType wxEVT_SHOW;
%constant wxEventType wxEVT_ICONIZE;
%constant wxEventType wxEVT_MAXIMIZE;
%constant wxEventType wxEVT_MOUSE_CAPTURE_CHANGED;
%constant wxEventType wxEVT_MOUSE_CAPTURE_LOST;
%constant wxEventType wxEVT_PAINT;
%constant wxEventType wxEVT_ERASE_BACKGROUND;
%constant wxEventType wxEVT_NC_PAINT;
%constant wxEventType wxEVT_MENU_OPEN;
%constant wxEventType wxEVT_MENU_CLOSE;
%constant wxEventType wxEVT_MENU_HIGHLIGHT;

%constant wxEventType wxEVT_CONTEXT_MENU;
%constant wxEventType wxEVT_SYS_COLOUR_CHANGED;
%constant wxEventType wxEVT_DISPLAY_CHANGED;
%constant wxEventType wxEVT_QUERY_NEW_PALETTE;
%constant wxEventType wxEVT_PALETTE_CHANGED;
%constant wxEventType wxEVT_DROP_FILES;
%constant wxEventType wxEVT_INIT_DIALOG;
%constant wxEventType wxEVT_IDLE;
%constant wxEventType wxEVT_UPDATE_UI;
%constant wxEventType wxEVT_SIZING;
%constant wxEventType wxEVT_MOVING;
%constant wxEventType wxEVT_MOVE_START;
%constant wxEventType wxEVT_MOVE_END;
%constant wxEventType wxEVT_HIBERNATE;

%constant wxEventType wxEVT_COMMAND_TEXT_COPY;
%constant wxEventType wxEVT_COMMAND_TEXT_CUT;
%constant wxEventType wxEVT_COMMAND_TEXT_PASTE;


// Generic command events
// Note: a click is a higher-level event than button down/up
%constant wxEventType wxEVT_COMMAND_LEFT_CLICK;
%constant wxEventType wxEVT_COMMAND_LEFT_DCLICK;
%constant wxEventType wxEVT_COMMAND_RIGHT_CLICK;
%constant wxEventType wxEVT_COMMAND_RIGHT_DCLICK;
%constant wxEventType wxEVT_COMMAND_SET_FOCUS;
%constant wxEventType wxEVT_COMMAND_KILL_FOCUS;
%constant wxEventType wxEVT_COMMAND_ENTER;



%pythoncode {
%#
%# Create some event binders
EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
EVT_MOVE_START = wx.PyEventBinder( wxEVT_MOVE_START )
EVT_MOVE_END = wx.PyEventBinder( wxEVT_MOVE_END )
EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
EVT_MOUSE_CAPTURE_LOST = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_LOST )

EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
EVT_MOUSE_AUX1_DOWN = wx.PyEventBinder( wxEVT_AUX1_DOWN )
EVT_MOUSE_AUX1_UP = wx.PyEventBinder( wxEVT_AUX1_UP )
EVT_MOUSE_AUX1_DCLICK = wx.PyEventBinder( wxEVT_AUX1_DCLICK )
EVT_MOUSE_AUX2_DOWN = wx.PyEventBinder( wxEVT_AUX2_DOWN )
EVT_MOUSE_AUX2_UP = wx.PyEventBinder( wxEVT_AUX2_UP )
EVT_MOUSE_AUX2_DCLICK = wx.PyEventBinder( wxEVT_AUX2_DCLICK )

EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
                                      wxEVT_LEFT_UP,
                                      wxEVT_MIDDLE_DOWN,
                                      wxEVT_MIDDLE_UP,
                                      wxEVT_RIGHT_DOWN,
                                      wxEVT_RIGHT_UP,
                                      wxEVT_MOTION,
                                      wxEVT_LEFT_DCLICK,
                                      wxEVT_MIDDLE_DCLICK,
                                      wxEVT_RIGHT_DCLICK,
                                      wxEVT_ENTER_WINDOW,
                                      wxEVT_LEAVE_WINDOW,
                                      wxEVT_MOUSEWHEEL,
                                      wxEVT_AUX1_DOWN,
                                      wxEVT_AUX1_UP,      
                                      wxEVT_AUX1_DCLICK,
                                      wxEVT_AUX2_DOWN,  
                                      wxEVT_AUX2_UP,      
                                      wxEVT_AUX2_DCLICK,
                                     ])


%# Scrolling from wxWindow (sent to wxScrolledWindow)
EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
                                  wxEVT_SCROLLWIN_BOTTOM,
                                  wxEVT_SCROLLWIN_LINEUP,
                                  wxEVT_SCROLLWIN_LINEDOWN,
                                  wxEVT_SCROLLWIN_PAGEUP,
                                  wxEVT_SCROLLWIN_PAGEDOWN,
                                  wxEVT_SCROLLWIN_THUMBTRACK,
                                  wxEVT_SCROLLWIN_THUMBRELEASE,
                                  ])

EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )

%# Scrolling from wx.Slider and wx.ScrollBar
EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
                               wxEVT_SCROLL_BOTTOM,
                               wxEVT_SCROLL_LINEUP,
                               wxEVT_SCROLL_LINEDOWN,
                               wxEVT_SCROLL_PAGEUP,
                               wxEVT_SCROLL_PAGEDOWN,
                               wxEVT_SCROLL_THUMBTRACK,
                               wxEVT_SCROLL_THUMBRELEASE,
                               wxEVT_SCROLL_CHANGED,
                               ])

EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED )
EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED

%# Scrolling from wx.Slider and wx.ScrollBar, with an id
EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
                                       wxEVT_SCROLL_BOTTOM,
                                       wxEVT_SCROLL_LINEUP,
                                       wxEVT_SCROLL_LINEDOWN,
                                       wxEVT_SCROLL_PAGEUP,
                                       wxEVT_SCROLL_PAGEDOWN,
                                       wxEVT_SCROLL_THUMBTRACK,
                                       wxEVT_SCROLL_THUMBRELEASE,
                                       wxEVT_SCROLL_CHANGED,
                                       ], 1)

EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1)
EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED

EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)

EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
EVT_TOOL_DROPDOWN = wx.PyEventBinder( wxEVT_COMMAND_TOOL_DROPDOWN_CLICKED, 1)
EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
EVT_COMBOBOX_DROPDOWN = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_DROPDOWN , 1)
EVT_COMBOBOX_CLOSEUP  = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_CLOSEUP , 1) 

EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)

EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )

EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)

EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )

EVT_TEXT_CUT   =  wx.PyEventBinder( wxEVT_COMMAND_TEXT_CUT )
EVT_TEXT_COPY  =  wx.PyEventBinder( wxEVT_COMMAND_TEXT_COPY )
EVT_TEXT_PASTE =  wx.PyEventBinder( wxEVT_COMMAND_TEXT_PASTE )

EVT_THREAD = wx.PyEventBinder( wxEVT_THREAD )
}

//---------------------------------------------------------------------------
%newgroup;

DocStr(wxEvent,
"An event is a structure holding information about an event passed to a
callback or member function. wx.Event is an abstract base class for
other event classes", "");

class wxEvent : public wxObject {
public:
    // wxEvent(int winid = 0, wxEventType commandType = wxEVT_NULL);     // *** This class is now an ABC
    ~wxEvent();

    DocDeclStr(
        void , SetEventType(wxEventType typ),
        "Sets the specific type of the event.", "");

    DocDeclStr(
        wxEventType , GetEventType() const,
        "Returns the identifier of the given event type, such as
``wxEVT_COMMAND_BUTTON_CLICKED``.", "");

    DocDeclStr(
        wxObject *, GetEventObject() const,
        "Returns the object (usually a window) associated with the event, if
any.", "");

    DocDeclStr(
        void , SetEventObject(wxObject *obj),
        "Sets the originating object, or in other words, obj is normally the
object that is sending the event.", "");

    long GetTimestamp() const;
    void SetTimestamp(long ts = 0);

    DocDeclStr(
        int  , GetId() const,
        "Returns the identifier associated with this event, such as a button
command id.", "");

    DocDeclStr(
        void , SetId(int Id),
        "Set's the ID for the event.  This is usually the ID of the window that
is sending the event, but it can also be a command id from a menu
item, etc.", "");

    
    DocDeclStr(
        wxEventCategory , GetEventCategory() const,
        "", "");
    

    DocDeclStr(
        bool , IsCommandEvent() const,
        "Returns true if the event is or is derived from `wx.CommandEvent` else
it returns false. Note: Exists only for optimization purposes.", "");


    DocDeclStr(
        void , Skip(bool skip = true),
        "This method can be used inside an event handler to control whether
further event handlers bound to this event will be called after the
current one returns. Without Skip() (or equivalently if Skip(False) is
used), the event will not be processed any more. If Skip(True) is
called, the event processing system continues searching for a further
handler function for this event, even though it has been processed
already in the current handler.", "");

    DocDeclStr(
        bool , GetSkipped() const,
        "Returns true if the event handler should be skipped, false otherwise.
:see: `Skip`", "");


    DocDeclStr(
        bool , ShouldPropagate() const,
        "Test if this event should be propagated to the parent window or not,
i.e. if the propagation level is currently greater than 0.", "");


    // Stop an event from propagating to its parent window, returns the old
    // propagation level value
    DocDeclStr(
        int , StopPropagation(),
        "Stop the event from propagating to its parent window.  Returns the old
propagation level value which may be later passed to
`ResumePropagation` to allow propagating the event again.", "");


    DocDeclStr(
        void , ResumePropagation(int propagationLevel),
        "Resume the event propagation by restoring the propagation level.  (For
example, you can use the value returned by an earlier call to
`StopPropagation`.)
", "");

    DocDeclStr(
        bool , WasProcessed(),
        "", "");
    

    bool ShouldProcessOnlyIn(wxEvtHandler *h) const;
    void DidntHonourProcessOnlyIn();
    
    
    // this function is used to create a copy of the event polymorphically and
    // all derived classes must implement it because otherwise wxPostEvent()
    // for them wouldn't work (it needs to do a copy of the event)
    virtual wxEvent *Clone() /* =0*/;

    %property(EventObject, GetEventObject, SetEventObject, doc="See `GetEventObject` and `SetEventObject`");
    %property(EventType, GetEventType, SetEventType, doc="See `GetEventType` and `SetEventType`");
    %property(Id, GetId, SetId, doc="See `GetId` and `SetId`");
    %property(Skipped, GetSkipped, doc="See `GetSkipped`");
    %property(Timestamp, GetTimestamp, SetTimestamp, doc="See `GetTimestamp` and `SetTimestamp`");
    
};


//---------------------------------------------------------------------------
%newgroup;

DocStr(wxPropagationDisabler,
"Helper class to temporarily change an event not to propagate.  Simply
create an instance of this class and then whe it is destroyed the
propogation of the event will be restored.", "");
class  wxPropagationDisabler
{
public:
    wxPropagationDisabler(wxEvent& event);
    ~wxPropagationDisabler();

    // for the 'with' statement
    %pythoncode { 
        def __enter__(self):
            return self
        def __exit__(self, exc_type, exc_val, exc_tb):
            return False
    }  
};


DocStr( wxPropagateOnce,
"A helper class that will temporarily lower propagation level of an
event.  Simply create an instance of this class and then whe it is
destroyed the propogation of the event will be restored.", "");
class  wxPropagateOnce
{
public:
    wxPropagateOnce(wxEvent& event);
    ~wxPropagateOnce();

    // for the 'with' statement
    %pythoncode { 
        def __enter__(self):
            return self
        def __exit__(self, exc_type, exc_val, exc_tb):
            return False
    }  
};


// A helper object used to temporarily make wxEvent::ShouldProcessOnlyIn()
// return true for the handler passed to its ctor.
class wxEventProcessInHandlerOnly
{
public:
    wxEventProcessInHandlerOnly(wxEvent& event, wxEvtHandler *handler);
    ~wxEventProcessInHandlerOnly();

    // for the 'with' statement
    %pythoncode { 
        def __enter__(self):
            return self
        def __exit__(self, exc_type, exc_val, exc_tb):
            return False
    }  
};


//---------------------------------------------------------------------------
%newgroup;

// TODO: wxCommandEvent now has an additional base class,
// wxEventBasicPayloadMixin handling the common int, string, etc. data
// methods.  Decide if that should be visible in the Python API too.


DocStr(wxCommandEvent,
"This event class contains information about command events, which
originate from a variety of simple controls, as well as menus and
toolbars.", "");

class wxCommandEvent : public wxEvent
{
public:
    wxCommandEvent(wxEventType commandType = wxEVT_NULL, int winid = 0);


//     // Set/Get client data from controls
//     void SetClientData(void* clientData) { m_clientData = clientData; }
//     void *GetClientData() const { return m_clientData; }

//     // Set/Get client object from controls
//     void SetClientObject(wxClientData* clientObject) { m_clientObject = clientObject; }
//     void *GetClientObject() const { return m_clientObject; }


    DocDeclStr(
        int , GetSelection() const,
        "Returns item index for a listbox or choice selection event (not valid
for a deselection).", "");


    void SetString(const wxString& s);
    DocDeclStr(
        wxString , GetString() const,
        "Returns item string for a listbox or choice selection event (not valid
for a deselection).", "");


    DocDeclStr(
        bool , IsChecked() const,
        "This method can be used with checkbox and menu events: for the
checkboxes, the method returns true for a selection event and false
for a deselection one. For the menu events, this method indicates if
the menu item just has become checked or unchecked (and thus only
makes sense for checkable menu items).", "");

    %pythoncode { Checked = IsChecked }

    DocDeclStr(
        bool , IsSelection() const,
        "For a listbox or similar event, returns true if it is a selection,
false if it is a deselection.", "");


    void SetExtraLong(long extraLong);
    DocDeclStr(
        long , GetExtraLong() const,
        "Returns extra information dependant on the event objects type. If the
event comes from a listbox selection, it is a boolean determining
whether the event was a selection (true) or a deselection (false). A
listbox deselection only occurs for multiple-selection boxes, and in
this case the index and string values are indeterminate and the
listbox must be examined by the application.", "");


    void SetInt(int i);
    DocDeclStr(
        int , GetInt() const,
        "Returns the integer identifier corresponding to a listbox, choice or
radiobox selection (only if the event was a selection, not a
deselection), or a boolean value representing the value of a checkbox.", "");


     %extend {
        DocStr(GetClientData,
               "Returns the client data object for a listbox or choice selection event, (if any.)", "");
        PyObject* GetClientData() {
            wxPyClientData* data = (wxPyClientData*)self->GetClientObject();
            if (data) {
                Py_INCREF(data->m_obj);
                return data->m_obj;
            } else {
                Py_INCREF(Py_None);
                return Py_None;
            }
        }

        DocStr(SetClientData,
               "Associate the given client data with the item at position n.", "");
        void SetClientData(PyObject* clientData) {
            wxPyClientData* data = new wxPyClientData(clientData);
            self->SetClientObject(data);
        }
    }
    %pythoncode {
         GetClientObject = GetClientData
         SetClientObject = SetClientData
    }

    virtual wxEvent *Clone() const;

    %property(ClientData, GetClientData, SetClientData, doc="See `GetClientData` and `SetClientData`");
    %property(ClientObject, GetClientObject, SetClientObject, doc="See `GetClientObject` and `SetClientObject`");
    %property(ExtraLong, GetExtraLong, SetExtraLong, doc="See `GetExtraLong` and `SetExtraLong`");
    %property(Int, GetInt, SetInt, doc="See `GetInt` and `SetInt`");
    %property(Selection, GetSelection, doc="See `GetSelection`");
    %property(String, GetString, SetString, doc="See `GetString` and `SetString`");
};

//---------------------------------------------------------------------------
%newgroup;

DocStr(wxNotifyEvent,
"An instance of this class (or one of its derived classes) is sent from
a control when the control's state is being changed and the control
allows that change to be prevented from happening.  The event handler
can call `Veto` or `Allow` to tell the control what to do.", "");

class wxNotifyEvent : public wxCommandEvent
{
public:
    wxNotifyEvent(wxEventType commandType = wxEVT_NULL, int winid = 0);

    DocDeclStr(
        void , Veto(),
        "Prevents the change announced by this event from happening.

It is in general a good idea to notify the user about the reasons for
vetoing the change because otherwise the applications behaviour (which
just refuses to do what the user wants) might be quite surprising.", "");


    DocDeclStr(
        void , Allow(),
        "This is the opposite of `Veto`: it explicitly allows the event to be
processed. For most events it is not necessary to call this method as
the events are allowed anyhow but some are forbidden by default (this
will be mentioned in the corresponding event description).", "");


    DocDeclStr(
        bool , IsAllowed(),
        "Returns true if the change is allowed (`Veto` hasn't been called) or
false otherwise (if it was).", "");

};


//---------------------------------------------------------------------------
%newgroup;


class wxThreadEvent : public wxEvent
{
public:
    wxThreadEvent(wxEventType eventType = wxEVT_THREAD, int id = wxID_ANY);

    long GetExtraLong() const;
    int GetInt() const;
    wxString GetString() const;
    void SetExtraLong(long extraLong);
    void SetInt(int intCommand);   
    void SetString(const wxString& string);

    %property(ExtraLong, GetExtraLong, SetExtraLong, doc="See `GetExtraLong` and `SetExtraLong`");
    %property(Int, GetInt, SetInt, doc="See `GetInt` and `SetInt`");
    %property(String, GetString, SetString, doc="See `GetString` and `SetString`");
};


//---------------------------------------------------------------------------
%newgroup;

DocStr(wxScrollEvent,
"A scroll event holds information about events sent from stand-alone
scrollbars and sliders. Note that scrolled windows do not send
instances of this event class, but send the `wx.ScrollWinEvent`
instead.", "

Events
-------
    =======================     ==========================================
    EVT_SCROLL                  Used to bind all scroll events
    EVT_SCROLL_TOP              scroll-to-top events (minimum position)
    EVT_SCROLL_BOTTOM           scroll-to-bottom events (maximum position)
    EVT_SCROLL_LINEUP           line up events
    EVT_SCROLL_LINEDOWN         line down events
    EVT_SCROLL_PAGEUP           page up events
    EVT_SCROLL_PAGEDOWN         page down events
    EVT_SCROLL_THUMBTRACK       thumbtrack events (frequent events sent
                                as the user drags the 'thumb')
    EVT_SCROLL_THUMBRELEASE     thumb release events
    EVT_SCROLL_CHANGED          End of scrolling
    =======================     ==========================================

Note
------
    The EVT_SCROLL_THUMBRELEASE event is only emitted when actually
    dragging the thumb using the mouse and releasing it (This
    EVT_SCROLL_THUMBRELEASE event is also followed by an
    EVT_SCROLL_CHANGED event).

    The EVT_SCROLL_CHANGED event also occurs when using the keyboard
    to change the thumb position, and when clicking next to the thumb
    (In all these cases the EVT_SCROLL_THUMBRELEASE event does not
    happen).

    In short, the EVT_SCROLL_CHANGED event is triggered when
    scrolling/ moving has finished. The only exception (unfortunately)
    is that changing the thumb position using the mousewheel does give
    a EVT_SCROLL_THUMBRELEASE event but NOT an EVT_SCROLL_CHANGED
    event.
");

class  wxScrollEvent : public wxCommandEvent
{
public:
    DocCtorStr(
        wxScrollEvent(wxEventType commandType = wxEVT_NULL,
                      int winid = 0, int pos = 0, int orient = 0),
        "", "");

    DocDeclStr(
        int , GetOrientation() const,
        "Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
the scrollbar.", "");

    DocDeclStr(
        int , GetPosition() const,
        "Returns the position of the scrollbar.", "");

    void SetOrientation(int orient);
    void SetPosition(int pos);
    
    %property(Orientation, GetOrientation, SetOrientation, doc="See `GetOrientation` and `SetOrientation`");
    %property(Position, GetPosition, SetPosition, doc="See `GetPosition` and `SetPosition`");
};


//---------------------------------------------------------------------------
%newgroup;

DocStr(wxScrollWinEvent,
"A wx.ScrollWinEvent holds information about scrolling and is sent from
scrolling windows.", "

Events
-------
    ==========================     ==========================================
    EVT_SCROLLWIN                  Used to bind all scrolled window scroll events
    EVT_SCROLLWIN_TOP              scroll-to-top events (minimum position)
    EVT_SCROLLWIN_BOTTOM           scroll-to-bottom events (maximum position)
    EVT_SCROLLWIN_LINEUP           line up events
    EVT_SCROLLWIN_LINEDOWN         line down events
    EVT_SCROLLWIN_PAGEUP           page up events
    EVT_SCROLLWIN_PAGEDOWN         page down events
    EVT_SCROLLWIN_THUMBTRACK       thumbtrack events (frequent events sent
                                   as the user drags the 'thumb')
    EVT_SCROLLWIN_THUMBRELEASE     thumb release events
    EVT_SCROLLWIN_CHANGED          End of scrolling
    ==========================     ==========================================

:see: `wx.ScrollEvent`
");

class wxScrollWinEvent : public wxEvent
{
public:
    wxScrollWinEvent(wxEventType commandType = wxEVT_NULL,
                     int pos = 0, int orient = 0);

    DocDeclStr(
        int , GetOrientation() const,
        "Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
the scrollbar.", "");

    DocDeclStr(
        int , GetPosition() const,
        "Returns the position of the scrollbar for the thumb track and release
events. Note that this field can't be used for the other events, you
need to query the window itself for the current position in that case.", "");

    void SetOrientation(int orient);
    void SetPosition(int pos);

    %property(Orientation, GetOrientation, SetOrientation, doc="See `GetOrientation` and `SetOrientation`");
    %property(Position, GetPosition, SetPosition, doc="See `GetPosition` and `SetPosition`");
};

//---------------------------------------------------------------------------
%newgroup;



DocStr(wxMouseEvent,
"This event class contains information about the events generated by
the mouse: they include mouse buttons press and release events and
mouse move events.

All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
a middle button so a portable application should avoid relying on the
events from it.

Note the difference between methods like `LeftDown` and `LeftIsDown`:
the former returns true when the event corresponds to the left mouse
button click while the latter returns true if the left mouse button is
currently being pressed. For example, when the user is dragging the
mouse you can use `LeftIsDown` to test whether the left mouse button
is (still) depressed. Also, by convention, if `LeftDown` returns true,
`LeftIsDown` will also return true in wxWidgets whatever the
underlying GUI behaviour is (which is platform-dependent). The same
applies, of course, to other mouse buttons as well.", "

Events
-------
    ==================     ==============================================
    EVT_LEFT_DOWN          Left mouse button down event. The handler
                           of this event should normally call
                           event.Skip() to allow the default processing
                           to take place as otherwise the window under
                           mouse wouldn't get the focus.
    EVT_LEFT_UP            Left mouse button up event
    EVT_LEFT_DCLICK        Left mouse button double click event
    EVT_MIDDLE_DOWN        Middle mouse button down event
    EVT_MIDDLE_UP          Middle mouse button up event
    EVT_MIDDLE_DCLICK      Middle mouse button double click event
    EVT_RIGHT_DOWN         Right mouse button down event
    EVT_RIGHT_UP           Right mouse button up event
    EVT_RIGHT_DCLICK       Right mouse button double click event
    EVT_MOTION             Event sent when the mouse is moving
    EVT_ENTER_WINDOW       Event sent when the mouse enters the
                           boundaries of a window.
    EVT_LEAVE_WINDOW       Sent when the mouse leaves the window's bounds
    EVT_MOUSEWHEEL         Mouse scroll wheel event
    EVT_MOUSE_EVENTS       Binds all mouse events at once.
    ==================     ==============================================

");



// Mouse event class
class  wxMouseEvent : public wxEvent, public wxMouseState
{
public:
    // turn off this typemap
    %typemap(out) wxMouseEvent*;    
    
    DocCtorStr(
        wxMouseEvent(wxEventType mouseType = wxEVT_NULL),
"Constructs a wx.MouseEvent.  Valid event types are:

    * wxEVT_ENTER_WINDOW
    * wxEVT_LEAVE_WINDOW
    * wxEVT_LEFT_DOWN
    * wxEVT_LEFT_UP
    * wxEVT_LEFT_DCLICK
    * wxEVT_MIDDLE_DOWN
    * wxEVT_MIDDLE_UP
    * wxEVT_MIDDLE_DCLICK
    * wxEVT_RIGHT_DOWN
    * wxEVT_RIGHT_UP
    * wxEVT_RIGHT_DCLICK
    * wxEVT_MOTION
    * wxEVT_MOUSEWHEEL ", "");

    // Turn it back on again
    %typemap(out) wxMouseEvent* { $result = wxPyMake_wxObject($1, $owner); }

    DocDeclStr(
        bool , IsButton() const,
        "Returns true if the event was a mouse button event (not necessarily a
button down event - that may be tested using `ButtonDown`).", "");


    DocDeclStr(
        bool , ButtonDown(int but = wxMOUSE_BTN_ANY) const,
        "If the argument is omitted, this returns true if the event was any
mouse button down event. Otherwise the argument specifies which
button-down event shold be checked for (see `Button` for the possible
values).", "");


    DocDeclStr(
        bool , ButtonDClick(int but = wxMOUSE_BTN_ANY) const,
        "If the argument is omitted, this returns true if the event was any
mouse double click event. Otherwise the argument specifies which
double click event to check for (see `Button` for the possible
values).", "");


    DocDeclStr(
        bool , ButtonUp(int but = wxMOUSE_BTN_ANY) const,
        "If the argument is omitted, this returns true if the event was any
mouse button up event. Otherwise the argument specifies which button
up event to check for (see `Button` for the possible values).", "");


    DocDeclStr(
        bool , Button(int button) const,
        "Returns true if the identified mouse button is changing state. Valid
values of button are:

     ====================      =====================================
     wx.MOUSE_BTN_LEFT         check if left button was pressed
     wx.MOUSE_BTN_MIDDLE       check if middle button was pressed
     wx.MOUSE_BTN_RIGHT        check if right button was pressed
     wx.MOUSE_BTN_ANY          check if any button was pressed
     ====================      =====================================
", "");



    DocDeclStr(
        int , GetButton() const,
        "Returns the mouse button which generated this event or
wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
right buttons respectively.", "");



    DocDeclStr(
        bool , LeftDown() const,
        "Returns true if the left mouse button state changed to down.", "");

    DocDeclStr(
        bool , MiddleDown() const,
        "Returns true if the middle mouse button state changed to down.", "");

    DocDeclStr(
        bool , RightDown() const,
        "Returns true if the right mouse button state changed to down.", "");

    DocDeclStr(
        bool , Aux1Down() const,
        "Returns true if the AUX1 mouse button state changed to down.", "");
    
    DocDeclStr(
        bool , Aux2Down() const,
        "Returns true if the AUX2 mouse button state changed to down.", "");


    DocDeclStr(
        bool , LeftUp() const,
        "Returns true if the left mouse button state changed to up.", "");

    DocDeclStr(
        bool , MiddleUp() const,
        "Returns true if the middle mouse button state changed to up.", "");

    DocDeclStr(
        bool , RightUp() const,
        "Returns true if the right mouse button state changed to up.", "");

    DocDeclStr(
        bool , Aux1Up() const,
        "Returns true if the AUX1  mouse button state changed to up.", "");
    
    DocDeclStr(
        bool , Aux2Up() const,
        "Returns true if the AUX2 mouse button state changed to up.", "");    



    DocDeclStr(
        bool , LeftDClick() const,
        "Returns true if the event was a left button double click.", "");

    DocDeclStr(
        bool , MiddleDClick() const,
        "Returns true if the event was a middle button double click.", "");

    DocDeclStr(
        bool , RightDClick() const,
        "Returns true if the event was a right button double click.", "");

    DocDeclStr(
        bool , Aux1DClick() const,
        "Returns true if the event was a AUX2 button double click.", "");
    
    DocDeclStr(
        bool , Aux2DClick() const,
        "Returns true if the event was a AUX2 button double click.", "");    



    DocDeclStr(
        bool , Dragging() const,
        "Returns true if this was a dragging event (motion while a button is
depressed).", "");


    DocDeclStr(
        bool , Moving() const,
        "Returns true if this was a motion event and no mouse buttons were
pressed. If any mouse button is held pressed, then this method returns
false and Dragging returns true.", "");


    DocDeclStr(
        bool , Entering() const,
        "Returns true if the mouse was entering the window.", "");


    DocDeclStr(
        bool , Leaving() const,
        "Returns true if the mouse was leaving the window.", "");

    DocDeclStr(
        int , GetClickCount() const,
        "Returns the number of mouse clicks associated with this event.", "");
    


    DocDeclStr(
        wxPoint , GetLogicalPosition(const wxDC& dc) const,
        "Returns the logical mouse position in pixels (i.e. translated
according to the translation set for the DC, which usually indicates
that the window has been scrolled).", "");


    DocDeclStr(
        int , GetWheelRotation() const,
        "Get wheel rotation, positive or negative indicates direction of
rotation. Current devices all send an event when rotation is equal to
+/-WheelDelta, but this allows for finer resolution devices to be
created in the future. Because of this you shouldn't assume that one
event is equal to 1 line or whatever, but you should be able to either
do partial line scrolling or wait until +/-WheelDelta rotation values
have been accumulated before scrolling.", "");


    DocDeclStr(
        int , GetWheelDelta() const,
        "Get wheel delta, normally 120. This is the threshold for action to be
taken, and one such action (for example, scrolling one increment)
should occur for each delta.", "");

    DocDeclStr(
        int , GetWheelAxis() const,
        "Gets the axis the wheel operation concerns, 0 being the y axis as on
most mouse wheels, 1 is the x axis for things like MightyMouse scrolls
or horizontal trackpad scrolling.", "");
    

    DocDeclStr(
        int , GetLinesPerAction() const,
        "Returns the configured number of lines (or whatever) to be scrolled
per wheel action. Defaults to three.", "");


    DocDeclStr(
        bool , IsPageScroll() const,
        "Returns true if the system has been setup to do page scrolling with
the mouse wheel instead of line scrolling.", "");


    %property(LinesPerAction, GetLinesPerAction, doc="See `GetLinesPerAction`");
    %property(LogicalPosition, GetLogicalPosition, doc="See `GetLogicalPosition`");
    %property(WheelDelta, GetWheelDelta, doc="See `GetWheelDelta`");
    %property(WheelRotation, GetWheelRotation, doc="See `GetWheelRotation`");
};

//---------------------------------------------------------------------------
%newgroup;

// Cursor set event

DocStr(wxSetCursorEvent,
"A SetCursorEvent is generated when the mouse cursor is about to be set
as a result of mouse motion. This event gives the application the
chance to perform specific mouse cursor processing based on the
current position of the mouse within the window. Use the `SetCursor`
method to specify the cursor you want to be displayed.", "");

class wxSetCursorEvent : public wxEvent
{
public:
    DocCtorStr(
        wxSetCursorEvent(wxCoord x = 0, wxCoord y = 0),
        "Construct a new `wx.SetCursorEvent`.", "");

    DocDeclStr(
        wxCoord , GetX() const,
        "Returns the X coordinate of the mouse in client coordinates.", "");

    DocDeclStr(
        wxCoord , GetY() const,
        "Returns the Y coordinate of the mouse in client coordinates.", "");


    DocDeclStr(
        void , SetCursor(const wxCursor& cursor),
        "Sets the cursor associated with this event.", "");

    DocDeclStr(
        const wxCursor& , GetCursor() const,
        "Returns a reference to the cursor specified by this event.", "");

    DocDeclStr(
        bool , HasCursor() const,
        "Returns true if the cursor specified by this event is a valid cursor.", "");

    %property(Cursor, GetCursor, SetCursor, doc="See `GetCursor` and `SetCursor`");
    %property(X, GetX, doc="See `GetX`");
    %property(Y, GetY, doc="See `GetY`");
};






//---------------------------------------------------------------------------
%newgroup;

// key categories: the bit flags for IsKeyInCategory() function
//
// the enum values used may change in future version of wx
// use the named constants only, or bitwise combinations thereof
enum wxKeyCategoryFlags
{
    // arrow keys, on and off numeric keypads
    WXK_CATEGORY_ARROW  = 1,

    // page up and page down keys, on and off numeric keypads
    WXK_CATEGORY_PAGING = 2,

    // home and end keys, on and off numeric keypads
    WXK_CATEGORY_JUMP   = 4,

    // tab key, on and off numeric keypads
    WXK_CATEGORY_TAB    = 8,

    // backspace and delete keys, on and off numeric keypads
    WXK_CATEGORY_CUT    = 16,

    // all keys usually used for navigation
    WXK_CATEGORY_NAVIGATION = WXK_CATEGORY_ARROW |
                              WXK_CATEGORY_PAGING |
                              WXK_CATEGORY_JUMP
};


DocStr(wxKeyEvent,
"This event class contains information about keypress and character
events.  These events are only sent to the widget that currently has
the keyboard focus.

Notice that there are three different kinds of keyboard events in
wxWidgets: key down and up events and char events. The difference
between the first two is clear - the first corresponds to a key press
and the second to a key release - otherwise they are identical. Just
note that if the key is maintained in a pressed state you will
typically get a lot of (automatically generated) down events but only
one up so it is wrong to assume that there is one up event
corresponding to each down one.

Both key events provide untranslated key codes while the char event
carries the translated one. The untranslated code for alphanumeric
keys is always an upper case value. For the other keys it is one of
WXK_XXX values from the keycodes table. The translated key is, in
general, the character the user expects to appear as the result of the
key combination when typing the text into a text entry zone, for
example.

A few examples to clarify this (all assume that CAPS LOCK is unpressed
and the standard US keyboard): when the 'A' key is pressed, the key
down event key code is equal to ASCII A == 65. But the char event key
code is ASCII a == 97. On the other hand, if you press both SHIFT and
'A' keys simultaneously , the key code in key down event will still be
just 'A' while the char event key code parameter will now be 'A' as
well.

Although in this simple case it is clear that the correct key code
could be found in the key down event handler by checking the value
returned by `ShiftDown`, in general you should use EVT_CHAR for this
as for non alphanumeric keys or non-US keyboard layouts the
translation is keyboard-layout dependent and can only be done properly
by the system itself.

Another kind of translation is done when the control key is pressed:
for example, for CTRL-A key press the key down event still carries the
same key code 'A' as usual but the char event will have key code of 1,
the ASCII value of this key combination.

You may discover how the other keys on your system behave
interactively by running the KeyEvents sample in the wxPython demo and
pressing some keys while the blue box at the top has the keyboard
focus.

**Note**: If a key down event is caught and the event handler does not
call event.Skip() then the coresponding char event will not
happen. This is by design and enables the programs that handle both
types of events to be a bit simpler.

**Note for Windows programmers**: The key and char events in wxWidgets
are similar to but slightly different from Windows WM_KEYDOWN and
WM_CHAR events. In particular, Alt-x combination will generate a char
event in wxWidgets (unless it is used as an accelerator).

**Tip**: be sure to call event.Skip() for events that you don't
process in key event function, otherwise menu shortcuts may cease to
work under Windows.
", "

Events
------
    ==================     ==============================================
    wx.EVT_KEY_DOWN        Sent when a keyboard key has been pressed
    wx.EVT_KEY_UP          Sent when a keyboard key has been released
    wx.EVT_CHAR            Sent for translated character events.
    ==================     ==============================================


Keycode Table
-------------
    ===========  ==============  ========  ====================  =================
    WXK_BACK     WXK_EXECUTE     WXK_F1    WXK_NUMPAD_SPACE      WXK_WINDOWS_LEFT
    WXK_TAB      WXK_SNAPSHOT    WXK_F2    WXK_NUMPAD_TAB        WXK_WINDOWS_RIGHT
    WXK_RETURN   WXK_INSERT      WXK_F3    WXK_NUMPAD_ENTER      WXK_WINDOWS_MENU
    WXK_ESCAPE   WXK_HELP        WXK_F4    WXK_NUMPAD_F1         WXK_SPECIAL1
    WXK_SPACE    WXK_NUMPAD0     WXK_F5    WXK_NUMPAD_F2         WXK_SPECIAL2
    WXK_DELETE   WXK_NUMPAD1     WXK_F6    WXK_NUMPAD_F3         WXK_SPECIAL3
    WXK_LBUTTON  WXK_NUMPAD2     WXK_F7    WXK_NUMPAD_F4         WXK_SPECIAL4
    WXK_RBUTTON  WXK_NUMPAD3     WXK_F8    WXK_NUMPAD_HOME       WXK_SPECIAL5
    WXK_CANCEL   WXK_NUMPAD4     WXK_F9    WXK_NUMPAD_LEFT       WXK_SPECIAL6
    WXK_MBUTTON  WXK_NUMPAD5     WXK_F10   WXK_NUMPAD_UP         WXK_SPECIAL7
    WXK_CLEAR    WXK_NUMPAD6     WXK_F11   WXK_NUMPAD_RIGHT      WXK_SPECIAL8
    WXK_SHIFT    WXK_NUMPAD7     WXK_F12   WXK_NUMPAD_DOWN       WXK_SPECIAL9
    WXK_ALT      WXK_NUMPAD8     WXK_F13   WXK_NUMPAD_PRIOR      WXK_SPECIAL10
    WXK_CONTROL  WXK_NUMPAD9     WXK_F14   WXK_NUMPAD_PAGEUP     WXK_SPECIAL11
    WXK_MENU     WXK_MULTIPLY    WXK_F15   WXK_NUMPAD_NEXT       WXK_SPECIAL12
    WXK_PAUSE    WXK_ADD         WXK_F16   WXK_NUMPAD_PAGEDOWN   WXK_SPECIAL13
    WXK_CAPITAL  WXK_SEPARATOR   WXK_F17   WXK_NUMPAD_END        WXK_SPECIAL14
    WXK_PRIOR    WXK_SUBTRACT    WXK_F18   WXK_NUMPAD_BEGIN      WXK_SPECIAL15
    WXK_NEXT     WXK_DECIMAL     WXK_F19   WXK_NUMPAD_INSERT     WXK_SPECIAL16
    WXK_END      WXK_DIVIDE      WXK_F20   WXK_NUMPAD_DELETE     WXK_SPECIAL17
    WXK_HOME     WXK_NUMLOCK     WXK_F21   WXK_NUMPAD_EQUAL      WXK_SPECIAL18
    WXK_LEFT     WXK_SCROLL      WXK_F22   WXK_NUMPAD_MULTIPLY   WXK_SPECIAL19
    WXK_UP       WXK_PAGEUP      WXK_F23   WXK_NUMPAD_ADD        WXK_SPECIAL20
    WXK_RIGHT    WXK_PAGEDOWN    WXK_F24   WXK_NUMPAD_SEPARATOR
    WXK_DOWN                               WXK_NUMPAD_SUBTRACT
    WXK_SELECT                             WXK_NUMPAD_DECIMAL
    WXK_PRINT                              WXK_NUMPAD_DIVIDE
    ===========  ==============  ========  ====================  =================
");

class wxKeyEvent : public wxEvent, public wxKeyboardState
{
public:
    DocCtorStr(
        wxKeyEvent(wxEventType eventType = wxEVT_NULL),
        "Construct a new `wx.KeyEvent`.  Valid event types are:
    * ", "");


    DocDeclStr(
        int , GetKeyCode() const,
        "Returns the virtual key code. ASCII events return normal ASCII values,
while non-ASCII events return values such as WXK_LEFT for the left
cursor key. See `wx.KeyEvent` for a full list of the virtual key
codes.

Note that in Unicode build, the returned value is meaningful only if
the user entered a character that can be represented in current
locale's default charset. You can obtain the corresponding Unicode
character using `GetUnicodeKey`.", "");
    
//    %pythoncode { KeyCode = GetKeyCode }  this will be hidden by the property


    // returns true iff this event's key code is of a certain type
    bool IsKeyInCategory(int category) const;

    
    %extend {
        DocStr(
            GetUnicodeKey,
            "Returns the Unicode character corresponding to this key event.  This
function is only meaningful in a Unicode build of wxPython.", "");
        int GetUnicodeKey() {
        %#if wxUSE_UNICODE
            return self->GetUnicodeKey();
        %#else
            return 0;
        %#endif
        }
    }
    %pythoncode { GetUniChar = GetUnicodeKey }

    %extend {
        DocStr(
            SetUnicodeKey,
            "Set the Unicode value of the key event, but only if this is a Unicode
build of wxPython.", "");
        void SetUnicodeKey(int uniChar) {
            %#if wxUSE_UNICODE
                self->m_uniChar = uniChar;
            %#endif
        }
    }

    DocDeclStr(
        wxUint32 , GetRawKeyCode() const,
        "Returns the raw key code for this event. This is a platform-dependent
scan code which should only be used in advanced
applications. Currently the raw key codes are not supported by all
ports.", "");


    DocDeclStr(
        wxUint32 , GetRawKeyFlags() const,
        "Returns the low level key flags for this event. The flags are
platform-dependent and should only be used in advanced applications.
Currently the raw key flags are not supported by all ports.", "");



    DocStr(GetPosition,   // sets the docstring for both
           "Find the position of the event, if applicable.", "");
    wxPoint GetPosition();

    DocDeclAName(
        void, GetPosition(long *OUTPUT, long *OUTPUT),
        "GetPositionTuple() -> (x,y)",
        GetPositionTuple);


    DocDeclStr(
        wxCoord , GetX() const,
        "Returns the X position (in client coordinates) of the event, if
applicable.", "");


    DocDeclStr(
        wxCoord , GetY() const,
        "Returns the Y position (in client coordinates) of the event, if
applicable.", "");


public:
    wxCoord       m_x, m_y;
    long          m_keyCode;

    wxUint32      m_rawCode;
    wxUint32      m_rawFlags;

    %property(KeyCode, GetKeyCode, doc="See `GetKeyCode`");
    %property(Position, GetPosition, doc="See `GetPosition`");
    %property(RawKeyCode, GetRawKeyCode, doc="See `GetRawKeyCode`");
    %property(RawKeyFlags, GetRawKeyFlags, doc="See `GetRawKeyFlags`");
    %property(UnicodeKey, GetUnicodeKey, SetUnicodeKey, doc="See `GetUnicodeKey` and `SetUnicodeKey`");
    %property(X, GetX, doc="See `GetX`");
    %property(Y, GetY, doc="See `GetY`");
};

//---------------------------------------------------------------------------
%newgroup;

// Size event class

DocStr(wxSizeEvent,
"A size event holds information about size change events.  The EVT_SIZE
handler function will be called when the window it is bound to has
been resized.

Note that the size passed is of the whole window: call
`wx.Window.GetClientSize` for the area which may be used by the
application.

When a window is resized, usually only a small part of the window is
damaged and and that area is all that is in the update region for the
next paint event. However, if your drawing depends on the size of the
window, you may need to clear the DC explicitly and repaint the whole
window. In which case, you may need to call `wx.Window.Refresh` to
invalidate the entire window.
", "");

class wxSizeEvent : public wxEvent
{
public:
    DocCtorStr(
        wxSizeEvent(const wxSize& sz=wxDefaultSize, int winid = 0),
        "Construct a new ``wx.SizeEvent``.", "");

    DocDeclStr(
        wxSize , GetSize() const,
        "Returns the entire size of the window generating the size change
event.", "");

    wxRect GetRect() const;
    void SetRect(wxRect rect);

    void SetSize(wxSize size);

    wxSize m_size;
    wxRect m_rect;
    
    %property(Rect, GetRect, SetRect, doc="See `GetRect` and `SetRect`");
    %property(Size, GetSize, SetSize, doc="See `GetSize` and `SetSize`");
};


//---------------------------------------------------------------------------
%newgroup;

DocStr(wxMoveEvent,
"This event object is sent for EVT_MOVE event bindings when a window is
moved to a new position.", "");

class wxMoveEvent : public wxEvent
{
public:
    DocCtorStr(
        wxMoveEvent(const wxPoint& pos=wxDefaultPosition, int winid = 0),
        "Constructor.", "");

    DocDeclStr(
        wxPoint , GetPosition() const,
        "Returns the position of the window generating the move change event.", "");

    wxRect GetRect() const;
    void SetRect(const wxRect& rect);
    void SetPosition(const wxPoint& pos);

    %pythoncode {
        m_pos =  property(GetPosition, SetPosition)
        m_rect = property(GetRect, SetRect)
    }

    %property(Position, GetPosition, SetPosition, doc="See `GetPosition` and `SetPosition`");
    %property(Rect, GetRect, SetRect, doc="See `GetRect` and `SetRect`");
    
};

//---------------------------------------------------------------------------
%newgroup;

DocStr(wxPaintEvent,
"A paint event is sent when a window's contents needs to be repainted.
Note that in an EVT_PAINT handler the application must *always* create
a `wx.PaintDC` object, even if you do not use it.  Otherwise MS
Windows assumes that the window has not been painted yet and will send
the event again, causing endless refreshes.

You can optimize painting by retrieving the rectangles that have been
damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
and only repainting these rectangles. The rectangles are in terms of
the client area, and are unscrolled, so you will need to do some
calculations using the current view position to obtain logical,
scrolled units.
", "");

class wxPaintEvent : public wxEvent
{
public:
    DocCtorStr(
        wxPaintEvent(int Id = 0),
        "", "");
};


class wxNcPaintEvent : public wxEvent
{
public:
    wxNcPaintEvent(int winid = 0);
};

//---------------------------------------------------------------------------
%newgroup;

DocStr(wxEraseEvent,
"An erase event is sent whenever the background of a window needs to be
repainted.  To intercept this event use the EVT_ERASE_BACKGROUND event
binder.  On some platforms, such as GTK+, this event is simulated
(simply generated just before the paint event) and may cause flicker.

To paint a custom background use the `GetDC` method and use the returned
device context if it is not ``None``, otherwise create a temporary
`wx.ClientDC` and draw on that.
", "");

class wxEraseEvent : public wxEvent
{
public:
    DocCtorStr(
        wxEraseEvent(int Id = 0, wxDC *dc = NULL),
        "Constructor", "");

    DocDeclStr(
        wxDC *, GetDC() const,
        "Returns the device context the event handler should draw upon.  If
``None`` is returned then create a temporary `wx.ClientDC` and use
that instead.", "");

    %property(DC, GetDC, doc="See `GetDC`"); 
};


//---------------------------------------------------------------------------
%newgroup;

DocStr(wxFocusEvent,
"A focus event is sent when a window's focus changes. The window losing
focus receives an EVT_KILL_FOCUS event while the window gaining it
gets an EVT_SET_FOCUS event.

Notice that the set focus event happens both when the user gives focus
to the window (whether using the mouse or keyboard) and when it is
done from the program itself using `wx.Window.SetFocus`.
", "");

class wxFocusEvent : public wxEvent
{
public:
    DocCtorStr(
        wxFocusEvent(wxEventType type = wxEVT_NULL, int winid = 0),
        "Constructor", "");

    DocDeclStr(
        wxWindow *, GetWindow() const,
        "Returns the other window associated with this event, that is the
window which had the focus before for the EVT_SET_FOCUS event and the
window which is going to receive focus for the wxEVT_KILL_FOCUS event.

Warning: the window returned may be None!", "");

    void SetWindow(wxWindow *win);

    %property(Window, GetWindow, SetWindow, doc="See `GetWindow` and `SetWindow`");
};

//---------------------------------------------------------------------------
%newgroup;

DocStr(wxChildFocusEvent,
"A child focus event is sent to a (parent-)window when one of its child
windows gains focus, so that the window could restore the focus back
to its corresponding child if it loses it now and regains later.

Notice that child window is the direct child of the window receiving
the event, and so may not be the actual widget recieving focus if it
is further down the containment heirarchy.  Use `wx.Window.FindFocus`
to get the widget that is actually receiving focus.", "");


class wxChildFocusEvent : public wxCommandEvent
{
public:
    DocCtorStr(
        wxChildFocusEvent(wxWindow *win = NULL),
        "Constructor", "");

    DocDeclStr(
        wxWindow *, GetWindow() const,
        "The window, or (grand)parent of the window which has just received the
focus.", "");

    %property(Window, GetWindow, doc="See `GetWindow`");
};

//---------------------------------------------------------------------------
%newgroup;

DocStr(wxActivateEvent,
"An activate event is sent when a top-level window or the entire
application is being activated or deactivated.

A top-level window (a dialog or frame) receives an activate event when
is being activated or deactivated. This is indicated visually by the
title bar changing colour, and a subwindow gaining the keyboard focus.
An application is activated or deactivated when one of its frames
becomes activated, or a frame becomes inactivate resulting in all
application frames being inactive.

Please note that usually you should call event.Skip() in your handlers
for these events so the default handlers will still be called, as not
doing so can result in strange effects.
", "

Events
-------
    =======================     ==========================================
    wx.EVT_ACTIVATE             Sent to a frame when it has been activated
                                or deactivated.
    wx.EVT_ACTIVATE_APP         Sent to the app object when its activation
                                state changes.
    =======================     ==========================================
");


class wxActivateEvent : public wxEvent
{
public:
    DocCtorStr(
        wxActivateEvent(wxEventType type = wxEVT_NULL, bool active = true, int Id = 0),
        "Constructor", "");

    DocDeclStr(
        bool , GetActive() const,
        "Returns true if the application or window is being activated, false
otherwise.", "");

    %property(Active, GetActive, doc="See `GetActive`");
};


//---------------------------------------------------------------------------
%newgroup;

DocStr(wxInitDialogEvent,
"A wx.InitDialogEvent is sent as a dialog is being initialised, or for
any window when `wx.Window.InitDialog` is called.  Handlers for this
event can transfer data to the window, or anything else that should be
done before the user begins editing the form. The default handler
calls `wx.Window.TransferDataToWindow`.", "

Events
-------
    =======================     ==========================================
    wx.EVT_INIT_DIALOG          Binder for init dialog events.
    =======================     ==========================================
");

class wxInitDialogEvent : public wxEvent
{
public:
    DocCtorStr(
        wxInitDialogEvent(int Id = 0),
        "Constructor", "");
};


//---------------------------------------------------------------------------
%newgroup;

DocStr(wxMenuEvent,
"This class is used for a variety of menu-related events.  Note that
these do not include menu command events, which are handled by sending
`wx.CommandEvent` objects.

The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
text in the first field of the status bar.", "

Events
-------
    =========================   ==========================================
    wx.EVT_MENU_OPEN            A menu is about to be opened. On Windows,
                                this is only sent once for each navigation
                                of the menubar (up until all menus have closed).
    wx.EVT_MENU_CLOSE           A menu has been just closed.
    wx.EVT_MENU_HIGHLIGHT       Sent when the menu item with the specified id
                                has been highlighted: used by default to show
                                help prompts in the `wx.Frame`'s status bar.
    wx.EVT_MENU_HIGHLIGHT_ALL   Can be used to catch the menu highlight
                                event for all menu items.
    =========================   ==========================================
");

class wxMenuEvent : public wxEvent
{
public:
    DocCtorStr(
        wxMenuEvent(wxEventType type = wxEVT_NULL, int winid = 0, wxMenu* menu = NULL),
        "Constructor", "");

    DocDeclStr(
        int , GetMenuId() const,
        "Returns the menu identifier associated with the event. This method
should be only used with the HIGHLIGHT events.", "");


    DocDeclStr(
        bool , IsPopup() const,
        "Returns ``True`` if the menu which is being opened or closed is a
popup menu, ``False`` if it is a normal one.  This method should only
be used with the OPEN and CLOSE events.", "");


    DocDeclStr(
        wxMenu* , GetMenu() const,
        "Returns the menu which is being opened or closed. This method should
only be used with the OPEN and CLOSE events.", "");

    %property(Menu, GetMenu, doc="See `GetMenu`");
    %property(MenuId, GetMenuId, doc="See `GetMenuId`");
};

//---------------------------------------------------------------------------
%newgroup;

DocStr(wxCloseEvent,
"This event class contains information about window and session close
events.

The handler function for EVT_CLOSE is called when the user has tried
to close a a frame or dialog box using the window manager controls or
the system menu. It can also be invoked by the application itself
programmatically, for example by calling the `wx.Window.Close`
function.

You should check whether the application is forcing the deletion of
the window using `CanVeto`. If it returns ``False``, you must destroy
the window using `wx.Window.Destroy`. If the return value is ``True``,
it is up to you whether you respond by destroying the window or not.
For example you may wish to display a message dialog prompting to save
files or to cancel the close.

If you don't destroy the window, you should call `Veto` to let the
calling code know that you did not destroy the window. This allows the
`wx.Window.Close` function to return ``True`` or ``False`` depending
on whether the close instruction was honored or not.", "

Events
-------
    =========================   ==========================================
    wx.EVT_CLOSE                This event is sent to a top-level window
                                when it has been requested to close either
                                from the user or programatically.
    wx.EVT_QUERY_END_SESSION    This event is sent to the `wx.App` when the
                                system is about to be logged off, giving the
                                app a chance to veto the shutdown.
    wx.EVT_END_SESSION          This event is sent to the `wx.App` when the
                                system is being logged off.
    =========================   ==========================================
");

class wxCloseEvent : public wxEvent
{
public:
    DocCtorStr(
        wxCloseEvent(wxEventType type = wxEVT_NULL, int winid = 0),
        "Constructor.", "");

    DocDeclStr(
        void , SetLoggingOff(bool logOff),
        "Sets the 'logging off' flag.", "");

    DocDeclStr(
        bool , GetLoggingOff() const,
        "Returns ``True`` if the user is logging off or ``False`` if the
system is shutting down. This method can only be called for end
session and query end session events, it doesn't make sense for close
window event.", "");


    DocDeclStr(
        void , Veto(bool veto = true),
        "Call this from your event handler to veto a system shutdown or to
signal to the calling application that a window close did not happen.

You can only veto a shutdown or close if `CanVeto` returns true.", "");

    bool GetVeto() const;

    DocDeclStr(
        void , SetCanVeto(bool canVeto),
        "Sets the 'can veto' flag.", "");

    DocDeclStr(
        bool , CanVeto() const,
        "Returns true if you can veto a system shutdown or a window close
event. Vetoing a window close event is not possible if the calling
code wishes to force the application to exit, and so this function
must be called to check this.", "");

    %property(LoggingOff, GetLoggingOff, SetLoggingOff, doc="See `GetLoggingOff` and `SetLoggingOff`");
};


//---------------------------------------------------------------------------
%newgroup;

DocStr(wxShowEvent,
"An EVT_SHOW event is sent when a window is shown or hidden.", "");

class wxShowEvent : public wxEvent
{
public:
    wxShowEvent(int winid = 0, bool show = false);

    void SetShow(bool show);
    bool IsShown() const;
    %pythoncode { GetShow = IsShown }
    
    %property(Show, IsShown, SetShow, doc="See `GetShow` and `SetShow`");
};


//---------------------------------------------------------------------------
%newgroup;

DocStr(wxIconizeEvent,
"An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
restored.", "");

class wxIconizeEvent: public wxEvent
{
public:
    wxIconizeEvent(int id = 0, bool iconized = true);

    DocDeclStr(
        bool , IsIconized(),
        "Returns ``True`` if the frame has been iconized, ``False`` if it has
been restored.", "");

    %pythoncode { Iconized = IsIconized }
};


//---------------------------------------------------------------------------
%newgroup;

DocStr(wxMaximizeEvent,
"An EVT_MAXIMIZE event is sent when a frame is maximized or restored.", "");

class wxMaximizeEvent: public wxEvent
{
public:
    wxMaximizeEvent(int id = 0);
};

//---------------------------------------------------------------------------
%newgroup;

DocStr(wxDropFilesEvent,
"This class is used for drop files events, that is, when files have
been dropped onto the window. This functionality is only available
under Windows. The window must have previously been enabled for
dropping by calling `wx.Window.DragAcceptFiles`.

Important note: this is a separate implementation to the more general
drag and drop implementation using `wx.FileDropTarget`, and etc. This
implementation uses the older, Windows message-based approach of
dropping files.

Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
events.
", "");

class wxDropFilesEvent: public wxEvent
{
public:

    // TODO:  wrap the ctor!


    DocDeclStr(
        wxPoint , GetPosition(),
        "Returns the position at which the files were dropped.", "");

    DocDeclStr(
        int , GetNumberOfFiles(),
        "Returns the number of files dropped.", "");


    %extend {
        DocStr(
            GetFiles,
            "Returns a list of the filenames that were dropped.", "");

        PyObject* GetFiles() {
            int         count = self->GetNumberOfFiles();
            wxString*   files = self->GetFiles();
            wxPyBlock_t blocked = wxPyBeginBlockThreads();
            PyObject*   list  = PyList_New(count);

            if (!list) {
                PyErr_SetString(PyExc_MemoryError, "Can't allocate list of files!");
                wxPyEndBlockThreads(blocked);
                return NULL;
            }

            for (int i=0; i<count; i++) {
                PyList_SetItem(list, i, wx2PyString(files[i]));
            }
            wxPyEndBlockThreads(blocked);
            return list;
        }
    }

    %property(Files, GetFiles, doc="See `GetFiles`");
    %property(NumberOfFiles, GetNumberOfFiles, doc="See `GetNumberOfFiles`");
    %property(Position, GetPosition, doc="See `GetPosition`");
};



//---------------------------------------------------------------------------
%newgroup;


enum wxUpdateUIMode
{
    wxUPDATE_UI_PROCESS_ALL,
    wxUPDATE_UI_PROCESS_SPECIFIED
};


DocStr(wxUpdateUIEvent,
"This class is used for EVT_UPDATE_UI pseudo-events which are sent by
wxWidgets to give an application the chance to update various user
interface elements.

Without update UI events, an application has to work hard to
check/uncheck, enable/disable, and set the text for elements such as
menu items and toolbar buttons. The code for doing this has to be
mixed up with the code that is invoked when an action is invoked for a
menu item or button.

With update UI events, you define an event handler to look at the
state of the application and change UI elements accordingly. wxWidgets
will call your handler functions in idle time, so you don't have to
worry where to call this code. In addition to being a clearer and more
declarative method, it also means you don't have to worry whether
you're updating a toolbar or menubar identifier. The same handler can
update a menu item and toolbar button, if the ID values are the same.

Instead of directly manipulating the menu or button, you call
functions in the event object, such as `Check`. wxWidgets will
determine whether such a call has been made, and which UI element to
update.

These events will work for popup menus as well as menubars. Just
before a menu is popped up, `wx.Menu.UpdateUI` is called to process
any UI events for the window that owns the menu.

If you find that the overhead of UI update processing is affecting
your application, you can do one or both of the following:

   1. Call `wx.UpdateUIEvent.SetMode` with a value of
      wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
      wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
      receive update events. No other windows will receive update
      events.

   2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
      value to set the delay between updates. You may need to call
      `wx.Window.UpdateWindowUI` at critical points, for example when
      a dialog is about to be shown, in case the user sees a slight
      delay before windows are updated.

Note that although events are sent in idle time, defining a EVT_IDLE
handler for a window does not affect this because the events are sent
from an internal idle handler.

wxWidgets tries to optimize update events on some platforms. On
Windows and GTK+, events for menubar items are only sent when the menu
is about to be shown, and not in idle time.
", "");

class wxUpdateUIEvent : public wxCommandEvent
{
public:
    DocCtorStr(
        wxUpdateUIEvent(wxWindowID commandId = 0),
        "Constructor", "");

    DocDeclStr(
        bool , GetChecked() const,
        "Returns ``True`` if the UI element should be checked.", "");

    DocDeclStr(
        bool , GetEnabled() const,
        "Returns ``True`` if the UI element should be enabled.", "");

    DocDeclStr(
        bool , GetShown() const,
        "Returns ``True`` if the UI element should be shown.", "");

    DocDeclStr(
        wxString , GetText() const,
        "Returns the text that should be set for the UI element.", "");

    DocDeclStr(
        bool , GetSetText() const,
        "Returns ``True`` if the application has called `SetText`. For
wxWidgets internal use only.", "");

    DocDeclStr(
        bool , GetSetChecked() const,
        "Returns ``True`` if the application has called `Check`. For wxWidgets
internal use only.", "");

    DocDeclStr(
        bool , GetSetEnabled() const,
        "Returns ``True`` if the application has called `Enable`. For wxWidgets
internal use only.", "");

    DocDeclStr(
        bool , GetSetShown() const,
        "Returns ``True`` if the application has called `Show`. For wxWidgets
internal use only.", "");


    DocDeclStr(
        void , Check(bool check),
        "Check or uncheck the UI element.", "");

    DocDeclStr(
        void , Enable(bool enable),
        "Enable or disable the UI element.", "");

    DocDeclStr(
        void , Show(bool show),
        "Show or hide the UI element.", "");


    DocDeclStr(
        void , SetText(const wxString& text),
        "Sets the text for this UI element.", "");



    DocDeclStr(
        static void , SetUpdateInterval(long updateInterval),
        "Sets the interval between updates in milliseconds. Set to -1 to
disable updates, or to 0 to update as frequently as possible. The
default is 0.

Use this to reduce the overhead of UI update events if your
application has a lot of windows. If you set the value to -1 or
greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
at appropriate points in your application, such as when a dialog is
about to be shown.", "");


    DocDeclStr(
        static long , GetUpdateInterval(),
        "Returns the current interval between updates in milliseconds. -1
disables updates, 0 updates as frequently as possible.", "");


    DocDeclStr(
        static bool , CanUpdate(wxWindow *win),
        "Returns ``True`` if it is appropriate to update (send UI update events
to) this window.

This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
events were last sent in idle time, and the update interval, to
determine whether events should be sent to this window now. By default
this will always return true because the update mode is initially
wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
events will be sent as often as possible. You can reduce the frequency
that events are sent by changing the mode and/or setting an update
interval.
", "");


    DocDeclStr(
        static void , ResetUpdateTime(),
        "Used internally to reset the last-updated time to the current time. It
is assumed that update events are normally sent in idle time, so this
is called at the end of idle processing.", "");


    DocDeclStr(
        static void , SetMode(wxUpdateUIMode mode),
        "Specify how wxWidgets will send update events: to all windows, or only
to those which specify that they will process the events.

The mode may be one of the following values:

    =============================   ==========================================
    wxUPDATE_UI_PROCESS_ALL         Send UI update events to all windows.  This
                                    is the default setting.
    wxUPDATE_UI_PROCESS_SPECIFIED   Send UI update events only to windows that
                                    have the wx.WS_EX_PROCESS_UI_UPDATES extra
                                    style set.
    =============================   ==========================================
", "");


    DocDeclStr(
        static wxUpdateUIMode , GetMode(),
        "Returns a value specifying how wxWidgets will send update events: to
all windows, or only to those which specify that they will process the
events.", "");

    %property(Checked, GetChecked, Check, doc="See `GetChecked`");
    %property(Enabled, GetEnabled, Enable, doc="See `GetEnabled`");
    %property(Shown, GetShown, Show, doc="See `GetShown`");
    %property(Text, GetText, SetText, doc="See `GetText` and `SetText`");
};

//---------------------------------------------------------------------------
%newgroup;

DocStr(wxSysColourChangedEvent,
"This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
when the user changes the colour settings using the control
panel. This is only applicable under Windows.

The default event handler for this event propagates the event to child
windows, since Windows only sends the events to top-level windows. If
intercepting this event for a top-level window, remember to call
`Skip` so the the base class handler will still be executed, or to
pass the event on to the window's children explicitly.
", "");

class wxSysColourChangedEvent: public wxEvent {
public:
    DocCtorStr(
        wxSysColourChangedEvent(),
        "Constructor", "");
};

//---------------------------------------------------------------------------
%newgroup;


DocStr(wxMouseCaptureChangedEvent,
"An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
a window that loses its mouse capture. This is called even if
`wx.Window.ReleaseMouse` was called by the application code. Handling
this event allows an application to cater for unexpected capture
releases which might otherwise confuse mouse handling code.

This event is implemented under Windows only.", "");

class wxMouseCaptureChangedEvent : public wxEvent
{
public:
    DocCtorStr(
        wxMouseCaptureChangedEvent(wxWindowID winid = 0, wxWindow* gainedCapture = NULL),
        "Constructor", "");

    DocDeclStr(
        wxWindow* , GetCapturedWindow() const,
        "Returns the window that gained the capture, or ``None`` if it was a
non-wxWidgets window.", "");

    %property(CapturedWindow, GetCapturedWindow, doc="See `GetCapturedWindow`");
};

//---------------------------------------------------------------------------
%newgroup;

DocStr(wxMouseCaptureLostEvent,
"A mouse capture lost event is sent to a window that obtained mouse
capture, which was subsequently loss due to \"external\" event, for
example when a dialog box is shown or if another application captures
the mouse.

If this happens, this event is sent to all windows that are on the
capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
if the capture changes because of a call to CaptureMouse or
ReleaseMouse.

This event is currently emitted under Windows only.
", "");

class wxMouseCaptureLostEvent : public wxEvent
{
public:
    wxMouseCaptureLostEvent(wxWindowID winid = 0);
};

//---------------------------------------------------------------------------
%newgroup;

DocStr(wxDisplayChangedEvent,
"An EVT_DISPLAY_CHANGED event is sent to all windows when the display
resolution has changed.

This event is implemented under Windows only.", "");

class wxDisplayChangedEvent : public wxEvent
{
public:
    DocCtorStr(
        wxDisplayChangedEvent(),
        "", "");
};

//---------------------------------------------------------------------------
%newgroup;

DocStr(wxPaletteChangedEvent,
"An EVT_PALETTE_CHANGED event is sent when the system palette has
changed, thereby giving each window a chance to redo their own to
match.

This event is implemented under Windows only.", "");

class  wxPaletteChangedEvent : public wxEvent
{
public:
    wxPaletteChangedEvent(wxWindowID id = 0);

    void SetChangedWindow(wxWindow* win);
    wxWindow* GetChangedWindow();

    %property(ChangedWindow, GetChangedWindow, SetChangedWindow, doc="See `GetChangedWindow` and `SetChangedWindow`");
};

//---------------------------------------------------------------------------
%newgroup;

DocStr(wxQueryNewPaletteEvent,
       "An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
focus and should re-do its palette.

This event is implemented under Windows only.", "");

class wxQueryNewPaletteEvent : public wxEvent
{
public:
    DocCtorStr(
        wxQueryNewPaletteEvent(wxWindowID winid = 0),
        "Constructor.", "");

    DocDeclStr(
        void , SetPaletteRealized(bool realized),
        "App should set this if it changes the palette.", "");

    bool GetPaletteRealized() const;

    %property(PaletteRealized, GetPaletteRealized, SetPaletteRealized, doc="See `GetPaletteRealized` and `SetPaletteRealized`");    
};

//---------------------------------------------------------------------------
%newgroup;



DocStr(wxNavigationKeyEvent,
"EVT_NAVIGATION_KEY events are used to control moving the focus between
widgets, otherwise known as tab-traversal.  You woudl normally not
catch navigation events in applications as there are already
appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
it useful to send navigation events in certain situations to change
the focus in certain ways, although it's probably easier to just call
`wx.Window.Navigate`.", "");

class wxNavigationKeyEvent : public wxEvent
{
public:
    DocCtorStr(
        wxNavigationKeyEvent(),
        "", "");

    DocDeclStr(
        bool , GetDirection() const,
        "Returns ``True`` if the direction is forward, ``False`` otherwise.", "");

    DocDeclStr(
        void , SetDirection(bool forward),
        "Specify the direction that the navigation should take.  Usually the
difference between using Tab and Shift-Tab.", "");


    DocDeclStr(
        bool , IsWindowChange() const,
        "Returns ``True`` if window change is allowed.", "");

    DocDeclStr(
        void , SetWindowChange(bool ischange),
        "Specify if the navigation should be able to change parent windows.
For example, changing notebook pages, etc. This is usually implemented
by using Control-Tab.", "");


    DocDeclStr(
        bool , IsFromTab() const,
        "Returns ``True`` if the navigation event is originated from the Tab
key.", "");

    DocDeclStr(
        void , SetFromTab(bool bIs),
        "Set to true under MSW if the event was generated using the tab key.
This is required for proper navogation over radio buttons.", "");


    DocDeclStr(
        void , SetFlags(long flags),
        "Set the navigation flags to a combination of the following:

    * wx.NavigationKeyEvent.IsBackward
    * wx.NavigationKeyEvent.IsForward
    * wx.NavigationKeyEvent.WinChange
    * wx.NavigationKeyEvent.FromTab
", "");


    DocDeclStr(
        wxWindow* , GetCurrentFocus() const,
        "Returns the child window which currenty has the focus.  May be
``None``.", "");

    DocDeclStr(
        void , SetCurrentFocus(wxWindow *win),
        "Set the window that has the focus.", "");


    enum wxNavigationKeyEventFlags {
        IsBackward,
        IsForward,
        WinChange,
        FromTab
    };

    %property(CurrentFocus, GetCurrentFocus, SetCurrentFocus, doc="See `GetCurrentFocus` and `SetCurrentFocus`");
    %property(Direction, GetDirection, SetDirection, doc="See `GetDirection` and `SetDirection`");
    
};

//---------------------------------------------------------------------------
%newgroup;


DocStr(wxWindowCreateEvent,
       "The EVT_WINDOW_CREATE event is sent as soon as the window object (the
underlying GUI object) exists.", "");

class wxWindowCreateEvent : public wxCommandEvent
{
public:
    wxWindowCreateEvent(wxWindow *win = NULL);

    DocDeclStr(
        wxWindow *, GetWindow() const,
        "Returns the window that this event refers to.", "");

    %property(Window, GetWindow, doc="See `GetWindow`");
};


DocStr(wxWindowDestroyEvent,
       "The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
when the GUI window is destroyed.

When a class derived from `wx.Window` is destroyed its destructor will
have already run by the time this event is sent. Therefore this event
will not usually be received at all by the window itself.  Since it is
received after the destructor has run, an object should not try to
handle its own wx.WindowDestroyEvent, but it can be used to get
notification of the destruction of another window.", "");
class wxWindowDestroyEvent : public wxCommandEvent
{
public:
    wxWindowDestroyEvent(wxWindow *win = NULL);

    DocDeclStr(
        wxWindow *, GetWindow() const,
        "Returns the window that this event refers to.", "");

    %property(Window, GetWindow, doc="See `GetWindow`");
};


//---------------------------------------------------------------------------
%newgroup;


DocStr(wxContextMenuEvent,
"This class is used for context menu events (EVT_CONTECT_MENU,) sent to
give the application a chance to show a context (popup) menu.", "");

class wxContextMenuEvent : public wxCommandEvent
{
public:
    DocCtorStr(
        wxContextMenuEvent(wxEventType type = wxEVT_NULL,
                           wxWindowID winid = 0,
                           const wxPoint& pt = wxDefaultPosition),
        "Constructor.", "");

    // Position of event (in screen coordinates)
    DocDeclStr(
        const wxPoint& , GetPosition() const,
        "Returns the position (in screen coordinants) at which the menu should
be shown.", "");


    DocDeclStr(
        void , SetPosition(const wxPoint& pos),
        "Sets the position at which the menu should be shown.", "");

    %property(Position, GetPosition, SetPosition, doc="See `GetPosition` and `SetPosition`");
};

//---------------------------------------------------------------------------
%newgroup;

enum wxIdleMode
{
    wxIDLE_PROCESS_ALL,
    wxIDLE_PROCESS_SPECIFIED
};


DocStr(wxIdleEvent,
"This class is used for EVT_IDLE events, which are generated and sent
when the application *becomes* idle.  In other words, the when the
event queue becomes empty then idle events are sent to all windows (by
default) and as long as none of them call `RequestMore` then there are
no more idle events until after the system event queue has some normal
events and then becomes empty again.

By default, idle events are sent to all windows. If this is causing a
significant overhead in your application, you can call
`wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
set the wx.WS_EX_PROCESS_IDLE extra window style for every window
which should receive idle events.  Then idle events will only be sent
to those windows and not to any others.", "");

class wxIdleEvent : public wxEvent
{
public:
    DocCtorStr(
        wxIdleEvent(),
        "Constructor", "");


    DocDeclStr(
        void , RequestMore(bool needMore = true),
        "Tells wxWidgets that more processing is required. This function can be
called by an EVT_IDLE handler for a window to indicate that the
application should forward the EVT_IDLE event once more to the
application windows. If no window calls this function during its
EVT_IDLE handler, then the application will remain in a passive event
loop until a new event is posted to the application by the windowing
system.", "");

    DocDeclStr(
        bool , MoreRequested() const,
        "Returns ``True`` if the OnIdle function processing this event
requested more processing time.", "");


    DocDeclStr(
        static void , SetMode(wxIdleMode mode),
        "Static method for specifying how wxWidgets will send idle events: to
all windows, or only to those which specify that they will process the
events.

The mode can be one of the following values:

    =========================   ========================================
    wx.IDLE_PROCESS_ALL         Send idle events to all windows
    wx.IDLE_PROCESS_SPECIFIED   Send idle events only to windows that have
                                the wx.WS_EX_PROCESS_IDLE extra style
                                flag set.
    =========================   ========================================
", "");


    DocDeclStr(
        static wxIdleMode , GetMode(),
        "Static method returning a value specifying how wxWidgets will send
idle events: to all windows, or only to those which specify that they
will process the events.", "");

};

//---------------------------------------------------------------------------
%newgroup;


DocStr(wxClipboardTextEvent,
"A Clipboard Text event is sent when a window intercepts a text
copy/cut/paste message, i.e. the user has cut/copied/pasted data
from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
popup menu command, etc.  NOTE : under windows these events are *NOT*
generated automatically for a Rich Edit text control.", "");

class wxClipboardTextEvent : public wxCommandEvent
{
public:
    wxClipboardTextEvent(wxEventType type = wxEVT_NULL,
                         wxWindowID winid = 0);
};


//---------------------------------------------------------------------------
%newgroup;

// These classes can be derived from in Python and passed through the event
// system without loosing anything.  They do this by keeping a reference to
// themselves and some special case handling in wxPyCallback::EventThunker.

DocStr(wxPyEvent,
"wx.PyEvent can be used as a base class for implementing custom event
types in Python.  You should derived from this class instead of
`wx.Event` because this class is Python-aware and is able to transport
its Python bits safely through the wxWidgets event system and have
them still be there when the event handler is invoked.

:see: `wx.PyCommandEvent`
", "");

class wxPyEvent : public wxEvent {
public:
    %pythonAppend wxPyEvent     "self._SetSelf(self)"
    DocCtorStr(
        wxPyEvent(int winid=0, wxEventType eventType = wxEVT_NULL ),
        "", "");

    ~wxPyEvent();


    %Rename(_SetSelf, void , SetSelf(PyObject* self));
    %Rename(_GetSelf, PyObject* , GetSelf());
};



DocStr(wxPyCommandEvent,
"wx.PyCommandEvent can be used as a base class for implementing custom
event types in Python, where the event should travel up to parent
windows looking for a handler.  You should derived from this class
instead of `wx.CommandEvent` because this class is Python-aware and is
able to transport its Python bits safely through the wxWidgets event
system and have them still be there when the event handler is invoked.

:see: `wx.PyEvent`
", "");

class wxPyCommandEvent : public wxCommandEvent {
public:
    %pythonAppend wxPyCommandEvent     "self._SetSelf(self)"

    DocCtorStr(
        wxPyCommandEvent(wxEventType eventType = wxEVT_NULL, int id=0),
        "", "");

    ~wxPyCommandEvent();

    %Rename(_SetSelf, void , SetSelf(PyObject* self));
    %Rename(_GetSelf, PyObject* , GetSelf());
};



//---------------------------------------------------------------------------


DocStr(wxDateEvent,
"This event class holds information about a date change event and is
used together with `wx.DatePickerCtrl`. It also serves as a base class
for `wx.calendar.CalendarEvent`.  Bind these event types with
EVT_DATE_CHANGED.", "");

class wxDateEvent : public wxCommandEvent
{
public:
    DocCtorStr(
        wxDateEvent(wxWindow *win, const wxDateTime& dt, wxEventType type),
        "", "");

    DocDeclStr(
        const wxDateTime& , GetDate() const,
        "Returns the date.", "");

    DocDeclStr(
        void , SetDate(const wxDateTime &date),
        "Sets the date carried by the event, normally only used by the library
internally.", "");

    %property(Date, GetDate, SetDate, doc="See `GetDate` and `SetDate`");

};


%constant wxEventType wxEVT_DATE_CHANGED;

%pythoncode {
    EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
}


//---------------------------------------------------------------------------

DocStr(wxEventBlocker,
"Helper class to temporarily disable event handling for a window.", "");

class wxEventBlocker : public wxEvtHandler
{
public:
    wxEventBlocker(wxWindow *win, wxEventType type = wxEVT_ANY);
    virtual ~wxEventBlocker();

    void Block(wxEventType type);
};


//---------------------------------------------------------------------------
//---------------------------------------------------------------------------