wxrust 0.0.1-alpha

Binding for the wxCore library of the wxWidgets toolkit.
Documentation
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
use super::*;

// wxMask
/// This trait represents [C++ `wxMask` class](https://docs.wxwidgets.org/3.2/classwx_mask.html)'s methods and inheritance.
///
/// See [`MaskIsOwned`] documentation for the class usage.
pub trait MaskMethods: ObjectMethods {
    // DTOR: fn ~wxMask()
    /// Constructs a mask from a bitmap and a palette index that indicates the background.
    ///
    /// See [C++ `wxMask::Create()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_mask.html#a1caffe6896159b669c11c691dbf0142f).
    fn create_int<B: BitmapMethods>(&self, bitmap: &B, index: c_int) -> bool {
        unsafe {
            let bitmap = bitmap.as_ptr();
            ffi::wxMask_Create(self.as_ptr(), bitmap, index)
        }
    }
    /// Constructs a mask from a monochrome bitmap.
    ///
    /// See [C++ `wxMask::Create()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_mask.html#aa10e8c239e67f5daba39046a2959b483).
    fn create<B: BitmapMethods>(&self, bitmap: &B) -> bool {
        unsafe {
            let bitmap = bitmap.as_ptr();
            ffi::wxMask_Create1(self.as_ptr(), bitmap)
        }
    }
    /// Constructs a mask from a bitmap and a colour that indicates the background.
    ///
    /// See [C++ `wxMask::Create()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_mask.html#ac4181b0bb83866525004d94264cf9803).
    fn create_colour<B: BitmapMethods, C: ColourMethods>(&self, bitmap: &B, colour: &C) -> bool {
        unsafe {
            let bitmap = bitmap.as_ptr();
            let colour = colour.as_ptr();
            ffi::wxMask_Create2(self.as_ptr(), bitmap, colour)
        }
    }
    /// Returns the mask as a monochrome bitmap.
    ///
    /// See [C++ `wxMask::GetBitmap()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_mask.html#af066abbe7a46fa595fbbce6e3b76a2d0).
    fn get_bitmap(&self) -> Bitmap {
        unsafe { Bitmap::from_ptr(ffi::wxMask_GetBitmap(self.as_ptr())) }
    }
}

// wxMaximizeEvent
/// This trait represents [C++ `wxMaximizeEvent` class](https://docs.wxwidgets.org/3.2/classwx_maximize_event.html)'s methods and inheritance.
///
/// See [`MaximizeEventIsOwned`] documentation for the class usage.
pub trait MaximizeEventMethods: EventMethods {}

// wxMemoryDC
/// This trait represents [C++ `wxMemoryDC` class](https://docs.wxwidgets.org/3.2/classwx_memory_d_c.html)'s methods and inheritance.
///
/// See [`MemoryDCIsOwned`] documentation for the class usage.
pub trait MemoryDCMethods: DCMethods {
    /// Allow using this device context object to modify the given bitmap contents.
    ///
    /// See [C++ `wxMemoryDC::SelectObject()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_memory_d_c.html#a93d218796ba9359eb4aec2ae46a813e6).
    fn select_object<B: BitmapMethods>(&self, bitmap: &B) {
        unsafe {
            let bitmap = bitmap.as_ptr();
            ffi::wxMemoryDC_SelectObject(self.as_ptr(), bitmap)
        }
    }
    /// Selects the given bitmap into the device context, to use as the memory bitmap.
    ///
    /// See [C++ `wxMemoryDC::SelectObjectAsSource()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_memory_d_c.html#a148ceba1c29d4a78fca6026a90e2ee5f).
    fn select_object_as_source<B: BitmapMethods>(&self, bitmap: &B) {
        unsafe {
            let bitmap = bitmap.as_ptr();
            ffi::wxMemoryDC_SelectObjectAsSource(self.as_ptr(), bitmap)
        }
    }
    /// Get the selected bitmap.
    ///
    /// See [C++ `wxMemoryDC::GetSelectedBitmap()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_memory_d_c.html#abfc29bdb24e4dba3dad63e8022030c11).
    fn get_selected_bitmap(&self) -> BitmapIsOwned<false> {
        unsafe { BitmapIsOwned::from_ptr(ffi::wxMemoryDC_GetSelectedBitmap(self.as_ptr())) }
    }
    // BLOCKED: fn GetSelectedBitmap1()
}

// wxMenu
/// This trait represents [C++ `wxMenu` class](https://docs.wxwidgets.org/3.2/classwx_menu.html)'s methods and inheritance.
///
/// See [`MenuIsOwned`] documentation for the class usage.
pub trait MenuMethods: EvtHandlerMethods {
    // DTOR: fn ~wxMenu()
    /// Adds a menu item.
    ///
    /// See [C++ `wxMenu::Append()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#a5a71098cee12cd7ad9c26d92e218c590).
    fn append_int_str(
        &self,
        id: c_int,
        item: &str,
        help_string: &str,
        kind: c_int,
    ) -> Option<MenuItemIsOwned<false>> {
        unsafe {
            let item = WxString::from(item);
            let item = item.as_ptr();
            let help_string = WxString::from(help_string);
            let help_string = help_string.as_ptr();
            MenuItem::option_from(ffi::wxMenu_Append(
                self.as_ptr(),
                id,
                item,
                help_string,
                kind,
            ))
        }
    }
    /// Adds a submenu.
    ///
    /// See [C++ `wxMenu::Append()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#afcd6a1a05161bd4c6c02656eca01eb1b).
    fn append_int_menu<M: MenuMethods>(
        &self,
        id: c_int,
        item: &str,
        sub_menu: Option<&M>,
        help_string: &str,
    ) -> Option<MenuItemIsOwned<false>> {
        unsafe {
            let item = WxString::from(item);
            let item = item.as_ptr();
            let sub_menu = match sub_menu {
                Some(r) => r.as_ptr(),
                None => ptr::null_mut(),
            };
            let help_string = WxString::from(help_string);
            let help_string = help_string.as_ptr();
            MenuItem::option_from(ffi::wxMenu_Append1(
                self.as_ptr(),
                id,
                item,
                sub_menu,
                help_string,
            ))
        }
    }
    /// Adds a menu item object.
    ///
    /// See [C++ `wxMenu::Append()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#a00d10cb282bd06aca0243c02a2153ac6).
    fn append_menuitem<M: MenuItemMethods>(
        &self,
        menu_item: Option<&M>,
    ) -> Option<MenuItemIsOwned<false>> {
        unsafe {
            let menu_item = match menu_item {
                Some(r) => r.as_ptr(),
                None => ptr::null_mut(),
            };
            MenuItem::option_from(ffi::wxMenu_Append2(self.as_ptr(), menu_item))
        }
    }
    /// Adds a checkable item to the end of the menu.
    ///
    /// See [C++ `wxMenu::AppendCheckItem()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#a24a34c612911df27e0bb3cae81bbdda0).
    fn append_check_item(
        &self,
        id: c_int,
        item: &str,
        help: &str,
    ) -> Option<MenuItemIsOwned<false>> {
        unsafe {
            let item = WxString::from(item);
            let item = item.as_ptr();
            let help = WxString::from(help);
            let help = help.as_ptr();
            MenuItem::option_from(ffi::wxMenu_AppendCheckItem(self.as_ptr(), id, item, help))
        }
    }
    /// Adds a radio item to the end of the menu.
    ///
    /// See [C++ `wxMenu::AppendRadioItem()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#a341af26a4d59740d99d17aa1a6ed6e48).
    fn append_radio_item(
        &self,
        id: c_int,
        item: &str,
        help: &str,
    ) -> Option<MenuItemIsOwned<false>> {
        unsafe {
            let item = WxString::from(item);
            let item = item.as_ptr();
            let help = WxString::from(help);
            let help = help.as_ptr();
            MenuItem::option_from(ffi::wxMenu_AppendRadioItem(self.as_ptr(), id, item, help))
        }
    }
    /// Adds a separator to the end of the menu.
    ///
    /// See [C++ `wxMenu::AppendSeparator()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#afdc206877228ad8cc2c9de5b71f5b633).
    fn append_separator(&self) -> Option<MenuItemIsOwned<false>> {
        unsafe { MenuItem::option_from(ffi::wxMenu_AppendSeparator(self.as_ptr())) }
    }
    /// Adds the given submenu to this menu.
    ///
    /// See [C++ `wxMenu::AppendSubMenu()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#a778d7e9b333967e5ae3954135fc730c8).
    fn append_sub_menu<M: MenuMethods>(
        &self,
        submenu: Option<&M>,
        text: &str,
        help: &str,
    ) -> Option<MenuItemIsOwned<false>> {
        unsafe {
            let submenu = match submenu {
                Some(r) => r.as_ptr(),
                None => ptr::null_mut(),
            };
            let text = WxString::from(text);
            let text = text.as_ptr();
            let help = WxString::from(help);
            let help = help.as_ptr();
            MenuItem::option_from(ffi::wxMenu_AppendSubMenu(
                self.as_ptr(),
                submenu,
                text,
                help,
            ))
        }
    }
    /// Inserts a break in a menu, causing the next appended item to appear in a new column.
    ///
    /// See [C++ `wxMenu::Break()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#a3728d2f96ee825b042e0b6d0e08d21d3).
    fn break_(&self) {
        unsafe { ffi::wxMenu_Break(self.as_ptr()) }
    }
    /// Checks or unchecks the menu item.
    ///
    /// See [C++ `wxMenu::Check()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#a3a5a76d1ee332a40919941870529b49f).
    fn check(&self, id: c_int, check: bool) {
        unsafe { ffi::wxMenu_Check(self.as_ptr(), id, check) }
    }
    /// Deletes the menu item from the menu.
    ///
    /// See [C++ `wxMenu::Delete()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#ad0478a386aa0f55b568686fc8837d00e).
    fn delete_int(&self, id: c_int) -> bool {
        unsafe { ffi::wxMenu_Delete(self.as_ptr(), id) }
    }
    /// Deletes the menu item from the menu.
    ///
    /// See [C++ `wxMenu::Delete()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#a8d88695161c09b8a43d2b1cf98defd85).
    fn delete_menuitem<M: MenuItemMethods>(&self, item: Option<&M>) -> bool {
        unsafe {
            let item = match item {
                Some(r) => r.as_ptr(),
                None => ptr::null_mut(),
            };
            ffi::wxMenu_Delete1(self.as_ptr(), item)
        }
    }
    /// Deletes the menu item from the menu.
    ///
    /// See [C++ `wxMenu::Destroy()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#ab30d479e9c8651d64b7c8fc30701aa8d).
    fn destroy_int(&self, id: c_int) -> bool {
        unsafe { ffi::wxMenu_Destroy(self.as_ptr(), id) }
    }
    /// Deletes the menu item from the menu.
    ///
    /// See [C++ `wxMenu::Destroy()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#a72bf5c0fa9af6227245930a06afdc19b).
    fn destroy_menuitem<M: MenuItemMethods>(&self, item: Option<&M>) -> bool {
        unsafe {
            let item = match item {
                Some(r) => r.as_ptr(),
                None => ptr::null_mut(),
            };
            ffi::wxMenu_Destroy1(self.as_ptr(), item)
        }
    }
    /// Enables or disables (greys out) a menu item.
    ///
    /// See [C++ `wxMenu::Enable()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#ae2a468532c454371d556d61efca7c002).
    fn enable(&self, id: c_int, enable: bool) {
        unsafe { ffi::wxMenu_Enable(self.as_ptr(), id, enable) }
    }
    /// Finds the menu item object associated with the given menu item identifier and, optionally, the position of the item in the menu.
    ///
    /// See [C++ `wxMenu::FindChildItem()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#a7cf7f66a395364aed26779cbf0d387d5).
    fn find_child_item(&self, id: c_int, pos: *mut c_void) -> Option<MenuItemIsOwned<false>> {
        unsafe { MenuItem::option_from(ffi::wxMenu_FindChildItem(self.as_ptr(), id, pos)) }
    }
    /// Finds the menu id for a menu item string.
    ///
    /// See [C++ `wxMenu::FindItem()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#a7e8bf27fe85df1e81905b544cbf2021a).
    fn find_item_str(&self, item_string: &str) -> c_int {
        unsafe {
            let item_string = WxString::from(item_string);
            let item_string = item_string.as_ptr();
            ffi::wxMenu_FindItem(self.as_ptr(), item_string)
        }
    }
    /// Finds the menu item object associated with the given menu item identifier and, optionally, the (sub)menu it belongs to.
    ///
    /// See [C++ `wxMenu::FindItem()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#aeaebdafea19d63fef51096d934b4c8e5).
    fn find_item_int<M: MenuMethods>(
        &self,
        id: c_int,
        menu: Option<&M>,
    ) -> Option<MenuItemIsOwned<false>> {
        unsafe {
            let menu = match menu {
                Some(r) => r.as_ptr(),
                None => ptr::null_mut(),
            };
            MenuItem::option_from(ffi::wxMenu_FindItem1(self.as_ptr(), id, menu))
        }
    }
    /// Returns the wxMenuItem given a position in the menu.
    ///
    /// See [C++ `wxMenu::FindItemByPosition()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#a8d91d9b706cd13df799ad8391cb28a2c).
    fn find_item_by_position(&self, position: usize) -> Option<MenuItemIsOwned<false>> {
        unsafe { MenuItem::option_from(ffi::wxMenu_FindItemByPosition(self.as_ptr(), position)) }
    }
    /// Returns the help string associated with a menu item.
    ///
    /// See [C++ `wxMenu::GetHelpString()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#ada059de657d426ef97435926b69fd88d).
    fn get_help_string(&self, id: c_int) -> String {
        unsafe { WxString::from_ptr(ffi::wxMenu_GetHelpString(self.as_ptr(), id)).into() }
    }
    /// Returns a menu item label.
    ///
    /// See [C++ `wxMenu::GetLabel()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#adf97a53174e150c94b459fe9aad06f36).
    fn get_label(&self, id: c_int) -> String {
        unsafe { WxString::from_ptr(ffi::wxMenu_GetLabel(self.as_ptr(), id)).into() }
    }
    /// Returns a menu item label, without any of the original mnemonics and accelerators.
    ///
    /// See [C++ `wxMenu::GetLabelText()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#a096a14747b7f1516795cb9d492973e21).
    fn get_label_text(&self, id: c_int) -> String {
        unsafe { WxString::from_ptr(ffi::wxMenu_GetLabelText(self.as_ptr(), id)).into() }
    }
    /// Returns the number of items in the menu.
    ///
    /// See [C++ `wxMenu::GetMenuItemCount()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#a0865b6be2b9067c38a177d5394460f5b).
    fn get_menu_item_count(&self) -> usize {
        unsafe { ffi::wxMenu_GetMenuItemCount(self.as_ptr()) }
    }
    // BLOCKED: fn GetMenuItems()
    // BLOCKED: fn GetMenuItems1()
    /// Returns the title of the menu.
    ///
    /// See [C++ `wxMenu::GetTitle()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#a5e18712fde92a7d24da6fe5747cfd22e).
    fn get_title(&self) -> String {
        unsafe { WxString::from_ptr(ffi::wxMenu_GetTitle(self.as_ptr())).into() }
    }
    /// Inserts the given item before the position pos.
    ///
    /// See [C++ `wxMenu::Insert()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#adacabf86ad46528b776cb72aa0883e19).
    fn insert_menuitem<M: MenuItemMethods>(
        &self,
        pos: usize,
        menu_item: Option<&M>,
    ) -> Option<MenuItemIsOwned<false>> {
        unsafe {
            let menu_item = match menu_item {
                Some(r) => r.as_ptr(),
                None => ptr::null_mut(),
            };
            MenuItem::option_from(ffi::wxMenu_Insert(self.as_ptr(), pos, menu_item))
        }
    }
    /// Inserts the given item before the position pos.
    ///
    /// See [C++ `wxMenu::Insert()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#a6d307c16972b3e8a815b891973d55f16).
    fn insert_int_str(
        &self,
        pos: usize,
        id: c_int,
        item: &str,
        help_string: &str,
        kind: c_int,
    ) -> Option<MenuItemIsOwned<false>> {
        unsafe {
            let item = WxString::from(item);
            let item = item.as_ptr();
            let help_string = WxString::from(help_string);
            let help_string = help_string.as_ptr();
            MenuItem::option_from(ffi::wxMenu_Insert1(
                self.as_ptr(),
                pos,
                id,
                item,
                help_string,
                kind,
            ))
        }
    }
    /// Inserts the given submenu before the position pos.
    ///
    /// See [C++ `wxMenu::Insert()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#acc220068554fcd46c2d395a56fd5b30b).
    fn insert_int_menu<M: MenuMethods>(
        &self,
        pos: usize,
        id: c_int,
        text: &str,
        submenu: Option<&M>,
        help: &str,
    ) -> Option<MenuItemIsOwned<false>> {
        unsafe {
            let text = WxString::from(text);
            let text = text.as_ptr();
            let submenu = match submenu {
                Some(r) => r.as_ptr(),
                None => ptr::null_mut(),
            };
            let help = WxString::from(help);
            let help = help.as_ptr();
            MenuItem::option_from(ffi::wxMenu_Insert2(
                self.as_ptr(),
                pos,
                id,
                text,
                submenu,
                help,
            ))
        }
    }
    /// Inserts a checkable item at the given position.
    ///
    /// See [C++ `wxMenu::InsertCheckItem()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#a69128701ada8f6d85fdba7b7cfef94cc).
    fn insert_check_item(
        &self,
        pos: usize,
        id: c_int,
        item: &str,
        help_string: &str,
    ) -> Option<MenuItemIsOwned<false>> {
        unsafe {
            let item = WxString::from(item);
            let item = item.as_ptr();
            let help_string = WxString::from(help_string);
            let help_string = help_string.as_ptr();
            MenuItem::option_from(ffi::wxMenu_InsertCheckItem(
                self.as_ptr(),
                pos,
                id,
                item,
                help_string,
            ))
        }
    }
    /// Inserts a radio item at the given position.
    ///
    /// See [C++ `wxMenu::InsertRadioItem()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#a51ac95b8d82e61ff0ccdffeb1dba19cd).
    fn insert_radio_item(
        &self,
        pos: usize,
        id: c_int,
        item: &str,
        help_string: &str,
    ) -> Option<MenuItemIsOwned<false>> {
        unsafe {
            let item = WxString::from(item);
            let item = item.as_ptr();
            let help_string = WxString::from(help_string);
            let help_string = help_string.as_ptr();
            MenuItem::option_from(ffi::wxMenu_InsertRadioItem(
                self.as_ptr(),
                pos,
                id,
                item,
                help_string,
            ))
        }
    }
    /// Inserts a separator at the given position.
    ///
    /// See [C++ `wxMenu::InsertSeparator()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#a968684b5237ebdf2d51bedcf66adb2d8).
    fn insert_separator(&self, pos: usize) -> Option<MenuItemIsOwned<false>> {
        unsafe { MenuItem::option_from(ffi::wxMenu_InsertSeparator(self.as_ptr(), pos)) }
    }
    /// Determines whether a menu item is checked.
    ///
    /// See [C++ `wxMenu::IsChecked()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#a753d11b69d263d7c4560af82454e27f1).
    fn is_checked(&self, id: c_int) -> bool {
        unsafe { ffi::wxMenu_IsChecked(self.as_ptr(), id) }
    }
    /// Determines whether a menu item is enabled.
    ///
    /// See [C++ `wxMenu::IsEnabled()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#aea543f11f8ccfb3c340a4ac45984c5c8).
    fn is_enabled(&self, id: c_int) -> bool {
        unsafe { ffi::wxMenu_IsEnabled(self.as_ptr(), id) }
    }
    // NOT_SUPPORTED: fn MSWCommand()
    /// Inserts the given item at position 0, i.e. before all the other existing items.
    ///
    /// See [C++ `wxMenu::Prepend()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#a2e24871e09f50a8075289ff3d6ad4076).
    fn prepend_menuitem<M: MenuItemMethods>(
        &self,
        item: Option<&M>,
    ) -> Option<MenuItemIsOwned<false>> {
        unsafe {
            let item = match item {
                Some(r) => r.as_ptr(),
                None => ptr::null_mut(),
            };
            MenuItem::option_from(ffi::wxMenu_Prepend(self.as_ptr(), item))
        }
    }
    /// Inserts the given item at position 0, i.e. before all the other existing items.
    ///
    /// See [C++ `wxMenu::Prepend()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#a78813c14e46be2029da3c9ea46e17a7f).
    fn prepend_int_str(
        &self,
        id: c_int,
        item: &str,
        help_string: &str,
        kind: c_int,
    ) -> Option<MenuItemIsOwned<false>> {
        unsafe {
            let item = WxString::from(item);
            let item = item.as_ptr();
            let help_string = WxString::from(help_string);
            let help_string = help_string.as_ptr();
            MenuItem::option_from(ffi::wxMenu_Prepend1(
                self.as_ptr(),
                id,
                item,
                help_string,
                kind,
            ))
        }
    }
    /// Inserts the given submenu at position 0.
    ///
    /// See [C++ `wxMenu::Prepend()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#a2750a6036cb0f7d0d6d5fc9521736329).
    fn prepend_int_menu<M: MenuMethods>(
        &self,
        id: c_int,
        text: &str,
        submenu: Option<&M>,
        help: &str,
    ) -> Option<MenuItemIsOwned<false>> {
        unsafe {
            let text = WxString::from(text);
            let text = text.as_ptr();
            let submenu = match submenu {
                Some(r) => r.as_ptr(),
                None => ptr::null_mut(),
            };
            let help = WxString::from(help);
            let help = help.as_ptr();
            MenuItem::option_from(ffi::wxMenu_Prepend2(self.as_ptr(), id, text, submenu, help))
        }
    }
    /// Inserts a checkable item at position 0.
    ///
    /// See [C++ `wxMenu::PrependCheckItem()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#a102bf56de810eecf74f83acf46b87009).
    fn prepend_check_item(
        &self,
        id: c_int,
        item: &str,
        help_string: &str,
    ) -> Option<MenuItemIsOwned<false>> {
        unsafe {
            let item = WxString::from(item);
            let item = item.as_ptr();
            let help_string = WxString::from(help_string);
            let help_string = help_string.as_ptr();
            MenuItem::option_from(ffi::wxMenu_PrependCheckItem(
                self.as_ptr(),
                id,
                item,
                help_string,
            ))
        }
    }
    /// Inserts a radio item at position 0.
    ///
    /// See [C++ `wxMenu::PrependRadioItem()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#a3f1570860f9613f7e4d31c0d29d79e11).
    fn prepend_radio_item(
        &self,
        id: c_int,
        item: &str,
        help_string: &str,
    ) -> Option<MenuItemIsOwned<false>> {
        unsafe {
            let item = WxString::from(item);
            let item = item.as_ptr();
            let help_string = WxString::from(help_string);
            let help_string = help_string.as_ptr();
            MenuItem::option_from(ffi::wxMenu_PrependRadioItem(
                self.as_ptr(),
                id,
                item,
                help_string,
            ))
        }
    }
    /// Inserts a separator at position 0.
    ///
    /// See [C++ `wxMenu::PrependSeparator()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#a13a427147256b2809a103a2874ea5e69).
    fn prepend_separator(&self) -> Option<MenuItemIsOwned<false>> {
        unsafe { MenuItem::option_from(ffi::wxMenu_PrependSeparator(self.as_ptr())) }
    }
    /// Removes the menu item from the menu but doesn't delete the associated C++ object.
    ///
    /// See [C++ `wxMenu::Remove()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#a873acedf8a664b574d1f97de9a100bf1).
    fn remove_int(&self, id: c_int) -> Option<MenuItemIsOwned<false>> {
        unsafe { MenuItem::option_from(ffi::wxMenu_Remove(self.as_ptr(), id)) }
    }
    /// Removes the menu item from the menu but doesn't delete the associated C++ object.
    ///
    /// See [C++ `wxMenu::Remove()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#acbb314ac2e3a4b20d0fc54abb8ea2d41).
    fn remove_menuitem<M: MenuItemMethods>(
        &self,
        item: Option<&M>,
    ) -> Option<MenuItemIsOwned<false>> {
        unsafe {
            let item = match item {
                Some(r) => r.as_ptr(),
                None => ptr::null_mut(),
            };
            MenuItem::option_from(ffi::wxMenu_Remove1(self.as_ptr(), item))
        }
    }
    /// Sets an item's help string.
    ///
    /// See [C++ `wxMenu::SetHelpString()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#afaad5f31ec3abcf830ecdf2532c6e98b).
    fn set_help_string(&self, id: c_int, help_string: &str) {
        unsafe {
            let help_string = WxString::from(help_string);
            let help_string = help_string.as_ptr();
            ffi::wxMenu_SetHelpString(self.as_ptr(), id, help_string)
        }
    }
    /// Sets the label of a menu item.
    ///
    /// See [C++ `wxMenu::SetLabel()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#aec7c82f4c6fa18187c25b3797590a9d2).
    fn set_label(&self, id: c_int, label: &str) {
        unsafe {
            let label = WxString::from(label);
            let label = label.as_ptr();
            ffi::wxMenu_SetLabel(self.as_ptr(), id, label)
        }
    }
    /// Sets the title of the menu.
    ///
    /// See [C++ `wxMenu::SetTitle()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#aa8b3117231c244d4952a641fb3e9a272).
    fn set_title(&self, title: &str) {
        unsafe {
            let title = WxString::from(title);
            let title = title.as_ptr();
            ffi::wxMenu_SetTitle(self.as_ptr(), title)
        }
    }
    /// Update the state of all menu items, recursively, by generating wxEVT_UPDATE_UI events for them.
    ///
    /// See [C++ `wxMenu::UpdateUI()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#aedd1c1536176ffec144f7e8bea85bd89).
    fn update_ui<E: EvtHandlerMethods>(&self, source: Option<&E>) {
        unsafe {
            let source = match source {
                Some(r) => r.as_ptr(),
                None => ptr::null_mut(),
            };
            ffi::wxMenu_UpdateUI(self.as_ptr(), source)
        }
    }
    ///
    /// See [C++ `wxMenu::SetInvokingWindow()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#a1c459fa87f5c52afc7b5d717e846cce4).
    fn set_invoking_window<W: WindowMethods>(&self, win: Option<&W>) {
        unsafe {
            let win = match win {
                Some(r) => r.as_ptr(),
                None => ptr::null_mut(),
            };
            ffi::wxMenu_SetInvokingWindow(self.as_ptr(), win)
        }
    }
    ///
    /// See [C++ `wxMenu::GetInvokingWindow()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#a21b4283f7debebca8b4a335f7209ab97).
    fn get_invoking_window(&self) -> WeakRef<Window> {
        unsafe { WeakRef::<Window>::from(ffi::wxMenu_GetInvokingWindow(self.as_ptr())) }
    }
    ///
    /// See [C++ `wxMenu::GetWindow()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#a6357304cd381232b374fbdbfd2f61c0b).
    fn get_window(&self) -> WeakRef<Window> {
        unsafe { WeakRef::<Window>::from(ffi::wxMenu_GetWindow(self.as_ptr())) }
    }
    ///
    /// See [C++ `wxMenu::GetStyle()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#a8042c4419e395495e41f181bca057558).
    fn get_style(&self) -> c_long {
        unsafe { ffi::wxMenu_GetStyle(self.as_ptr()) }
    }
    ///
    /// See [C++ `wxMenu::SetParent()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#a7873255a269c036348d6af33629d118b).
    fn set_parent<M: MenuMethods>(&self, parent: Option<&M>) {
        unsafe {
            let parent = match parent {
                Some(r) => r.as_ptr(),
                None => ptr::null_mut(),
            };
            ffi::wxMenu_SetParent(self.as_ptr(), parent)
        }
    }
    ///
    /// See [C++ `wxMenu::GetParent()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#afcf1a7b77318e8a3affb4d2e42b5b3e6).
    fn get_parent(&self) -> WeakRef<Menu> {
        unsafe { WeakRef::<Menu>::from(ffi::wxMenu_GetParent(self.as_ptr())) }
    }
    ///
    /// See [C++ `wxMenu::Attach()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#a15faea06e13e6751f561d4edd6b1052e).
    fn attach<M: MenuBarMethods>(&self, menubar: Option<&M>) {
        unsafe {
            let menubar = match menubar {
                Some(r) => r.as_ptr(),
                None => ptr::null_mut(),
            };
            ffi::wxMenu_Attach(self.as_ptr(), menubar)
        }
    }
    ///
    /// See [C++ `wxMenu::Detach()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#a19a7de8fd10b2cd24c6387b02762fecd).
    fn detach(&self) {
        unsafe { ffi::wxMenu_Detach(self.as_ptr()) }
    }
    ///
    /// See [C++ `wxMenu::IsAttached()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu.html#a1e980cc5464e02baa51bd3db636625a7).
    fn is_attached(&self) -> bool {
        unsafe { ffi::wxMenu_IsAttached(self.as_ptr()) }
    }
}

// wxMenuBar
/// This trait represents [C++ `wxMenuBar` class](https://docs.wxwidgets.org/3.2/classwx_menu_bar.html)'s methods and inheritance.
///
/// See [`MenuBarIsOwned`] documentation for the class usage.
pub trait MenuBarMethods: WindowMethods {
    // DTOR: fn ~wxMenuBar()
    /// Adds the item to the end of the menu bar.
    ///
    /// See [C++ `wxMenuBar::Append()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_bar.html#a342fec5ec2d96789cfc7b82557dfa646).
    fn append<M: MenuMethods>(&self, menu: Option<&M>, title: &str) -> bool {
        unsafe {
            let menu = match menu {
                Some(r) => r.as_ptr(),
                None => ptr::null_mut(),
            };
            let title = WxString::from(title);
            let title = title.as_ptr();
            ffi::wxMenuBar_Append(self.as_ptr(), menu, title)
        }
    }
    /// Checks or unchecks a menu item.
    ///
    /// See [C++ `wxMenuBar::Check()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_bar.html#ae52945fab916e8031fdb14b8124f3cd9).
    fn check(&self, id: c_int, check: bool) {
        unsafe { ffi::wxMenuBar_Check(self.as_ptr(), id, check) }
    }
    /// Enables or disables (greys out) a menu item.
    ///
    /// See [C++ `wxMenuBar::Enable()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_bar.html#ab53b19f2e8b0e7b39ae551d51f2f6f6b).
    fn enable_int(&self, id: c_int, enable: bool) {
        unsafe { ffi::wxMenuBar_Enable(self.as_ptr(), id, enable) }
    }
    /// Returns true if the menu with the given index is enabled.
    ///
    /// See [C++ `wxMenuBar::IsEnabledTop()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_bar.html#a5fc45b5e36edc176235c7ee385e92e2f).
    fn is_enabled_top(&self, pos: usize) -> bool {
        unsafe { ffi::wxMenuBar_IsEnabledTop(self.as_ptr(), pos) }
    }
    /// Enables or disables a whole menu.
    ///
    /// See [C++ `wxMenuBar::EnableTop()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_bar.html#ae995701578fa19cc6ae528cfb13a4d7d).
    fn enable_top(&self, pos: usize, enable: bool) {
        unsafe { ffi::wxMenuBar_EnableTop(self.as_ptr(), pos, enable) }
    }
    /// Finds the menu item object associated with the given menu item identifier.
    ///
    /// See [C++ `wxMenuBar::FindItem()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_bar.html#a7bc48a9a0e6ec8268d3281e401183552).
    fn find_item<M: MenuMethods>(
        &self,
        id: c_int,
        menu: Option<&M>,
    ) -> Option<MenuItemIsOwned<false>> {
        unsafe {
            let menu = match menu {
                Some(r) => r.as_ptr(),
                None => ptr::null_mut(),
            };
            MenuItem::option_from(ffi::wxMenuBar_FindItem(self.as_ptr(), id, menu))
        }
    }
    /// Returns the index of the menu with the given title or wxNOT_FOUND if no such menu exists in this menubar.
    ///
    /// See [C++ `wxMenuBar::FindMenu()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_bar.html#a459b49b70c955145fbb202c258188309).
    fn find_menu(&self, title: &str) -> c_int {
        unsafe {
            let title = WxString::from(title);
            let title = title.as_ptr();
            ffi::wxMenuBar_FindMenu(self.as_ptr(), title)
        }
    }
    /// Finds the menu item id for a menu name/menu item string pair.
    ///
    /// See [C++ `wxMenuBar::FindMenuItem()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_bar.html#a56e9010ba84f0ac5303cd52a34ac0dc7).
    fn find_menu_item(&self, menu_string: &str, item_string: &str) -> c_int {
        unsafe {
            let menu_string = WxString::from(menu_string);
            let menu_string = menu_string.as_ptr();
            let item_string = WxString::from(item_string);
            let item_string = item_string.as_ptr();
            ffi::wxMenuBar_FindMenuItem(self.as_ptr(), menu_string, item_string)
        }
    }
    /// Gets the help string associated with the menu item identifier.
    ///
    /// See [C++ `wxMenuBar::GetHelpString()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_bar.html#ad3e511976bb620ce9a7accfe32fe6073).
    fn get_help_string(&self, id: c_int) -> String {
        unsafe { WxString::from_ptr(ffi::wxMenuBar_GetHelpString(self.as_ptr(), id)).into() }
    }
    /// Gets the label associated with a menu item.
    ///
    /// See [C++ `wxMenuBar::GetLabel()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_bar.html#a4d82ad199d1c348a144637ca92bf6b6f).
    fn get_label_int(&self, id: c_int) -> String {
        unsafe { WxString::from_ptr(ffi::wxMenuBar_GetLabel(self.as_ptr(), id)).into() }
    }
    // BLOCKED: fn GetLabelTop()
    /// Returns the menu at menuIndex (zero-based).
    ///
    /// See [C++ `wxMenuBar::GetMenu()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_bar.html#a54ea388d67b44a06e80b68a5b1b7f4c3).
    fn get_menu(&self, menu_index: usize) -> WeakRef<Menu> {
        unsafe { WeakRef::<Menu>::from(ffi::wxMenuBar_GetMenu(self.as_ptr(), menu_index)) }
    }
    /// Returns the number of menus in this menubar.
    ///
    /// See [C++ `wxMenuBar::GetMenuCount()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_bar.html#add65e03ec1f868486e541426381a17f7).
    fn get_menu_count(&self) -> usize {
        unsafe { ffi::wxMenuBar_GetMenuCount(self.as_ptr()) }
    }
    /// Returns the label of a top-level menu.
    ///
    /// See [C++ `wxMenuBar::GetMenuLabel()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_bar.html#ae177b639c9a6281a4bb0f202f8758b61).
    fn get_menu_label(&self, pos: usize) -> String {
        unsafe { WxString::from_ptr(ffi::wxMenuBar_GetMenuLabel(self.as_ptr(), pos)).into() }
    }
    /// Returns the label of a top-level menu.
    ///
    /// See [C++ `wxMenuBar::GetMenuLabelText()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_bar.html#a9a9b0bf227387c5c2b9ab291bfdf3027).
    fn get_menu_label_text(&self, pos: usize) -> String {
        unsafe { WxString::from_ptr(ffi::wxMenuBar_GetMenuLabelText(self.as_ptr(), pos)).into() }
    }
    /// Inserts the menu at the given position into the menu bar.
    ///
    /// See [C++ `wxMenuBar::Insert()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_bar.html#a6bb349afc87743a78f25159bc68a4087).
    fn insert<M: MenuMethods>(&self, pos: usize, menu: Option<&M>, title: &str) -> bool {
        unsafe {
            let menu = match menu {
                Some(r) => r.as_ptr(),
                None => ptr::null_mut(),
            };
            let title = WxString::from(title);
            let title = title.as_ptr();
            ffi::wxMenuBar_Insert(self.as_ptr(), pos, menu, title)
        }
    }
    /// Determines whether an item is checked.
    ///
    /// See [C++ `wxMenuBar::IsChecked()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_bar.html#aea128698af773f0fc6024fecfbe39281).
    fn is_checked(&self, id: c_int) -> bool {
        unsafe { ffi::wxMenuBar_IsChecked(self.as_ptr(), id) }
    }
    /// Determines whether an item is enabled.
    ///
    /// See [C++ `wxMenuBar::IsEnabled()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_bar.html#a43e4c04827f790a5bfeacef95b53e461).
    fn is_enabled_int(&self, id: c_int) -> bool {
        unsafe { ffi::wxMenuBar_IsEnabled(self.as_ptr(), id) }
    }
    /// Removes the menu from the menu bar and returns the menu object - the caller is responsible for deleting it.
    ///
    /// See [C++ `wxMenuBar::Remove()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_bar.html#a05d7e4c19d2c98aca6bd6cf81af2f0b4).
    fn remove(&self, pos: usize) -> WeakRef<Menu> {
        unsafe { WeakRef::<Menu>::from(ffi::wxMenuBar_Remove(self.as_ptr(), pos)) }
    }
    /// Replaces the menu at the given position with another one.
    ///
    /// See [C++ `wxMenuBar::Replace()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_bar.html#a77bd71f6c9dc1bb21742c07c4683e789).
    fn replace<M: MenuMethods>(&self, pos: usize, menu: Option<&M>, title: &str) -> WeakRef<Menu> {
        unsafe {
            let menu = match menu {
                Some(r) => r.as_ptr(),
                None => ptr::null_mut(),
            };
            let title = WxString::from(title);
            let title = title.as_ptr();
            WeakRef::<Menu>::from(ffi::wxMenuBar_Replace(self.as_ptr(), pos, menu, title))
        }
    }
    /// Sets the help string associated with a menu item.
    ///
    /// See [C++ `wxMenuBar::SetHelpString()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_bar.html#a4379fba6f5a0a3e62b6271735f2b4841).
    fn set_help_string(&self, id: c_int, help_string: &str) {
        unsafe {
            let help_string = WxString::from(help_string);
            let help_string = help_string.as_ptr();
            ffi::wxMenuBar_SetHelpString(self.as_ptr(), id, help_string)
        }
    }
    /// Sets the label of a menu item.
    ///
    /// See [C++ `wxMenuBar::SetLabel()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_bar.html#a4b3669c33dfafeb1c8468a0ba3c09d5f).
    fn set_label_int(&self, id: c_int, label: &str) {
        unsafe {
            let label = WxString::from(label);
            let label = label.as_ptr();
            ffi::wxMenuBar_SetLabel(self.as_ptr(), id, label)
        }
    }
    // BLOCKED: fn SetLabelTop()
    /// Sets the label of a top-level menu.
    ///
    /// See [C++ `wxMenuBar::SetMenuLabel()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_bar.html#a66a14aec7caeff702f964cd35085cf06).
    fn set_menu_label(&self, pos: usize, label: &str) {
        unsafe {
            let label = WxString::from(label);
            let label = label.as_ptr();
            ffi::wxMenuBar_SetMenuLabel(self.as_ptr(), pos, label)
        }
    }
    /// Returns the Apple menu.
    ///
    /// See [C++ `wxMenuBar::OSXGetAppleMenu()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_bar.html#a61209f2ef16fa67bf8d5216732437431).
    fn osx_get_apple_menu(&self) -> WeakRef<Menu> {
        unsafe { WeakRef::<Menu>::from(ffi::wxMenuBar_OSXGetAppleMenu(self.as_ptr())) }
    }
    ///
    /// See [C++ `wxMenuBar::GetFrame()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_bar.html#a464b1576b87f6f5806379e523b0e95c3).
    fn get_frame(&self) -> WeakRef<Frame> {
        unsafe { WeakRef::<Frame>::from(ffi::wxMenuBar_GetFrame(self.as_ptr())) }
    }
    ///
    /// See [C++ `wxMenuBar::IsAttached()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_bar.html#a1ef964f2241f7d0eff30c3dd6d65c97d).
    fn is_attached(&self) -> bool {
        unsafe { ffi::wxMenuBar_IsAttached(self.as_ptr()) }
    }
    ///
    /// See [C++ `wxMenuBar::Attach()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_bar.html#a4ca9c3e53c3ff18f7f74e3d2aeea3dab).
    fn attach<F: FrameMethods>(&self, frame: Option<&F>) {
        unsafe {
            let frame = match frame {
                Some(r) => r.as_ptr(),
                None => ptr::null_mut(),
            };
            ffi::wxMenuBar_Attach(self.as_ptr(), frame)
        }
    }
    ///
    /// See [C++ `wxMenuBar::Detach()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_bar.html#a3fc40b9272a0ef7ff1bcbea04d3557c7).
    fn detach(&self) {
        unsafe { ffi::wxMenuBar_Detach(self.as_ptr()) }
    }
    /// Enables you to set the global menubar on Mac, that is, the menubar displayed when the app is running without any frames open.
    ///
    /// See [C++ `wxMenuBar::MacSetCommonMenuBar()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_bar.html#a1fd28115be9437d0dd7b1f99049ec905).
    fn mac_set_common_menu_bar<M: MenuBarMethods>(menubar: Option<&M>) {
        unsafe {
            let menubar = match menubar {
                Some(r) => r.as_ptr(),
                None => ptr::null_mut(),
            };
            ffi::wxMenuBar_MacSetCommonMenuBar(menubar)
        }
    }
    /// Enables you to get the global menubar on Mac, that is, the menubar displayed when the app is running without any frames open.
    ///
    /// See [C++ `wxMenuBar::MacGetCommonMenuBar()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_bar.html#a1c373424e34a9a1a0f40b29f30f6fecb).
    fn mac_get_common_menu_bar() -> WeakRef<MenuBar> {
        unsafe { WeakRef::<MenuBar>::from(ffi::wxMenuBar_MacGetCommonMenuBar()) }
    }
}

// wxMenuEvent
/// This trait represents [C++ `wxMenuEvent` class](https://docs.wxwidgets.org/3.2/classwx_menu_event.html)'s methods and inheritance.
///
/// See [`MenuEventIsOwned`] documentation for the class usage.
pub trait MenuEventMethods: EventMethods {
    /// Returns the menu which is being opened or closed, or the menu containing the highlighted item.
    ///
    /// See [C++ `wxMenuEvent::GetMenu()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_event.html#a1b44ad5a80dbce004b9d304813c91f29).
    fn get_menu(&self) -> WeakRef<Menu> {
        unsafe { WeakRef::<Menu>::from(ffi::wxMenuEvent_GetMenu(self.as_ptr())) }
    }
    /// Returns the menu identifier associated with the event.
    ///
    /// See [C++ `wxMenuEvent::GetMenuId()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_event.html#af59809f4b21a8136ebb84395756c7323).
    fn get_menu_id(&self) -> c_int {
        unsafe { ffi::wxMenuEvent_GetMenuId(self.as_ptr()) }
    }
    /// Returns true if the menu which is being opened or closed is a popup menu, false if it is a normal one.
    ///
    /// See [C++ `wxMenuEvent::IsPopup()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_event.html#a1a38c42493a996ea43bcc8a55fe4174c).
    fn is_popup(&self) -> bool {
        unsafe { ffi::wxMenuEvent_IsPopup(self.as_ptr()) }
    }
}

// wxMenuItem
/// This trait represents [C++ `wxMenuItem` class](https://docs.wxwidgets.org/3.2/classwx_menu_item.html)'s methods and inheritance.
///
/// See [`MenuItemIsOwned`] documentation for the class usage.
pub trait MenuItemMethods: ObjectMethods {
    // BLOCKED: fn GetBackgroundColour()
    /// Returns the item bitmap.
    ///
    /// See [C++ `wxMenuItem::GetBitmap()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_item.html#acad864491fe941af3718115a79daed8d).
    fn get_bitmap(&self) -> Bitmap {
        unsafe { Bitmap::from_ptr(ffi::wxMenuItem_GetBitmap(self.as_ptr())) }
    }
    /// Returns the checked or unchecked bitmap.
    ///
    /// See [C++ `wxMenuItem::GetBitmap()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_item.html#a2fdaf18c01423ccd46c22dfe0c4ac821).
    fn get_bitmap_bool(&self, checked: bool) -> Bitmap {
        unsafe { Bitmap::from_ptr(ffi::wxMenuItem_GetBitmap1(self.as_ptr(), checked)) }
    }
    /// Returns the bitmap bundle containing the bitmap used for this item.
    ///
    /// See [C++ `wxMenuItem::GetBitmapBundle()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_item.html#ab22eaea1e24d1de0186bd2f496c67905).
    fn get_bitmap_bundle(&self) -> BitmapBundle {
        unsafe { BitmapBundle::from_ptr(ffi::wxMenuItem_GetBitmapBundle(self.as_ptr())) }
    }
    /// Returns the bitmap used for disabled items.
    ///
    /// See [C++ `wxMenuItem::GetDisabledBitmap()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_item.html#ad159d100aa8852d5a3d90bd07e3db0b8).
    fn get_disabled_bitmap(&self) -> Bitmap {
        unsafe { Bitmap::from_ptr(ffi::wxMenuItem_GetDisabledBitmap(self.as_ptr())) }
    }
    // BLOCKED: fn GetFont()
    /// Returns the help string associated with the menu item.
    ///
    /// See [C++ `wxMenuItem::GetHelp()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_item.html#a0e5cf57080e9239d54b1145b00449332).
    fn get_help(&self) -> String {
        unsafe { WxString::from_ptr(ffi::wxMenuItem_GetHelp(self.as_ptr())).into() }
    }
    /// Returns the menu item identifier.
    ///
    /// See [C++ `wxMenuItem::GetId()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_item.html#a86d0d34d65d1d115ea951870298b4330).
    fn get_id(&self) -> c_int {
        unsafe { ffi::wxMenuItem_GetId(self.as_ptr()) }
    }
    /// Returns the text associated with the menu item including any accelerator characters that were passed to the constructor or SetItemLabel().
    ///
    /// See [C++ `wxMenuItem::GetItemLabel()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_item.html#a7ca185aa5c527d13b8c62d3e01c3471a).
    fn get_item_label(&self) -> String {
        unsafe { WxString::from_ptr(ffi::wxMenuItem_GetItemLabel(self.as_ptr())).into() }
    }
    /// Returns the text associated with the menu item, without any accelerator characters.
    ///
    /// See [C++ `wxMenuItem::GetItemLabelText()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_item.html#a8f8c25b7e46072f5f6e51856cae53584).
    fn get_item_label_text(&self) -> String {
        unsafe { WxString::from_ptr(ffi::wxMenuItem_GetItemLabelText(self.as_ptr())).into() }
    }
    /// Returns the item kind, one of wxITEM_SEPARATOR, wxITEM_NORMAL, wxITEM_CHECK or wxITEM_RADIO.
    ///
    /// See [C++ `wxMenuItem::GetKind()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_item.html#a7020d6b58487acb2cc691d2230938fe5).
    fn get_kind(&self) -> c_int {
        unsafe { ffi::wxMenuItem_GetKind(self.as_ptr()) }
    }
    // BLOCKED: fn GetLabel()
    /// Gets the width of the menu item checkmark bitmap.
    ///
    /// See [C++ `wxMenuItem::GetMarginWidth()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_item.html#a5d49fce4aa0446c647906bd46e86c134).
    fn get_margin_width(&self) -> c_int {
        unsafe { ffi::wxMenuItem_GetMarginWidth(self.as_ptr()) }
    }
    /// Returns the menu this menu item is in, or NULL if this menu item is not attached.
    ///
    /// See [C++ `wxMenuItem::GetMenu()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_item.html#ab3acd9e96ff430293380b53ec817dad2).
    fn get_menu(&self) -> WeakRef<Menu> {
        unsafe { WeakRef::<Menu>::from(ffi::wxMenuItem_GetMenu(self.as_ptr())) }
    }
    // BLOCKED: fn GetName()
    /// Returns the submenu associated with the menu item, or NULL if there isn't one.
    ///
    /// See [C++ `wxMenuItem::GetSubMenu()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_item.html#a41d4139faeb7323ad8a0059fa06f3eec).
    fn get_sub_menu(&self) -> WeakRef<Menu> {
        unsafe { WeakRef::<Menu>::from(ffi::wxMenuItem_GetSubMenu(self.as_ptr())) }
    }
    // BLOCKED: fn GetText()
    // BLOCKED: fn GetTextColour()
    /// Get our accelerator or NULL (caller must delete the pointer)
    ///
    /// See [C++ `wxMenuItem::GetAccel()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_item.html#a011e5b7a9945b43acc32848612376c2e).
    fn get_accel(&self) -> Option<AcceleratorEntryIsOwned<false>> {
        unsafe { AcceleratorEntry::option_from(ffi::wxMenuItem_GetAccel(self.as_ptr())) }
    }
    // BLOCKED: fn GetAccelFromString()
    /// Returns true if the item is a check item.
    ///
    /// See [C++ `wxMenuItem::IsCheck()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_item.html#ad130ff84162b411524b8fd67e4fa4766).
    fn is_check(&self) -> bool {
        unsafe { ffi::wxMenuItem_IsCheck(self.as_ptr()) }
    }
    /// Returns true if the item is checkable.
    ///
    /// See [C++ `wxMenuItem::IsCheckable()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_item.html#a0c10c9514cdc1a719b5e53fe75c1e764).
    fn is_checkable(&self) -> bool {
        unsafe { ffi::wxMenuItem_IsCheckable(self.as_ptr()) }
    }
    /// Returns true if the item is checked.
    ///
    /// See [C++ `wxMenuItem::IsChecked()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_item.html#a8727ee892b87d44b4c23566dd81e71db).
    fn is_checked(&self) -> bool {
        unsafe { ffi::wxMenuItem_IsChecked(self.as_ptr()) }
    }
    /// Returns true if the item is enabled.
    ///
    /// See [C++ `wxMenuItem::IsEnabled()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_item.html#a9f5e3a06bf0d596098ffdf2b48779911).
    fn is_enabled(&self) -> bool {
        unsafe { ffi::wxMenuItem_IsEnabled(self.as_ptr()) }
    }
    /// Returns true if the item is a radio button.
    ///
    /// See [C++ `wxMenuItem::IsRadio()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_item.html#a680da3cb33645cac12057a62a3207268).
    fn is_radio(&self) -> bool {
        unsafe { ffi::wxMenuItem_IsRadio(self.as_ptr()) }
    }
    /// Returns true if the item is a separator.
    ///
    /// See [C++ `wxMenuItem::IsSeparator()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_item.html#acda66a8035c0e880ba996da2da6c7371).
    fn is_separator(&self) -> bool {
        unsafe { ffi::wxMenuItem_IsSeparator(self.as_ptr()) }
    }
    /// Returns true if the item is a submenu.
    ///
    /// See [C++ `wxMenuItem::IsSubMenu()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_item.html#ab400e6250bcab892205bb22e703d024e).
    fn is_sub_menu(&self) -> bool {
        unsafe { ffi::wxMenuItem_IsSubMenu(self.as_ptr()) }
    }
    /// Sets the background colour associated with the menu item.
    ///
    /// See [C++ `wxMenuItem::SetBackgroundColour()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_item.html#a5a4462c00517c5d8470b99fd021c6a9d).
    fn set_background_colour<C: ColourMethods>(&self, colour: &C) {
        unsafe {
            let colour = colour.as_ptr();
            ffi::wxMenuItem_SetBackgroundColour(self.as_ptr(), colour)
        }
    }
    /// Sets the bitmap for the menu item.
    ///
    /// See [C++ `wxMenuItem::SetBitmap()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_item.html#abf175a94aa2b9ce76ab8bf4e223e609d).
    fn set_bitmap<B: BitmapBundleMethods>(&self, bmp: &B) {
        unsafe {
            let bmp = bmp.as_ptr();
            ffi::wxMenuItem_SetBitmap(self.as_ptr(), bmp)
        }
    }
    /// Sets the checked or unchecked bitmap for the menu item.
    ///
    /// See [C++ `wxMenuItem::SetBitmap()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_item.html#a8e935bd7d6b0c93b243dfdfd102421b3).
    fn set_bitmap_bool<B: BitmapBundleMethods>(&self, bmp: &B, checked: bool) {
        unsafe {
            let bmp = bmp.as_ptr();
            ffi::wxMenuItem_SetBitmap1(self.as_ptr(), bmp, checked)
        }
    }
    /// Sets the checked/unchecked bitmaps for the menu item.
    ///
    /// See [C++ `wxMenuItem::SetBitmaps()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_item.html#a8024cfb73724cc156049571cc23bd9a0).
    fn set_bitmaps<B: BitmapBundleMethods, B2: BitmapBundleMethods>(
        &self,
        checked: &B,
        unchecked: &B2,
    ) {
        unsafe {
            let checked = checked.as_ptr();
            let unchecked = unchecked.as_ptr();
            ffi::wxMenuItem_SetBitmaps(self.as_ptr(), checked, unchecked)
        }
    }
    /// Sets the to be used for disabled menu items.
    ///
    /// See [C++ `wxMenuItem::SetDisabledBitmap()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_item.html#ac6304d34c075ed4d7fc25581440f7b43).
    fn set_disabled_bitmap<B: BitmapBundleMethods>(&self, disabled: &B) {
        unsafe {
            let disabled = disabled.as_ptr();
            ffi::wxMenuItem_SetDisabledBitmap(self.as_ptr(), disabled)
        }
    }
    /// Sets the font associated with the menu item.
    ///
    /// See [C++ `wxMenuItem::SetFont()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_item.html#a5deda3866e4308a965caa2fb78c1ca93).
    fn set_font<F: FontMethods>(&self, font: &F) {
        unsafe {
            let font = font.as_ptr();
            ffi::wxMenuItem_SetFont(self.as_ptr(), font)
        }
    }
    /// Sets the help string.
    ///
    /// See [C++ `wxMenuItem::SetHelp()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_item.html#af20e2cb1c73892e1c8e86e69b40d9040).
    fn set_help(&self, help_string: &str) {
        unsafe {
            let help_string = WxString::from(help_string);
            let help_string = help_string.as_ptr();
            ffi::wxMenuItem_SetHelp(self.as_ptr(), help_string)
        }
    }
    /// Sets the label associated with the menu item.
    ///
    /// See [C++ `wxMenuItem::SetItemLabel()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_item.html#a8b0517fb35e3eada66b51568aa87f261).
    fn set_item_label(&self, label: &str) {
        unsafe {
            let label = WxString::from(label);
            let label = label.as_ptr();
            ffi::wxMenuItem_SetItemLabel(self.as_ptr(), label)
        }
    }
    /// Sets the width of the menu item checkmark bitmap.
    ///
    /// See [C++ `wxMenuItem::SetMarginWidth()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_item.html#aac2257b03dd2485c72f9398ceb1a76cf).
    fn set_margin_width(&self, width: c_int) {
        unsafe { ffi::wxMenuItem_SetMarginWidth(self.as_ptr(), width) }
    }
    /// Sets the parent menu which will contain this menu item.
    ///
    /// See [C++ `wxMenuItem::SetMenu()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_item.html#a41fb81219430a81e7e2a668831868296).
    fn set_menu<M: MenuMethods>(&self, menu: Option<&M>) {
        unsafe {
            let menu = match menu {
                Some(r) => r.as_ptr(),
                None => ptr::null_mut(),
            };
            ffi::wxMenuItem_SetMenu(self.as_ptr(), menu)
        }
    }
    /// Sets the submenu of this menu item.
    ///
    /// See [C++ `wxMenuItem::SetSubMenu()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_item.html#ab222651b8b47653d8890cd3469d5ff5a).
    fn set_sub_menu<M: MenuMethods>(&self, menu: Option<&M>) {
        unsafe {
            let menu = match menu {
                Some(r) => r.as_ptr(),
                None => ptr::null_mut(),
            };
            ffi::wxMenuItem_SetSubMenu(self.as_ptr(), menu)
        }
    }
    // BLOCKED: fn SetText()
    /// Sets the text colour associated with the menu item.
    ///
    /// See [C++ `wxMenuItem::SetTextColour()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_item.html#a695b5f2f1c2325ec01dba5cdd83dd3b5).
    fn set_text_colour<C: ColourMethods>(&self, colour: &C) {
        unsafe {
            let colour = colour.as_ptr();
            ffi::wxMenuItem_SetTextColour(self.as_ptr(), colour)
        }
    }
    /// Set the accel for this item - this may also be done indirectly with SetText()
    ///
    /// See [C++ `wxMenuItem::SetAccel()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_item.html#a1deb59611abda8b68cd06c848f48884d).
    fn set_accel<A: AcceleratorEntryMethods>(&self, accel: Option<&A>) {
        unsafe {
            let accel = match accel {
                Some(r) => r.as_ptr(),
                None => ptr::null_mut(),
            };
            ffi::wxMenuItem_SetAccel(self.as_ptr(), accel)
        }
    }
    /// Add an extra accelerator for this menu item.
    ///
    /// See [C++ `wxMenuItem::AddExtraAccel()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_item.html#ac289400c23e28ff4b094a4263d093c66).
    fn add_extra_accel<A: AcceleratorEntryMethods>(&self, accel: &A) {
        unsafe {
            let accel = accel.as_ptr();
            ffi::wxMenuItem_AddExtraAccel(self.as_ptr(), accel)
        }
    }
    /// Clear the extra accelerators list.
    ///
    /// See [C++ `wxMenuItem::ClearExtraAccels()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_item.html#a80f57a2bf185823729bf1cba73aef43d).
    fn clear_extra_accels(&self) {
        unsafe { ffi::wxMenuItem_ClearExtraAccels(self.as_ptr()) }
    }
    // DTOR: fn ~wxMenuItem()
    /// Checks or unchecks the menu item.
    ///
    /// See [C++ `wxMenuItem::Check()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_item.html#afcfbb12e302c0528e55efcb1c6f5f7fc).
    fn check(&self, check: bool) {
        unsafe { ffi::wxMenuItem_Check(self.as_ptr(), check) }
    }
    /// Enables or disables the menu item.
    ///
    /// See [C++ `wxMenuItem::Enable()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_item.html#a1e399da82f486adea3893480bcf66b21).
    fn enable(&self, enable: bool) {
        unsafe { ffi::wxMenuItem_Enable(self.as_ptr(), enable) }
    }
    // BLOCKED: fn GetLabelFromText()
    /// Strips all accelerator characters and mnemonics from the given text.
    ///
    /// See [C++ `wxMenuItem::GetLabelText()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_menu_item.html#afed23d53a97171076763385c93207fc0).
    fn get_label_text(text: &str) -> String {
        unsafe {
            let text = WxString::from(text);
            let text = text.as_ptr();
            WxString::from_ptr(ffi::wxMenuItem_GetLabelText(text)).into()
        }
    }
}

// wxMessageDialog
/// This trait represents [C++ `wxMessageDialog` class](https://docs.wxwidgets.org/3.2/classwx_message_dialog.html)'s methods and inheritance.
///
/// See [`MessageDialogIsOwned`] documentation for the class usage.
pub trait MessageDialogMethods: DialogMethods {
    /// Sets the extended message for the dialog: this message is usually an extension of the short message specified in the constructor or set with SetMessage().
    ///
    /// See [C++ `wxMessageDialog::SetExtendedMessage()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_message_dialog.html#a6085d6b273139c655af06874abf03ea3).
    fn set_extended_message(&self, extended_message: &str) {
        unsafe {
            let extended_message = WxString::from(extended_message);
            let extended_message = extended_message.as_ptr();
            ffi::wxMessageDialog_SetExtendedMessage(self.as_ptr(), extended_message)
        }
    }
    /// Sets the label for the Help button.
    ///
    /// See [C++ `wxMessageDialog::SetHelpLabel()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_message_dialog.html#a85dd2dfd88baa9af9de185bae6642c0e).
    fn set_help_label(&self, help: *const c_void) -> bool {
        unsafe { ffi::wxMessageDialog_SetHelpLabel(self.as_ptr(), help) }
    }
    /// Sets the message shown by the dialog.
    ///
    /// See [C++ `wxMessageDialog::SetMessage()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_message_dialog.html#a43fd42a28d0008f5de3c8bd88aa47a87).
    fn set_message(&self, message: &str) {
        unsafe {
            let message = WxString::from(message);
            let message = message.as_ptr();
            ffi::wxMessageDialog_SetMessage(self.as_ptr(), message)
        }
    }
    /// Overrides the default labels of the OK and Cancel buttons.
    ///
    /// See [C++ `wxMessageDialog::SetOKCancelLabels()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_message_dialog.html#ad8fdf1426f7363bd1e1e07af5f1e7adc).
    fn set_ok_cancel_labels(&self, ok: *const c_void, cancel: *const c_void) -> bool {
        unsafe { ffi::wxMessageDialog_SetOKCancelLabels(self.as_ptr(), ok, cancel) }
    }
    /// Overrides the default label of the OK button.
    ///
    /// See [C++ `wxMessageDialog::SetOKLabel()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_message_dialog.html#a9790fa9c1f2fc473539b57d9c1e862a9).
    fn set_ok_label(&self, ok: *const c_void) -> bool {
        unsafe { ffi::wxMessageDialog_SetOKLabel(self.as_ptr(), ok) }
    }
    /// Overrides the default labels of the Yes, No and Cancel buttons.
    ///
    /// See [C++ `wxMessageDialog::SetYesNoCancelLabels()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_message_dialog.html#a69d5facbe995eee8e92035423e30f534).
    fn set_yes_no_cancel_labels(
        &self,
        yes: *const c_void,
        no: *const c_void,
        cancel: *const c_void,
    ) -> bool {
        unsafe { ffi::wxMessageDialog_SetYesNoCancelLabels(self.as_ptr(), yes, no, cancel) }
    }
    /// Overrides the default labels of the Yes and No buttons.
    ///
    /// See [C++ `wxMessageDialog::SetYesNoLabels()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_message_dialog.html#aa23b25ebf18bf0915d438cc13b55cb23).
    fn set_yes_no_labels(&self, yes: *const c_void, no: *const c_void) -> bool {
        unsafe { ffi::wxMessageDialog_SetYesNoLabels(self.as_ptr(), yes, no) }
    }
    ///
    /// See [C++ `wxMessageDialog::GetCaption()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_message_dialog.html#a380e4f2718064c3c52654a6f53545223).
    fn get_caption(&self) -> String {
        unsafe { WxString::from_ptr(ffi::wxMessageDialog_GetCaption(self.as_ptr())).into() }
    }
    ///
    /// See [C++ `wxMessageDialog::GetMessage()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_message_dialog.html#acab6c3bb053033eca71b1676b12af9ee).
    fn get_message(&self) -> String {
        unsafe { WxString::from_ptr(ffi::wxMessageDialog_GetMessage(self.as_ptr())).into() }
    }
    ///
    /// See [C++ `wxMessageDialog::GetExtendedMessage()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_message_dialog.html#a332328991aadf9dab5c0694a66d23a5d).
    fn get_extended_message(&self) -> String {
        unsafe { WxString::from_ptr(ffi::wxMessageDialog_GetExtendedMessage(self.as_ptr())).into() }
    }
    ///
    /// See [C++ `wxMessageDialog::GetMessageDialogStyle()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_message_dialog.html#a29fb358b32048e35d2baf2dda0c1da51).
    fn get_message_dialog_style(&self) -> c_long {
        unsafe { ffi::wxMessageDialog_GetMessageDialogStyle(self.as_ptr()) }
    }
    ///
    /// See [C++ `wxMessageDialog::HasCustomLabels()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_message_dialog.html#a3004e1d69c6d468af486ed716e1b8bbb).
    fn has_custom_labels(&self) -> bool {
        unsafe { ffi::wxMessageDialog_HasCustomLabels(self.as_ptr()) }
    }
    ///
    /// See [C++ `wxMessageDialog::GetYesLabel()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_message_dialog.html#a2a47c30c4a7387bc97634f1a5fb02407).
    fn get_yes_label(&self) -> String {
        unsafe { WxString::from_ptr(ffi::wxMessageDialog_GetYesLabel(self.as_ptr())).into() }
    }
    ///
    /// See [C++ `wxMessageDialog::GetNoLabel()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_message_dialog.html#a4c91306d0b35371ad55572659b974f19).
    fn get_no_label(&self) -> String {
        unsafe { WxString::from_ptr(ffi::wxMessageDialog_GetNoLabel(self.as_ptr())).into() }
    }
    ///
    /// See [C++ `wxMessageDialog::GetOKLabel()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_message_dialog.html#aaff522bee896f22fb41a58a75124df7f).
    fn get_ok_label(&self) -> String {
        unsafe { WxString::from_ptr(ffi::wxMessageDialog_GetOKLabel(self.as_ptr())).into() }
    }
    ///
    /// See [C++ `wxMessageDialog::GetCancelLabel()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_message_dialog.html#a01862f641296cb49c813bc7d3718435a).
    fn get_cancel_label(&self) -> String {
        unsafe { WxString::from_ptr(ffi::wxMessageDialog_GetCancelLabel(self.as_ptr())).into() }
    }
    ///
    /// See [C++ `wxMessageDialog::GetHelpLabel()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_message_dialog.html#a6dab1b25eeea11ded4e4bfaed376f5eb).
    fn get_help_label(&self) -> String {
        unsafe { WxString::from_ptr(ffi::wxMessageDialog_GetHelpLabel(self.as_ptr())).into() }
    }
    ///
    /// See [C++ `wxMessageDialog::GetEffectiveIcon()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_message_dialog.html#a5b9e20e8335e1799356d8326342f8a24).
    fn get_effective_icon(&self) -> c_long {
        unsafe { ffi::wxMessageDialog_GetEffectiveIcon(self.as_ptr()) }
    }
}

// wxMessageOutputMessageBox
/// This trait represents [C++ `wxMessageOutputMessageBox` class](https://docs.wxwidgets.org/3.2/classwx_message_output_message_box.html)'s methods and inheritance.
///
/// See [`MessageOutputMessageBoxIsOwned`] documentation for the class usage.
pub trait MessageOutputMessageBoxMethods: MessageOutputMethods {}

// wxMiniFrame
/// This trait represents [C++ `wxMiniFrame` class](https://docs.wxwidgets.org/3.2/classwx_mini_frame.html)'s methods and inheritance.
///
/// See [`MiniFrameIsOwned`] documentation for the class usage.
pub trait MiniFrameMethods: FrameMethods {
    // DTOR: fn ~wxMiniFrame()
}

// wxMirrorDC
/// This trait represents [C++ `wxMirrorDC` class](https://docs.wxwidgets.org/3.2/classwx_mirror_d_c.html)'s methods and inheritance.
///
/// See [`MirrorDCIsOwned`] documentation for the class usage.
pub trait MirrorDCMethods: DCMethods {}

// wxMouseCaptureChangedEvent
/// This trait represents [C++ `wxMouseCaptureChangedEvent` class](https://docs.wxwidgets.org/3.2/classwx_mouse_capture_changed_event.html)'s methods and inheritance.
///
/// See [`MouseCaptureChangedEventIsOwned`] documentation for the class usage.
pub trait MouseCaptureChangedEventMethods: EventMethods {
    /// Returns the window that gained the capture, or NULL if it was a non-wxWidgets window.
    ///
    /// See [C++ `wxMouseCaptureChangedEvent::GetCapturedWindow()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_mouse_capture_changed_event.html#a403f9904cb2e746ae5cb052fdb328f4a).
    fn get_captured_window(&self) -> WeakRef<Window> {
        unsafe {
            WeakRef::<Window>::from(ffi::wxMouseCaptureChangedEvent_GetCapturedWindow(
                self.as_ptr(),
            ))
        }
    }
}

// wxMouseCaptureLostEvent
/// This trait represents [C++ `wxMouseCaptureLostEvent` class](https://docs.wxwidgets.org/3.2/classwx_mouse_capture_lost_event.html)'s methods and inheritance.
///
/// See [`MouseCaptureLostEventIsOwned`] documentation for the class usage.
pub trait MouseCaptureLostEventMethods: EventMethods {}

// wxMouseEvent
/// This trait represents [C++ `wxMouseEvent` class](https://docs.wxwidgets.org/3.2/classwx_mouse_event.html)'s methods and inheritance.
///
/// See [`MouseEventIsOwned`] documentation for the class usage.
pub trait MouseEventMethods: EventMethods {
    /// Returns true if the event was a first extra button double click.
    ///
    /// See [C++ `wxMouseEvent::Aux1DClick()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_mouse_event.html#ae2c51596a8608ac2028911140efca9f4).
    fn aux1_d_click(&self) -> bool {
        unsafe { ffi::wxMouseEvent_Aux1DClick(self.as_ptr()) }
    }
    /// Returns true if the first extra button mouse button changed to down.
    ///
    /// See [C++ `wxMouseEvent::Aux1Down()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_mouse_event.html#afe1a57591865fe8454a21bd3699a01f9).
    fn aux1_down(&self) -> bool {
        unsafe { ffi::wxMouseEvent_Aux1Down(self.as_ptr()) }
    }
    /// Returns true if the first extra button mouse button changed to up.
    ///
    /// See [C++ `wxMouseEvent::Aux1Up()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_mouse_event.html#add041b97305586a2305b3b532dc65123).
    fn aux1_up(&self) -> bool {
        unsafe { ffi::wxMouseEvent_Aux1Up(self.as_ptr()) }
    }
    /// Returns true if the event was a second extra button double click.
    ///
    /// See [C++ `wxMouseEvent::Aux2DClick()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_mouse_event.html#a2be62a363b8da0a5ecfe06929e3ad4bb).
    fn aux2_d_click(&self) -> bool {
        unsafe { ffi::wxMouseEvent_Aux2DClick(self.as_ptr()) }
    }
    /// Returns true if the second extra button mouse button changed to down.
    ///
    /// See [C++ `wxMouseEvent::Aux2Down()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_mouse_event.html#a5494f60d0424dbed2886853207ca24b4).
    fn aux2_down(&self) -> bool {
        unsafe { ffi::wxMouseEvent_Aux2Down(self.as_ptr()) }
    }
    /// Returns true if the second extra button mouse button changed to up.
    ///
    /// See [C++ `wxMouseEvent::Aux2Up()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_mouse_event.html#aae659084143a6485d5dd95fb81d1ffaa).
    fn aux2_up(&self) -> bool {
        unsafe { ffi::wxMouseEvent_Aux2Up(self.as_ptr()) }
    }
    // NOT_SUPPORTED: fn Button()
    // NOT_SUPPORTED: fn ButtonDClick()
    // NOT_SUPPORTED: fn ButtonDown()
    // NOT_SUPPORTED: fn ButtonUp()
    /// Returns true if this was a dragging event (motion while a button is depressed).
    ///
    /// See [C++ `wxMouseEvent::Dragging()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_mouse_event.html#aa08074a2555618c63e2a53f38e56f18f).
    fn dragging(&self) -> bool {
        unsafe { ffi::wxMouseEvent_Dragging(self.as_ptr()) }
    }
    /// Returns true if the mouse was entering the window.
    ///
    /// See [C++ `wxMouseEvent::Entering()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_mouse_event.html#aba23d806bfad21911a5e1e4f21bdf283).
    fn entering(&self) -> bool {
        unsafe { ffi::wxMouseEvent_Entering(self.as_ptr()) }
    }
    /// Returns the mouse button which generated this event or wxMOUSE_BTN_NONE if no button is involved (for mouse move, enter or leave event, for example).
    ///
    /// See [C++ `wxMouseEvent::GetButton()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_mouse_event.html#a33653a3f59d68405361f3ae65d2936eb).
    fn get_button(&self) -> c_int {
        unsafe { ffi::wxMouseEvent_GetButton(self.as_ptr()) }
    }
    /// Returns the number of mouse clicks for this event: 1 for a simple click, 2 for a double-click, 3 for a triple-click and so on.
    ///
    /// See [C++ `wxMouseEvent::GetClickCount()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_mouse_event.html#a392c9bac6c152016ecf09c05fa2d8f9c).
    fn get_click_count(&self) -> c_int {
        unsafe { ffi::wxMouseEvent_GetClickCount(self.as_ptr()) }
    }
    /// Returns the configured number of lines (or whatever) to be scrolled per wheel action.
    ///
    /// See [C++ `wxMouseEvent::GetLinesPerAction()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_mouse_event.html#a0af4db62efdd4e3a51d5ea120aeadda2).
    fn get_lines_per_action(&self) -> c_int {
        unsafe { ffi::wxMouseEvent_GetLinesPerAction(self.as_ptr()) }
    }
    /// Returns the configured number of columns (or whatever) to be scrolled per wheel action.
    ///
    /// See [C++ `wxMouseEvent::GetColumnsPerAction()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_mouse_event.html#a84ffae36f25eb784975ccbd4b8774b01).
    fn get_columns_per_action(&self) -> c_int {
        unsafe { ffi::wxMouseEvent_GetColumnsPerAction(self.as_ptr()) }
    }
    /// Returns the logical mouse position in pixels (i.e. translated according to the translation set for the DC, which usually indicates that the window has been scrolled).
    ///
    /// See [C++ `wxMouseEvent::GetLogicalPosition()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_mouse_event.html#ada3567c0ac444667e328c7c733496b58).
    fn get_logical_position<D: DCMethods>(&self, dc: &D) -> Point {
        unsafe {
            let dc = dc.as_ptr();
            Point::from_ptr(ffi::wxMouseEvent_GetLogicalPosition(self.as_ptr(), dc))
        }
    }
    // NOT_SUPPORTED: fn GetMagnification()
    /// Get wheel delta, normally 120.
    ///
    /// See [C++ `wxMouseEvent::GetWheelDelta()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_mouse_event.html#a5fa028a09896b6ddb894b12caacc32fb).
    fn get_wheel_delta(&self) -> c_int {
        unsafe { ffi::wxMouseEvent_GetWheelDelta(self.as_ptr()) }
    }
    /// On Mac, has the user selected "Natural" scrolling in their System Preferences? Currently false on all other OS's.
    ///
    /// See [C++ `wxMouseEvent::IsWheelInverted()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_mouse_event.html#ae69c1c2d061961457432976e73856af9).
    fn is_wheel_inverted(&self) -> bool {
        unsafe { ffi::wxMouseEvent_IsWheelInverted(self.as_ptr()) }
    }
    /// Get wheel rotation, positive or negative indicates direction of rotation.
    ///
    /// See [C++ `wxMouseEvent::GetWheelRotation()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_mouse_event.html#af25c634cf45cb3d4633d45c472f5b2b9).
    fn get_wheel_rotation(&self) -> c_int {
        unsafe { ffi::wxMouseEvent_GetWheelRotation(self.as_ptr()) }
    }
    // NOT_SUPPORTED: fn GetWheelAxis()
    /// Returns true if the event was a mouse button event (not necessarily a button down event - that may be tested using ButtonDown()).
    ///
    /// See [C++ `wxMouseEvent::IsButton()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_mouse_event.html#aabd0abde2a268f185577e5cdad70804e).
    fn is_button(&self) -> bool {
        unsafe { ffi::wxMouseEvent_IsButton(self.as_ptr()) }
    }
    /// Returns true if the system has been setup to do page scrolling with the mouse wheel instead of line scrolling.
    ///
    /// See [C++ `wxMouseEvent::IsPageScroll()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_mouse_event.html#ab00378989ac7f5e8c56bcc4bd5e4251a).
    fn is_page_scroll(&self) -> bool {
        unsafe { ffi::wxMouseEvent_IsPageScroll(self.as_ptr()) }
    }
    /// Returns true if the mouse was leaving the window.
    ///
    /// See [C++ `wxMouseEvent::Leaving()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_mouse_event.html#a40c80ae3b1c99525711c5c68aa31d917).
    fn leaving(&self) -> bool {
        unsafe { ffi::wxMouseEvent_Leaving(self.as_ptr()) }
    }
    /// Returns true if the event was a left double click.
    ///
    /// See [C++ `wxMouseEvent::LeftDClick()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_mouse_event.html#ad34fad1c0f5a1e1912edcc3a8dec1c6f).
    fn left_d_click(&self) -> bool {
        unsafe { ffi::wxMouseEvent_LeftDClick(self.as_ptr()) }
    }
    /// Returns true if the left mouse button changed to down.
    ///
    /// See [C++ `wxMouseEvent::LeftDown()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_mouse_event.html#af24cf14161da22d4d0d8bc80ffe33150).
    fn left_down(&self) -> bool {
        unsafe { ffi::wxMouseEvent_LeftDown(self.as_ptr()) }
    }
    /// Returns true if the left mouse button changed to up.
    ///
    /// See [C++ `wxMouseEvent::LeftUp()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_mouse_event.html#a47552c7cc416599eed216be1948da5c8).
    fn left_up(&self) -> bool {
        unsafe { ffi::wxMouseEvent_LeftUp(self.as_ptr()) }
    }
    /// Returns true if the event is a magnify (i.e. pinch to zoom) event.
    ///
    /// See [C++ `wxMouseEvent::Magnify()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_mouse_event.html#a661103e003b464a6af90fef888a4bcc1).
    fn magnify(&self) -> bool {
        unsafe { ffi::wxMouseEvent_Magnify(self.as_ptr()) }
    }
    /// Returns true if the Meta key was down at the time of the event.
    ///
    /// See [C++ `wxMouseEvent::MetaDown()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_mouse_event.html#afe6f69d3384ce92e42f4c57ea625303d).
    fn meta_down(&self) -> bool {
        unsafe { ffi::wxMouseEvent_MetaDown(self.as_ptr()) }
    }
    /// Returns true if the event was a middle double click.
    ///
    /// See [C++ `wxMouseEvent::MiddleDClick()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_mouse_event.html#a82a4878e915c35d2a71fe2d882c5e7fd).
    fn middle_d_click(&self) -> bool {
        unsafe { ffi::wxMouseEvent_MiddleDClick(self.as_ptr()) }
    }
    /// Returns true if the middle mouse button changed to down.
    ///
    /// See [C++ `wxMouseEvent::MiddleDown()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_mouse_event.html#a3e1baf28a5a73bf16d4a567fdb05fa25).
    fn middle_down(&self) -> bool {
        unsafe { ffi::wxMouseEvent_MiddleDown(self.as_ptr()) }
    }
    /// Returns true if the middle mouse button changed to up.
    ///
    /// See [C++ `wxMouseEvent::MiddleUp()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_mouse_event.html#a53904a7f504db15ad3978d270bee2ebf).
    fn middle_up(&self) -> bool {
        unsafe { ffi::wxMouseEvent_MiddleUp(self.as_ptr()) }
    }
    /// Returns true if this was a motion event and no mouse buttons were pressed.
    ///
    /// See [C++ `wxMouseEvent::Moving()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_mouse_event.html#a03707fb904deb70ab5cfe2e893046465).
    fn moving(&self) -> bool {
        unsafe { ffi::wxMouseEvent_Moving(self.as_ptr()) }
    }
    /// Returns true if the event was a right double click.
    ///
    /// See [C++ `wxMouseEvent::RightDClick()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_mouse_event.html#a3f47f47ce99e00138b8d4f31390192f9).
    fn right_d_click(&self) -> bool {
        unsafe { ffi::wxMouseEvent_RightDClick(self.as_ptr()) }
    }
    /// Returns true if the right mouse button changed to down.
    ///
    /// See [C++ `wxMouseEvent::RightDown()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_mouse_event.html#ae3da81deb2d240ad6a43b8b3255e00b9).
    fn right_down(&self) -> bool {
        unsafe { ffi::wxMouseEvent_RightDown(self.as_ptr()) }
    }
    /// Returns true if the right mouse button changed to up.
    ///
    /// See [C++ `wxMouseEvent::RightUp()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_mouse_event.html#a345a41200f4fb64724e54b2fd85e7770).
    fn right_up(&self) -> bool {
        unsafe { ffi::wxMouseEvent_RightUp(self.as_ptr()) }
    }
}

// wxMouseEventsManager
/// This trait represents [C++ `wxMouseEventsManager` class](https://docs.wxwidgets.org/3.2/classwx_mouse_events_manager.html)'s methods and inheritance.
///
/// See [`MouseEventsManagerIsOwned`] documentation for the class usage.
pub trait MouseEventsManagerMethods: EvtHandlerMethods {
    /// Finishes initialization of the object created using default constructor.
    ///
    /// See [C++ `wxMouseEventsManager::Create()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_mouse_events_manager.html#a8627443b743f13fb4a486ee9831f6f89).
    fn create<W: WindowMethods>(&self, win: Option<&W>) -> bool {
        unsafe {
            let win = match win {
                Some(r) => r.as_ptr(),
                None => ptr::null_mut(),
            };
            ffi::wxMouseEventsManager_Create(self.as_ptr(), win)
        }
    }
}

// wxMoveEvent
/// This trait represents [C++ `wxMoveEvent` class](https://docs.wxwidgets.org/3.2/classwx_move_event.html)'s methods and inheritance.
///
/// See [`MoveEventIsOwned`] documentation for the class usage.
pub trait MoveEventMethods: EventMethods {
    /// Returns the position of the window generating the move change event.
    ///
    /// See [C++ `wxMoveEvent::GetPosition()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_move_event.html#a4d49085d2cc9c758e8520048cdd33bee).
    fn get_position(&self) -> Point {
        unsafe { Point::from_ptr(ffi::wxMoveEvent_GetPosition(self.as_ptr())) }
    }
    ///
    /// See [C++ `wxMoveEvent::GetRect()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_move_event.html#ae759cbaaa2f269271bcc3ec2f27f15fb).
    fn get_rect(&self) -> Rect {
        unsafe { Rect::from_ptr(ffi::wxMoveEvent_GetRect(self.as_ptr())) }
    }
    ///
    /// See [C++ `wxMoveEvent::SetRect()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_move_event.html#a8a497be8943285a6cbc031b466dda914).
    fn set_rect<R: RectMethods>(&self, rect: &R) {
        unsafe {
            let rect = rect.as_ptr();
            ffi::wxMoveEvent_SetRect(self.as_ptr(), rect)
        }
    }
    ///
    /// See [C++ `wxMoveEvent::SetPosition()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_move_event.html#a4abd7f5e82edbc613cbddca16d54f4ce).
    fn set_position<P: PointMethods>(&self, pos: &P) {
        unsafe {
            let pos = pos.as_ptr();
            ffi::wxMoveEvent_SetPosition(self.as_ptr(), pos)
        }
    }
}