1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065 | %%
%% \ / | |\ | |¯\ /¯\ \ /
%% W X VV | | \| |_/ \_/ VV . E R L
%%——————————————————————————————————————————
%%
%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
%%
%%——————————————————————————————————————————————
%% Whitespace Beautified by ScriptCulture © 2018
%% Sit Back · Feet Up · Learn wxErlang
%% For use as a reference only
%% www.scriptculture.com
%% Not check-summed
%% wx 1.8 ——————————————————————————————————————
%%
%% Licensed under the Apache License,
%% Version 2.0 (the "License"); you may
%% not use this file except in compliance
%% with the License. You may obtain a copy
%% of the License at:
%%
%% http://www.apache.org/licenses/LICENSE-2.0
%%
%% Unless required by
%% applicable law or agreed to in writing, software
%% distributed under the License is distributed
%% on an "AS IS" BASIS, WITHOUT WARRANTIES
%% OR CONDITIONS OF ANY KIND, either
%% express or implied. See the
%% License for the specific
%% language governing
%% permissions and
%% limitations
%% under the
%% License.
%%%%%%%
%%%%
%%%
%%%%
%% @doc See external documentation: <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxwindow.html">wxWindow</a>.
%% <p>This class is derived (and can use functions) from:
%% <br />{@link wxEvtHandler}
%% </p>
%% @type wxWindow().
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% OVERVIEW
%% ––––––––
%% wxWindow is the base class for all windows and represents
%% any visible object on screen.
%% All controls, top level windows and so on are windows.
%% Sizers and device contexts are not, however,
%% as they don't appear on screen themselves.
%%
%% Please note that all children of the window will be deleted automatically
%% by the destructor before the window itself is deleted which means that you
%% don't have to worry about deleting them manually.
%% Please see the window deletion overview for more information.
%%
%% Also note that in this, and many others, wxWidgets classes some GetXXX()
%% methods may be overloaded (as, for example, GetSize or GetClientSize).
%%
%%
%% ———— NOTES FROM LIAM ———
%% Worth reading: "http://www-h.eng.cam.ac.uk/help/tpl/languages/C++/virtualsandoverloading.html"
%% In this case, the overloads are non-virtual because having multiple virtual
%% functions with the same name results in a virtual function name hiding at the
%% derived class level (in English, this means that the derived class has
%% to override all overloaded variants if it overrides any of them).
%% To allow overriding them in the derived class, wxWidgets uses a unique
%% protected virtual DoGetXXX() method and all GetXXX() ones are forwarded to it,
%% so overriding the former changes the behaviour of the latter.
%%
%%
%% WINDOW STYLES
%% —————————————
%% The following styles can apply to all windows, although they will not always
%% make sense for a particular window class or on all platforms.
%%
%% wxBORDER_SIMPLE Displays a thin border around the window.
%% wxSIMPLE_BORDER is the old name for this style.
%% wxBORDER_DOUBLE Displays a double border.
%% wxDOUBLE_BORDER is the old name for this style.
%% Windows and Mac only.
%% wxBORDER_SUNKEN Displays a sunken border.
%% wxSUNKEN_BORDER is the old name for this style.
%% wxBORDER_RAISED Displays a raised border.
%% wxRAISED_BORDER is the old name for this style.
%% wxBORDER_STATIC Displays a border suitable for a static control.
%% wxSTATIC_BORDER is the old name for this style. Windows only.
%% wxBORDER_THEME Displays a themed border where possible.
%% Currently this has an effect on Windows XP and above only.
%% For more information on themed borders,
%% please see Themed borders on Windows.
%% wxBORDER_NONE Displays no border, overriding the default border style for the window.
%% wxNO_BORDER is the old name for this style.
%%
%% wxTRANSPARENT_WINDOW The window is transparent, that is,
%% it will not receive paint events. Windows only.
%% wxTAB_TRAVERSAL Use this to enable tab traversal for non-dialog windows.
%% wxWANTS_CHARS Use this to indicate that the window wants to get all
%% char/key events for all keys - even for keys like TAB
%% or ENTER which are usually used for dialog navigation
%% and which wouldn't be generated without this style.
%% If you need to use this style in order to get the arrows or etc.,
%% but would still like to have normal keyboard navigation take place,
%% you should create and send a wxNavigationKeyEvent in response
%% to the key events for Tab and Shift-Tab.
%% wxNO_FULL_REPAINT_ON_RESIZE On Windows, this style used to disable repainting the window
%% completely when its size is changed. Since this behaviour
%% is now the default, the style is now obsolete and no longer
%% has an effect.
%% wxVSCROLL Use this style to enable a vertical scrollbar.
%% wxHSCROLL Use this style to enable a horizontal scrollbar.
%% wxALWAYS_SHOW_SB If a window has scrollbars, disable them instead of hiding
%% them when they are not needed (i.e. when the size of the
%% window is big enough to not require the scrollbars to navigate it).
%% This style is currently implemented for wxMSW, wxGTK and
%% wxUniversal and does nothing on the other platforms.
%% wxCLIP_CHILDREN Use this style to eliminate flicker caused by the background being
%% repainted, then children being painted over them. Windows only.
%% wxFULL_REPAINT_ON_RESIZE Use this style to force a complete redraw of the window whenever
%% it is resized instead of redrawing just the part of the
%% window affected by resizing. Note that this was the behaviour
%% by default before 2.5.1 release and that if you experience
%% redraw problems with code which previously used to work you
%% may want to try this. Currently this style applies on GTK+ 2
%% and Windows only, and full repainting is
%% always done on other platforms.
%%
%% See also window styles overview.
%%
%%
%%
%% EXTRA WINDOW STYLES
%% ———————————————————
%%
%% The following are extra styles, set using wxWindow:setExtraStyle
%%
%% wxWS_EX_VALIDATE_RECURSIVELY By default, Validate/TransferDataTo/FromWindow() only work
%% on direct children of the window (compatible behaviour).
%% Set this flag to make them recursively descend into all subwindows.
%%
%% wxWS_EX_BLOCK_EVENTS wxCommandEvents and the objects of the derived classes are
%% forwarded to the parent window and so on recursively by default.
%% Using this flag for the given window allows to block this
%% propagation at this window, i.e. prevent the events from being
%% propagated further upwards. Dialogs have this flag on by default.
%%
%% wxWS_EX_TRANSIENT Don't use this window as an implicit parent for the other windows:
%% this must be used with transient windows as otherwise there
%% is the risk of creating a dialog/frame with this window as a
%% parent which would lead to a crash if the parent is destroyed
%% before the child.
%%
%% wxWS_EX_PROCESS_IDLE This window should always process idle events, even if the mode
%% set by wxIdleEvent::SetMode is wxIDLE_PROCESS_SPECIFIED.
%%
%% wxWS_EX_PROCESS_UI_UPDATES This window should always process UI update events, even if the
%% mode set by wxUpdateUIEvent::SetMode is wxUPDATE_UI_PROCESS_SPECIFIED.
%%
%% wx.hrl
%% ——————
%% -define(wxWS_EX_CONTEXTHELP, 128).
%% -define(wxWS_EX_PROCESS_UI_UPDATES, 32).
%% -define(wxWS_EX_PROCESS_IDLE, 16).
%% -define(wxWS_EX_THEMED_BACKGROUND, 8).
%% -define(wxWS_EX_TRANSIENT, 4).
%% -define(wxWS_EX_BLOCK_EVENTS, 2).
%% -define(wxWS_EX_VALIDATE_RECURSIVELY, 1).
%%
%%
%% See Also:
%% —————————
%% Event handling overview,
%% Window sizing overview
%%
%%
%/
-module(wxWindow).
-include("wxe.hrl").
-export(['Destroy'/1,
cacheBestSize/2, captureMouse/1, center/1,
center/2, centerOnParent/1, centerOnParent/2,
centre/1, centre/2, centreOnParent/1,
centreOnParent/2, clearBackground/1, clientToScreen/2,
clientToScreen/3, close/1, close/2,
convertDialogToPixels/2, destroy/1, convertPixelsToDialog/2,
destroyChildren/1, disable/1, enable/1,
enable/2, findFocus/0, findWindow/2,
findWindowById/1, findWindowById/2, findWindowByLabel/1,
findWindowByLabel/2, findWindowByName/1, findWindowByName/2,
fit/1, fitInside/1, freeze/1,
getAcceleratorTable/1, getBackgroundColour/1, getBackgroundStyle/1,
getBestSize/1, getCapture/0, getCaret/1,
getCharHeight/1, getCharWidth/1, getChildren/1,
getClientSize/1, getContainingSizer/1, getCursor/1,
getDropTarget/1, getEventHandler/1, getExtraStyle/1,
getFont/1, getForegroundColour/1, getGrandParent/1,
getHandle/1, getHelpText/1, getId/1,
getLabel/1, getMaxSize/1, getMinSize/1,
getName/1, getParent/1, getPosition/1,
getRect/1, getScreenPosition/1, getScreenRect/1,
getScrollPos/2, getScrollRange/2, getScrollThumb/2,
getSize/1, getSizer/1, getTextExtent/2,
getTextExtent/3, getToolTip/1, getUpdateRegion/1,
getVirtualSize/1, getWindowStyleFlag/1, getWindowVariant/1,
hasCapture/1, hasScrollbar/2, hasTransparentBackground/1,
hide/1, inheritAttributes/1, initDialog/1,
invalidateBestSize/1, isEnabled/1, isExposed/2,
isExposed/3, isExposed/5, isRetained/1,
isShown/1, isTopLevel/1, layout/1,
lineDown/1, lineUp/1, lower/1,
makeModal/1, makeModal/2, move/2,
move/3, move/4, moveAfterInTabOrder/2,
moveBeforeInTabOrder/2, navigate/1, navigate/2,
new/0, new/2, new/3,
pageDown/1, pageUp/1, popEventHandler/1,
popEventHandler/2, popupMenu/2, popupMenu/3,
popupMenu/4, raise/1, refresh/1,
refresh/2, refreshRect/2, refreshRect/3,
releaseMouse/1, removeChild/2, reparent/2,
screenToClient/1, screenToClient/2, scrollLines/2,
scrollPages/2, scrollWindow/3, scrollWindow/4,
setAcceleratorTable/2, setAutoLayout/2, setBackgroundColour/2,
setBackgroundStyle/2, setCaret/2, setClientSize/2,
setClientSize/3, setContainingSizer/2, setCursor/2,
setDropTarget/2, setExtraStyle/2, setFocus/1,
setFocusFromKbd/1, setFont/2, setForegroundColour/2,
setHelpText/2, setId/2, setLabel/2,
setMaxSize/2, setMinSize/2, setName/2,
setOwnBackgroundColour/2, setOwnFont/2, setOwnForegroundColour/2,
setPalette/2, setScrollPos/3, setScrollPos/4,
setScrollbar/5, setScrollbar/6, setSize/2,
setSize/3, setSize/5, setSize/6,
setSizeHints/2, setSizeHints/3, setSizeHints/4,
setSizer/2, setSizer/3, setSizerAndFit/2,
setSizerAndFit/3, setThemeEnabled/2, setToolTip/2,
setVirtualSize/2, setVirtualSize/3, setVirtualSizeHints/2,
setVirtualSizeHints/3, setVirtualSizeHints/4, setWindowStyle/2,
setWindowStyleFlag/2, setWindowVariant/2, shouldInheritColours/1,
show/1, show/2, thaw/1,
transferDataFromWindow/1, transferDataToWindow/1, update/1,
updateWindowUI/1, updateWindowUI/2, validate/1,
warpPointer/3
]).
%% inherited exports
-export([connect/2,connect/3,disconnect/1,disconnect/2,disconnect/3,parent_class/1]).
-export_type([wxWindow/0]).
%% @hidden
parent_class(wxEvtHandler) -> true
;parent_class( _Class ) -> erlang:error({badtype, ?MODULE}).
-type wxWindow() :: wx:wx_object().
%·%% NEW / 0 %%·%
%%
%% Default constructor.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec new() -> wxWindow().
new() ->
wxe_util:construct(?wxWindow_new_0,
<<>>).
%% @equiv new(Parent,Id, [])
-spec new(Parent, Id) -> wxWindow()
when
Parent :: wxWindow(),
Id :: integer().
new(Parent,Id)
when
is_record(Parent, wx_ref),
is_integer(Id) -> new(Parent,Id, []).
%·%% NEW %%·%
%%
%% Constructs a window, which can be a child of a frame, dialog or any other non-control window.
%%
%% parent Pointer to a parent window.
%% id Window identifier. If wxID_ANY, will automatically create an identifier.
%% pos Window position. wxDefaultPosition indicates that wxWidgets should generate a default
%% position for the window. If using the wxWindow class directly,
%% supply an actual position.
%% size Window size. wxDefaultSize indicates that wxWidgets should
%% generate a default size for the window.
%% If no suitable size can be found, the window will be sized to 20x20 pixels so that the
%% window is visible but obviously not correctly sized.
%% style Window style. For generic window styles, please see wxWindow.
%% name Window name.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec new(Parent, Id, [Option]) -> wxWindow()
when
Parent :: wxWindow(),
Id :: integer(),
Option :: {pos, {X :: integer(), Y :: integer()}}
| {size, {W :: integer(), H :: integer()}}
| {style, integer()}.
new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
when
is_integer(Id),
is_list(Options) ->
?CLASS(ParentT,wxWindow),
MOpts = fun({pos, {PosX, PosY}}, Acc) -> [<<1:32/?UI,PosX:32/?UI,PosY:32/?UI,0:32>>|Acc];
({size, {SizeW,SizeH}}, Acc) -> [<<2:32/?UI,SizeW:32/?UI,SizeH:32/?UI,0:32>>|Acc];
({style, Style}, Acc) -> [<<3:32/?UI,Style:32/?UI>>|Acc];
(BadOpt, _ ) -> erlang:error({badoption, BadOpt})
end,
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
wxe_util:construct(?wxWindow_new_3,
<<ParentRef:32/?UI,Id:32/?UI, BinOpt/binary>>).
%·%% CLOSE / 1 %%·%
%%
%% See below...
%% @equiv close(This, [])
-spec close(This) -> boolean()
when
This :: wxWindow().
close(This)
when
is_record(This, wx_ref) -> close(This, []).
%·%% CLOSE / 2 %%·%
%%
%% This function simply generates a wxCloseEvent whose handler usually tries to close the window.
%% It doesn't close the window itself, however.
%%
%% Close calls the close handler for the window, providing an opportunity for the window
%% to choose whether to destroy the window. Usually it is only used with the top level windows
%% (wxFrame and wxDialog classes) as the others are not supposed to have any special OnClose() logic.
%%
%% The close handler should check whether the window is being deleted forcibly,
%% using wxCloseEvent::CanVeto, in which case it should destroy
%% the window using wxWindow::Destroy.
%%
%% Note that calling Close does not guarantee that the window will be destroyed;
%% but it provides a way to simulate a manual close of a window,
%% which may or may not be implemented by destroying the window.
%% The default implementation of wxDialog::OnCloseWindow does not
%% necessarily delete the dialog, since it will simply simulate
%% an wxID_CANCEL event which is handled by the appropriate button
%% event handler and may do anything at all.
%%
%% To guarantee that the window will be destroyed, call wxWindow::Destroy instead
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec close(This, [Option]) -> boolean()
when
This :: wxWindow(),
Option :: {force, boolean()}. %% false if the window's close handler should be able to
%% veto the destruction of this window, true if it cannot.
close(#wx_ref{type=ThisT,ref=ThisRef},
Options)
when
is_list(Options) ->
?CLASS(ThisT,wxWindow),
MOpts = fun({force, Force}, Acc) -> [<<1:32/?UI,(wxe_util:from_bool(Force)):32/?UI>>|Acc];
(BadOpt, _ ) -> erlang:error({badoption, BadOpt})
end,
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
wxe_util:call(?wxWindow_Close,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
%·%% DESTROY %%·%
%% Destructor. Deletes all subwindows, then deletes itself.
%% Instead of using the delete operator explicitly,
%% you should normally use wxWindow::Destroy so that wxWidgets
%% can delete a window only when it is safe to do so, in idle time.
%%
%% @doc Destroys this object, do not use object again
-spec destroy( This :: wxWindow()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxWindow),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
ok.
%·%% 'Destroy' %%·%
%%
%% Destroys the window safely. Use this function instead of the delete operator,
%% since different window classes can be destroyed differently.
%% Frames and dialogs are not destroyed immediately when this function is
%% called -- they are added to a list of windows to be deleted on idle time,
%% when all the window's events have been processed.
%% This prevents problems with events being sent to non-existent windows.
%%
%% Return Value: true if the window has either been successfully deleted, or
%% it has been added to the list of windows pending real deletion.
%% See Also:
%%*%%*%%
-spec 'Destroy'(This) -> boolean()
when
This :: wxWindow().
'Destroy'(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_Destroy,
<<ThisRef:32/?UI>>).
%·%% GET GRAND PARENT %%·%
%%
%% Returns the grandparent of a window, or NULL if there isn't one.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec getGrandParent(This) -> wxWindow()
when
This :: wxWindow().
getGrandParent(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetGrandParent,
<<ThisRef:32/?UI>>).
%·%% GET PARENT %%·%
%%
%% Returns the parent of the window, or NULL if there is no parent.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec getParent(This) -> wxWindow()
when
This :: wxWindow().
getParent(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetParent,
<<ThisRef:32/?UI>>).
%·%% REPARENT %%·%
%%
%% Reparents the window, i.e the window will be removed from its current
%% parent window (e.g. a non-standard toolbar in a wxFrame) and
%% then re-inserted into another.
%%
%% Return Value:
%% See Also: New parent.
%%*%%*%%
-spec reparent(This, NewParent) -> boolean()
when
This :: wxWindow(),
NewParent :: wxWindow().
reparent(#wx_ref{type=ThisT,ref=ThisRef},
#wx_ref{type=NewParentT,ref=NewParentRef}) ->
?CLASS(ThisT,wxWindow),
?CLASS(NewParentT,wxWindow),
wxe_util:call(?wxWindow_Reparent,
<<ThisRef:32/?UI,NewParentRef:32/?UI>>).
%·%% GET CHILDREN %%·%
%%
%% Returns a reference to the list of the window's children.
%% wxWindowList is a type-safe wxList-like class whose
%% elements are of type wxWindow *.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec getChildren(This) -> [wxWindow()]
when
This :: wxWindow().
getChildren(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetChildren,
<<ThisRef:32/?UI>>).
%·%% REMOVE CHILD %%·%
%%
%% Removes a child window.
%% This is called automatically by window deletion functions so should
%% not be required by the application programmer.
%%
%% Notice that this function is mostly internal to wxWidgets and
%% shouldn't be called by the user code.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec removeChild(This, Child) -> ok
when
This :: wxWindow(),
Child :: wxWindow(). % Child window to remove.
removeChild(#wx_ref{type=ThisT,ref=ThisRef},
#wx_ref{type=ChildT,ref=ChildRef}) ->
?CLASS(ThisT,wxWindow),
?CLASS(ChildT,wxWindow),
wxe_util:cast(?wxWindow_RemoveChild,
<<ThisRef:32/?UI,ChildRef:32/?UI>>).
%·%% FIND WINDOW %%·%
%% 1st
%% Find a child of this window, by identifier.
%%
%% 2nd
%% Find a child of this window, by name.
%%
%% Return Value:
%% See Also:
%%*%%*%%
%%
-spec findWindow(This, Winid) -> wxWindow()
when
This :: wxWindow(),
Winid :: integer();
(This, Name) -> wxWindow()
when
This :: wxWindow(),
Name :: unicode:chardata().
findWindow(#wx_ref{type=ThisT,ref=ThisRef},Winid)
when
is_integer(Winid) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_FindWindow_1_0,
<<ThisRef:32/?UI,Winid:32/?UI>>);
findWindow(#wx_ref{type=ThisT,ref=ThisRef},Name)
when
is_list(Name) ->
?CLASS(ThisT,wxWindow),
Name_UC = unicode:characters_to_binary([Name,0]),
wxe_util:call(?wxWindow_FindWindow_1_1,
<<ThisRef:32/?UI,(byte_size(Name_UC)):32/?UI,(Name_UC)/binary,
0:(((8- ((0+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8>>).
%·%% DESTROY CHILDREN %%·%
%%
%% Destroys all children of a window.
%%
%% Called automatically by the destructor.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec destroyChildren(This) -> boolean()
when
This :: wxWindow().
destroyChildren(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_DestroyChildren,
<<ThisRef:32/?UI>>).
%·%% INHERIT ATTRIBUTES %%·%
%%
%% This function is (or should be, in case of custom controls) called during
%% window creation to intelligently set up the window visual attributes,
%% that is the font and the foreground and background colours.
%%
%% By "intelligently'' the following is meant: by default, all windows use
%% their own default attributes. However if some of the parents attributes
%% are explicitly (that is, using SetFont and not SetOwnFont) changed and
%% if the corresponding attribute hadn't been explicitly set for this window
%% itself, then this window takes the same value as used by the parent.
%% In addition, if the window overrides ShouldInheritColours to return false,
%% the colours will not be changed no matter what and only the font might.
%%
%% This rather complicated logic is necessary in order to accommodate the
%% different usage scenarios. The most common one is when all default
%% attributes are used and in this case, nothing should be inherited as
%% in modern GUIs different controls use different fonts (and colours)
%% than their siblings so they can't inherit the same value from the parent.
%% However it was also deemed desirable to allow to simply change the attributes
%% of all children at once by just changing the font or colour of their common parent,
%% hence in this case we do inherit the parents attributes.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec inheritAttributes(This) -> ok
when
This :: wxWindow().
inheritAttributes(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_InheritAttributes,
<<ThisRef:32/?UI>>).
%·%% SHOULD INHERIT COLOURS %%·%
%%
%% Return true from here to allow the colours of this window
%% to be changed by InheritAttributes, returning false forbids
%% inheriting them from the parent window.
%%
%% The base class version returns false, but this method is overridden
%% in wxControl where it returns true.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec shouldInheritColours(This) -> boolean()
when
This :: wxWindow().
shouldInheritColours(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_ShouldInheritColours,
<<ThisRef:32/?UI>>).
%·%% GET BEST SIZE %%·%
%%
%% This functions returns the best acceptable
%% MINIMAL SIZE for the window.
%% For example, for a static control,
%% it will be the minimal size such that
%% the control label is not truncated.
%% For windows containing subwindows (typically wxPanel),
%% the size returned by this function
%% will be the same as the size the window
%% would have had after calling Fit.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec getBestSize(This) -> {W :: integer(), H :: integer()}
when
This :: wxWindow().
getBestSize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetBestSize,
<<ThisRef:32/?UI>>).
%·%% CACHE BEST SIZE %%·%
%%
%% Sets the cached best size value.
%%
%% Cache the best size so it doesn't need to be calculated again,
%% (at least until some properties of the window change.)
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec cacheBestSize(This, Size) -> ok
when
This :: wxWindow(),
Size :: {W :: integer(),
H :: integer()}.
cacheBestSize(#wx_ref{type=ThisT,ref=ThisRef},{SizeW,SizeH})
when
is_integer(SizeW),
is_integer(SizeH) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_CacheBestSize,
<<ThisRef:32/?UI,SizeW:32/?UI,SizeH:32/?UI>>).
%·%% INVALIDATE BEST SIZE %%·%
%%
%% Resets the cached best size value
%% so it will be recalculated the next time it is needed.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec invalidateBestSize(This) -> ok
when
This :: wxWindow().
invalidateBestSize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_InvalidateBestSize,
<<ThisRef:32/?UI>>).
%·%% CAPTURE MOUSE %%·%
%%
%% Directs all mouse input to this window.
%% Call wxWindow::ReleaseMouse to release the capture.
%%
%% Note that wxWidgets maintains the stack of
%% windows having captured the mouse and when the
%% mouse is released the capture returns to the window
%% which had had captured it previously and it is
%% only really released if there were no previous window.
%% In particular, this means that you must release the mouse
%% as many times as you capture it, unless the window receives
%% the wxMouseCaptureLostEvent event.
%%
%% Any application which captures the mouse
%% in the beginning of some operation
%% must handle wxMouseCaptureLostEvent and
%% cancel this operation when i`t receives the event.
%%
%% - The event handler must not recapture mouse.
%%
%% Return Value:
%% See Also: wxWindow::ReleaseMouse wxMouseCaptureLostEvent
%%*%%*%%
-spec captureMouse(This) -> ok
when
This :: wxWindow().
captureMouse(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_CaptureMouse,
<<ThisRef:32/?UI>>).
%·%% RELEASE MOUSE %%·%
%%
%% Releases mouse input captured with wxWindow::CaptureMouse.
%%
%% Return Value:
%% See Also: wxWindow::CaptureMouse, wxWindow::HasCapture,
%% wxWindow::ReleaseMouse, wxMouseCaptureLostEvent wxMouseCaptureChangedEvent
%%*%%*%%
-spec releaseMouse(This) -> ok
when
This :: wxWindow().
releaseMouse(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_ReleaseMouse,
<<ThisRef:32/?UI>>).
%·%% GET CAPTURE %%·%
%%
%% Returns the currently captured window.
%%
%% Return Value:
%% See Also: wxWindow:HasCapture,
%% wxWindow:CaptureMouse,
%% wxWindow:ReleaseMouse,
%% wxMouse:CaptureLostEvent,
%% wxMouse:CaptureChangedEvent
%%*%%*%%
-spec getCapture() -> wxWindow().
getCapture() ->
wxe_util:call(?wxWindow_GetCapture,
<<>>).
%·%% HAS CAPTURE %%·%
%%
%% Returns true if this window has the current mouse capture.
%%
%% Return Value:
%% See Also: wxWindow::CaptureMouse, wxWindow::ReleaseMouse,
%% wxMouseCaptureLostEvent, wxMouseCaptureChangedEvent
%%*%%*%%
-spec hasCapture(This) -> boolean()
when
This :: wxWindow().
hasCapture(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_HasCapture,
<<ThisRef:32/?UI>>).
%·%% CENTER %%·%
%%
%% See below...
%% @equiv center(This, [])
-spec center(This) -> ok
when
This :: wxWindow().
center(This)
when
is_record(This, wx_ref) -> center(This, []).
%%
%% A synonym for Centre.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec center(This, [Option]) -> ok
when
This :: wxWindow(),
Option :: {dir, integer()}.
center(#wx_ref{type=ThisT,ref=ThisRef},
Options)
when
is_list(Options) ->
?CLASS(ThisT,wxWindow),
MOpts = fun({dir, Dir}, Acc) -> [<<1:32/?UI,Dir:32/?UI>>|Acc];
(BadOpt, _ ) -> erlang:error({badoption, BadOpt})
end,
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
wxe_util:cast(?wxWindow_Center,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
%·%% CENTRE %%·%
%%
%% See below...
%% @equiv centre(This, [])
-spec centre(This) -> ok
when
This :: wxWindow().
centre(This)
when
is_record(This, wx_ref) ->
centre(This, []).
%%
%% Centres the window.
%%
%% If the window is a top level one (i.e. doesn't have a parent), it will be centered relative to the screen anyhow.
%%
%% direction Specifies the direction for the centering.
%% May be wxHORIZONTAL, wxVERTICAL or wxBOTH.
%% It may also include wxCENTRE_ON_SCREEN flag if you want to
%% center the window on the entire screen and not on its parent window.
%%
%% The flag wxCENTRE_FRAME is obsolete and should not be used any longer (it has no effect).
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec centre(This, [Option]) -> ok
when
This :: wxWindow(),
Option :: {dir, integer()}.
centre(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when
is_list(Options) ->
?CLASS(ThisT,wxWindow),
MOpts = fun({dir, Dir}, Acc) -> [<<1:32/?UI,Dir:32/?UI>>|Acc];
(BadOpt, _ ) -> erlang:error({badoption, BadOpt})
end,
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
wxe_util:cast(?wxWindow_Centre,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
%·%% CENTER ON PARENT %%·%
%%
%% See below...
%% @equiv centerOnParent(This, [])
-spec centerOnParent(This) -> ok
when
This :: wxWindow().
centerOnParent(This)
when
is_record(This, wx_ref) -> centerOnParent(This, []).
%%
%% A synonym for CentreOnParent.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec centerOnParent(This, [Option]) -> ok
when
This :: wxWindow(),
Option :: {dir, integer()}.
centerOnParent(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when
is_list(Options) ->
?CLASS(ThisT,wxWindow),
MOpts = fun({dir, Dir}, Acc) -> [<<1:32/?UI,Dir:32/?UI>>|Acc];
(BadOpt, _ ) -> erlang:error({badoption, BadOpt})
end,
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
wxe_util:cast(?wxWindow_CenterOnParent,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
%·%% CENTRE ON PARENT %%·%
%%
%% See below...
%% @equiv centreOnParent(This, [])
-spec centreOnParent(This) -> ok
when
This :: wxWindow().
centreOnParent(This)
when
is_record(This, wx_ref) -> centreOnParent(This, []).
%%
%% Centres the window on its parent. This is a more readable synonym for Centre.
%%
%% This methods provides for a way to center top level windows over their
%% parents instead of the entire screen. If there is no parent or if the window
%% is not a top level window, then behaviour is the same as wxWindow::Centre.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec centreOnParent(This, [Option]) -> ok
when
This :: wxWindow() ,
Option :: {dir, integer()}. %% Specifies the direction for the centering.
%% May be wxHORIZONTAL, wxVERTICAL or wxBOTH.
centreOnParent(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when
is_list(Options) ->
?CLASS(ThisT,wxWindow),
MOpts = fun({dir, Dir}, Acc) -> [<<1:32/?UI,Dir:32/?UI>>|Acc];
(BadOpt, _ ) -> erlang:error({badoption, BadOpt})
end,
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
wxe_util:cast(?wxWindow_CentreOnParent,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
%·%% GET FOREGROUND COLOUR %%·%
%%
%% Returns the foreground colour of the window.
%%
%% The interpretation of foreground colour is open to
%% interpretation according to the window class;
%% it may be the text colour or other colour, or it may not be used at all.
%%
%% Return Value:
%% See Also: wxWindow::SetForegroundColour, wxWindow::SetBackgroundColour, wxWindow::GetBackgroundColour
%%*%%*%%
-spec getForegroundColour(This) -> wx:wx_colour4()
when
This :: wxWindow().
getForegroundColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetForegroundColour,
<<ThisRef:32/?UI>>).
%·%% SET FOREGROUND COLOUR %%·%
%%
%% Sets the foreground colour of the window.
%%
%% Please see InheritAttributes for explanation of the difference
%% between this method and SetOwnForegroundColour.
%%
%% The interpretation of foreground colour is open to interpretation
%% according to the window class; it may be the text colour or other colour,
%% or it may not be used at all.
%%
%% Using this function will disable attempts to use themes for this window,
%% if the system supports them. Use with care since usually the themes represent
%% the appearance chosen by the user to be used for all applications on the system.
%%
%% Return Value:
%% See Also: wxWindow::GetForegroundColour, wxWindow::SetBackgroundColour,
%% wxWindow::GetBackgroundColour, wxWindow::ShouldInheritColours
%%*%%*%%
-spec setForegroundColour(This, Colour) -> boolean()
when
This :: wxWindow(),
Colour :: wx:wx_colour().
%% The colour to be used as the foreground colour,
%% pass wxNullColour to reset to the default colour.
setForegroundColour(#wx_ref{type=ThisT,ref=ThisRef},
Colour)
when tuple_size(Colour) =:= 3;
tuple_size(Colour) =:= 4 ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_SetForegroundColour,
<<ThisRef:32/?UI,(wxe_util:colour_bin(Colour)):16/binary>>).
%·%% SET OWN FOREGROUND COLOUR %%·%
%%
%% Sets the foreground colour of the window but prevents it from being
%% inherited by the children of this window.
%%
%% Return Value:
%% See Also: SetForegroundColour, InheritAttributes
%%*%%*%%
-spec setOwnForegroundColour(This, Colour) -> ok
when
This :: wxWindow(),
Colour :: wx:wx_colour().
setOwnForegroundColour(#wx_ref{type=ThisT,ref=ThisRef},
Colour)
when
tuple_size(Colour) =:= 3;
tuple_size(Colour) =:= 4 ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_SetOwnForegroundColour,
<<ThisRef:32/?UI,(wxe_util:colour_bin(Colour)):16/binary>>).
%·%% GET BACKGROUND COLOUR %%·%
%%
%% Returns the background colour of the window.
%%
%% Return Value:
%% See Also: wxWindow::SetBackgroundColour,
%% wxWindow::SetForegroundColour,
%% wxWindow::GetForegroundColour
%%*%%*%%
-spec getBackgroundColour(This) -> wx:wx_colour4()
when
This :: wxWindow().
getBackgroundColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetBackgroundColour,
<<ThisRef:32/?UI>>).
%·%% SET BACKGROUND COLOUR %%·%
%%
%% Sets the background colour of the window.
%% Please see InheritAttributes for explanation of the difference between
%% this method and SetOwnBackgroundColour.
%%
%% The background colour is usually painted by the default wxEraseEvent
%% event handler function under Windows and automatically under GTK.
%%
%% Note that setting the background colour does not cause an immediate refresh,
%% so you may wish to call wxWindow::ClearBackground or wxWindow::Refresh after
%% calling this function.
%%
%% Using this function will disable attempts to use themes for this window,
%% if the system supports them. Use with care since usually the themes represent
%% the appearance chosen by the user to be used for all applications on the system.
%%
%% Return Value:
%% See Also: wxWindow::GetBackgroundColour, wxWindow::SetForegroundColour,
%% wxWindow::GetForegroundColour, wxWindow::ClearBackground,
%% wxWindow::Refresh, wxEraseEvent
%%*%%*%%
-spec setBackgroundColour(This, Colour) -> boolean()
when
This :: wxWindow(),
Colour :: wx:wx_colour().
%% The colour to be used as the background colour,
%% pass wxNullColour to reset to the default colour.
setBackgroundColour(#wx_ref{type=ThisT,ref=ThisRef},
Colour)
when
tuple_size(Colour) =:= 3;
tuple_size(Colour) =:= 4 ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_SetBackgroundColour,
<<ThisRef:32/?UI,(wxe_util:colour_bin(Colour)):16/binary>>).
%·%% SET OWN BACKGROUND COLOUR %%·%
%%
%% Sets the background colour of the window but prevents it from being
%% inherited by the children of this window.
%%
%% Return Value:
%% See Also: SetBackgroundColour, InheritAttributes
%%*%%*%%
-spec setOwnBackgroundColour(This, Colour) -> ok
when
This :: wxWindow(),
Colour :: wx:wx_colour().
setOwnBackgroundColour(#wx_ref{type=ThisT,ref=ThisRef},Colour)
when
tuple_size(Colour) =:= 3;
tuple_size(Colour) =:= 4 ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_SetOwnBackgroundColour,
<<ThisRef:32/?UI,(wxe_util:colour_bin(Colour)):16/binary>>).
%·%% GET BACKGROUND STYLE %%·%
%%
%% Returns the background style of the window.
%% The background style indicates
%%
%% wxBG_STYLE_SYSTEM,
%% whether background colour
%% should be determined by the system
%%
%% wxBG_STYLE_COLOUR
%% be set to a specific colour ,
%%
%% wxBG_STYLE_CUSTOM
%% or should be left to the application to implement .
%%
%% On GTK+, use of wxBG_STYLE_CUSTOM allows the flicker-free drawing
%% of a custom background, such as a tiled bitmap.
%% Currently the style has no effect on other platforms.
%%
%% Return Value:
%% See Also: wxWindow::SetBackgroundColour,
%% wxWindow::GetForegroundColour,
%% wxWindow::SetBackgroundStyle
%%*%%*%%
%%<br /> Res = ?wxBG_STYLE_SYSTEM
%% | ?wxBG_STYLE_COLOUR
%% | ?wxBG_STYLE_CUSTOM
-spec getBackgroundStyle(This) -> wx:wx_enum()
when
This :: wxWindow().
getBackgroundStyle(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetBackgroundStyle,
<<ThisRef:32/?UI>>).
%·%% SET BACKGROUND STYLE %%·%
%%
%% Sets the background style of the window.
%% The background style indicates whether background colour should be
%% determined by the system (wxBG_STYLE_SYSTEM), be set to a specific colour
%% (wxBG_STYLE_COLOUR), or should be left to the application to implement
%% (wxBG_STYLE_CUSTOM).
%%
%% On GTK+, use of wxBG_STYLE_CUSTOM allows the flicker-free drawing of a
%% custom background, such as a tiled bitmap. Currently the style has no
%% effect on other platforms.
%%
%% Return Value:
%% See Also: wxWindow::SetBackgroundColour, wxWindow::GetForegroundColour, wxWindow::GetBackgroundStyle
%%*%%*%%
-spec setBackgroundStyle(This, Style) -> boolean()
when
This :: wxWindow(),
Style :: wx:wx_enum().
%%-define(wxBG_STYLE_SYSTEM, 0).
%%-define(wxBG_STYLE_COLOUR, 1).
%%-define(wxBG_STYLE_CUSTOM, 2).
setBackgroundStyle(#wx_ref{type=ThisT,ref=ThisRef},Style)
when
is_integer(Style) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_SetBackgroundStyle,
<<ThisRef:32/?UI,Style:32/?UI>>).
%·%% CLEAR BACKGROUND %%·%
%%
%% Clears the window by filling it with the current background colour.
%% Does not cause an erase background event to be generated.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec clearBackground(This) -> ok
when
This :: wxWindow().
clearBackground(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_ClearBackground,
<<ThisRef:32/?UI>>).
%·%% SET THEME ENABLED %%·%
%%
%% This function tells a window if it should use the system's "theme" code to
%% draw the windows' background instead if its own background drawing code.
%% This does not always have any effect since the underlying platform obviously
%% needs to support the notion of themes in user defined windows.
%% One such platform is GTK+ where windows can have (very colourful)
%% backgrounds defined by a user's selected theme.
%%
%% Dialogs, notebook pages and the status bar have this flag set to
%% true by default so that the default look and feel is simulated best.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec setThemeEnabled(This, EnableTheme) -> ok
when
This :: wxWindow(),
EnableTheme :: boolean().
setThemeEnabled(#wx_ref{type=ThisT,ref=ThisRef}, EnableTheme)
when
is_boolean(EnableTheme) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_SetThemeEnabled,
<<ThisRef:32/?UI,(wxe_util:from_bool(EnableTheme)):32/?UI>>).
%·%% HAS TRANSPARENT BACKGROUND %%·%
%%
%% Returns true if this window background is
%% transparent (as, for example, for wxStaticText)
%% and should show the parent window background.
%%
%% This method is mostly used internally by the
%% library itself and you normally shouldn't have to call it.
%% You may, however, have to override it in your
%% wxWindow-derived class to ensure that
%% background is painted correctly.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec hasTransparentBackground(This) -> boolean()
when
This :: wxWindow().
hasTransparentBackground(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_HasTransparentBackground,
<<ThisRef:32/?UI>>).
%·%% SCREEN TO CLIENT %%·%
%%
%% Converts from screen to client window coordinates.
%%
%% x - Stores the screen x coordinate and receives the client x coordinate.
%% y - Stores the screen x coordinate and receives the client x coordinate.
%%
%% Return Value: Gives you the X & Y of a client window.
%% See Also:
%%*%%*%%
-spec screenToClient(This) -> {X :: integer(), Y :: integer()}
when
This :: wxWindow().
screenToClient(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_ScreenToClient_2,
<<ThisRef:32/?UI>>).
%·%% SCREEN TO CLIENT %%·%
%%
%% Pt - The screen position for the second form of the function.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec screenToClient(This, Pt) -> {X :: integer(), Y :: integer()}
when
This :: wxWindow(),
Pt :: {X :: integer(), Y :: integer()}.
screenToClient(#wx_ref{type=ThisT,ref=ThisRef},
{PtX,PtY})
when
is_integer(PtX),
is_integer(PtY) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_ScreenToClient_1,
<<ThisRef:32/?UI,PtX:32/?UI,PtY:32/?UI>>).
%·%% CLIENT TO SCREEN %%·%
-spec clientToScreen(This, Pt) -> {X :: integer(), Y :: integer()}
when
This :: wxWindow(),
Pt :: {X :: integer(), Y :: integer()}.
%% X & Y %% A pointer to a integer value for the x coordinate.
%% Pass the client coordinate in, and a screen coordinate will be passed out.
%% Converts to screen coordinates from coordinates relative to this window.
%%
%% Takes a point in the client area,
%% and says where that is, in comparison to the scren.
%%
%% Return Value:
%% See Also:
%%*%%*%%
clientToScreen(#wx_ref{type=ThisT,ref=ThisRef},{PtX,PtY})
when
is_integer(PtX),
is_integer(PtY) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_ClientToScreen_1,
<<ThisRef:32/?UI,PtX:32/?UI,PtY:32/?UI>>).
%·%% CLIENT TO SCREEN / 3 %%·%
-spec clientToScreen(This, X, Y) -> {X :: integer(), Y :: integer()}
when
This :: wxWindow(),
X :: integer(),
Y :: integer().
clientToScreen(#wx_ref{type=ThisT,ref=ThisRef},X,Y)
when
is_integer(X),
is_integer(Y) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_ClientToScreen_2,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI>>).
%·%% CONVERT DIALOG TO PIXELS %%·%
%%
%% Converts a point or size from dialog units to pixels.
%%
%% For the x dimension, the dialog units are multiplied by
%% the average character width and then divided by 4.
%%
%% For the y dimension, the dialog units are multiplied by
%% the average character height and then divided by 8.
%%
%% Dialog units are used for maintaining a dialog's proportions even if the font changes.
%%
%% You can also use these functions programmatically. A convenience macro is defined:
%%
%% #define wxDLG_UNIT(parent, pt) parent->ConvertDialogToPixels(pt)
%%
%% Return Value:
%% See Also: wxWindow::ConvertPixelsToDialog
%%*%%*%%
-spec convertDialogToPixels(This, Sz) -> {W :: integer(), H :: integer()}
when
This :: wxWindow(),
Sz :: {W :: integer(), H :: integer()}.
convertDialogToPixels(#wx_ref{type=ThisT,ref=ThisRef},{SzW,SzH})
when
is_integer(SzW),
is_integer(SzH) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_ConvertDialogToPixels,
<<ThisRef:32/?UI,SzW:32/?UI,SzH:32/?UI>>).
%·%% CONVERT PIXELS TO DIALOG %%·%
%%
%% Converts a point or size from pixels to dialog units.
%%
%% For the x dimension, the pixels are multiplied by 4 and then divided by the average character width.
%% For the y dimension, the pixels are multiplied by 8 and then divided by the average character height.
%%
%% Dialog units are used for maintaining a dialog's proportions even if the font changes.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec convertPixelsToDialog(This, Sz) -> {W :: integer(), H :: integer()}
when
This :: wxWindow(),
Sz :: {W :: integer(),
H :: integer()}.
convertPixelsToDialog(#wx_ref{type=ThisT,ref=ThisRef},{SzW,SzH})
when
is_integer(SzW),
is_integer(SzH) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_ConvertPixelsToDialog,
<<ThisRef:32/?UI,SzW:32/?UI,SzH:32/?UI>>).
%·%% GET POSITION %%·%
%%
%% This gets the position of the window in pixels:
%%
%% —relative to the parent window for the CHILD WINDOWS or
%%
%% —relative to the display origin for the TOP LEVEL WINDOWS.
%%
%% x
%% Receives the x position of the window if non-NULL.
%% y
%% Receives the y position of the window if non-NULL.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec getPosition(This) -> {X :: integer(), Y :: integer()}
when
This :: wxWindow().
getPosition(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetPosition,
<<ThisRef:32/?UI>>).
%·%% GET RECT %%·%
%%
%% Returns the size and position of the window as a wxRect object.
%%
%% Return Value:
%% See Also: GetScreenRect
%%*%%*%%
-spec getRect(This) -> {X :: integer(), Y :: integer(), W :: integer(), H :: integer()}
when
This :: wxWindow().
getRect(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetRect,
<<ThisRef:32/?UI>>).
%·%% GET SCREEN POSITION %%·%
%%
%% Returns the window position in screen coordinates,
%% whether the window is a child window or a top level one.
%%
%% x
%% Receives the x position of the window if non-NULL.
%% y
%% Receives the y position of the window if non-NULL.
%% Return Value:
%% See Also:
%%*%%*%%
-spec getScreenPosition(This) -> {X :: integer(), Y :: integer()}
when
This :: wxWindow().
getScreenPosition(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetScreenPosition,
<<ThisRef:32/?UI>>).
%·%% GET SCREEN RECT %%·%
%%
%% Returns the size and position of the window on the screen as a wxRect object.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec getScreenRect(This) -> {X :: integer(), Y :: integer(), W :: integer(), H :: integer()}
when
This :: wxWindow().
getScreenRect(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetScreenRect,
<<ThisRef:32/?UI>>).
%·%% GET VIRTUAL SIZE %%·%
%%
%% This gets the virtual size of the window in pixels.
%% By default it returns the client size of the window,
%% but after a call to SetVirtualSize it will return that size.
%%
%% width
%% Receives the window width.
%% height
%% Receives the window height.
%%
%% Return Value:
%% See Also: GetSize, GetClientSize
%%*%%*%%
-spec getVirtualSize(This) -> {W :: integer(), H :: integer()}
when
This :: wxWindow().
getVirtualSize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetVirtualSize,
<<ThisRef:32/?UI>>).
%·%% SET VIRTUAL SIZE %%·%
%%
%% Sets the virtual size of the window in pixels.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec setVirtualSize(This, Size) -> ok
when
This :: wxWindow(),
Size :: {W :: integer(),
H :: integer()}.
setVirtualSize(#wx_ref{type=ThisT,ref=ThisRef}, {SizeW, SizeH})
when
is_integer(SizeW),
is_integer(SizeH) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_SetVirtualSize_1,
<<ThisRef:32/?UI,SizeW:32/?UI,SizeH:32/?UI>>).
%·%% SET VIRTUAL SIZE %%·%
%%
%% Sets the virtual size of the window in pixels.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec setVirtualSize(This, X, Y) -> ok
when
This :: wxWindow(),
X :: integer(),
Y :: integer().
setVirtualSize(#wx_ref{type=ThisT,ref=ThisRef}, X, Y)
when
is_integer(X),
is_integer(Y) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_SetVirtualSize_2,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI>>).
%·%% SET VIRTUAL SIZE HINTS %%·%
%%
%% See below...
%% @equiv setVirtualSizeHints(This,MinSize, [])
-spec setVirtualSizeHints(This, MinSize) -> ok
when
This :: wxWindow(),
MinSize :: {W :: integer(),
H :: integer()}.
setVirtualSizeHints(This,MinSize={MinSizeW, MinSizeH})
when
is_record(This, wx_ref),
is_integer(MinSizeW),
is_integer(MinSizeH) -> setVirtualSizeHints(This,MinSize, []).
%%
%% Allows specification of minimum and maximum virtual window sizes.
%% If a pair of values is not set (or set to -1), the default values will be used.
%%
%% If this function is called, the user will not be able to
%% size the virtual area of the window outside the given bounds.
%%
%% minW
%% Specifies the minimum width allowable.
%%
%% minH
%% Specifies the minimum height allowable.
%%
%% maxW
%% Specifies the maximum width allowable.
%%
%% maxH
%% Specifies the maximum height allowable.
%%
%% minSize
%% Minimum size.
%%
%% maxSize
%% Maximum size.
%% Return Value:
%% See Also:
%%*%%*%%
%%
-spec setVirtualSizeHints(This, MinW, MinH) -> ok
when
This :: wxWindow(),
MinW :: integer(),
MinH :: integer();
(This, MinSize, [Option]) -> ok
when
This :: wxWindow(),
MinSize :: {W :: integer(), H :: integer()},
Option :: {maxSize, {W :: integer(), H :: integer()}}.
setVirtualSizeHints(This,MinW,MinH)
when
is_record(This, wx_ref),
is_integer(MinW),
is_integer(MinH) -> setVirtualSizeHints(This,MinW,MinH, []);
setVirtualSizeHints(#wx_ref{type=ThisT,ref=ThisRef},
{MinSizeW,MinSizeH},
Options)
when
is_integer(MinSizeW),
is_integer(MinSizeH),
is_list(Options) ->
?CLASS(ThisT,wxWindow),
MOpts = fun({maxSize, {MaxSizeW,MaxSizeH}}, Acc) -> [<<1:32/?UI,MaxSizeW:32/?UI,MaxSizeH:32/?UI,0:32>>|Acc];
(BadOpt, _) -> erlang:error({badoption, BadOpt})
end,
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
wxe_util:cast(?wxWindow_SetVirtualSizeHints_2,
<<ThisRef:32/?UI,MinSizeW:32/?UI,MinSizeH:32/?UI, 0:32,BinOpt/binary>>).
%·%% SET VIRTUAL SIZE HINTS %%·%
%%
%% /\
%% See Above...
%% Return Value:
%% See Also:
%%*%%*%%
-spec setVirtualSizeHints(This, MinW, MinH, [Option]) -> ok
when
This :: wxWindow(),
MinW :: integer(),
MinH :: integer(),
Option :: {maxW, integer()}
| {maxH, integer()}.
setVirtualSizeHints(#wx_ref{type=ThisT,ref=ThisRef}, MinW, MinH, Options)
when
is_integer(MinW),
is_integer(MinH),
is_list(Options) ->
?CLASS(ThisT,wxWindow),
MOpts = fun({maxW, MaxW}, Acc) -> [<<1:32/?UI,MaxW:32/?UI>>|Acc];
({maxH, MaxH}, Acc) -> [<<2:32/?UI,MaxH:32/?UI>>|Acc];
(BadOpt, _) -> erlang:error({badoption, BadOpt})
end,
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
wxe_util:cast(?wxWindow_SetVirtualSizeHints_3,
<<ThisRef:32/?UI,MinW:32/?UI,MinH:32/?UI, 0:32,BinOpt/binary>>).
%·%% FIT %%·%
%%
%% Sizes the window so that it fits around its subwindows.
%% This function won't do anything if there are no subwindows
%% and will only really work correctly if the sizers are used for
%% the subwindows layout. Also, if the window has exactly one subwindow
%% it is better (faster and the result is more precise as Fit adds some
%% margin to account for fuzziness of its calculations) to call
%%
%% window->SetClientSize(child->GetSize());
%%
%% instead of calling Fit.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec fit(This) -> ok
when
This :: wxWindow().
fit(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_Fit,
<<ThisRef:32/?UI>>).
%·%% FIT INSIDE %%·%
%%
%% Similar to Fit, but sizes the interior (virtual) size of a window.
%% Mainly useful with scrolled windows to reset scrollbars
%% after sizing changes that do not trigger a size event,
%% and/or scrolled windows without an interior sizer.
%% This function similarly won't do anything
%% if there are no subwindows.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec fitInside(This) -> ok
when
This :: wxWindow().
fitInside(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_FitInside,
<<ThisRef:32/?UI>>).
%·%% ENABLE %%·%
%%
%% See below...
%% @equiv enable(This, [])
-spec enable(This) -> boolean()
when
This :: wxWindow().
enable(This)
when
is_record(This, wx_ref) -> enable(This, []).
%%
%% Enable or disable the window for user input.
%% Note that when a parent window is disabled,
%% all of its children are disabled as well and
%% they are reenabled again when the parent is.
%%
%% Return Value: Returns true if the window has been enabled or disabled,
%% false if nothing was done,
%% i.e. if the window had already been in the specified state.
%% See Also: wxWindow::IsEnabled,
%% wxWindow::Disable,
%% wxRadioBox::Enable
%%*%%*%%
-spec enable(This, [Option]) -> boolean()
when
This :: wxWindow(),
Option :: {enable, boolean()}. %% If vtrue, enables the window for input.
%% If false, disables the window.
enable(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when
is_list(Options) ->
?CLASS(ThisT,wxWindow),
MOpts = fun({enable, Enable}, Acc) -> [<<1:32/?UI,(wxe_util:from_bool(Enable)):32/?UI>>|Acc];
(BadOpt, _) -> erlang:error({badoption, BadOpt})
end,
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
wxe_util:call(?wxWindow_Enable,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
%·%% DISABLE %%·%
%%
%% Disables the window, same as Enable(false).
%%
%% Return Value: Returns true if the window has been disabled,
%% false if it had been already disabled before the call to this function.
%% See Also:
%%*%%*%%
-spec disable(This) -> boolean()
when
This :: wxWindow().
disable(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_Disable,
<<ThisRef:32/?UI>>).
%·%% IS ENABLED %%·%
%%
%% Returns true if the window is enabled for input, false otherwise.
%%
%% Return Value:
%% See Also: wxWindow::Enable
%%*%%*%%
-spec isEnabled(This) -> boolean()
when
This :: wxWindow().
isEnabled(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_IsEnabled,
<<ThisRef:32/?UI>>).
%·%% FREEZE %%·%
%%
%% Freezes the window or, in other words,
%% prevents any updates from taking place on screen,
%% the window is not redrawn at all.
%% Thaw must be called to reenable window redrawing.
%% Calls to these two functions may be nested.
%%
%% This method is useful for visual appearance optimization
%% (for example, it is a good idea to use it
%% before doing many large text insertions
%% in a row into a wxTextCtrl under wxGTK)
%% but is not implemented on all platforms
%% nor for all controls so it is mostly just a hint
%% to wxWidgets and not a mandatory directive.
%%
%% Return Value:
%% See Also: wxWindowUpdateLocker
%%*%%*%%
-spec freeze(This) -> ok
when
This :: wxWindow().
freeze(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_Freeze,
<<ThisRef:32/?UI>>).
%·%% THAW %%·%
%%
%% Reenables window updating after a previous call to Freeze.
%% To really thaw the control, it must be called exactly
%% the same number of times as Freeze.
%%
%% Return Value:
%% See Also: wxWindowUpdateLocker
%%*%%*%%
-spec thaw(This) -> ok
when
This :: wxWindow().
thaw(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_Thaw,
<<ThisRef:32/?UI>>).
%·%% SET FOCUS %%·%
%%
%% This sets the window to receive keyboard input.
%% rc_note: havn't got this work successfully,
%% used wxWindow:raise() instead.
%% Havn't tried the one below, though.
%%
%% Return Value:
%% See Also: wxFocusEvent wxPanel::SetFocus wxPanel::SetFocusIgnoringChildren
%%*%%*%%
-spec setFocus(This) -> ok
when
This :: wxWindow().
setFocus(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_SetFocus,
<<ThisRef:32/?UI>>).
%·%% SET FOCUS FROM KBD(keyboard) %%·%
%%
%% This function is called by wxWidgets keyboard navigation code when the user
%% gives the focus to this window from keyboard (e.g. using TAB key).
%% By default this method simply calls SetFocus but can be overridden to
%% do something in addition to this in the derived classes.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec setFocusFromKbd(This) -> ok
when
This :: wxWindow().
setFocusFromKbd(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_SetFocusFromKbd,
<<ThisRef:32/?UI>>).
%·%% FIND FOCUS %%·%
%%
%% Finds the window or control which currently has the keyboard focus.
%%
%% Note that this is a static function, so it can be called without needing a wxWindow pointer.
%%
%% Return Value:
%% See Also: wxWindow::SetFocus
%%*%%*%%
-spec findFocus() -> wxWindow().
findFocus() ->
wxe_util:call(?wxWindow_FindFocus,
<<>>).
%·%% RAISE %%·%
%%
%% Raises the window to the top of the window hierarchy (z-order).
%%
%% In current version of wxWidgets this works both
%% for managed and child windows.
%%
%% Return Value:
%% See Also: Lower
%%*%%*%%
-spec raise(This) -> ok
when
This :: wxWindow().
raise(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_Raise,
<<ThisRef:32/?UI>>).
%·%% LOWER %%·%
%%
%% Lowers the window to the bottom of the window hierarchy (z-order).
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec lower(This) -> ok
when
This :: wxWindow().
lower(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_Lower,
<<ThisRef:32/?UI>>).
%·%% MAKE MODAL %%·%
%%
%% See below...
%% @equiv makeModal(This, [])
-spec makeModal(This) -> ok
when
This :: wxWindow().
makeModal(This)
when
is_record(This, wx_ref) -> makeModal(This, []).
%%
%% Disables all other windows in the application so that the user can only
%% interact with this window.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec makeModal(This, [Option]) -> ok
when
This :: wxWindow(),
Option :: {modal, boolean()}.
%% If true, this call disables all other windows in the application
%% so that the user can only interact with this window.
%% If false, the effect is reversed.
makeModal(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when
is_list(Options) ->
?CLASS(ThisT,wxWindow),
MOpts = fun({modal, Modal}, Acc) -> [<<1:32/?UI,(wxe_util:from_bool(Modal)):32/?UI>>|Acc];
(BadOpt, _) -> erlang:error({badoption, BadOpt})
end,
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
wxe_util:cast(?wxWindow_MakeModal,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
%% @equiv findWindowById(Winid, [])
-spec findWindowById(Winid) -> wxWindow()
when
Winid :: integer().
findWindowById(Winid)
when
is_integer(Winid) -> findWindowById(Winid, []).
%·%% FIND WINDOW BY ID %%·%
%%
%% Find the first window with the given id.
%%
%% If parent is NULL, the search will start from all top-level frames and dialog boxes;
%% if non-NULL, the search will be limited to the given window hierarchy.
%% The search is recursive in both cases.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec findWindowById(Winid, [Option]) -> wxWindow()
when
Winid :: integer(),
Option :: {parent, wxWindow()}.
findWindowById(Winid, Options)
when
is_integer(Winid),
is_list(Options) ->
MOpts = fun({parent, #wx_ref{type=ParentT,ref=ParentRef}}, Acc) ->
?CLASS(ParentT,wxWindow),[<<1:32/?UI,ParentRef:32/?UI>>|Acc];
(BadOpt, _) -> erlang:error({badoption, BadOpt})
end,
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
wxe_util:call(?wxWindow_FindWindowById,
<<Winid:32/?UI, 0:32,BinOpt/binary>>).
%·%% FIND WINDOW BY NAME %%·%
%%
%% See below...
%% @equiv findWindowByName(Name, [])
-spec findWindowByName(Name) -> wxWindow()
when
Name :: unicode:chardata().
findWindowByName(Name)
when
is_list(Name) -> findWindowByName(Name, []).
%%
%% Find a window by its name (as given in a window constructor or Create function call).
%% If parent is NULL, the search will start from all top-level frames and dialog boxes;
%% if non-NULL, the search will be limited to the given window hierarchy.
%% The search is recursive in both cases.
%%
%% If no window with such name is found, FindWindowByLabel is called.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec findWindowByName(Name, [Option]) -> wxWindow()
when
Name :: unicode:chardata() ,
Option :: {parent, wxWindow()}.
findWindowByName(Name, Options)
when
is_list(Name),
is_list(Options) ->
Name_UC = unicode:characters_to_binary([Name,0]),
MOpts = fun({parent, #wx_ref{type=ParentT,ref=ParentRef}}, Acc) ->
?CLASS(ParentT,wxWindow),[<<1:32/?UI,ParentRef:32/?UI>>|Acc];
(BadOpt, _) ->
erlang:error({badoption, BadOpt})
end,
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
wxe_util:call(?wxWindow_FindWindowByName,
<<(byte_size(Name_UC)):32/?UI,(Name_UC)/binary,
0:(((8- ((4+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
%·%% FIND WINDOW BY LABEL %%·%
%%
%% See below...
%% @equiv findWindowByLabel(Label, [])
-spec findWindowByLabel(Label) -> wxWindow()
when
Label :: unicode:chardata().
findWindowByLabel(Label)
when
is_list(Label) -> findWindowByLabel(Label, []).
%%
%% Find a window by its label.
%% Depending on the type of window, the label may be a window title or panel item label.
%% If parent is NULL, the search will start from all top-level frames and dialog boxes;
%% if non-NULL, the search will be limited to the given window hierarchy.
%% The search is recursive in both cases.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec findWindowByLabel(Label, [Option]) -> wxWindow()
when
Label :: unicode:chardata(),
Option :: {parent, wxWindow()}.
findWindowByLabel(Label, Options)
when
is_list(Label),
is_list(Options) ->
Label_UC = unicode:characters_to_binary([Label,0]),
MOpts = fun({parent, #wx_ref{type=ParentT,ref=ParentRef}}, Acc) ->
?CLASS(ParentT,wxWindow),[<<1:32/?UI,ParentRef:32/?UI>>|Acc];
(BadOpt, _) ->
erlang:error({badoption, BadOpt})
end,
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
wxe_util:call(?wxWindow_FindWindowByLabel,
<<(byte_size(Label_UC)):32/?UI,(Label_UC)/binary,
0:(((8- ((4+byte_size(Label_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
%·%% GET ACCELERATOR TABLE %%·%
%%
%% Gets the accelerator table for this window. See wxAcceleratorTable.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec getAcceleratorTable(This) -> wxAcceleratorTable:wxAcceleratorTable()
when
This :: wxWindow().
getAcceleratorTable(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetAcceleratorTable,
<<ThisRef:32/?UI>>).
%·%% SET ACCELERATOR TABLE %%·%
%%
%% Sets the accelerator table for this window. See wxAcceleratorTable.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec setAcceleratorTable(This, Accel) -> ok
when
This :: wxWindow(),
Accel :: wxAcceleratorTable:wxAcceleratorTable().
setAcceleratorTable(#wx_ref{type=ThisT,ref=ThisRef},
#wx_ref{type=AccelT,ref=AccelRef}) ->
?CLASS(ThisT,wxWindow),
?CLASS(AccelT,wxAcceleratorTable),
wxe_util:cast(?wxWindow_SetAcceleratorTable,
<<ThisRef:32/?UI,AccelRef:32/?UI>>).
%·%% GET CARET %%·%
%%
%% Returns the caret associated with the window.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec getCaret(This) -> wxCaret:wxCaret()
when
This :: wxWindow().
getCaret(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetCaret,
<<ThisRef:32/?UI>>).
%·%% SET CARET %%·%
%%
%% Sets the caret associated with the window.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec setCaret(This, Caret) -> ok
when
This :: wxWindow(),
Caret :: wxCaret:wxCaret().
setCaret(#wx_ref{type=ThisT,ref=ThisRef},
#wx_ref{type=CaretT,ref=CaretRef}) ->
?CLASS(ThisT,wxWindow),
?CLASS(CaretT,wxCaret),
wxe_util:cast(?wxWindow_SetCaret,
<<ThisRef:32/?UI,CaretRef:32/?UI>>).
%·%% GET CLIENT SIZE %%·%
%%
%% This gets the size of the window 'client area' in pixels.
%% The client area is the area which may be drawn on by the programmer,
%% excluding title bar, border, scrollbars, etc.
%%
%% W - Receives the client width in pixels.
%% H - Receives the client height in pixels.
%% Return Value:
%% See Also:
%%*%%*%%
-spec getClientSize(This) -> {W :: integer(), H :: integer()}
when
This :: wxWindow().
getClientSize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetClientSize,
<<ThisRef:32/?UI>>).
%·%% SET CLIENT SIZE %%·%
%%
%% This sets the size of the window client area in pixels.
%% Using this function to size a window tends to be more device-independent
%% than wxWindow::SetSize, since the application need not worry about what
%% dimensions the border or title bar have when trying to fit the window around
%% panel items, for example.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec setClientSize(This, Size) -> ok
when
This :: wxWindow(),
Size :: {W :: integer(), %% The required client area width.
H :: integer()}; %% The required client area height.
(This, Rect) -> ok
when
This :: wxWindow(),
Rect :: {X :: integer(),
Y :: integer(),
W :: integer(),
H :: integer()}.
setClientSize(#wx_ref{type=ThisT,ref=ThisRef},
{SizeW,SizeH})
when
is_integer(SizeW),
is_integer(SizeH) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_SetClientSize_1_0,
<<ThisRef:32/?UI,SizeW:32/?UI,SizeH:32/?UI>>);
setClientSize(#wx_ref{type=ThisT,ref=ThisRef},
{RectX,RectY,RectW,RectH})
when
is_integer(RectX),
is_integer(RectY),
is_integer(RectW),
is_integer(RectH) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_SetClientSize_1_1,
<<ThisRef:32/?UI,RectX:32/?UI,RectY:32/?UI,RectW:32/?UI,RectH:32/?UI>>).
%% See Above
%% Return Value:
%% See Also:
%%*%%*%%
-spec setClientSize(This, Width, Height) -> ok
when
This :: wxWindow(),
Width :: integer(), %% The required client area width.
Height :: integer(). %% The required client area height.
setClientSize(#wx_ref{type=ThisT,ref=ThisRef},
Width,
Height)
when
is_integer(Width),
is_integer(Height) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_SetClientSize_2,
<<ThisRef:32/?UI,Width:32/?UI,Height:32/?UI>>).
%·%% GET CURSOR %%·%
%%
%% Return the cursor associated with this window.
%%
%% Return Value:
%% See Also: wxWindow::SetCursor
%%*%%*%%
-spec getCursor(This) -> wxCursor:wxCursor()
when
This :: wxWindow().
getCursor(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetCursor,
<<ThisRef:32/?UI>>).
%·%% SET CURSOR %%·%
%%
%% Sets the window's cursor. Notice that the window cursor also
%% sets it for the children of the window implicitly.
%%
%% The cursor may be wxNullCursor in which case the window cursor
%% will be reset back to default.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec setCursor(This, Cursor) -> boolean()
when
This :: wxWindow(),
Cursor :: wxCursor:wxCursor(). %% Specifies the cursor that the window should normally display.
setCursor(#wx_ref{type=ThisT,ref=ThisRef},
#wx_ref{type=CursorT,ref=CursorRef}) ->
?CLASS(ThisT,wxWindow),
?CLASS(CursorT,wxCursor),
wxe_util:call(?wxWindow_SetCursor,
<<ThisRef:32/?UI,CursorRef:32/?UI>>).
%·%% GET DROP TARGET %%·%
%%
%% Returns the associated drop target, which may be NULL.
%%
%% Return Value:
%% See Also: wxWindow::SetDropTarget, Drag and drop overview
%%*%%*%%
-spec getDropTarget(This) -> wx:wx_object()
when
This :: wxWindow().
getDropTarget(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetDropTarget,
<<ThisRef:32/?UI>>).
%·%% SET DROP TARGET %%·%
%%
%% Associates a drop target with this window.
%%
%% If the window already has a drop target, it is deleted.
%%
%% Return Value:
%% See Also: wxWindow::GetDropTarget, Drag and drop overview
%%*%%*%%
-spec setDropTarget(This, DropTarget) -> ok
when
This :: wxWindow(),
DropTarget :: wx:wx_object().
setDropTarget(#wx_ref{type=ThisT,ref=ThisRef},
#wx_ref{type=DropTargetT,ref=DropTargetRef}) ->
?CLASS(ThisT,wxWindow),
?CLASS(DropTargetT,wxDropTarget),
wxe_util:cast(?wxWindow_SetDropTarget,
<<ThisRef:32/?UI,DropTargetRef:32/?UI>>).
%·%% GET EXTRA STYLE %%·%
%%
%% Returns the extra style bits for the window.
%%
%% See below for details.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec getExtraStyle(This) -> integer()
when
This :: wxWindow().
getExtraStyle(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetExtraStyle,
<<ThisRef:32/?UI>>).
%·%% SET EXTRA STYLE %%·%
%%
%% Sets the extra style bits for the window.
%% The currently defined extra style bits are:
%%
%% wxWS_EX_VALIDATE_RECURSIVELY TransferDataTo/FromWindow() and Validate()
%% methods will recursively descend into all
%% children of the window if it has
%% this style flag set.
%%
%% wxWS_EX_BLOCK_EVENTS Normally, the command events are propagated
%% upwards to the window parent recursively
%% until a handler for them is found.
%% Using this style:
%% allows to prevent them from being propagated
%% beyond this window. Notice that wxDialog
%% has this style on by default for the reasons
%% explained in the event processing overview.
%%
%% wxWS_EX_TRANSIENT This can be used to prevent a window from
%% being used as an implicit parent for the
%% dialogs which were created without a parent.
%% It is useful for the windows which can
%% disappear at any moment as creating children
%% of such windows results in fatal problems.
%%
%% wxWS_EX_CONTEXTHELP Under Windows, puts a query button on the
%% caption. When pressed, Windows will go into
%% a context-sensitive help mode and wxWidgets
%% will send a wxEVT_HELP event if the user
%% clicked on an application window.
%% This style cannot be used together
%% with wxMAXIMIZE_BOX or wxMINIMIZE_BOX,
%% so these two styles are automatically
%% turned of if this one is used.
%%
%% wxWS_EX_PROCESS_IDLE This window should always process idle
%% events, even if the mode set by
%% wxIdleEvent::SetMode is
%% wxIDLE_PROCESS_SPECIFIED.
%%
%% wxWS_EX_PROCESS_UI_UPDATES This window should always process UI
%% update events, even if the mode
%% set by wxUpdateUIEvent::SetMode
%% is wxUPDATE_UI_PROCESS_SPECIFIED.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec setExtraStyle(This, ExStyle) -> ok
when
This :: wxWindow(),
ExStyle :: integer().
setExtraStyle(#wx_ref{type=ThisT,ref=ThisRef},ExStyle)
when
is_integer(ExStyle) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_SetExtraStyle,
<<ThisRef:32/?UI,ExStyle:32/?UI>>).
%·%% GET FONT %%·%
%%
%% Returns the font for this window.
%%
%% Return Value:
%% See Also: wxWindow::SetFont
%%*%%*%%
-spec getFont(This) -> wxFont:wxFont()
when
This :: wxWindow().
getFont(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetFont,
<<ThisRef:32/?UI>>).
%·%% SET FONT %%·%
%%
%% Sets the font for this window. This function should not be called for the
%% parent window if you don't want its font to be inherited by its children,
%% use SetOwnFont instead in this case and see InheritAttributes for more explanations.
%%
%% Please notice that the given font is not automatically used for wxPaintDC
%% objects associated with this window, you need to call wxDC::SetFont() too.
%% However this font is used by any standard controls for drawing their text
%% as well as by wxWindow::GetTextExtent().
%%
%% Return Value:
%% See Also: wxWindow::GetFont, InheritAttributes
%%*%%*%%
-spec setFont(This, Font) -> boolean()
when
This :: wxWindow(),
Font :: wxFont:wxFont(). %%
%% Font to associate with this window,
%% pass wxNullFont to reset to the default font.
setFont(#wx_ref{type=ThisT,ref=ThisRef},
#wx_ref{type=FontT,ref=FontRef}) ->
?CLASS(ThisT,wxWindow),
?CLASS(FontT,wxFont),
wxe_util:call(?wxWindow_SetFont,
<<ThisRef:32/?UI,FontRef:32/?UI>>).
%·%% SET OWN FONT %%·%
%%
%% Sets the font of the window but prevents it from being inherited
%% by the children of this window.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec setOwnFont(This, Font) -> ok
when
This :: wxWindow(),
Font :: wxFont:wxFont().
setOwnFont(#wx_ref{type=ThisT,ref=ThisRef},
#wx_ref{type=FontT,ref=FontRef}) ->
?CLASS(ThisT,wxWindow),
?CLASS(FontT,wxFont),
wxe_util:cast(?wxWindow_SetOwnFont,
<<ThisRef:32/?UI,FontRef:32/?UI>>).
%·%% GET HELP TEXT %%·%
%%
%% Gets the help text to be used as context-sensitive help for this window.
%%
%% Note that the text is actually stored by the current wxHelpProvider implementation,
%% and not in the window object itself.
%%
%% Return Value:
%% See Also: SetHelpText, GetHelpTextAtPoint, wxHelpProvider
%%*%%*%%
-spec getHelpText(This) -> unicode:charlist()
when
This :: wxWindow().
getHelpText(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetHelpText,
<<ThisRef:32/?UI>>).
%·%% SET HELP TEXT %%·%
%%
%% Sets the help text to be used as context-sensitive help for this window.
%%
%% Note that the text is actually stored by the current wxHelpProvider
%% implementation, and not in the window object itself.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec setHelpText(This, Text) -> ok
when
This :: wxWindow(),
Text :: unicode:chardata().
setHelpText(#wx_ref{type=ThisT,ref=ThisRef},Text)
when
is_list(Text) ->
?CLASS(ThisT,wxWindow),
Text_UC = unicode:characters_to_binary([Text,0]),
wxe_util:cast(?wxWindow_SetHelpText,
<<ThisRef:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary,
0:(((8- ((0+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8>>).
%·%% GET ID %%·%
%%
%% Returns the identifier of the window.
%%
%% Each window has an integer identifier.
%% If the application has not provided one
%% (or the default wxID_ANY) an unique identifier with a
%% negative value will be generated.
%%
%% Return Value:
%% See Also: wxWindow::SetId, Window identifiers
%%*%%*%%
-spec getId(This) -> integer()
when
This :: wxWindow().
getId(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetId,
<<ThisRef:32/?UI>>).
%·%% SET ID %%·%
%%
%% Sets the identifier of the window.
%%
%% Each window has an integer identifier.
%% If the application has not provided one, an identifier will be generated.
%% Normally, the identifier should be provided on creation and
%% should not be modified subsequently.
%%
%% Return Value:
%% See Also: wxWindow::GetId, Window identifiers
%%*%%*%%
-spec setId(This, Winid) -> ok
when
This :: wxWindow(),
Winid :: integer().
setId(#wx_ref{type=ThisT,ref=ThisRef},
Winid)
when
is_integer(Winid) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_SetId,
<<ThisRef:32/?UI,Winid:32/?UI>>).
%·%% GET LABEL %%·%
%%
%% Generic way of getting a label from any window, for identification purposes.
%%
%% The interpretation of this function differs from class to class.
%% For frames and dialogs, the value returned is the title.
%% For buttons or static text controls, it is the button text.
%% This function can be useful for meta-programs
%% (such as testing tools or special-needs access programs)
%% which need to identify windows by name.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec getLabel(This) -> unicode:charlist()
when
This :: wxWindow().
getLabel(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetLabel,
<<ThisRef:32/?UI>>).
%·%% SET LABEL %%·%
%%
%% Sets the window's label.
%%
%% Return Value:
%% See Also: wxWindow::GetLabel
%%*%%*%%
-spec setLabel(This, Label) -> ok
when
This :: wxWindow(),
Label :: unicode:chardata(). %% The window label.
setLabel(#wx_ref{type=ThisT,ref=ThisRef},Label)
when
is_list(Label) ->
?CLASS(ThisT,wxWindow),
Label_UC = unicode:characters_to_binary([Label,0]),
wxe_util:cast(?wxWindow_SetLabel,
<<ThisRef:32/?UI,(byte_size(Label_UC)):32/?UI,(Label_UC)/binary,
0:(((8- ((0+byte_size(Label_UC)) band 16#7)) band 16#7))/unit:8>>).
%·%% GET MAX SIZE %%·%
%%
%% Returns the maximum size of the window, an indication to the sizer
%% layout mechanism that this is the maximum possible size.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec getMaxSize(This) -> {W :: integer(), H :: integer()}
when
This :: wxWindow().
getMaxSize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetMaxSize,
<<ThisRef:32/?UI>>).
%·%% SET MAX SIZE %%·%
%%
%% Sets the maximum size of the window,
%% to indicate to the sizer layout mechanism
%% that this is the maximum possible size.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec setMaxSize(This, MaxSize) -> ok
when
This :: wxWindow(),
MaxSize :: {W :: integer(),
H :: integer()}.
setMaxSize(#wx_ref{type=ThisT,ref=ThisRef},
{MaxSizeW,MaxSizeH})
when
is_integer(MaxSizeW),
is_integer(MaxSizeH) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_SetMaxSize,
<<ThisRef:32/?UI,MaxSizeW:32/?UI,MaxSizeH:32/?UI>>).
%·%% GET MIN SIZE %%·%
%%
%% Returns the minimum size of the window, an indication to the sizer
%% layout mechanism that this is the minimum required size.
%% It normally just returns the value set by SetMinSize,
%% but it can be overridden to do the calculation on demand.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec getMinSize(This) -> {W :: integer(), H :: integer()}
when
This :: wxWindow().
getMinSize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetMinSize,
<<ThisRef:32/?UI>>).
%·%% SET MIN SIZE %%·%
%%
%% Sets the minimum size of the window,
%% to indicate to the sizer layout mechanism
%% that this is the minimum required size.
%% You may need to call this if you change the window
%% size after construction and before adding to its parent sizer.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec setMinSize(This, MinSize) -> ok
when
This :: wxWindow(),
MinSize :: {W :: integer(),
H :: integer()}.
setMinSize(#wx_ref{type=ThisT,ref=ThisRef},{MinSizeW,MinSizeH})
when
is_integer(MinSizeW),
is_integer(MinSizeH) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_SetMinSize,
<<ThisRef:32/?UI,MinSizeW:32/?UI,MinSizeH:32/?UI>>).
%·%% GET NAME %%·%
%%
%% Returns the window's name.
%%
%% This name is not guaranteed to be unique; it is up to the programmer
%% to supply an appropriate name in the window constructor or
%% via wxWindow::SetName.
%%
%% Return Value:
%% See Also: wxWindow::SetName
%%*%%*%%
-spec getName(This) -> unicode:charlist()
when
This :: wxWindow().
getName(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetName,
<<ThisRef:32/?UI>>).
%·%% SET NAME %%·%
%%
%% Sets the window's name.
%%
%% Return Value:
%% See Also: wxWindow::GetName
%%*%%*%%
-spec setName(This, Name) -> ok
when
This :: wxWindow(),
Name :: unicode:chardata(). %% A name to set for the window.
setName(#wx_ref{type=ThisT,ref=ThisRef},Name)
when
is_list(Name) ->
?CLASS(ThisT,wxWindow),
Name_UC = unicode:characters_to_binary([Name,0]),
wxe_util:cast(?wxWindow_SetName,
<<ThisRef:32/?UI,(byte_size(Name_UC)):32/?UI,(Name_UC)/binary,
0:(((8- ((0+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8>>).
%·%% HAS SCROLLBAR %%·%
%%
%% Returns true if this window has a scroll bar for this orientation.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec hasScrollbar(This, Orient) -> boolean()
when
This :: wxWindow(),
Orient :: integer(). %% Orientation to check, either wxHORIZONTAL or wxVERTICAL.
hasScrollbar(#wx_ref{type=ThisT,ref=ThisRef},
Orient)
when
is_integer(Orient) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_HasScrollbar,
<<ThisRef:32/?UI,Orient:32/?UI>>).
%·%% GET SCROLL RANGE %%·%
%%
%% Returns the built-in scrollbar range.
%%
%% Return Value:
%% See Also: wxWindow::SetScrollbar
%%*%%*%%
-spec getScrollRange(This, Orient) -> integer()
when
This :: wxWindow(),
Orient :: integer().
getScrollRange(#wx_ref{type=ThisT,ref=ThisRef},
Orient )
when
is_integer(Orient) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetScrollRange,
<<ThisRef:32/?UI,Orient:32/?UI>>).
%·%% GET SCROLL THUMB %%·%
%%
%% Returns the built-in scrollbar thumb size.
%%
%% Return Value:
%% See Also: wxWindow::SetScrollbar
%%*%%*%%
-spec getScrollThumb(This, Orient) -> integer()
when
This :: wxWindow(),
Orient :: integer().
getScrollThumb(#wx_ref{type=ThisT,ref=ThisRef},
Orient)
when
is_integer(Orient) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetScrollThumb,
<<ThisRef:32/?UI,Orient:32/?UI>>).
%·%% GET SCROLL POS %%·%
%%
%% Returns the built-in scrollbar position.
%%
%% Return Value:
%% See Also: See wxWindow::SetScrollbar
%%*%%*%%
-spec getScrollPos(This, Orient) -> integer()
when
This :: wxWindow(),
Orient :: integer().
getScrollPos(#wx_ref{type=ThisT,ref=ThisRef},
Orient)
when
is_integer(Orient) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetScrollPos,
<<ThisRef:32/?UI,Orient:32/?UI>>).
%·%% SET SCROLL POS %%·%
%%
%% See below...
%% @equiv setScrollPos(This,Orient,Pos, [])
-spec setScrollPos(This, Orient, Pos) -> ok
when
This :: wxWindow(),
Orient :: integer(),
Pos :: integer().
setScrollPos(This,Orient,Pos)
when
is_record(This, wx_ref),
is_integer(Orient),
is_integer(Pos) -> setScrollPos(This,Orient,Pos, []).
%%
%% Sets the position of one of the built-in scrollbars.
%%
%% This function does not directly affect the contents of the window:
%% it is up to the application to take note of scrollbar attributes and
%% redraw contents accordingly.
%%
%% Return Value:
%% See Also: wxWindow::SetScrollbar, wxWindow::GetScrollPos, wxWindow::GetScrollThumb, wxScrollBar, wxScrolledWindow
%%*%%*%%
-spec setScrollPos(This, Orient, Pos, [Option]) -> ok
when
This :: wxWindow(),
Orient :: integer(), %% Determines the scrollbar whose position is to be set.
%% May be wxHORIZONTAL or wxVERTICAL.
Pos :: integer(), %% Position in scroll units.
Option :: {refresh, boolean()}. %% true to redraw the scrollbar, false otherwise.
setScrollPos(#wx_ref{type=ThisT,ref=ThisRef},
Orient,
Pos,
Options)
when
is_integer(Orient),
is_integer(Pos),
is_list(Options) ->
?CLASS(ThisT,wxWindow),
MOpts = fun({refresh, Refresh}, Acc) -> [<<1:32/?UI,(wxe_util:from_bool(Refresh)):32/?UI>>|Acc];
(BadOpt, _) -> erlang:error({badoption, BadOpt})
end,
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
wxe_util:cast(?wxWindow_SetScrollPos,
<<ThisRef:32/?UI,Orient:32/?UI,Pos:32/?UI, 0:32,BinOpt/binary>>).
%·%% SET SCROLLBAR %%·%
%%
%% See below...
%% @equiv setScrollbar(This,Orient,Pos,ThumbVisible,Range, [])
-spec setScrollbar(This, Orient, Pos, ThumbVisible, Range) -> ok
when
This :: wxWindow(),
Orient :: integer(),
Pos :: integer(),
ThumbVisible :: integer(),
Range :: integer().
setScrollbar(This,Orient,Pos,ThumbVisible,Range)
when
is_record(This, wx_ref),
is_integer(Orient),
is_integer(Pos),
is_integer(ThumbVisible),
is_integer(Range) -> setScrollbar(This,Orient,Pos,ThumbVisible,Range, []).
%%
%% Sets the scrollbar properties of a built-in scrollbar.
%%
%% Parameters
%%
%% orientation
%% Determines the scrollbar whose page size is to be set. May be wxHORIZONTAL or wxVERTICAL.
%% position
%% The position of the scrollbar in scroll units.
%% thumbSize
%% The size of the thumb, or visible portion of the scrollbar, in scroll units.
%% range
%% The maximum position of the scrollbar.
%% refresh
%% true to redraw the scrollbar, false otherwise.
%%
%%
%% Let's say you wish to display 50 lines of text, using the same font.
%% The window is sized so that you can only see 16 lines at a time.
%%
%% You would use:
%% SetScrollbar(wxVERTICAL, 0, 16, 50);
%%
%% Note that with the window at this size,
%% the thumb position can never go above 50 minus 16, or 34.
%% You can determine how many lines are currently visible by
%% dividing the current view size by the character height in pixels.
%% When defining your own scrollbar behaviour, you will always need to
%% recalculate the scrollbar settings when the window size changes.
%% You could therefore put your scrollbar calculations and SetScrollbar
%% call into a function named AdjustScrollbars, which can be called
%% initially and also from your wxSizeEvent handler function.
%%
%% Return Value:
%% See Also: Scrolling overview, wxScrollBar, wxScrolledWindow, wxScrollWinEvent
%%*%%*%%
-spec setScrollbar(This, Orient, Pos, ThumbVisible, Range, [Option]) -> ok
when
This :: wxWindow(),
Orient :: integer(),
Pos :: integer(),
ThumbVisible :: integer(),
Range :: integer(),
Option :: {refresh, boolean()}.
setScrollbar(#wx_ref{type=ThisT,ref=ThisRef},Orient,Pos,ThumbVisible,Range, Options)
when
is_integer(Orient),
is_integer(Pos),
is_integer(ThumbVisible),
is_integer(Range),
is_list(Options) ->
?CLASS(ThisT,wxWindow),
MOpts = fun({refresh, Refresh}, Acc) -> [<<1:32/?UI,(wxe_util:from_bool(Refresh)):32/?UI>>|Acc];
(BadOpt, _) -> erlang:error({badoption, BadOpt})
end,
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
wxe_util:cast(?wxWindow_SetScrollbar,
<<ThisRef:32/?UI,Orient:32/?UI,Pos:32/?UI,ThumbVisible:32/?UI,Range:32/?UI, 0:32,BinOpt/binary>>).
%·%% SCROLL LINES %%·%
%%
%% Scrolls the window by the given number of lines down (if lines is positive) or up.
%%
%% This function is currently only implemented under MSW and wxTextCtrl
%% under wxGTK (it also works for wxScrolledWindow derived classes under all platforms).
%%
%% Return Value: Returns true if the window was scrolled,
%% false if it was already on top/bottom and nothing was done.
%% See Also: ScrollPages
%%*%%*%%
-spec scrollLines(This, Lines) -> boolean()
when
This :: wxWindow(),
Lines :: integer().
scrollLines(#wx_ref{type=ThisT,ref=ThisRef},
Lines)
when
is_integer(Lines) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_ScrollLines,
<<ThisRef:32/?UI,Lines:32/?UI>>).
%·%% LINE DOWN %%·%
%%
%% This is just a wrapper for ScrollLines(1).
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec lineDown(This) -> boolean()
when
This :: wxWindow().
lineDown(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_LineDown,
<<ThisRef:32/?UI>>).
%·%% LINE UP %%·%
%%
%% This is just a wrapper for ScrollLines(-1).
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec lineUp(This) -> boolean()
when
This :: wxWindow().
lineUp(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_LineUp,
<<ThisRef:32/?UI>>).
%·%% SCROLL PAGES %%·%
%%
%% Scrolls the window by the given number of pages down (if pages is positive) or up.
%%
%% This function is currently only implemented under MSW and wxGTK.
%%
%% Return Value: Returns true if the window was scrolled,
%% false if it was already on top/bottom and nothing was done.
%% See Also:
%%*%%*%%
-spec scrollPages(This, Pages) -> boolean()
when
This :: wxWindow(),
Pages :: integer().
scrollPages(#wx_ref{type=ThisT,ref=ThisRef},Pages)
when
is_integer(Pages) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_ScrollPages,
<<ThisRef:32/?UI,Pages:32/?UI>>).
%·%% PAGE DOWN %%·%
%%
%% This is just a wrapper for ScrollPages()(1).
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec pageDown(This) -> boolean()
when
This :: wxWindow().
pageDown(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_PageDown,
<<ThisRef:32/?UI>>).
%·%% PAGE UP %%·%
%%
%% This is just a wrapper for ScrollPages()(-1).
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec pageUp(This) -> boolean()
when
This :: wxWindow().
pageUp(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_PageUp,
<<ThisRef:32/?UI>>).
%·%% SCROLL WINDOW %%·%
%%
%% See below...
%% @equiv scrollWindow(This,Dx,Dy, [])
-spec scrollWindow(This, Dx, Dy) -> ok
when
This :: wxWindow(),
Dx :: integer(),
Dy :: integer().
scrollWindow(This,Dx,Dy)
when
is_record(This, wx_ref),
is_integer(Dx),
is_integer(Dy) -> scrollWindow(This,Dx,Dy, []).
%%
%% Physically scrolls the pixels in the window and move child windows accordingly.
%%
%%
%% Note: that you can often USE wxScrolledWindow INSTEAD
%% of using this function directly.
%%
%%
%% dx - Amount to scroll horizontally.
%% dy - Amount to scroll vertically.
%% rect - Rectangle to scroll, if it is NULL, the whole window
%% is scrolled (this is always the case under wxGTK which doesn't
%% support this parameter)
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec scrollWindow(This, Dx, Dy, [Option]) -> ok
when
This :: wxWindow(),
Dx :: integer(),
Dy :: integer(),
Option :: {rect, {X :: integer(),
Y :: integer(),
W :: integer(),
H :: integer()}}.
scrollWindow(#wx_ref{type=ThisT,ref=ThisRef},Dx,Dy, Options)
when
is_integer(Dx),
is_integer(Dy),
is_list(Options) ->
?CLASS(ThisT,wxWindow),
MOpts = fun({rect, {RectX,RectY,RectW,RectH}}, Acc) -> [<<1:32/?UI,RectX:32/?UI,RectY:32/?UI,RectW:32/?UI,RectH:32/?UI,0:32>>|Acc];
(BadOpt, _) -> erlang:error({badoption, BadOpt})
end,
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
wxe_util:cast(?wxWindow_ScrollWindow,
<<ThisRef:32/?UI,Dx:32/?UI,Dy:32/?UI, 0:32,BinOpt/binary>>).
%·%% GET SIZE %%·%
%%
%% This gets the size of the entire window in pixels,
%% including title bar, border, scrollbars, etc.
%%
%% width
%% Receives the window width.
%% height
%% Receives the window height.
%%
%% Return Value:
%% See Also: GetClientSize, GetVirtualSize
%%*%%*%%
-spec getSize(This) -> {W :: integer(), H :: integer()}
when
This :: wxWindow().
getSize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetSize,
<<ThisRef:32/?UI>>).
%·%% SET SIZE %%·%
%%
%% Sets the size and position of the window in pixels.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec setSize(This, Rect) -> ok
when
This :: wxWindow(),
Rect :: {X :: integer(),
Y :: integer(),
W :: integer(),
H :: integer()};
(This, Size) -> ok
when
This :: wxWindow(),
Size :: {W :: integer(),
H :: integer()}.
setSize(This,Rect={RectX,RectY,RectW,RectH})
when
is_record(This, wx_ref),
is_integer(RectX),
is_integer(RectY),
is_integer(RectW),
is_integer(RectH) -> setSize(This,Rect, []);
setSize(#wx_ref{type=ThisT,ref=ThisRef},
{SizeW,SizeH})
when
is_integer(SizeW),
is_integer(SizeH) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_SetSize_1,
<<ThisRef:32/?UI,SizeW:32/?UI,SizeH:32/?UI>>).
%·%% SET SIZE / 3 %%·%
%%
%% Sets the size and position of the window in pixels.
%%
%% The second form is a convenience for calling the first form with
%% default x and y parameters, and must be used with
%% non-default width and height values.
%%
%% The first form sets the position and optionally size, of the window.
%% Parameters may be wxDefaultCoord to indicate either
%% that a default should be supplied by wxWidgets, or that the
%% current value of the dimension should be used.
%%
%% Parameters
%%
%% X Required x position in pixels, or wxDefaultCoord to indicate that the existing value should be used.
%% Y Required y position in pixels, or wxDefaultCoord to indicate that the existing value should be used.
%% width Required width in pixels, or wxDefaultCoord to indicate that the existing value should be used.
%% height Required height position in pixels, or wxDefaultCoord to indicate that the existing value should be used.
%% size wxSize object for setting the size.
%% rect wxRect object for setting the position and size.
%% sizeFlags Indicates the interpretation of other parameters. It is a bit list of the following:
%%
%% wxSIZE_AUTO_WIDTH: a wxDefaultCoord width value is taken to indicate a wxWidgets-supplied default width.
%% wxSIZE_AUTO_HEIGHT: a wxDefaultCoord height value is taken to indicate a wxWidgets-supplied default height.
%% wxSIZE_AUTO: wxDefaultCoord size values are taken to indicate a wxWidgets-supplied default size.
%% wxSIZE_USE_EXISTING: existing dimensions should be used if wxDefaultCoord values are supplied.
%% wxSIZE_ALLOW_MINUS_ONE: allow negative dimensions (ie. value of wxDefaultCoord) to be interpreted
%% as real dimensions, not default values.
%% wxSIZE_FORCE: normally, if the position and the size of the window are already
%% the same as the parameters of this function, nothing is done.
%% but with this flag a window resize may be forced even in this case
%% (supported in wx 2.6.2 and later and only implemented for MSW and
%% ignored elsewhere currently)
%%
%% Return Value:
%% See Also:
%%*%%*%%
%%
-spec setSize(This, Width, Height) -> ok
when
This :: wxWindow(),
Width :: integer(),
Height :: integer();
(This, Rect, [Option]) -> ok
when
This :: wxWindow(),
Rect :: {X :: integer(),
Y :: integer(),
W :: integer(),
H :: integer()},
Option :: {sizeFlags, integer()}.
setSize(#wx_ref{type=ThisT,ref=ThisRef},Width,Height)
when
is_integer(Width),
is_integer(Height) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_SetSize_2_0,
<<ThisRef:32/?UI,Width:32/?UI,Height:32/?UI>>);
setSize(#wx_ref{type=ThisT,ref=ThisRef},
{RectX,RectY,RectW,RectH},
Options)
when
is_integer(RectX),
is_integer(RectY),
is_integer(RectW),
is_integer(RectH),
is_list(Options) ->
?CLASS(ThisT,wxWindow),
MOpts = fun({sizeFlags, SizeFlags}, Acc) -> [<<1:32/?UI,SizeFlags:32/?UI>>|Acc];
(BadOpt, _) -> erlang:error({badoption, BadOpt})
end,
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
wxe_util:cast(?wxWindow_SetSize_2_1,
<<ThisRef:32/?UI,RectX:32/?UI,RectY:32/?UI,RectW:32/?UI,RectH:32/?UI, 0:32,BinOpt/binary>>).
%·%% SET SIZE / 5 %%·%
%% /\
%% See above...
%% @equiv setSize(This,X,Y,Width,Height, [])
-spec setSize(This, X, Y, Width, Height) -> ok
when
This :: wxWindow(),
X :: integer(),
Y :: integer(),
Width :: integer(),
Height :: integer().
setSize(This,X,Y,Width,Height)
when
is_record(This, wx_ref),
is_integer(X),
is_integer(Y),
is_integer(Width),
is_integer(Height) -> setSize(This,X,Y,Width,Height, []).
%% /\
%% Return Value:
%% See Also:
%%*%%*%%
-spec setSize(This, X, Y, Width, Height, [Option]) -> ok
when
This :: wxWindow(),
X :: integer(),
Y :: integer(),
Width :: integer(),
Height :: integer(),
Option :: {sizeFlags, integer()}.
setSize(#wx_ref{type=ThisT,ref=ThisRef},X,Y,Width,Height, Options)
when
is_integer(X),
is_integer(Y),
is_integer(Width),
is_integer(Height),
is_list(Options) ->
?CLASS(ThisT,wxWindow),
MOpts = fun({sizeFlags, SizeFlags}, Acc) -> [<<1:32/?UI,SizeFlags:32/?UI>>|Acc];
(BadOpt, _) -> erlang:error({badoption, BadOpt})
end,
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
wxe_util:cast(?wxWindow_SetSize_5,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI,Width:32/?UI,Height:32/?UI, 0:32,BinOpt/binary>>).
%·%% SET SIZE HINTS %%·%
%%
%% See below...
%% @equiv setSizeHints(This,MinSize, [])
-spec setSizeHints(This, MinSize) -> ok
when
This :: wxWindow(),
MinSize :: {W :: integer(),
H :: integer()}.
setSizeHints(This,MinSize={MinSizeW,MinSizeH})
when
is_record(This, wx_ref),
is_integer(MinSizeW),
is_integer(MinSizeH) -> setSizeHints(This,MinSize, []).
%%
%% Use of this function for windows which are not toplevel windows
%% (such as wxDialog or wxFrame) is discouraged. Please use SetMinSize
%% and SetMaxSize instead.
%%
%% Return Value:
%% See Also: wxTopLevelWindow::SetSizeHints.
%%*%%*%%
-spec setSizeHints(This, MinW, MinH) -> ok
when
This :: wxWindow(),
MinW :: integer(),
MinH :: integer();
(This, MinSize, [Option]) -> ok
when
This :: wxWindow(),
MinSize :: {W :: integer(),
H :: integer()},
Option :: {maxSize, {W :: integer(), H :: integer()}}
| {incSize, {W :: integer(), H :: integer()}}.
setSizeHints(This,MinW,MinH)
when
is_record(This, wx_ref),
is_integer(MinW),
is_integer(MinH) ->
setSizeHints(This,MinW,MinH, []);
setSizeHints(#wx_ref{type=ThisT,ref=ThisRef}, {MinSizeW, MinSizeH}, Options)
when
is_integer(MinSizeW),
is_integer(MinSizeH),
is_list(Options) ->
?CLASS(ThisT,wxWindow),
MOpts = fun({maxSize, {MaxSizeW,MaxSizeH}}, Acc) -> [<<1:32/?UI,MaxSizeW:32/?UI,MaxSizeH:32/?UI,0:32>>|Acc];
({incSize, {IncSizeW,IncSizeH}}, Acc) -> [<<2:32/?UI,IncSizeW:32/?UI,IncSizeH:32/?UI,0:32>>|Acc];
(BadOpt, _) -> erlang:error({badoption, BadOpt})
end,
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
wxe_util:cast(?wxWindow_SetSizeHints_2,
<<ThisRef:32/?UI,MinSizeW:32/?UI,MinSizeH:32/?UI, 0:32,BinOpt/binary>>).
%·%% SET SIZE HINTS %%·%
%%
%%
%% See above.
%% Return Value:
%% See Also:
%%*%%*%%
-spec setSizeHints(This, MinW, MinH, [Option]) -> ok
when
This :: wxWindow(),
MinW :: integer(),
MinH :: integer(),
Option :: {maxW, integer()}
| {maxH, integer()}
| {incW, integer()}
| {incH, integer()}.
setSizeHints(#wx_ref{type=ThisT,ref=ThisRef}, MinW, MinH, Options)
when
is_integer(MinW),
is_integer(MinH),
is_list(Options) ->
?CLASS(ThisT,wxWindow),
MOpts = fun({maxW, MaxW}, Acc) -> [<<1:32/?UI,MaxW:32/?UI>>|Acc];
({maxH, MaxH}, Acc) -> [<<2:32/?UI,MaxH:32/?UI>>|Acc];
({incW, IncW}, Acc) -> [<<3:32/?UI,IncW:32/?UI>>|Acc];
({incH, IncH}, Acc) -> [<<4:32/?UI,IncH:32/?UI>>|Acc];
(BadOpt, _) -> erlang:error({badoption, BadOpt})
end,
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
wxe_util:cast(?wxWindow_SetSizeHints_3,
<<ThisRef:32/?UI,MinW:32/?UI,MinH:32/?UI, 0:32,BinOpt/binary>>).
%·%% SET SIZER AND FIT %%·%
%%
%% See below...
%% @equiv setSizerAndFit(This,Sizer, [])
-spec setSizerAndFit(This, Sizer) -> ok
when
This :: wxWindow(), Sizer :: wxSizer:wxSizer().
setSizerAndFit(This,Sizer)
when
is_record(This, wx_ref),
is_record(Sizer, wx_ref) -> setSizerAndFit(This,Sizer, []).
%%
%% The same as SetSizer, except it also sets the size hints
%% for the window based on the sizer's minimum size.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec setSizerAndFit(This, Sizer, [Option]) -> ok
when
This :: wxWindow(),
Sizer :: wxSizer:wxSizer(),
Option :: {deleteOld, boolean()}.
setSizerAndFit(#wx_ref{type=ThisT,ref=ThisRef},
#wx_ref{type=SizerT,ref=SizerRef}, Options)
when
is_list(Options) ->
?CLASS(ThisT,wxWindow),
?CLASS(SizerT,wxSizer),
MOpts = fun({deleteOld, DeleteOld}, Acc) -> [<<1:32/?UI,(wxe_util:from_bool(DeleteOld)):32/?UI>>|Acc];
(BadOpt, _) -> erlang:error({badoption, BadOpt})
end,
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
wxe_util:cast(?wxWindow_SetSizerAndFit,
<<ThisRef:32/?UI,SizerRef:32/?UI, BinOpt/binary>>).
%·%% GET SIZER %%·%
%%
%% Return the sizer associated with the window by a
%% previous call to SetSizer() or NULL.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec getSizer(This) -> wxSizer:wxSizer()
when
This :: wxWindow().
getSizer(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetSizer,
<<ThisRef:32/?UI>>).
%·%% SET SIZER / 2 %%·%
%% @equiv setSizer(This,Sizer, [])
-spec setSizer(This, Sizer) -> ok
when
This :: wxWindow(),
Sizer :: wxSizer:wxSizer().
setSizer(This,Sizer)
when
is_record(This, wx_ref),
is_record(Sizer, wx_ref) -> setSizer(This,Sizer, []).
%·%% SET SIZER / 3 %%·%
%%
%% Sets the window to have the given layout sizer.
%% The window will then own the object, and will take care of its deletion.
%% If an existing layout constraints object is already owned by the window,
%% it will be deleted if the deleteOld parameter is true.
%%
%% Note that this function will also call SetAutoLayout implicitly with
%% true parameter if the sizer is non-NULL and false otherwise.
%%
%% SetSizer now enables and disables Layout automatically,
%% but prior to wxWidgets 2.3.3 the following applied:
%% You must call wxWindow::SetAutoLayout to tell a window
%% to use the sizer automatically in OnSize; otherwise,
%% you must override OnSize and call Layout() explicitly.
%% When setting both a wxSizer and a wxLayoutConstraints,
%% only the sizer will have effect.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec setSizer(This, Sizer, [Option]) -> ok
when
This :: wxWindow(),
Sizer :: wxSizer:wxSizer(), %% The sizer to set.
%% Pass NULL to disassociate and conditionally delete the window's sizer.
%% See below.
Option :: {deleteOld, boolean()}. %% If true (the default), this will delete any prexisting sizer.
%% Pass false if you wish to handle deleting the old sizer yourself.
setSizer(#wx_ref{type=ThisT,ref=ThisRef},
#wx_ref{type=SizerT,ref=SizerRef}, Options)
when
is_list(Options) ->
?CLASS(ThisT,wxWindow),
?CLASS(SizerT,wxSizer),
MOpts = fun({deleteOld, DeleteOld}, Acc) -> [<<1:32/?UI,(wxe_util:from_bool(DeleteOld)):32/?UI>>|Acc];
(BadOpt, _) -> erlang:error({badoption, BadOpt})
end,
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
wxe_util:cast(?wxWindow_SetSizer,
<<ThisRef:32/?UI,SizerRef:32/?UI, BinOpt/binary>>).
%·%% GET CONTAINING SIZER %%·%
%%
%% Return the sizer that this window is a member of, if any, otherwise NULL.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec getContainingSizer(This) -> wxSizer:wxSizer()
when
This :: wxWindow().
getContainingSizer(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetContainingSizer,
<<ThisRef:32/?UI>>).
%·%% SET CONTAINING SIZER %%·%
%%
%% This normally does not need to be called by user code.
%% It is called when a window is added to a sizer, and
%% is used so the window can remove itself from the sizer when it is destroyed.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec setContainingSizer(This, Sizer) -> ok
when
This :: wxWindow(),
Sizer :: wxSizer:wxSizer().
setContainingSizer(#wx_ref{type=ThisT,ref=ThisRef},
#wx_ref{type=SizerT,ref=SizerRef}) ->
?CLASS(ThisT,wxWindow),
?CLASS(SizerT,wxSizer),
wxe_util:cast(?wxWindow_SetContainingSizer,
<<ThisRef:32/?UI,SizerRef:32/?UI>>).
%·%% LAYOUT %%·%
%%
%% Invokes the constraint-based layout algorithm or the sizer-based
%% algorithm for this window.
%%
%% See wxWindow::SetAutoLayout: when auto layout is on,
%% this function gets called automatically
%% when the window is resized.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec layout(This) -> boolean()
when
This :: wxWindow().
layout(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_Layout,
<<ThisRef:32/?UI>>).
%·%% SET AUTO LAYOUT %%·%
%%
%% Determines whether the wxWindow::Layout function will be called
%% automatically when the window is resized.
%% Please note:
%% that this only happens for the windows usually
%% used to contain children, namely wxPanel and wxTopLevelWindow
%% (and the classes deriving from them).
%%
%% This method is called implicitly by wxWindow::SetSizer but if you
%% use wxWindow::SetConstraints you should call it manually or otherwise
%% the window layout won't be correctly updated when its size changes.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec setAutoLayout(This, AutoLayout) -> ok
when
This :: wxWindow(),
AutoLayout :: boolean().
%% Set this to true if you wish the Layout function to be called
%% automatically when the window is resized.
setAutoLayout(#wx_ref{type=ThisT,ref=ThisRef},AutoLayout)
when
is_boolean(AutoLayout) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_SetAutoLayout,
<<ThisRef:32/?UI,(wxe_util:from_bool(AutoLayout)):32/?UI>>).
%·%% GET TOOL TIP %%·%
%%
%% Get the associated tooltip or NULL if none.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec getToolTip(This) -> wxToolTip:wxToolTip()
when
This :: wxWindow().
getToolTip(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetToolTip,
<<ThisRef:32/?UI>>).
%·%% SET TOOL TIP %%·%
%%
%% Attach a tooltip to the window.
%%
%% Return Value:
%% See Also: See also: GetToolTip, wxToolTip
%%*%%*%%
-spec setToolTip(This, Tip) -> ok
when
This :: wxWindow(),
Tip :: unicode:chardata();
(This, Tip) -> ok
when
This :: wxWindow(),
Tip :: wxToolTip:wxToolTip().
setToolTip(#wx_ref{type=ThisT,ref=ThisRef}, Tip)
when
is_list(Tip) ->
?CLASS(ThisT,wxWindow),
Tip_UC = unicode:characters_to_binary([Tip,0]),
wxe_util:cast(?wxWindow_SetToolTip_1_0,
<<ThisRef:32/?UI,(byte_size(Tip_UC)):32/?UI,(Tip_UC)/binary, 0:(((8- ((0+byte_size(Tip_UC)) band 16#7)) band 16#7))/unit:8>>);
]setToolTip(#wx_ref{type=ThisT,ref=ThisRef},
#wx_ref{type=TipT,ref=TipRef}) ->
?CLASS(ThisT,wxWindow),
?CLASS(TipT,wxToolTip),
wxe_util:cast(?wxWindow_SetToolTip_1_1,
<<ThisRef:32/?UI,TipRef:32/?UI>>).
%·%% SHOW %%·%
%%
%% See below...
%% @equiv show(This, [])
-spec show(This) -> boolean()
when
This :: wxWindow().
show(This)
when
is_record(This, wx_ref) -> show(This, []).
%%
%% Shows or hides the window.
%% You may need to call Raise for a top level window if you want to bring
%% it to top, although this is not needed if Show() is called immediately
%% after the frame creation.
%%
%% Return Value:
%% See Also: wxWindow::IsShown, wxWindow::Hide, wxRadioBox::Show
%%*%%*%%
-spec show(This, [Option]) -> boolean()
when
This :: wxWindow(),
Option :: {show, boolean()}. %% If true displays the window. Otherwise, hides it.
show(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when
is_list(Options) ->
?CLASS(ThisT,wxWindow),
MOpts = fun({show, Show}, Acc) -> [<<1:32/?UI,(wxe_util:from_bool(Show)):32/?UI>>|Acc];
(BadOpt, _) -> erlang:error({badoption, BadOpt})
end,
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
wxe_util:call(?wxWindow_Show,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
%·%% IS SHOWN %%·%
%%
%% Returns true if the window is shown, false if it has been hidden.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec isShown(This) -> boolean()
when
This :: wxWindow().
isShown(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_IsShown,
<<ThisRef:32/?UI>>).
%·%% HIDE %%·%
%%
%% Equivalent to calling Show(false).
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec hide(This) -> boolean()
when
This :: wxWindow().
hide(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_Hide,
<<ThisRef:32/?UI>>).
%·%% GET WINDOW STYLE FLAG %%·%
%%
%% Gets the window style that was passed
%% to the constructor or Create method.
%%
%% GetWindowStyle() is another name for the same function.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec getWindowStyleFlag(This) -> integer()
when
This :: wxWindow().
getWindowStyleFlag(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetWindowStyleFlag,
<<ThisRef:32/?UI>>).
%·%% SET WINDOW STYLE FLAG %%·%
%%
%% Sets the style of the window.
%% Please note that some styles cannot be changed after
%% the window creation and that Refresh()
%% might need to be be called after changing the
%% others for the change to take place immediately.
%%
%% See WINDOW STYLES, at the top og page, for more information about flags.
%%
%% Return Value:
%% See Also: GetWindowStyleFlag
%%*%%*%%
-spec setWindowStyleFlag(This, Style) -> ok
when
This :: wxWindow(),
Style :: integer().
setWindowStyleFlag(#wx_ref{type=ThisT,ref=ThisRef},
Style)
when
is_integer(Style) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_SetWindowStyleFlag,
<<ThisRef:32/?UI,Style:32/?UI>>).
%·%% SET WINDOW STYLE %%·%
%%
%% Identical to SetWindowStyleFlag.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec setWindowStyle(This, Style) -> ok
when
This :: wxWindow(),
Style :: integer().
setWindowStyle(#wx_ref{type=ThisT,ref=ThisRef},Style)
when
is_integer(Style) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_SetWindowStyle,
<<ThisRef:32/?UI,Style:32/?UI>>).
%·%% GET WINDOW VARIANT %%·%
%%
%% Returns the value previously passed to wxWindow::SetWindowVariant.
%%
%% Return Value:
%% See Also:
%%*%%*%%
%%<br /> Res = ?wxWINDOW_VARIANT_NORMAL
%% | ?wxWINDOW_VARIANT_SMALL
%% | ?wxWINDOW_VARIANT_MINI
%% | ?wxWINDOW_VARIANT_LARGE
%% | ?wxWINDOW_VARIANT_MAX
-spec getWindowVariant(This) -> wx:wx_enum()
when
This :: wxWindow().
getWindowVariant(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetWindowVariant,
<<ThisRef:32/?UI>>).
%·%% SET WINDOW VARIANT %%·%
%%
%% This function can be called under all platforms but only does anything
%% under Mac OS X 10.3+ currently. Under this system, each of the standard
%% control can exist in several sizes which correspond to the elements
%% of wxWindowVariant enum:
%%
%% enum wxWindowVariant
%% {
%% wxWINDOW_VARIANT_NORMAL, // Normal size
%% wxWINDOW_VARIANT_SMALL, // Smaller size (about 25 % smaller than normal )
%% wxWINDOW_VARIANT_MINI, // Mini size (about 33 % smaller than normal )
%% wxWINDOW_VARIANT_LARGE, // Large size (about 25 % larger than normal )
%% };
%%
%% By default the controls use the normal size, of course, but this function can be used to change this.
%%
%% Return Value:
%% See Also:
%%*%%*%%
%%<br /> Variant = ?wxWINDOW_VARIANT_NORMAL
%% | ?wxWINDOW_VARIANT_SMALL
%% | ?wxWINDOW_VARIANT_MINI
%% | ?wxWINDOW_VARIANT_LARGE
%% | ?wxWINDOW_VARIANT_MAX
-spec setWindowVariant(This, Variant) -> ok
when
This :: wxWindow(),
Variant :: wx:wx_enum().
setWindowVariant(#wx_ref{type=ThisT,ref=ThisRef},
Variant)
when
is_integer(Variant) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_SetWindowVariant,
<<ThisRef:32/?UI,Variant:32/?UI>>).
%·%% MOVE AFTER IN TAB ORDER %%·%
%%
%% Moves this window in the tab navigation order after the specified win.
%% This means that when the user presses TAB key on that other window,
%% the focus switches to this window.
%%
%% Default tab order is the same as creation order,
%% this function and MoveBeforeInTabOrder() allow to change it after creating
%% all the windows.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec moveAfterInTabOrder(This, Win) -> ok
when
This :: wxWindow(),
Win :: wxWindow(). %% A sibling of this window which should precede it in tab order, must not be NULL
moveAfterInTabOrder(#wx_ref{type=ThisT,ref=ThisRef},
#wx_ref{type=WinT,ref=WinRef}) ->
?CLASS(ThisT,wxWindow),
?CLASS(WinT,wxWindow),
wxe_util:cast(?wxWindow_MoveAfterInTabOrder,
<<ThisRef:32/?UI,WinRef:32/?UI>>).
%·%% MOVE BEFORE IN TAB ORDER %%·%
%%
%% Same as MoveAfterInTabOrder except that it inserts this window just
%% before win instead of putting it right after it.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec moveBeforeInTabOrder(This, Win) -> ok
when
This :: wxWindow(),
Win :: wxWindow().
moveBeforeInTabOrder(#wx_ref{type=ThisT,ref=ThisRef},
#wx_ref{type=WinT,ref=WinRef}) ->
?CLASS(ThisT,wxWindow),
?CLASS(WinT,wxWindow),
wxe_util:cast(?wxWindow_MoveBeforeInTabOrder,
<<ThisRef:32/?UI,WinRef:32/?UI>>).
%·%% NAVIGATE / 1 %%·%
%%
%% See below...
%% @equiv navigate(This, [])
-spec navigate(This) -> boolean()
when
This :: wxWindow().
navigate(This)
when
is_record(This, wx_ref) -> navigate(This, []).
%·%% NAVIGATE / 2 %%·%
%%
%% Does keyboard navigation from this window to another,
%% by sending a wxNavigationKeyEvent.
%%
%% -#wx{ event = #wxNavigationKey{ type = navigation_key
%% flags = integer(),
%% focus = wxWindow:wxWindow()
%% } },
%%
%% You may wish to call this from a text control custom keypress handler
%% to do the default navigation behaviour for the tab key,
%% since the standard default behaviour for a multiline text control
%% with the wxTE_PROCESS_TAB style is to insert a tab and not navigate
%% to the next control.
%% ctrl+tab traditionally switches doc in AUI
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec navigate(This, [Option]) -> boolean()
when
This :: wxWindow(),
Option :: {flags, integer()}.
%% flags - A combination of wxNavigationKeyEvent::IsForward
%% and wxNavigationKeyEvent::WinChange.
navigate(#wx_ref{type=ThisT,ref=ThisRef},
Options)
when
is_list(Options) ->
?CLASS(ThisT,wxWindow),
MOpts = fun({flags, Flags}, Acc) -> [<<1:32/?UI,Flags:32/?UI>>|Acc];
(BadOpt, _) -> erlang:error({badoption, BadOpt})
end,
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
wxe_util:call(?wxWindow_Navigate,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
%·%% MOVE %%·%
%%
%% See below...
%% @equiv move(This,Pt, [])
-spec move(This, Pt) -> ok
when
This :: wxWindow(),
Pt :: {X :: integer(), %% wxPoint object representing the position.
Y :: integer()}.
move(This,Pt={PtX,PtY})
when
is_record(This, wx_ref),
is_integer(PtX),
is_integer(PtY) -> move(This,Pt, []).
%%
%% Moves the window to the given position.
%%
%% See below ...
%% Return Value:
%% See Also:
%%*%%*%%
-spec move(This, X, Y) -> ok
when
This :: wxWindow(),
X :: integer(),
Y :: integer();
(This, Pt, [Option]) -> ok
when
This :: wxWindow(),
Pt :: {X :: integer(),
Y :: integer()},
Option :: {flags, integer()}.
move(This,X,Y)
when
is_record(This, wx_ref),
is_integer(X),
is_integer(Y) -> move(This,X,Y, []);
move(#wx_ref{type=ThisT,ref=ThisRef},
{PtX,PtY},
Options)
when
is_integer(PtX),
is_integer(PtY),
is_list(Options) ->
?CLASS(ThisT,wxWindow),
MOpts = fun({flags, Flags}, Acc) -> [<<1:32/?UI,Flags:32/?UI>>|Acc];
(BadOpt, _) -> erlang:error({badoption, BadOpt})
end,
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
wxe_util:cast(?wxWindow_Move_2,
<<ThisRef:32/?UI,PtX:32/?UI,PtY:32/?UI, 0:32,BinOpt/binary>>).
%·%% MOVE / 4 %%·%
%%
%% Moves the window to the given position.
%%
%% Implementations of SetSize can also implicitly
%% implement the wxWindow::Move function,
%% which is defined in the base wxWindow class as the call:
%%
%% SetSize(x, y, wxDefaultCoord, wxDefaultCoord, wxSIZE_USE_EXISTING);
%%
%%
%% Return Value:
%% See Also: wxWindow::SetSize
%%*%%*%%
-spec move(This, X, Y, [Option]) -> ok
when
This :: wxWindow(),
X :: integer(), %% Required x position.
Y :: integer(), %% Required y position
Option :: {flags, integer()}.
move(#wx_ref{type=ThisT,ref=ThisRef},X,Y, Options)
when
is_integer(X),
is_integer(Y),
is_list(Options) ->
?CLASS(ThisT,wxWindow),
MOpts = fun({flags, Flags}, Acc) -> [<<1:32/?UI,Flags:32/?UI>>|Acc];
(BadOpt, _) -> erlang:error({badoption, BadOpt})
end,
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
wxe_util:cast(?wxWindow_Move_3,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI, 0:32,BinOpt/binary>>).
%·%% INIT DIALOG %%·%
%%
%% Sends an wxEVT_INIT_DIALOG event,
%% whose handler usually transfers data to the dialog via validators.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec initDialog(This) -> ok
when
This :: wxWindow().
initDialog(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_InitDialog,
<<ThisRef:32/?UI>>).
%·%% UPDATE WINDOW U I %%·%
%%
%% See below...
%% @equiv updateWindowUI(This, [])
-spec updateWindowUI(This) -> ok
when
This :: wxWindow().
updateWindowUI(This)
when
is_record(This, wx_ref) -> updateWindowUI(This, []).
%%
%% This function sends wxUpdateUIEvents to the window.
%%
%% - #wx{ event = #wxUpdateUI{ type= update_ui } } ,
%%
%% The particular implementation depends on the window;
%% for example-
%% a wxToolBar will send
%% an update UI event for each toolbar button, and
%%
%% a wxFrame will send an update UI event
%% for each menubar menu item.
%%
%% RCNote - It is easier to think of it as a unique type of Idle Event;
%% One that is 'commanded'.
%% wxUpdateUIEvent inherits from wxCommandEvent.
%% Be sure to use the { obj = ObjectVariable } part of the record.
%%
%% You can call this function from your
%% application to ensure that your
%% UI is up-to-date at this point (as far as your wxUpdateUIEvent
%% handlers are concerned).
%%
%% This may be necessary if you have called
%% wxUpdateUIEvent::SetMode or
%% wxUpdateUIEvent::SetUpdateInterval
%% to limit the overhead that wxWidgets incurs by sending
%% update UI events in idle time.
%%
%% flags should be a bitlist of one or more of the following values.
%%
%% enum wxUpdateUI
%% {
%% wxUPDATE_UI_NONE = 0x0000, // No particular value
%% wxUPDATE_UI_RECURSE = 0x0001, // Call the function for descendants
%% wxUPDATE_UI_FROMIDLE = 0x0002 // Invoked from On(Internal)Idle
%% };
%%
%% If you are calling this function from an wxOnInternalIdle
%% or OnIdle function, make sure you pass the wxUPDATE_UI_FROMIDLE flag,
%% since this tells the window to only update the UI elements that need
%% to be updated in idle time. Some windows update their elements
%% only when necessary, for example when a menu is about to be shown.
%% The following is an example of how to call UpdateWindowUI from an idle function.
%%
%% void MyWindow::OnInternalIdle()
%% {
%% if (wxUpdateUIEvent::CanUpdate(this))
%% UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
%% }
%%
%%
%% Return Value:
%% See Also: wxUpdateUIEvent,
%% wxWindow::DoUpdateWindowUI,
%% wxWindow::OnInternalIdle
%%*%%*%%
-spec updateWindowUI(This, [Option]) -> ok
when
This :: wxWindow(),
Option :: {flags, integer()}.
updateWindowUI(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when
is_list(Options) ->
?CLASS(ThisT,wxWindow),
MOpts = fun({flags, Flags}, Acc) -> [<<1:32/?UI,Flags:32/?UI>>|Acc];
( BadOpt, _) -> erlang:error({badoption, BadOpt})
end,
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
wxe_util:cast(?wxWindow_UpdateWindowUI,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
%·%% UPDATE %%·%
%%
%% Calling this method immediately repaints the invalidated area of
%% the window and all of its children recursively while this would
%% usually only happen when the flow of control returns to the event loop.
%% Notice that this function doesn't invalidate any area of the window
%% --so nothing happens if nothing has been invalidated--
%% (i.e. marked as requiring a redraw).
%% Use Refresh first if you want to immediately
%% redraw the window unconditionally.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec update(This) -> ok
when
This :: wxWindow().
update(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_Update,
<<ThisRef:32/?UI>>).
%·%% GET UPDATE REGION %%·%
%%
%% Returns the region specifying which parts of
%% the window have been damaged.
%%
%% Should only be called within an wxPaintEvent handler.
%%
%% Return Value:
%% See Also: wxRegion
%%*%%*%%
-spec getUpdateRegion(This) -> wxRegion:wxRegion()
when
This :: wxWindow().
getUpdateRegion(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetUpdateRegion,
<<ThisRef:32/?UI>>).
%·%% IS EXPOSED / 2 %%·%
%%
%% Returns true if the given point or rectangle area
%% has been exposed since the last repaint.
%%
%% Call this in an paint event handler to optimize
%% redrawing by only redrawing those areas, which have been exposed.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec isExposed(This, Pt) -> boolean()
when
This :: wxWindow(),
Pt :: {X :: integer(), Y :: integer()};
(This, Rect) -> boolean()
when
This :: wxWindow(),
Rect :: {X :: integer(), Y :: integer(), W :: integer(), H :: integer()}.
isExposed(#wx_ref{type=ThisT,ref=ThisRef},
{PtX,PtY})
when
is_integer(PtX),
is_integer(PtY) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_IsExposed_1_0,
<<ThisRef:32/?UI,PtX:32/?UI,PtY:32/?UI>>);
isExposed(#wx_ref{type=ThisT,ref=ThisRef},
{RectX,RectY,RectW,RectH})
when
is_integer(RectX),
is_integer(RectY),
is_integer(RectW),
is_integer(RectH) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_IsExposed_1_1,
<<ThisRef:32/?UI,RectX:32/?UI,RectY:32/?UI,RectW:32/?UI,RectH:32/?UI>>).
%·%% IS EXPOSED / 3 %%·%
%%
%% Returns true if the given point or rectangle area
%% has been exposed since the last repaint.
%%
%% Call this in an paint event handler to optimize
%% redrawing by only redrawing those areas, which have been exposed.
%%
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec isExposed(This, X, Y) -> boolean()
when
This :: wxWindow(),
X :: integer(),
Y :: integer().
isExposed(#wx_ref{type=ThisT,ref=ThisRef},
X,Y)
when
is_integer(X),
is_integer(Y) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_IsExposed_2,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI>>).
%·%% IS EXPOSED / 4 %%·%
%%
%% Returns true if the given point or rectangle area
%% has been exposed since the last repaint.
%%
%% Call this in an paint event handler to optimize
%% redrawing by only redrawing those areas, which have been exposed.
%%
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec isExposed(This, X, Y, W, H) -> boolean()
when
This :: wxWindow(),
X :: integer(),
Y :: integer(),
W :: integer(),
H :: integer().
isExposed(#wx_ref{type=ThisT,ref=ThisRef},X,Y,W,H)
when
is_integer(X),
is_integer(Y),
is_integer(W),
is_integer(H) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_IsExposed_4,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI,W:32/?UI,H:32/?UI>>).
%·%% REFRESH %%·%
%%
%% See below...
%% @equiv refresh(This, [])
-spec refresh(This) -> ok
when
This :: wxWindow().
refresh(This)
when
is_record(This, wx_ref) -> refresh(This, []).
%%
%% Causes this window, and all of its children recursively
%% (except under wxGTK1 where this is not implemented), to be repainted.
%% Note that repainting doesn't happen immediately but only during the next
%% event loop iteration, if you need to update the window immediately you
%% should use Update instead.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec refresh(This, [Option]) -> ok
when
This :: wxWindow(),
Option :: {eraseBackground, boolean()} %% If true, the background will be erased.
| {rect, {X :: integer(), %% If non-NULL, only the given rectangle
Y :: integer(), % will be treated as damaged.
W :: integer(),
H :: integer()}}.
refresh(#wx_ref{type=ThisT,ref=ThisRef},
Options)
when
is_list(Options) ->
?CLASS(ThisT,wxWindow),
MOpts = fun({eraseBackground, EraseBackground}, Acc) -> [<<1:32/?UI,(wxe_util:from_bool(EraseBackground)):32/?UI>>|Acc];
({rect, {RectX,RectY,RectW,RectH}}, Acc) -> [<<2:32/?UI,RectX:32/?UI,RectY:32/?UI,RectW:32/?UI,RectH:32/?UI,0:32>>|Acc];
(BadOpt, _) -> erlang:error({badoption, BadOpt})
end,
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
wxe_util:cast(?wxWindow_Refresh,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
%·%% REFRESH RECT %%·%
%%
%% See below...
%% @equiv refreshRect(This,Rect, [])
-spec refreshRect(This, Rect) -> ok
when
This :: wxWindow(),
Rect :: {X :: integer(),
Y :: integer(),
W :: integer(),
H :: integer()}.
refreshRect(This,Rect={RectX,RectY,RectW,RectH})
when
is_record(This, wx_ref),
is_integer(RectX),
is_integer(RectY),
is_integer(RectW),
is_integer(RectH) -> refreshRect(This,Rect, []).
%%
%% Redraws the contents of the given rectangle: only the area inside
%% it will be repainted.
%%
%% This is the same as Refresh but has a nicer syntax as it can be
%% called with a temporary wxRect object as argument like
%% this RefreshRect(wxRect(x, y, w, h)).
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec refreshRect(This, Rect, [Option]) -> ok
when
This :: wxWindow(),
Rect :: { X :: integer(),
Y :: integer(),
W :: integer(),
H :: integer()},
Option :: {eraseBackground, boolean()}.
refreshRect(#wx_ref{type=ThisT,ref=ThisRef},
{RectX,RectY,RectW,RectH},
Options)
when
is_integer(RectX),
is_integer(RectY),
is_integer(RectW),
is_integer(RectH),
is_list(Options) ->
?CLASS(ThisT,wxWindow),
MOpts = fun({eraseBackground, EraseBackground}, Acc) -> [<<1:32/?UI,(wxe_util:from_bool(EraseBackground)):32/?UI>>|Acc];
(BadOpt, _) -> erlang:error({badoption, BadOpt})
end,
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
wxe_util:cast(?wxWindow_RefreshRect,
<<ThisRef:32/?UI,RectX:32/?UI,RectY:32/?UI,RectW:32/?UI,RectH:32/?UI, 0:32,BinOpt/binary>>).
%·%% IS RETAINED %%·%
%%
%% Returns true if the window is retained, false otherwise.
%%
%% Retained windows are only available on X platforms.
%%
%% A retained window is
%% A window with an offscreen buffer for screen pixel values.
%% Images are rendered into the buffer for any portions
%% of the window that aren't visible onscreen.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec isRetained(This) -> boolean()
when
This :: wxWindow().
isRetained(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_IsRetained,
<<ThisRef:32/?UI>>).
%·%% IS TOP LEVEL %%·%
%%
%% Returns true if the given window is a top-level one.
%% Currently all frames and dialogs are considered to be top-level windows
%% (even if they have a parent window).
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec isTopLevel(This) -> boolean()
when
This :: wxWindow().
isTopLevel(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_IsTopLevel,
<<ThisRef:32/?UI>>).
%·%% POPUP MENU / 2,3 %%·%
%%
%% See below...
%% @equiv popupMenu(This,Menu, [])
-spec popupMenu(This, Menu) -> boolean()
when
This :: wxWindow(),
Menu :: wxMenu:wxMenu().
popupMenu(This,Menu)
when
is_record(This, wx_ref),
is_record(Menu, wx_ref) -> popupMenu(This,Menu, []).
%·%% POPUP MENU / 3 %%·%
%%
%% Pops up the given menu at the specified coordinates, relative to this window,
%% and returns control when the user has dismissed the menu.
%% If a menu item is selected, the corresponding menu event is generated and
%% will be processed as usually. If the coordinates are not specified,
%% the current mouse cursor position is used.
%%
%% Just before the menu is popped up,
%% wxMenu::UpdateUI is called
%% to ensure
%% that the menu items are in the correct state.
%% The menu does not get deleted by the window.
%%
%%
%% It is recommended to not explicitly specify coordinates when calling
%% PopupMenu in response to mouse click, because some of the ports (namely, wxGTK)
%% can do a better job of positioning the menu in that case.
%% With that said, here are the two functions that do.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec popupMenu(This, Menu, [Option]) -> boolean()
when
This :: wxWindow(),
Menu :: wxMenu:wxMenu(), %% Menu to pop up.
Option :: {pos, {X :: integer(), %% The position where the menu will appear.
Y :: integer()}}.
popupMenu(#wx_ref{type=ThisT,ref=ThisRef},
#wx_ref{type=MenuT,ref=MenuRef},
Options)
when
is_list(Options) ->
?CLASS(ThisT,wxWindow),
?CLASS(MenuT,wxMenu),
MOpts = fun({pos, {PosX,PosY}}, Acc) -> [<<1:32/?UI,PosX:32/?UI,PosY:32/?UI,0:32>>|Acc];
(BadOpt, _) -> erlang:error({badoption, BadOpt})
end,
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
wxe_util:call(?wxWindow_PopupMenu_2,
<<ThisRef:32/?UI,MenuRef:32/?UI, BinOpt/binary>>).
%·%% POPUP MENU / 4 %%·%
%%
%% /\
%% See above...
%% Return Value:
%% See Also:
%%*%%*%%
-spec popupMenu(This, Menu, X, Y) -> boolean()
when
This :: wxWindow(),
Menu :: wxMenu:wxMenu(),
X :: integer(),
Y :: integer().
popupMenu(#wx_ref{type=ThisT,ref=ThisRef},
#wx_ref{type=MenuT,ref=MenuRef},
X,
Y)
when
is_integer(X),
is_integer(Y) ->
?CLASS(ThisT,wxWindow),
?CLASS(MenuT,wxMenu),
wxe_util:call(?wxWindow_PopupMenu_3,
<<ThisRef:32/?UI,MenuRef:32/?UI,X:32/?UI,Y:32/?UI>>).
%·%% GET CHAR HEIGHT %%·%
%%
%% Returns the character height for this window.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec getCharHeight(This) -> integer()
when
This :: wxWindow().
getCharHeight(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetCharHeight,
<<ThisRef:32/?UI>>).
%·%% GET CHAR WIDTH %%·%
%%
%% Returns the average character width for this window.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec getCharWidth(This) -> integer()
when
This :: wxWindow().
getCharWidth(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetCharWidth,
<<ThisRef:32/?UI>>).
%·%% GET TEXT EXTENT %%·%
%%
%% See below...
%% @equiv getTextExtent(This,String, [])
-spec getTextExtent(This, String) -> Result
when
Result :: {X :: integer(),
Y :: integer(),
Descent :: integer(),
ExternalLeading :: integer()},
This :: wxWindow(),
String :: unicode:chardata().
getTextExtent(This,String)
when
is_record(This, wx_ref),
is_list(String) -> getTextExtent(This,String, []).
%%
%% Gets the dimensions of the string as
%% it would be drawn on the window
%% with the currently selected font.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec getTextExtent(This, String, [Option]) -> Result
when
Result :: { X :: integer() , %% Return value for width.
Y :: integer() , %% Return value for height.
Descent :: integer() , %% Return value for descent.
ExternalLeading :: integer()}, %% Return value for external leading.
This :: wxWindow() ,
String :: unicode:chardata() , %% String whose extent is to be measured.
Option :: {theFont, wxFont:wxFont()}. %% Font to use instead of the current window font (optional).
getTextExtent(#wx_ref{type=ThisT,ref=ThisRef},String, Options)
when
is_list(String),
is_list(Options) ->
?CLASS(ThisT,wxWindow),
String_UC = unicode:characters_to_binary([String,0]),
MOpts = fun({theFont, #wx_ref{type=TheFontT,ref=TheFontRef}}, Acc) ->
?CLASS(TheFontT,wxFont),
[<<1:32/?UI,TheFontRef:32/?UI>>|Acc];
(BadOpt, _ ) -> erlang:error({badoption, BadOpt})
end,
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
wxe_util:call(?wxWindow_GetTextExtent,
<<ThisRef:32/?UI,(byte_size(String_UC)):32/?UI,(String_UC)/binary,
0:(((8- ((0+byte_size(String_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
%·%% POP EVENT HANDLER %%·%
%%
%% Use PushEventHandler/PopEventHandler to form a chain of event handlers,
%% where each handler processes a different range of events independently
%% from the other handlers.
%%
%% See below...
%% @equiv popEventHandler(This, [])
-spec popEventHandler(This) -> wxEvtHandler:wxEvtHandler()
when
This :: wxWindow().
popEventHandler(This)
when
is_record(This, wx_ref) -> popEventHandler(This, []).
%%
%% Removes and returns the top-most event handler
%% on the event handler stack.
%%
%% Return Value:
%% See Also: wxWindow::SetEventHandler,
%% wxWindow::GetEventHandler,
%% wxWindow::PushEventHandler,
%% wxEvtHandler::ProcessEvent,
%% wxEvtHandler
%%*%%*%%
-spec popEventHandler(This, [Option]) -> wxEvtHandler:wxEvtHandler()
when
This :: wxWindow(),
Option :: {deleteHandler, boolean()}. %% If this is true,
%% the handler will be deleted
%% after it is removed.
%% The default value is false.
popEventHandler(#wx_ref{type=ThisT,ref=ThisRef},
Options)
when
is_list(Options) ->
?CLASS(ThisT,wxWindow),
MOpts = fun({deleteHandler, DeleteHandler}, Acc) -> [<<1:32/?UI,(wxe_util:from_bool(DeleteHandler)):32/?UI>>|Acc];
(BadOpt, _ ) -> erlang:error({badoption, BadOpt})
end,
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
wxe_util:call(?wxWindow_PopEventHandler,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
%·%% GET EVENT HANDLER %%·%
%%
%% Returns the event handler for this window.
%%
%% By default, the window is its own event handler.
%%
%% Return Value:
%% See Also: wxWindow::SetEventHandler,
%% wxWindow::PushEventHandler,
%% wxWindow::PopEventHandler,
%% wxEvtHandler::ProcessEvent,
%% wxEvtHandler
%%*%%*%%
-spec getEventHandler(This) -> wxEvtHandler:wxEvtHandler()
when
This :: wxWindow().
getEventHandler(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetEventHandler,
<<ThisRef:32/?UI>>).
%·%% GET HANDLE %%·%
%%
%% Returns the platform-specific handle
%% of the physical window.
%% Cast it to an appropriate handle,
%% such as HWND for Windows, Widget for Motif, GtkWidget for GTK or
%% WinHandle for PalmOS.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec getHandle(This) -> integer()
when
This :: wxWindow().
getHandle(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetHandle,
<<ThisRef:32/?UI>>).
%·%% WARP POINTER %%·%
%%
%% Moves the pointer to the given position on the window.
%%
%% NB: This function IS NOT SUPPORTED UNDER MAC because Apple Human
%% Interface Guidelines forbid moving the mouse cursor programmatically.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec warpPointer(This, X, Y) -> ok
when
This :: wxWindow(),
X :: integer(), %% The new x position for the cursor.
Y :: integer(). %% The new y position for the cursor.
warpPointer(#wx_ref{type=ThisT,ref=ThisRef},
X,
Y)
when
is_integer(X),
is_integer(Y) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_WarpPointer,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI>>).
%·%% VALIDATE %%·%
%%
%% Validates the current values of the child controls using their validators.
%%
%% ——————————— ———————————
%% | A | --------> | B |
%% ——————————— ———————————
%%
%% So A is going to send Data to B
%% a text entry to a change font size
%%
%%
%% A validator is like a contract checker, to ensure the data type
%% flowing thorugh, will be accepted on the other
%% end and not crash the program
%% ||
%% ——————————— \/ ———————————
%% | A | -----—---> | B |
%% ——————————— ———————————
%%
%%
%% It typically beeps back at the user
%%
%%
%% Validator
%% ——————————— ——————————— ———————————
%% | A | -----| VAL |—---> | B |
%% ——————————— ——————————— ———————————
%%
%% But Erlang is great at this already
%%
%% Other languages need this fuction to check that all other windows
%%
%%
%% If the window has wxWS_EX_VALIDATE_RECURSIVELY extra style flag set,
%% the method will also call Validate() of all child windows.
%%
%% wxWidgets supports validators, which are objects that
%% link data variables and their corresponding controls.
%%
%% Although not always applicable, the use of validators where possible
%% will save you a lot of time and can make it unnecessary
%% to write TransferDataToWindow and TransferDataFromWindow functions.
%%
%%
%%
%% Return Value: Returns false if any of the validations failed.
%% See Also: wxWindow::TransferDataFromWindow,
%% wxWindow::TransferDataToWindow,
%% wxValidator
%%*%%*%%
-spec validate(This) -> boolean()
when
This :: wxWindow().
validate(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_Validate,
<<ThisRef:32/?UI>>).
%·%% TRANSFER DATA FROM WINDOW %%·%
%% ————
%%
%% Transfers values from child controls to data areas
%% specified by their validators.
%% Returns false if a transfer failed.
%%
%% If the window has wxWS_EX_VALIDATE_RECURSIVELY extra style flag set,
%% the method will also call TransferDataFromWindow() of all child windows.
%%
%% Return Value:
%% See Also: wxWindow::TransferDataToWindow, wxValidator, wxWindow::Validate
%%*%%*%%
-spec transferDataFromWindow(This) -> boolean()
when
This :: wxWindow().
transferDataFromWindow(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_TransferDataFromWindow,
<<ThisRef:32/?UI>>).
%·%% TRANSFER DATA TO WINDOW %%·%
%% ——
%%
%% Transfers values to child controls
%% from data areas specified by their validators.
%%
%% If the window has wxWS_EX_VALIDATE_RECURSIVELY extra style flag set,
%% the method will also call TransferDataToWindow() of all child windows.
%%
%% Return Value: Returns false if a transfer failed.
%% See Also: wxWindow::TransferDataFromWindow, wxValidator, wxWindow::Validate
%%*%%*%%
-spec transferDataToWindow(This) -> boolean()
when
This :: wxWindow().
transferDataToWindow(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_TransferDataToWindow,
<<ThisRef:32/?UI>>).
%·%% SET PALETTE %%·%
%%
%% Obsolete - use wxDC::SetPalette instead.
%%
%% Return Value:
%% See Also:
%%*%%*%%
-spec setPalette(This, Pal) -> ok
when
This :: wxWindow(),
Pal :: wxPalette:wxPalette().
setPalette(#wx_ref{type=ThisT,ref=ThisRef},
#wx_ref{type=PalT,ref=PalRef}) ->
?CLASS(ThisT,wxWindow),
?CLASS(PalT,wxPalette),
wxe_util:cast(?wxWindow_SetPalette,
<<ThisRef:32/?UI,PalRef:32/?UI>>).
%% From wxEvtHandler
%% @hidden
disconnect(This,EventType, Options) -> wxEvtHandler:disconnect(This,EventType, Options).
%% @hidden
disconnect(This,EventType) -> wxEvtHandler:disconnect(This,EventType).
%% @hidden
disconnect(This) -> wxEvtHandler:disconnect(This).
%% @hidden
connect(This,EventType, Options) -> wxEvtHandler:connect(This,EventType, Options).
%% @hidden
connect(This,EventType) -> wxEvtHandler:connect(This,EventType).
|