wxrust/generated/
class_t.rs

1use super::*;
2
3// wxTGAHandler
4wxwidgets! {
5    /// This is the image handler for the TGA format.
6    /// - [`TGAHandler`] represents a C++ `wxTGAHandler` class instance which your code has ownership, [`TGAHandlerIsOwned`]`<false>` represents one which don't own.
7    /// - Use [`TGAHandler`]'s `new()` or [`Buildable::builder()`] (if available) to create an instance of this class.
8    /// - See [C++ `wxTGAHandler` class's documentation](https://docs.wxwidgets.org/3.2/classwx_t_g_a_handler.html) for more details.
9    #[doc(alias = "wxTGAHandler")]
10    #[doc(alias = "TGAHandler")]
11    class TGAHandler
12        = TGAHandlerIsOwned<true>(wxTGAHandler) impl
13        TGAHandlerMethods,
14        ImageHandlerMethods,
15        ObjectMethods
16}
17impl<const OWNED: bool> TGAHandlerIsOwned<OWNED> {
18    /// Default constructor for wxTGAHandler.
19    ///
20    /// See [C++ `wxTGAHandler::wxTGAHandler()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_t_g_a_handler.html#a5258c1de737fd77d505c06a7f822000a).
21    pub fn new() -> TGAHandlerIsOwned<OWNED> {
22        unsafe { TGAHandlerIsOwned(ffi::wxTGAHandler_new()) }
23    }
24    pub fn none() -> Option<&'static Self> {
25        None
26    }
27}
28impl Clone for TGAHandlerIsOwned<false> {
29    fn clone(&self) -> Self {
30        Self(self.0)
31    }
32}
33impl<const OWNED: bool> From<TGAHandlerIsOwned<OWNED>> for ImageHandlerIsOwned<OWNED> {
34    fn from(o: TGAHandlerIsOwned<OWNED>) -> Self {
35        unsafe { Self::from_ptr(o.as_ptr()) }
36    }
37}
38impl<const OWNED: bool> From<TGAHandlerIsOwned<OWNED>> for ObjectIsOwned<OWNED> {
39    fn from(o: TGAHandlerIsOwned<OWNED>) -> Self {
40        unsafe { Self::from_ptr(o.as_ptr()) }
41    }
42}
43impl<const OWNED: bool> DynamicCast for TGAHandlerIsOwned<OWNED> {
44    fn class_info() -> ClassInfoIsOwned<false> {
45        unsafe { ClassInfoIsOwned::from_ptr(ffi::wxTGAHandler_CLASSINFO()) }
46    }
47}
48impl<const OWNED: bool> Drop for TGAHandlerIsOwned<OWNED> {
49    fn drop(&mut self) {
50        if OWNED {
51            unsafe { ffi::wxObject_delete(self.0) }
52        }
53    }
54}
55
56// wxTIFFHandler
57wxwidgets! {
58    /// This is the image handler for the TIFF format.
59    /// - [`TIFFHandler`] represents a C++ `wxTIFFHandler` class instance which your code has ownership, [`TIFFHandlerIsOwned`]`<false>` represents one which don't own.
60    /// - Use [`TIFFHandler`]'s `new()` or [`Buildable::builder()`] (if available) to create an instance of this class.
61    /// - See [C++ `wxTIFFHandler` class's documentation](https://docs.wxwidgets.org/3.2/classwx_t_i_f_f_handler.html) for more details.
62    #[doc(alias = "wxTIFFHandler")]
63    #[doc(alias = "TIFFHandler")]
64    class TIFFHandler
65        = TIFFHandlerIsOwned<true>(wxTIFFHandler) impl
66        TIFFHandlerMethods,
67        // ImageHandlerMethods,
68        ObjectMethods
69}
70impl<const OWNED: bool> TIFFHandlerIsOwned<OWNED> {
71    /// Default constructor for wxTIFFHandler.
72    ///
73    /// See [C++ `wxTIFFHandler::wxTIFFHandler()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_t_i_f_f_handler.html#a8ff101a3e846cdfaf3170d54805d05c8).
74    pub fn new() -> TIFFHandlerIsOwned<OWNED> {
75        unsafe { TIFFHandlerIsOwned(ffi::wxTIFFHandler_new()) }
76    }
77    pub fn none() -> Option<&'static Self> {
78        None
79    }
80}
81impl Clone for TIFFHandlerIsOwned<false> {
82    fn clone(&self) -> Self {
83        Self(self.0)
84    }
85}
86impl<const OWNED: bool> From<TIFFHandlerIsOwned<OWNED>> for ImageHandlerIsOwned<OWNED> {
87    fn from(o: TIFFHandlerIsOwned<OWNED>) -> Self {
88        unsafe { Self::from_ptr(o.as_ptr()) }
89    }
90}
91impl<const OWNED: bool> From<TIFFHandlerIsOwned<OWNED>> for ObjectIsOwned<OWNED> {
92    fn from(o: TIFFHandlerIsOwned<OWNED>) -> Self {
93        unsafe { Self::from_ptr(o.as_ptr()) }
94    }
95}
96impl<const OWNED: bool> DynamicCast for TIFFHandlerIsOwned<OWNED> {
97    fn class_info() -> ClassInfoIsOwned<false> {
98        unsafe { ClassInfoIsOwned::from_ptr(ffi::wxTIFFHandler_CLASSINFO()) }
99    }
100}
101impl<const OWNED: bool> Drop for TIFFHandlerIsOwned<OWNED> {
102    fn drop(&mut self) {
103        if OWNED {
104            unsafe { ffi::wxObject_delete(self.0) }
105        }
106    }
107}
108impl<const OWNED: bool> ImageHandlerMethods for TIFFHandlerIsOwned<OWNED> {
109    // NOT_SUPPORTED: fn GetLibraryVersionInfo()
110}
111
112// wxTaskBarIcon
113wxwidgets! {
114    /// This class represents a taskbar icon.
115    /// - [`TaskBarIcon`] represents a C++ `wxTaskBarIcon` class instance which your code has ownership, [`TaskBarIconIsOwned`]`<false>` represents one which don't own.
116    /// - Use [`TaskBarIcon`]'s `new()` or [`Buildable::builder()`] (if available) to create an instance of this class.
117    /// - See [C++ `wxTaskBarIcon` class's documentation](https://docs.wxwidgets.org/3.2/classwx_task_bar_icon.html) for more details.
118    #[doc(alias = "wxTaskBarIcon")]
119    #[doc(alias = "TaskBarIcon")]
120    class TaskBarIcon
121        = TaskBarIconIsOwned<true>(wxTaskBarIcon) impl
122        TaskBarIconMethods,
123        EvtHandlerMethods,
124        ObjectMethods
125}
126impl<const OWNED: bool> TaskBarIconIsOwned<OWNED> {
127    // NOT_SUPPORTED: fn wxTaskBarIcon()
128    pub fn none() -> Option<&'static Self> {
129        None
130    }
131}
132impl<const OWNED: bool> Clone for TaskBarIconIsOwned<OWNED> {
133    fn clone(&self) -> Self {
134        Self(self.0)
135    }
136}
137impl<const OWNED: bool> From<TaskBarIconIsOwned<OWNED>> for EvtHandlerIsOwned<OWNED> {
138    fn from(o: TaskBarIconIsOwned<OWNED>) -> Self {
139        unsafe { Self::from_ptr(o.as_ptr()) }
140    }
141}
142impl<const OWNED: bool> From<TaskBarIconIsOwned<OWNED>> for ObjectIsOwned<OWNED> {
143    fn from(o: TaskBarIconIsOwned<OWNED>) -> Self {
144        unsafe { Self::from_ptr(o.as_ptr()) }
145    }
146}
147impl<const OWNED: bool> DynamicCast for TaskBarIconIsOwned<OWNED> {
148    fn class_info() -> ClassInfoIsOwned<false> {
149        unsafe { ClassInfoIsOwned::from_ptr(ffi::wxTaskBarIcon_CLASSINFO()) }
150    }
151}
152
153// wxTaskBarIconEvent
154wxwidgets! {
155    /// The event class used by wxTaskBarIcon.
156    /// - [`TaskBarIconEvent`] represents a C++ `wxTaskBarIconEvent` class instance which your code has ownership, [`TaskBarIconEventIsOwned`]`<false>` represents one which don't own.
157    /// - Use [`TaskBarIconEvent`]'s `new()` or [`Buildable::builder()`] (if available) to create an instance of this class.
158    /// - See [C++ `wxTaskBarIconEvent` class's documentation](https://docs.wxwidgets.org/3.2/classwx_task_bar_icon_event.html) for more details.
159    #[doc(alias = "wxTaskBarIconEvent")]
160    #[doc(alias = "TaskBarIconEvent")]
161    class TaskBarIconEvent
162        = TaskBarIconEventIsOwned<true>(wxTaskBarIconEvent) impl
163        TaskBarIconEventMethods,
164        EventMethods,
165        ObjectMethods
166}
167impl<const OWNED: bool> TaskBarIconEventIsOwned<OWNED> {
168    // NOT_SUPPORTED: fn wxTaskBarIconEvent()
169    pub fn none() -> Option<&'static Self> {
170        None
171    }
172}
173impl Clone for TaskBarIconEventIsOwned<false> {
174    fn clone(&self) -> Self {
175        Self(self.0)
176    }
177}
178impl<const OWNED: bool> From<TaskBarIconEventIsOwned<OWNED>> for EventIsOwned<OWNED> {
179    fn from(o: TaskBarIconEventIsOwned<OWNED>) -> Self {
180        unsafe { Self::from_ptr(o.as_ptr()) }
181    }
182}
183impl<const OWNED: bool> From<TaskBarIconEventIsOwned<OWNED>> for ObjectIsOwned<OWNED> {
184    fn from(o: TaskBarIconEventIsOwned<OWNED>) -> Self {
185        unsafe { Self::from_ptr(o.as_ptr()) }
186    }
187}
188impl<const OWNED: bool> DynamicCast for TaskBarIconEventIsOwned<OWNED> {
189    fn class_info() -> ClassInfoIsOwned<false> {
190        unsafe { ClassInfoIsOwned::from_ptr(ffi::wxTaskBarIconEvent_CLASSINFO()) }
191    }
192}
193impl<const OWNED: bool> Drop for TaskBarIconEventIsOwned<OWNED> {
194    fn drop(&mut self) {
195        if OWNED {
196            unsafe { ffi::wxObject_delete(self.0) }
197        }
198    }
199}
200
201// wxTextAttr
202wxwidgets! {
203    /// wxTextAttr represents the character and paragraph attributes, or style, for a range of text in a wxTextCtrl or wxRichTextCtrl.
204    /// - [`TextAttr`] represents a C++ `wxTextAttr` class instance which your code has ownership, [`TextAttrIsOwned`]`<false>` represents one which don't own.
205    /// - Use [`TextAttr`]'s `new()` or [`Buildable::builder()`] (if available) to create an instance of this class.
206    /// - See [C++ `wxTextAttr` class's documentation](https://docs.wxwidgets.org/3.2/classwx_text_attr.html) for more details.
207    #[doc(alias = "wxTextAttr")]
208    #[doc(alias = "TextAttr")]
209    class TextAttr
210        = TextAttrIsOwned<true>(wxTextAttr) impl
211        TextAttrMethods
212}
213impl<const OWNED: bool> TextAttrIsOwned<OWNED> {
214    /// Constructors.
215    ///
216    /// See [C++ `wxTextAttr::wxTextAttr()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_text_attr.html#a7870ad57a4430b83a9478adeda20c6ec).
217    pub fn new() -> TextAttrIsOwned<OWNED> {
218        unsafe { TextAttrIsOwned(ffi::wxTextAttr_new()) }
219    }
220    // NOT_SUPPORTED: fn wxTextAttr1()
221    ///
222    /// See [C++ `wxTextAttr::wxTextAttr()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_text_attr.html#a56e913249eb032aa4184f26ebdbca454).
223    pub fn new_with_textattr<T: TextAttrMethods>(attr: &T) -> TextAttrIsOwned<OWNED> {
224        unsafe {
225            let attr = attr.as_ptr();
226            TextAttrIsOwned(ffi::wxTextAttr_new2(attr))
227        }
228    }
229    pub fn none() -> Option<&'static Self> {
230        None
231    }
232}
233impl Clone for TextAttrIsOwned<false> {
234    fn clone(&self) -> Self {
235        Self(self.0)
236    }
237}
238impl<const OWNED: bool> Drop for TextAttrIsOwned<OWNED> {
239    fn drop(&mut self) {
240        if OWNED {
241            unsafe { ffi::wxTextAttr_delete(self.0) }
242        }
243    }
244}
245
246// wxTextCtrl
247wxwidgets! {
248    /// A text control allows text to be displayed and edited.
249    /// - [`TextCtrl`] represents a C++ `wxTextCtrl` class instance which your code has ownership, [`TextCtrlIsOwned`]`<false>` represents one which don't own.
250    /// - Use [`TextCtrl`]'s `new()` or [`Buildable::builder()`] (if available) to create an instance of this class.
251    /// - See [C++ `wxTextCtrl` class's documentation](https://docs.wxwidgets.org/3.2/classwx_text_ctrl.html) for more details.
252    #[doc(alias = "wxTextCtrl")]
253    #[doc(alias = "TextCtrl")]
254    class TextCtrl
255        = TextCtrlIsOwned<true>(wxTextCtrl) impl
256        TextCtrlMethods,
257        ControlMethods,
258        WindowMethods,
259        EvtHandlerMethods,
260        ObjectMethods
261}
262impl<const OWNED: bool> TextCtrlIsOwned<OWNED> {
263    /// Default ctor.
264    ///
265    /// See [C++ `wxTextCtrl::wxTextCtrl()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_text_ctrl.html#a4d01be66f9a9e95501aa55d54f94d54f).
266    pub fn new_2step() -> TextCtrlIsOwned<OWNED> {
267        unsafe { TextCtrlIsOwned(ffi::wxTextCtrl_new()) }
268    }
269    /// Constructor, creating and showing a text control.
270    ///
271    /// See [C++ `wxTextCtrl::wxTextCtrl()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_text_ctrl.html#a4f398e4800a904fdf225fabc366d7910).
272    pub fn new<W: WindowMethods, P: PointMethods, S: SizeMethods, V: ValidatorMethods>(
273        parent: Option<&W>,
274        id: c_int,
275        value: &str,
276        pos: &P,
277        size: &S,
278        style: c_long,
279        validator: &V,
280        name: &str,
281    ) -> TextCtrlIsOwned<OWNED> {
282        unsafe {
283            let parent = match parent {
284                Some(r) => r.as_ptr(),
285                None => ptr::null_mut(),
286            };
287            let value = WxString::from(value);
288            let value = value.as_ptr();
289            let pos = pos.as_ptr();
290            let size = size.as_ptr();
291            let validator = validator.as_ptr();
292            let name = WxString::from(name);
293            let name = name.as_ptr();
294            TextCtrlIsOwned(ffi::wxTextCtrl_new1(
295                parent, id, value, pos, size, style, validator, name,
296            ))
297        }
298    }
299    pub fn none() -> Option<&'static Self> {
300        None
301    }
302}
303impl<const OWNED: bool> Clone for TextCtrlIsOwned<OWNED> {
304    fn clone(&self) -> Self {
305        Self(self.0)
306    }
307}
308impl<const OWNED: bool> From<TextCtrlIsOwned<OWNED>> for ControlIsOwned<OWNED> {
309    fn from(o: TextCtrlIsOwned<OWNED>) -> Self {
310        unsafe { Self::from_ptr(o.as_ptr()) }
311    }
312}
313impl<const OWNED: bool> From<TextCtrlIsOwned<OWNED>> for WindowIsOwned<OWNED> {
314    fn from(o: TextCtrlIsOwned<OWNED>) -> Self {
315        unsafe { Self::from_ptr(o.as_ptr()) }
316    }
317}
318impl<const OWNED: bool> From<TextCtrlIsOwned<OWNED>> for EvtHandlerIsOwned<OWNED> {
319    fn from(o: TextCtrlIsOwned<OWNED>) -> Self {
320        unsafe { Self::from_ptr(o.as_ptr()) }
321    }
322}
323impl<const OWNED: bool> From<TextCtrlIsOwned<OWNED>> for ObjectIsOwned<OWNED> {
324    fn from(o: TextCtrlIsOwned<OWNED>) -> Self {
325        unsafe { Self::from_ptr(o.as_ptr()) }
326    }
327}
328impl<const OWNED: bool> DynamicCast for TextCtrlIsOwned<OWNED> {
329    fn class_info() -> ClassInfoIsOwned<false> {
330        unsafe { ClassInfoIsOwned::from_ptr(ffi::wxTextCtrl_CLASSINFO()) }
331    }
332}
333// Mix-in(s) to wxTextCtrl
334impl<const OWNED: bool> TextEntryMethods for TextCtrlIsOwned<OWNED> {
335    fn as_text_entry(&self) -> *mut c_void {
336        unsafe { ffi::wxTextCtrl_AsTextEntry(self.as_ptr()) }
337    }
338}
339
340// wxTextDataObject
341wxwidgets! {
342    /// wxTextDataObject is a specialization of wxDataObjectSimple for text data.
343    /// - [`TextDataObject`] represents a C++ `wxTextDataObject` class instance which your code has ownership, [`TextDataObjectIsOwned`]`<false>` represents one which don't own.
344    /// - Use [`TextDataObject`]'s `new()` or [`Buildable::builder()`] (if available) to create an instance of this class.
345    /// - See [C++ `wxTextDataObject` class's documentation](https://docs.wxwidgets.org/3.2/classwx_text_data_object.html) for more details.
346    #[doc(alias = "wxTextDataObject")]
347    #[doc(alias = "TextDataObject")]
348    class TextDataObject
349        = TextDataObjectIsOwned<true>(wxTextDataObject) impl
350        TextDataObjectMethods,
351        // DataObjectSimpleMethods,
352        DataObjectMethods
353}
354impl<const OWNED: bool> TextDataObjectIsOwned<OWNED> {
355    /// Constructor, may be used to initialise the text (otherwise SetText() should be used later).
356    ///
357    /// See [C++ `wxTextDataObject::wxTextDataObject()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_text_data_object.html#a1d1c7457cb2b89f2df0a11129344c078).
358    pub fn new(text: &str) -> TextDataObjectIsOwned<OWNED> {
359        unsafe {
360            let text = WxString::from(text);
361            let text = text.as_ptr();
362            TextDataObjectIsOwned(ffi::wxTextDataObject_new(text))
363        }
364    }
365    pub fn none() -> Option<&'static Self> {
366        None
367    }
368}
369impl Clone for TextDataObjectIsOwned<false> {
370    fn clone(&self) -> Self {
371        Self(self.0)
372    }
373}
374impl<const OWNED: bool> From<TextDataObjectIsOwned<OWNED>> for DataObjectSimpleIsOwned<OWNED> {
375    fn from(o: TextDataObjectIsOwned<OWNED>) -> Self {
376        unsafe { Self::from_ptr(o.as_ptr()) }
377    }
378}
379impl<const OWNED: bool> From<TextDataObjectIsOwned<OWNED>> for DataObjectIsOwned<OWNED> {
380    fn from(o: TextDataObjectIsOwned<OWNED>) -> Self {
381        unsafe { Self::from_ptr(o.as_ptr()) }
382    }
383}
384impl<const OWNED: bool> Drop for TextDataObjectIsOwned<OWNED> {
385    fn drop(&mut self) {
386        if OWNED {
387            unsafe { ffi::wxTextDataObject_delete(self.0) }
388        }
389    }
390}
391impl<const OWNED: bool> DataObjectSimpleMethods for TextDataObjectIsOwned<OWNED> {
392    // BLOCKED: fn GetFormat()
393}
394
395// wxTextDropTarget
396wxwidgets! {
397    /// A predefined drop target for dealing with text data.
398    /// - [`TextDropTarget`] represents a C++ `wxTextDropTarget` class instance which your code has ownership, [`TextDropTargetIsOwned`]`<false>` represents one which don't own.
399    /// - Use [`TextDropTarget`]'s `new()` or [`Buildable::builder()`] (if available) to create an instance of this class.
400    /// - See [C++ `wxTextDropTarget` class's documentation](https://docs.wxwidgets.org/3.2/classwx_text_drop_target.html) for more details.
401    #[doc(alias = "wxTextDropTarget")]
402    #[doc(alias = "TextDropTarget")]
403    class TextDropTarget
404        = TextDropTargetIsOwned<true>(wxTextDropTarget) impl
405        TextDropTargetMethods,
406        DropTargetMethods
407}
408impl<const OWNED: bool> TextDropTargetIsOwned<OWNED> {
409    // BLOCKED: fn wxTextDropTarget()
410    pub fn none() -> Option<&'static Self> {
411        None
412    }
413}
414impl Clone for TextDropTargetIsOwned<false> {
415    fn clone(&self) -> Self {
416        Self(self.0)
417    }
418}
419impl<const OWNED: bool> From<TextDropTargetIsOwned<OWNED>> for DropTargetIsOwned<OWNED> {
420    fn from(o: TextDropTargetIsOwned<OWNED>) -> Self {
421        unsafe { Self::from_ptr(o.as_ptr()) }
422    }
423}
424impl<const OWNED: bool> Drop for TextDropTargetIsOwned<OWNED> {
425    fn drop(&mut self) {
426        if OWNED {
427            unsafe { ffi::wxTextDropTarget_delete(self.0) }
428        }
429    }
430}
431
432// wxTextEntry
433wxwidgets! {
434    /// Common base class for single line text entry fields.
435    /// - [`TextEntry`] represents a C++ `wxTextEntry` class instance which your code has ownership, [`TextEntryIsOwned`]`<false>` represents one which don't own.
436    /// - Use [`TextEntry`]'s `new()` or [`Buildable::builder()`] (if available) to create an instance of this class.
437    /// - See [C++ `wxTextEntry` class's documentation](https://docs.wxwidgets.org/3.2/classwx_text_entry.html) for more details.
438    #[doc(alias = "wxTextEntry")]
439    #[doc(alias = "TextEntry")]
440    class TextEntry
441        = TextEntryIsOwned<true>(wxTextEntry) impl
442        TextEntryMethods
443}
444impl<const OWNED: bool> TextEntryIsOwned<OWNED> {
445    pub fn none() -> Option<&'static Self> {
446        None
447    }
448}
449impl Clone for TextEntryIsOwned<false> {
450    fn clone(&self) -> Self {
451        Self(self.0)
452    }
453}
454impl<const OWNED: bool> Drop for TextEntryIsOwned<OWNED> {
455    fn drop(&mut self) {
456        if OWNED {
457            unsafe { ffi::wxTextEntry_delete(self.0) }
458        }
459    }
460}
461
462// wxTextEntryDialog
463wxwidgets! {
464    /// This class represents a dialog that requests a one-line text string from the user.
465    /// - [`TextEntryDialog`] represents a C++ `wxTextEntryDialog` class instance which your code has ownership, [`TextEntryDialogIsOwned`]`<false>` represents one which don't own.
466    /// - Use [`TextEntryDialog`]'s `new()` or [`Buildable::builder()`] (if available) to create an instance of this class.
467    /// - See [C++ `wxTextEntryDialog` class's documentation](https://docs.wxwidgets.org/3.2/classwx_text_entry_dialog.html) for more details.
468    #[doc(alias = "wxTextEntryDialog")]
469    #[doc(alias = "TextEntryDialog")]
470    class TextEntryDialog
471        = TextEntryDialogIsOwned<true>(wxTextEntryDialog) impl
472        TextEntryDialogMethods,
473        DialogMethods,
474        TopLevelWindowMethods,
475        NonOwnedWindowMethods,
476        WindowMethods,
477        EvtHandlerMethods,
478        ObjectMethods
479}
480impl<const OWNED: bool> TextEntryDialogIsOwned<OWNED> {
481    /// Default constructor.
482    ///
483    /// See [C++ `wxTextEntryDialog::wxTextEntryDialog()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_text_entry_dialog.html#ac6f3a153bafcc98078217e0201e6b834).
484    pub fn new_2step() -> TextEntryDialogIsOwned<OWNED> {
485        unsafe { TextEntryDialogIsOwned(ffi::wxTextEntryDialog_new()) }
486    }
487    /// Constructor.
488    ///
489    /// See [C++ `wxTextEntryDialog::wxTextEntryDialog()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_text_entry_dialog.html#ae8c8bf35b7fa14e4a0b6203d38d4dc3d).
490    pub fn new<W: WindowMethods, P: PointMethods>(
491        parent: Option<&W>,
492        message: &str,
493        caption: &str,
494        value: &str,
495        style: c_long,
496        pos: &P,
497    ) -> TextEntryDialogIsOwned<OWNED> {
498        unsafe {
499            let parent = match parent {
500                Some(r) => r.as_ptr(),
501                None => ptr::null_mut(),
502            };
503            let message = WxString::from(message);
504            let message = message.as_ptr();
505            let caption = WxString::from(caption);
506            let caption = caption.as_ptr();
507            let value = WxString::from(value);
508            let value = value.as_ptr();
509            let pos = pos.as_ptr();
510            TextEntryDialogIsOwned(ffi::wxTextEntryDialog_new1(
511                parent, message, caption, value, style, pos,
512            ))
513        }
514    }
515    pub fn none() -> Option<&'static Self> {
516        None
517    }
518}
519impl<const OWNED: bool> Clone for TextEntryDialogIsOwned<OWNED> {
520    fn clone(&self) -> Self {
521        Self(self.0)
522    }
523}
524impl<const OWNED: bool> From<TextEntryDialogIsOwned<OWNED>> for DialogIsOwned<OWNED> {
525    fn from(o: TextEntryDialogIsOwned<OWNED>) -> Self {
526        unsafe { Self::from_ptr(o.as_ptr()) }
527    }
528}
529impl<const OWNED: bool> From<TextEntryDialogIsOwned<OWNED>> for TopLevelWindowIsOwned<OWNED> {
530    fn from(o: TextEntryDialogIsOwned<OWNED>) -> Self {
531        unsafe { Self::from_ptr(o.as_ptr()) }
532    }
533}
534impl<const OWNED: bool> From<TextEntryDialogIsOwned<OWNED>> for NonOwnedWindowIsOwned<OWNED> {
535    fn from(o: TextEntryDialogIsOwned<OWNED>) -> Self {
536        unsafe { Self::from_ptr(o.as_ptr()) }
537    }
538}
539impl<const OWNED: bool> From<TextEntryDialogIsOwned<OWNED>> for WindowIsOwned<OWNED> {
540    fn from(o: TextEntryDialogIsOwned<OWNED>) -> Self {
541        unsafe { Self::from_ptr(o.as_ptr()) }
542    }
543}
544impl<const OWNED: bool> From<TextEntryDialogIsOwned<OWNED>> for EvtHandlerIsOwned<OWNED> {
545    fn from(o: TextEntryDialogIsOwned<OWNED>) -> Self {
546        unsafe { Self::from_ptr(o.as_ptr()) }
547    }
548}
549impl<const OWNED: bool> From<TextEntryDialogIsOwned<OWNED>> for ObjectIsOwned<OWNED> {
550    fn from(o: TextEntryDialogIsOwned<OWNED>) -> Self {
551        unsafe { Self::from_ptr(o.as_ptr()) }
552    }
553}
554impl<const OWNED: bool> DynamicCast for TextEntryDialogIsOwned<OWNED> {
555    fn class_info() -> ClassInfoIsOwned<false> {
556        unsafe { ClassInfoIsOwned::from_ptr(ffi::wxTextEntryDialog_CLASSINFO()) }
557    }
558}
559
560// wxTextValidator
561wxwidgets! {
562    /// wxTextValidator validates text controls, providing a variety of filtering behaviours.
563    /// - [`TextValidator`] represents a C++ `wxTextValidator` class instance which your code has ownership, [`TextValidatorIsOwned`]`<false>` represents one which don't own.
564    /// - Use [`TextValidator`]'s `new()` or [`Buildable::builder()`] (if available) to create an instance of this class.
565    /// - See [C++ `wxTextValidator` class's documentation](https://docs.wxwidgets.org/3.2/classwx_text_validator.html) for more details.
566    #[doc(alias = "wxTextValidator")]
567    #[doc(alias = "TextValidator")]
568    class TextValidator
569        = TextValidatorIsOwned<true>(wxTextValidator) impl
570        TextValidatorMethods,
571        ValidatorMethods,
572        EvtHandlerMethods,
573        ObjectMethods
574}
575impl<const OWNED: bool> TextValidatorIsOwned<OWNED> {
576    /// Copy constructor.
577    ///
578    /// See [C++ `wxTextValidator::wxTextValidator()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_text_validator.html#a383375eef8f5897386b0cbc8d5eccfe5).
579    pub fn new_with_textvalidator<T: TextValidatorMethods>(
580        validator: &T,
581    ) -> TextValidatorIsOwned<OWNED> {
582        unsafe {
583            let validator = validator.as_ptr();
584            TextValidatorIsOwned(ffi::wxTextValidator_new(validator))
585        }
586    }
587    /// Constructor taking a style and optional pointer to a wxString variable.
588    ///
589    /// See [C++ `wxTextValidator::wxTextValidator()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_text_validator.html#aae2135bd984152d4f5d006b012b83992).
590    pub fn new_with_long(style: c_long, val_ptr: *mut c_void) -> TextValidatorIsOwned<OWNED> {
591        unsafe { TextValidatorIsOwned(ffi::wxTextValidator_new1(style, val_ptr)) }
592    }
593    pub fn none() -> Option<&'static Self> {
594        None
595    }
596}
597impl<const OWNED: bool> Clone for TextValidatorIsOwned<OWNED> {
598    fn clone(&self) -> Self {
599        Self(self.0)
600    }
601}
602impl<const OWNED: bool> From<TextValidatorIsOwned<OWNED>> for ValidatorIsOwned<OWNED> {
603    fn from(o: TextValidatorIsOwned<OWNED>) -> Self {
604        unsafe { Self::from_ptr(o.as_ptr()) }
605    }
606}
607impl<const OWNED: bool> From<TextValidatorIsOwned<OWNED>> for EvtHandlerIsOwned<OWNED> {
608    fn from(o: TextValidatorIsOwned<OWNED>) -> Self {
609        unsafe { Self::from_ptr(o.as_ptr()) }
610    }
611}
612impl<const OWNED: bool> From<TextValidatorIsOwned<OWNED>> for ObjectIsOwned<OWNED> {
613    fn from(o: TextValidatorIsOwned<OWNED>) -> Self {
614        unsafe { Self::from_ptr(o.as_ptr()) }
615    }
616}
617impl<const OWNED: bool> DynamicCast for TextValidatorIsOwned<OWNED> {
618    fn class_info() -> ClassInfoIsOwned<false> {
619        unsafe { ClassInfoIsOwned::from_ptr(ffi::wxTextValidator_CLASSINFO()) }
620    }
621}
622
623// wxThreadEvent
624wxwidgets! {
625    /// This class adds some simple functionality to wxEvent to facilitate inter-thread communication.
626    /// - [`ThreadEvent`] represents a C++ `wxThreadEvent` class instance which your code has ownership, [`ThreadEventIsOwned`]`<false>` represents one which don't own.
627    /// - Use [`ThreadEvent`]'s `new()` or [`Buildable::builder()`] (if available) to create an instance of this class.
628    /// - See [C++ `wxThreadEvent` class's documentation](https://docs.wxwidgets.org/3.2/classwx_thread_event.html) for more details.
629    #[doc(alias = "wxThreadEvent")]
630    #[doc(alias = "ThreadEvent")]
631    class ThreadEvent
632        = ThreadEventIsOwned<true>(wxThreadEvent) impl
633        ThreadEventMethods,
634        EventMethods,
635        ObjectMethods
636}
637impl<const OWNED: bool> ThreadEventIsOwned<OWNED> {
638    // NOT_SUPPORTED: fn wxThreadEvent()
639    pub fn none() -> Option<&'static Self> {
640        None
641    }
642}
643impl Clone for ThreadEventIsOwned<false> {
644    fn clone(&self) -> Self {
645        Self(self.0)
646    }
647}
648impl<const OWNED: bool> From<ThreadEventIsOwned<OWNED>> for EventIsOwned<OWNED> {
649    fn from(o: ThreadEventIsOwned<OWNED>) -> Self {
650        unsafe { Self::from_ptr(o.as_ptr()) }
651    }
652}
653impl<const OWNED: bool> From<ThreadEventIsOwned<OWNED>> for ObjectIsOwned<OWNED> {
654    fn from(o: ThreadEventIsOwned<OWNED>) -> Self {
655        unsafe { Self::from_ptr(o.as_ptr()) }
656    }
657}
658impl<const OWNED: bool> DynamicCast for ThreadEventIsOwned<OWNED> {
659    fn class_info() -> ClassInfoIsOwned<false> {
660        unsafe { ClassInfoIsOwned::from_ptr(ffi::wxThreadEvent_CLASSINFO()) }
661    }
662}
663impl<const OWNED: bool> Drop for ThreadEventIsOwned<OWNED> {
664    fn drop(&mut self) {
665        if OWNED {
666            unsafe { ffi::wxObject_delete(self.0) }
667        }
668    }
669}
670
671// wxTimePickerCtrl
672wxwidgets! {
673    /// This control allows the user to enter time.
674    /// - [`TimePickerCtrl`] represents a C++ `wxTimePickerCtrl` class instance which your code has ownership, [`TimePickerCtrlIsOwned`]`<false>` represents one which don't own.
675    /// - Use [`TimePickerCtrl`]'s `new()` or [`Buildable::builder()`] (if available) to create an instance of this class.
676    /// - See [C++ `wxTimePickerCtrl` class's documentation](https://docs.wxwidgets.org/3.2/classwx_time_picker_ctrl.html) for more details.
677    #[doc(alias = "wxTimePickerCtrl")]
678    #[doc(alias = "TimePickerCtrl")]
679    class TimePickerCtrl
680        = TimePickerCtrlIsOwned<true>(wxTimePickerCtrl) impl
681        TimePickerCtrlMethods,
682        ControlMethods,
683        WindowMethods,
684        EvtHandlerMethods,
685        ObjectMethods
686}
687impl<const OWNED: bool> TimePickerCtrlIsOwned<OWNED> {
688    /// Default constructor.
689    ///
690    /// See [C++ `wxTimePickerCtrl::wxTimePickerCtrl()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_time_picker_ctrl.html#a500865526b4290d8ffb1c588b146712a).
691    pub fn new_2step() -> TimePickerCtrlIsOwned<OWNED> {
692        unsafe { TimePickerCtrlIsOwned(ffi::wxTimePickerCtrl_new()) }
693    }
694    /// Initializes the object and calls Create() with all the parameters.
695    ///
696    /// See [C++ `wxTimePickerCtrl::wxTimePickerCtrl()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_time_picker_ctrl.html#adb47aa561d4fd65849d85ac08139806e).
697    pub fn new<
698        W: WindowMethods,
699        D: DateTimeMethods,
700        P: PointMethods,
701        S: SizeMethods,
702        V: ValidatorMethods,
703    >(
704        parent: Option<&W>,
705        id: c_int,
706        dt: &D,
707        pos: &P,
708        size: &S,
709        style: c_long,
710        validator: &V,
711        name: &str,
712    ) -> TimePickerCtrlIsOwned<OWNED> {
713        unsafe {
714            let parent = match parent {
715                Some(r) => r.as_ptr(),
716                None => ptr::null_mut(),
717            };
718            let dt = dt.as_ptr();
719            let pos = pos.as_ptr();
720            let size = size.as_ptr();
721            let validator = validator.as_ptr();
722            let name = WxString::from(name);
723            let name = name.as_ptr();
724            TimePickerCtrlIsOwned(ffi::wxTimePickerCtrl_new1(
725                parent, id, dt, pos, size, style, validator, name,
726            ))
727        }
728    }
729    pub fn none() -> Option<&'static Self> {
730        None
731    }
732}
733impl<const OWNED: bool> Clone for TimePickerCtrlIsOwned<OWNED> {
734    fn clone(&self) -> Self {
735        Self(self.0)
736    }
737}
738impl<const OWNED: bool> From<TimePickerCtrlIsOwned<OWNED>> for ControlIsOwned<OWNED> {
739    fn from(o: TimePickerCtrlIsOwned<OWNED>) -> Self {
740        unsafe { Self::from_ptr(o.as_ptr()) }
741    }
742}
743impl<const OWNED: bool> From<TimePickerCtrlIsOwned<OWNED>> for WindowIsOwned<OWNED> {
744    fn from(o: TimePickerCtrlIsOwned<OWNED>) -> Self {
745        unsafe { Self::from_ptr(o.as_ptr()) }
746    }
747}
748impl<const OWNED: bool> From<TimePickerCtrlIsOwned<OWNED>> for EvtHandlerIsOwned<OWNED> {
749    fn from(o: TimePickerCtrlIsOwned<OWNED>) -> Self {
750        unsafe { Self::from_ptr(o.as_ptr()) }
751    }
752}
753impl<const OWNED: bool> From<TimePickerCtrlIsOwned<OWNED>> for ObjectIsOwned<OWNED> {
754    fn from(o: TimePickerCtrlIsOwned<OWNED>) -> Self {
755        unsafe { Self::from_ptr(o.as_ptr()) }
756    }
757}
758impl<const OWNED: bool> DynamicCast for TimePickerCtrlIsOwned<OWNED> {
759    fn class_info() -> ClassInfoIsOwned<false> {
760        unsafe { ClassInfoIsOwned::from_ptr(ffi::wxTimePickerCtrl_CLASSINFO()) }
761    }
762}
763
764// wxTipProvider
765wxwidgets! {
766    /// This is the class used together with wxShowTip() function.
767    /// - [`TipProvider`] represents a C++ `wxTipProvider` class instance which your code has ownership, [`TipProviderIsOwned`]`<false>` represents one which don't own.
768    /// - Use [`TipProvider`]'s `new()` or [`Buildable::builder()`] (if available) to create an instance of this class.
769    /// - See [C++ `wxTipProvider` class's documentation](https://docs.wxwidgets.org/3.2/classwx_tip_provider.html) for more details.
770    #[doc(alias = "wxTipProvider")]
771    #[doc(alias = "TipProvider")]
772    class TipProvider
773        = TipProviderIsOwned<true>(wxTipProvider) impl
774        TipProviderMethods
775}
776impl<const OWNED: bool> TipProviderIsOwned<OWNED> {
777    // BLOCKED: fn wxTipProvider()
778    pub fn none() -> Option<&'static Self> {
779        None
780    }
781}
782impl Clone for TipProviderIsOwned<false> {
783    fn clone(&self) -> Self {
784        Self(self.0)
785    }
786}
787impl<const OWNED: bool> Drop for TipProviderIsOwned<OWNED> {
788    fn drop(&mut self) {
789        if OWNED {
790            unsafe { ffi::wxTipProvider_delete(self.0) }
791        }
792    }
793}
794
795// wxTipWindow
796wxwidgets! {
797    /// Shows simple text in a popup tip window on creation.
798    /// - [`TipWindow`] represents a C++ `wxTipWindow` class instance which your code has ownership, [`TipWindowIsOwned`]`<false>` represents one which don't own.
799    /// - Use [`TipWindow`]'s `new()` or [`Buildable::builder()`] (if available) to create an instance of this class.
800    /// - See [C++ `wxTipWindow` class's documentation](https://docs.wxwidgets.org/3.2/classwx_tip_window.html) for more details.
801    #[doc(alias = "wxTipWindow")]
802    #[doc(alias = "TipWindow")]
803    class TipWindow
804        = TipWindowIsOwned<true>(wxTipWindow) impl
805        TipWindowMethods,
806        WindowMethods,
807        EvtHandlerMethods,
808        ObjectMethods
809}
810impl<const OWNED: bool> TipWindowIsOwned<OWNED> {
811    /// Constructor.
812    ///
813    /// See [C++ `wxTipWindow::wxTipWindow()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_tip_window.html#a080acf702dedf627f278050b90a9e292).
814    pub fn new<W: WindowMethods, T: TipWindowMethods, R: RectMethods>(
815        parent: Option<&W>,
816        text: &str,
817        max_length: c_int,
818        window_ptr: Option<&T>,
819        rect_bounds: Option<&R>,
820    ) -> TipWindowIsOwned<OWNED> {
821        unsafe {
822            let parent = match parent {
823                Some(r) => r.as_ptr(),
824                None => ptr::null_mut(),
825            };
826            let text = WxString::from(text);
827            let text = text.as_ptr();
828            let window_ptr = match window_ptr {
829                Some(r) => r.as_ptr(),
830                None => ptr::null_mut(),
831            };
832            let rect_bounds = match rect_bounds {
833                Some(r) => r.as_ptr(),
834                None => ptr::null_mut(),
835            };
836            TipWindowIsOwned(ffi::wxTipWindow_new(
837                parent,
838                text,
839                max_length,
840                window_ptr,
841                rect_bounds,
842            ))
843        }
844    }
845    pub fn none() -> Option<&'static Self> {
846        None
847    }
848}
849impl<const OWNED: bool> Clone for TipWindowIsOwned<OWNED> {
850    fn clone(&self) -> Self {
851        Self(self.0)
852    }
853}
854impl<const OWNED: bool> From<TipWindowIsOwned<OWNED>> for WindowIsOwned<OWNED> {
855    fn from(o: TipWindowIsOwned<OWNED>) -> Self {
856        unsafe { Self::from_ptr(o.as_ptr()) }
857    }
858}
859impl<const OWNED: bool> From<TipWindowIsOwned<OWNED>> for EvtHandlerIsOwned<OWNED> {
860    fn from(o: TipWindowIsOwned<OWNED>) -> Self {
861        unsafe { Self::from_ptr(o.as_ptr()) }
862    }
863}
864impl<const OWNED: bool> From<TipWindowIsOwned<OWNED>> for ObjectIsOwned<OWNED> {
865    fn from(o: TipWindowIsOwned<OWNED>) -> Self {
866        unsafe { Self::from_ptr(o.as_ptr()) }
867    }
868}
869impl<const OWNED: bool> DynamicCast for TipWindowIsOwned<OWNED> {
870    fn class_info() -> ClassInfoIsOwned<false> {
871        unsafe { ClassInfoIsOwned::from_ptr(ffi::wxTipWindow_CLASSINFO()) }
872    }
873}
874
875// wxToggleButton
876wxwidgets! {
877    /// wxToggleButton is a button that stays pressed when clicked by the user.
878    /// - [`ToggleButton`] represents a C++ `wxToggleButton` class instance which your code has ownership, [`ToggleButtonIsOwned`]`<false>` represents one which don't own.
879    /// - Use [`ToggleButton`]'s `new()` or [`Buildable::builder()`] (if available) to create an instance of this class.
880    /// - See [C++ `wxToggleButton` class's documentation](https://docs.wxwidgets.org/3.2/classwx_toggle_button.html) for more details.
881    #[doc(alias = "wxToggleButton")]
882    #[doc(alias = "ToggleButton")]
883    class ToggleButton
884        = ToggleButtonIsOwned<true>(wxToggleButton) impl
885        ToggleButtonMethods,
886        AnyButtonMethods,
887        ControlMethods,
888        WindowMethods,
889        EvtHandlerMethods,
890        ObjectMethods
891}
892impl<const OWNED: bool> ToggleButtonIsOwned<OWNED> {
893    /// Default constructor.
894    ///
895    /// See [C++ `wxToggleButton::wxToggleButton()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_toggle_button.html#ae80157529dec7b6db6d02641f34512ab).
896    pub fn new_2step() -> ToggleButtonIsOwned<OWNED> {
897        unsafe { ToggleButtonIsOwned(ffi::wxToggleButton_new()) }
898    }
899    /// Constructor, creating and showing a toggle button.
900    ///
901    /// See [C++ `wxToggleButton::wxToggleButton()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_toggle_button.html#af0d1a2dcae93ee68a23a5a2b77aced5b).
902    pub fn new<W: WindowMethods, P: PointMethods, S: SizeMethods, V: ValidatorMethods>(
903        parent: Option<&W>,
904        id: c_int,
905        label: &str,
906        pos: &P,
907        size: &S,
908        style: c_long,
909        val: &V,
910        name: &str,
911    ) -> ToggleButtonIsOwned<OWNED> {
912        unsafe {
913            let parent = match parent {
914                Some(r) => r.as_ptr(),
915                None => ptr::null_mut(),
916            };
917            let label = WxString::from(label);
918            let label = label.as_ptr();
919            let pos = pos.as_ptr();
920            let size = size.as_ptr();
921            let val = val.as_ptr();
922            let name = WxString::from(name);
923            let name = name.as_ptr();
924            ToggleButtonIsOwned(ffi::wxToggleButton_new1(
925                parent, id, label, pos, size, style, val, name,
926            ))
927        }
928    }
929    pub fn none() -> Option<&'static Self> {
930        None
931    }
932}
933impl<const OWNED: bool> Clone for ToggleButtonIsOwned<OWNED> {
934    fn clone(&self) -> Self {
935        Self(self.0)
936    }
937}
938impl<const OWNED: bool> From<ToggleButtonIsOwned<OWNED>> for AnyButtonIsOwned<OWNED> {
939    fn from(o: ToggleButtonIsOwned<OWNED>) -> Self {
940        unsafe { Self::from_ptr(o.as_ptr()) }
941    }
942}
943impl<const OWNED: bool> From<ToggleButtonIsOwned<OWNED>> for ControlIsOwned<OWNED> {
944    fn from(o: ToggleButtonIsOwned<OWNED>) -> Self {
945        unsafe { Self::from_ptr(o.as_ptr()) }
946    }
947}
948impl<const OWNED: bool> From<ToggleButtonIsOwned<OWNED>> for WindowIsOwned<OWNED> {
949    fn from(o: ToggleButtonIsOwned<OWNED>) -> Self {
950        unsafe { Self::from_ptr(o.as_ptr()) }
951    }
952}
953impl<const OWNED: bool> From<ToggleButtonIsOwned<OWNED>> for EvtHandlerIsOwned<OWNED> {
954    fn from(o: ToggleButtonIsOwned<OWNED>) -> Self {
955        unsafe { Self::from_ptr(o.as_ptr()) }
956    }
957}
958impl<const OWNED: bool> From<ToggleButtonIsOwned<OWNED>> for ObjectIsOwned<OWNED> {
959    fn from(o: ToggleButtonIsOwned<OWNED>) -> Self {
960        unsafe { Self::from_ptr(o.as_ptr()) }
961    }
962}
963impl<const OWNED: bool> DynamicCast for ToggleButtonIsOwned<OWNED> {
964    fn class_info() -> ClassInfoIsOwned<false> {
965        unsafe { ClassInfoIsOwned::from_ptr(ffi::wxToggleButton_CLASSINFO()) }
966    }
967}
968
969// wxToolBar
970wxwidgets! {
971    /// A toolbar is a bar of buttons and/or other controls usually placed below the menu bar in a wxFrame.
972    /// - [`ToolBar`] represents a C++ `wxToolBar` class instance which your code has ownership, [`ToolBarIsOwned`]`<false>` represents one which don't own.
973    /// - Use [`ToolBar`]'s `new()` or [`Buildable::builder()`] (if available) to create an instance of this class.
974    /// - See [C++ `wxToolBar` class's documentation](https://docs.wxwidgets.org/3.2/classwx_tool_bar.html) for more details.
975    #[doc(alias = "wxToolBar")]
976    #[doc(alias = "ToolBar")]
977    class ToolBar
978        = ToolBarIsOwned<true>(wxToolBar) impl
979        ToolBarMethods,
980        ControlMethods,
981        WindowMethods,
982        EvtHandlerMethods,
983        ObjectMethods
984}
985impl<const OWNED: bool> ToolBarIsOwned<OWNED> {
986    /// Default constructor.
987    ///
988    /// See [C++ `wxToolBar::wxToolBar()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_tool_bar.html#a1d03fd30dfb9c0af2e65164008eca1a3).
989    pub fn new_2step() -> ToolBarIsOwned<OWNED> {
990        unsafe { ToolBarIsOwned(ffi::wxToolBar_new()) }
991    }
992    /// Constructs a toolbar.
993    ///
994    /// See [C++ `wxToolBar::wxToolBar()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_tool_bar.html#a1c5d3a2853b41a2ef728dad18c321e1f).
995    pub fn new<W: WindowMethods, P: PointMethods, S: SizeMethods>(
996        parent: Option<&W>,
997        id: c_int,
998        pos: &P,
999        size: &S,
1000        style: c_long,
1001        name: &str,
1002    ) -> ToolBarIsOwned<OWNED> {
1003        unsafe {
1004            let parent = match parent {
1005                Some(r) => r.as_ptr(),
1006                None => ptr::null_mut(),
1007            };
1008            let pos = pos.as_ptr();
1009            let size = size.as_ptr();
1010            let name = WxString::from(name);
1011            let name = name.as_ptr();
1012            ToolBarIsOwned(ffi::wxToolBar_new1(parent, id, pos, size, style, name))
1013        }
1014    }
1015    pub fn none() -> Option<&'static Self> {
1016        None
1017    }
1018}
1019impl<const OWNED: bool> Clone for ToolBarIsOwned<OWNED> {
1020    fn clone(&self) -> Self {
1021        Self(self.0)
1022    }
1023}
1024impl<const OWNED: bool> From<ToolBarIsOwned<OWNED>> for ControlIsOwned<OWNED> {
1025    fn from(o: ToolBarIsOwned<OWNED>) -> Self {
1026        unsafe { Self::from_ptr(o.as_ptr()) }
1027    }
1028}
1029impl<const OWNED: bool> From<ToolBarIsOwned<OWNED>> for WindowIsOwned<OWNED> {
1030    fn from(o: ToolBarIsOwned<OWNED>) -> Self {
1031        unsafe { Self::from_ptr(o.as_ptr()) }
1032    }
1033}
1034impl<const OWNED: bool> From<ToolBarIsOwned<OWNED>> for EvtHandlerIsOwned<OWNED> {
1035    fn from(o: ToolBarIsOwned<OWNED>) -> Self {
1036        unsafe { Self::from_ptr(o.as_ptr()) }
1037    }
1038}
1039impl<const OWNED: bool> From<ToolBarIsOwned<OWNED>> for ObjectIsOwned<OWNED> {
1040    fn from(o: ToolBarIsOwned<OWNED>) -> Self {
1041        unsafe { Self::from_ptr(o.as_ptr()) }
1042    }
1043}
1044impl<const OWNED: bool> DynamicCast for ToolBarIsOwned<OWNED> {
1045    fn class_info() -> ClassInfoIsOwned<false> {
1046        unsafe { ClassInfoIsOwned::from_ptr(ffi::wxToolBar_CLASSINFO()) }
1047    }
1048}
1049
1050// wxToolTip
1051wxwidgets! {
1052    /// This class holds information about a tooltip associated with a window (see wxWindow::SetToolTip()).
1053    /// - [`ToolTip`] represents a C++ `wxToolTip` class instance which your code has ownership, [`ToolTipIsOwned`]`<false>` represents one which don't own.
1054    /// - Use [`ToolTip`]'s `new()` or [`Buildable::builder()`] (if available) to create an instance of this class.
1055    /// - See [C++ `wxToolTip` class's documentation](https://docs.wxwidgets.org/3.2/classwx_tool_tip.html) for more details.
1056    #[doc(alias = "wxToolTip")]
1057    #[doc(alias = "ToolTip")]
1058    class ToolTip
1059        = ToolTipIsOwned<true>(wxToolTip) impl
1060        ToolTipMethods,
1061        ObjectMethods
1062}
1063impl<const OWNED: bool> ToolTipIsOwned<OWNED> {
1064    /// Constructor.
1065    ///
1066    /// See [C++ `wxToolTip::wxToolTip()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_tool_tip.html#a64d0a8d8439571dfae42b2558559c8fb).
1067    pub fn new(tip: &str) -> ToolTipIsOwned<OWNED> {
1068        unsafe {
1069            let tip = WxString::from(tip);
1070            let tip = tip.as_ptr();
1071            ToolTipIsOwned(ffi::wxToolTip_new(tip))
1072        }
1073    }
1074    pub fn none() -> Option<&'static Self> {
1075        None
1076    }
1077}
1078impl Clone for ToolTipIsOwned<false> {
1079    fn clone(&self) -> Self {
1080        Self(self.0)
1081    }
1082}
1083impl<const OWNED: bool> From<ToolTipIsOwned<OWNED>> for ObjectIsOwned<OWNED> {
1084    fn from(o: ToolTipIsOwned<OWNED>) -> Self {
1085        unsafe { Self::from_ptr(o.as_ptr()) }
1086    }
1087}
1088impl<const OWNED: bool> DynamicCast for ToolTipIsOwned<OWNED> {
1089    fn class_info() -> ClassInfoIsOwned<false> {
1090        unsafe { ClassInfoIsOwned::from_ptr(ffi::wxToolTip_CLASSINFO()) }
1091    }
1092}
1093impl<const OWNED: bool> Drop for ToolTipIsOwned<OWNED> {
1094    fn drop(&mut self) {
1095        if OWNED {
1096            unsafe { ffi::wxObject_delete(self.0) }
1097        }
1098    }
1099}
1100
1101// wxToolbook
1102wxwidgets! {
1103    /// wxToolbook is a class similar to wxNotebook but which uses a wxToolBar to show the labels instead of the tabs.
1104    /// - [`Toolbook`] represents a C++ `wxToolbook` class instance which your code has ownership, [`ToolbookIsOwned`]`<false>` represents one which don't own.
1105    /// - Use [`Toolbook`]'s `new()` or [`Buildable::builder()`] (if available) to create an instance of this class.
1106    /// - See [C++ `wxToolbook` class's documentation](https://docs.wxwidgets.org/3.2/classwx_toolbook.html) for more details.
1107    #[doc(alias = "wxToolbook")]
1108    #[doc(alias = "Toolbook")]
1109    class Toolbook
1110        = ToolbookIsOwned<true>(wxToolbook) impl
1111        ToolbookMethods,
1112        BookCtrlBaseMethods,
1113        ControlMethods,
1114        // WindowMethods,
1115        EvtHandlerMethods,
1116        ObjectMethods
1117}
1118impl<const OWNED: bool> ToolbookIsOwned<OWNED> {
1119    /// Constructs a choicebook control.
1120    ///
1121    /// See [C++ `wxToolbook::wxToolbook()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_toolbook.html#a8d988e8cdd0a495d737603418af5da34).
1122    pub fn new_2step() -> ToolbookIsOwned<OWNED> {
1123        unsafe { ToolbookIsOwned(ffi::wxToolbook_new()) }
1124    }
1125    ///
1126    /// See [C++ `wxToolbook::wxToolbook()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_toolbook.html#a9587b9f1a9234c9ae366003a6551ac0e).
1127    pub fn new<W: WindowMethods, P: PointMethods, S: SizeMethods>(
1128        parent: Option<&W>,
1129        id: c_int,
1130        pos: &P,
1131        size: &S,
1132        style: c_long,
1133        name: &str,
1134    ) -> ToolbookIsOwned<OWNED> {
1135        unsafe {
1136            let parent = match parent {
1137                Some(r) => r.as_ptr(),
1138                None => ptr::null_mut(),
1139            };
1140            let pos = pos.as_ptr();
1141            let size = size.as_ptr();
1142            let name = WxString::from(name);
1143            let name = name.as_ptr();
1144            ToolbookIsOwned(ffi::wxToolbook_new1(parent, id, pos, size, style, name))
1145        }
1146    }
1147    pub fn none() -> Option<&'static Self> {
1148        None
1149    }
1150}
1151impl<const OWNED: bool> Clone for ToolbookIsOwned<OWNED> {
1152    fn clone(&self) -> Self {
1153        Self(self.0)
1154    }
1155}
1156impl<const OWNED: bool> From<ToolbookIsOwned<OWNED>> for BookCtrlBaseIsOwned<OWNED> {
1157    fn from(o: ToolbookIsOwned<OWNED>) -> Self {
1158        unsafe { Self::from_ptr(o.as_ptr()) }
1159    }
1160}
1161impl<const OWNED: bool> From<ToolbookIsOwned<OWNED>> for ControlIsOwned<OWNED> {
1162    fn from(o: ToolbookIsOwned<OWNED>) -> Self {
1163        unsafe { Self::from_ptr(o.as_ptr()) }
1164    }
1165}
1166impl<const OWNED: bool> From<ToolbookIsOwned<OWNED>> for WindowIsOwned<OWNED> {
1167    fn from(o: ToolbookIsOwned<OWNED>) -> Self {
1168        unsafe { Self::from_ptr(o.as_ptr()) }
1169    }
1170}
1171impl<const OWNED: bool> From<ToolbookIsOwned<OWNED>> for EvtHandlerIsOwned<OWNED> {
1172    fn from(o: ToolbookIsOwned<OWNED>) -> Self {
1173        unsafe { Self::from_ptr(o.as_ptr()) }
1174    }
1175}
1176impl<const OWNED: bool> From<ToolbookIsOwned<OWNED>> for ObjectIsOwned<OWNED> {
1177    fn from(o: ToolbookIsOwned<OWNED>) -> Self {
1178        unsafe { Self::from_ptr(o.as_ptr()) }
1179    }
1180}
1181impl<const OWNED: bool> DynamicCast for ToolbookIsOwned<OWNED> {
1182    fn class_info() -> ClassInfoIsOwned<false> {
1183        unsafe { ClassInfoIsOwned::from_ptr(ffi::wxToolbook_CLASSINFO()) }
1184    }
1185}
1186impl<const OWNED: bool> WindowMethods for ToolbookIsOwned<OWNED> {
1187    /// Create the tool book control that has already been constructed with the default constructor.
1188    ///
1189    /// See [C++ `wxToolbook::Create()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_toolbook.html#a2138b2b4a597fc51dd28f1b9e9710b1c).
1190    fn create<W: WindowMethods, P: PointMethods, S: SizeMethods>(
1191        &self,
1192        parent: Option<&W>,
1193        id: c_int,
1194        pos: &P,
1195        size: &S,
1196        style: c_long,
1197        name: &str,
1198    ) -> bool {
1199        unsafe {
1200            let parent = match parent {
1201                Some(r) => r.as_ptr(),
1202                None => ptr::null_mut(),
1203            };
1204            let pos = pos.as_ptr();
1205            let size = size.as_ptr();
1206            let name = WxString::from(name);
1207            let name = name.as_ptr();
1208            ffi::wxToolbook_Create(self.as_ptr(), parent, id, pos, size, style, name)
1209        }
1210    }
1211}
1212
1213// wxTopLevelWindow
1214wxwidgets! {
1215    /// wxTopLevelWindow is a common base class for wxDialog and wxFrame.
1216    /// - [`TopLevelWindow`] represents a C++ `wxTopLevelWindow` class instance which your code has ownership, [`TopLevelWindowIsOwned`]`<false>` represents one which don't own.
1217    /// - Use [`TopLevelWindow`]'s `new()` or [`Buildable::builder()`] (if available) to create an instance of this class.
1218    /// - See [C++ `wxTopLevelWindow` class's documentation](https://docs.wxwidgets.org/3.2/classwx_top_level_window.html) for more details.
1219    #[doc(alias = "wxTopLevelWindow")]
1220    #[doc(alias = "TopLevelWindow")]
1221    class TopLevelWindow
1222        = TopLevelWindowIsOwned<true>(wxTopLevelWindow) impl
1223        TopLevelWindowMethods,
1224        NonOwnedWindowMethods,
1225        WindowMethods,
1226        EvtHandlerMethods,
1227        ObjectMethods
1228}
1229impl<const OWNED: bool> TopLevelWindowIsOwned<OWNED> {
1230    /// Default ctor.
1231    ///
1232    /// See [C++ `wxTopLevelWindow::wxTopLevelWindow()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_top_level_window.html#abb919ad585057de6fce94bb7d5497256).
1233    pub fn new_2step() -> TopLevelWindowIsOwned<OWNED> {
1234        unsafe { TopLevelWindowIsOwned(ffi::wxTopLevelWindow_new()) }
1235    }
1236    /// Constructor creating the top level window.
1237    ///
1238    /// See [C++ `wxTopLevelWindow::wxTopLevelWindow()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_top_level_window.html#abddbaa0d42b46847b679464b485654be).
1239    pub fn new<W: WindowMethods, P: PointMethods, S: SizeMethods>(
1240        parent: Option<&W>,
1241        id: c_int,
1242        title: &str,
1243        pos: &P,
1244        size: &S,
1245        style: c_long,
1246        name: &str,
1247    ) -> TopLevelWindowIsOwned<OWNED> {
1248        unsafe {
1249            let parent = match parent {
1250                Some(r) => r.as_ptr(),
1251                None => ptr::null_mut(),
1252            };
1253            let title = WxString::from(title);
1254            let title = title.as_ptr();
1255            let pos = pos.as_ptr();
1256            let size = size.as_ptr();
1257            let name = WxString::from(name);
1258            let name = name.as_ptr();
1259            TopLevelWindowIsOwned(ffi::wxTopLevelWindow_new1(
1260                parent, id, title, pos, size, style, name,
1261            ))
1262        }
1263    }
1264    pub fn none() -> Option<&'static Self> {
1265        None
1266    }
1267}
1268impl<const OWNED: bool> Clone for TopLevelWindowIsOwned<OWNED> {
1269    fn clone(&self) -> Self {
1270        Self(self.0)
1271    }
1272}
1273impl<const OWNED: bool> From<TopLevelWindowIsOwned<OWNED>> for NonOwnedWindowIsOwned<OWNED> {
1274    fn from(o: TopLevelWindowIsOwned<OWNED>) -> Self {
1275        unsafe { Self::from_ptr(o.as_ptr()) }
1276    }
1277}
1278impl<const OWNED: bool> From<TopLevelWindowIsOwned<OWNED>> for WindowIsOwned<OWNED> {
1279    fn from(o: TopLevelWindowIsOwned<OWNED>) -> Self {
1280        unsafe { Self::from_ptr(o.as_ptr()) }
1281    }
1282}
1283impl<const OWNED: bool> From<TopLevelWindowIsOwned<OWNED>> for EvtHandlerIsOwned<OWNED> {
1284    fn from(o: TopLevelWindowIsOwned<OWNED>) -> Self {
1285        unsafe { Self::from_ptr(o.as_ptr()) }
1286    }
1287}
1288impl<const OWNED: bool> From<TopLevelWindowIsOwned<OWNED>> for ObjectIsOwned<OWNED> {
1289    fn from(o: TopLevelWindowIsOwned<OWNED>) -> Self {
1290        unsafe { Self::from_ptr(o.as_ptr()) }
1291    }
1292}
1293impl<const OWNED: bool> DynamicCast for TopLevelWindowIsOwned<OWNED> {
1294    fn class_info() -> ClassInfoIsOwned<false> {
1295        unsafe { ClassInfoIsOwned::from_ptr(ffi::wxTopLevelWindow_CLASSINFO()) }
1296    }
1297}
1298
1299// wxTreeCtrl
1300wxwidgets! {
1301    /// A tree control presents information as a hierarchy, with items that may be expanded to show further items.
1302    /// - [`TreeCtrl`] represents a C++ `wxTreeCtrl` class instance which your code has ownership, [`TreeCtrlIsOwned`]`<false>` represents one which don't own.
1303    /// - Use [`TreeCtrl`]'s `new()` or [`Buildable::builder()`] (if available) to create an instance of this class.
1304    /// - See [C++ `wxTreeCtrl` class's documentation](https://docs.wxwidgets.org/3.2/classwx_tree_ctrl.html) for more details.
1305    #[doc(alias = "wxTreeCtrl")]
1306    #[doc(alias = "TreeCtrl")]
1307    class TreeCtrl
1308        = TreeCtrlIsOwned<true>(wxTreeCtrl) impl
1309        TreeCtrlMethods,
1310        // ControlMethods,
1311        // WindowMethods,
1312        EvtHandlerMethods,
1313        ObjectMethods
1314}
1315impl<const OWNED: bool> TreeCtrlIsOwned<OWNED> {
1316    /// Default Constructor.
1317    ///
1318    /// See [C++ `wxTreeCtrl::wxTreeCtrl()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_tree_ctrl.html#ac4a07aa9c3ef92d6663ace3c20aa1576).
1319    pub fn new_2step() -> TreeCtrlIsOwned<OWNED> {
1320        unsafe { TreeCtrlIsOwned(ffi::wxTreeCtrl_new()) }
1321    }
1322    /// Constructor, creating and showing a tree control.
1323    ///
1324    /// See [C++ `wxTreeCtrl::wxTreeCtrl()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_tree_ctrl.html#a298f48e824d12a43539a018e2cc06999).
1325    pub fn new<W: WindowMethods, P: PointMethods, S: SizeMethods, V: ValidatorMethods>(
1326        parent: Option<&W>,
1327        id: c_int,
1328        pos: &P,
1329        size: &S,
1330        style: c_long,
1331        validator: &V,
1332        name: &str,
1333    ) -> TreeCtrlIsOwned<OWNED> {
1334        unsafe {
1335            let parent = match parent {
1336                Some(r) => r.as_ptr(),
1337                None => ptr::null_mut(),
1338            };
1339            let pos = pos.as_ptr();
1340            let size = size.as_ptr();
1341            let validator = validator.as_ptr();
1342            let name = WxString::from(name);
1343            let name = name.as_ptr();
1344            TreeCtrlIsOwned(ffi::wxTreeCtrl_new1(
1345                parent, id, pos, size, style, validator, name,
1346            ))
1347        }
1348    }
1349    pub fn none() -> Option<&'static Self> {
1350        None
1351    }
1352}
1353impl<const OWNED: bool> Clone for TreeCtrlIsOwned<OWNED> {
1354    fn clone(&self) -> Self {
1355        Self(self.0)
1356    }
1357}
1358impl<const OWNED: bool> From<TreeCtrlIsOwned<OWNED>> for ControlIsOwned<OWNED> {
1359    fn from(o: TreeCtrlIsOwned<OWNED>) -> Self {
1360        unsafe { Self::from_ptr(o.as_ptr()) }
1361    }
1362}
1363impl<const OWNED: bool> From<TreeCtrlIsOwned<OWNED>> for WindowIsOwned<OWNED> {
1364    fn from(o: TreeCtrlIsOwned<OWNED>) -> Self {
1365        unsafe { Self::from_ptr(o.as_ptr()) }
1366    }
1367}
1368impl<const OWNED: bool> From<TreeCtrlIsOwned<OWNED>> for EvtHandlerIsOwned<OWNED> {
1369    fn from(o: TreeCtrlIsOwned<OWNED>) -> Self {
1370        unsafe { Self::from_ptr(o.as_ptr()) }
1371    }
1372}
1373impl<const OWNED: bool> From<TreeCtrlIsOwned<OWNED>> for ObjectIsOwned<OWNED> {
1374    fn from(o: TreeCtrlIsOwned<OWNED>) -> Self {
1375        unsafe { Self::from_ptr(o.as_ptr()) }
1376    }
1377}
1378impl<const OWNED: bool> DynamicCast for TreeCtrlIsOwned<OWNED> {
1379    fn class_info() -> ClassInfoIsOwned<false> {
1380        unsafe { ClassInfoIsOwned::from_ptr(ffi::wxTreeCtrl_CLASSINFO()) }
1381    }
1382}
1383impl<const OWNED: bool> ControlMethods for TreeCtrlIsOwned<OWNED> {
1384    /// Creates the tree control.
1385    ///
1386    /// See [C++ `wxTreeCtrl::Create()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_tree_ctrl.html#adf40716643252f78e72fcb95dbd347ae).
1387    fn create_validator<W: WindowMethods, P: PointMethods, S: SizeMethods, V: ValidatorMethods>(
1388        &self,
1389        parent: Option<&W>,
1390        id: c_int,
1391        pos: &P,
1392        size: &S,
1393        style: c_long,
1394        validator: &V,
1395        name: &str,
1396    ) -> bool {
1397        unsafe {
1398            let parent = match parent {
1399                Some(r) => r.as_ptr(),
1400                None => ptr::null_mut(),
1401            };
1402            let pos = pos.as_ptr();
1403            let size = size.as_ptr();
1404            let validator = validator.as_ptr();
1405            let name = WxString::from(name);
1406            let name = name.as_ptr();
1407            ffi::wxTreeCtrl_Create(self.as_ptr(), parent, id, pos, size, style, validator, name)
1408        }
1409    }
1410}
1411impl<const OWNED: bool> WindowMethods for TreeCtrlIsOwned<OWNED> {
1412    /// Sets the mode flags associated with the display of the tree control.
1413    ///
1414    /// See [C++ `wxTreeCtrl::SetWindowStyle()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_tree_ctrl.html#a00974d17198e3883bfe4cca9d7ab52ba).
1415    fn set_window_style(&self, styles: c_long) {
1416        unsafe { ffi::wxTreeCtrl_SetWindowStyle(self.as_ptr(), styles) }
1417    }
1418}
1419
1420// wxTreeEvent
1421wxwidgets! {
1422    /// A tree event holds information about events associated with wxTreeCtrl objects.
1423    /// - [`TreeEvent`] represents a C++ `wxTreeEvent` class instance which your code has ownership, [`TreeEventIsOwned`]`<false>` represents one which don't own.
1424    /// - Use [`TreeEvent`]'s `new()` or [`Buildable::builder()`] (if available) to create an instance of this class.
1425    /// - See [C++ `wxTreeEvent` class's documentation](https://docs.wxwidgets.org/3.2/classwx_tree_event.html) for more details.
1426    #[doc(alias = "wxTreeEvent")]
1427    #[doc(alias = "TreeEvent")]
1428    class TreeEvent
1429        = TreeEventIsOwned<true>(wxTreeEvent) impl
1430        TreeEventMethods,
1431        NotifyEventMethods,
1432        CommandEventMethods,
1433        EventMethods,
1434        ObjectMethods
1435}
1436impl<const OWNED: bool> TreeEventIsOwned<OWNED> {
1437    // NOT_SUPPORTED: fn wxTreeEvent()
1438    pub fn none() -> Option<&'static Self> {
1439        None
1440    }
1441}
1442impl Clone for TreeEventIsOwned<false> {
1443    fn clone(&self) -> Self {
1444        Self(self.0)
1445    }
1446}
1447impl<const OWNED: bool> From<TreeEventIsOwned<OWNED>> for NotifyEventIsOwned<OWNED> {
1448    fn from(o: TreeEventIsOwned<OWNED>) -> Self {
1449        unsafe { Self::from_ptr(o.as_ptr()) }
1450    }
1451}
1452impl<const OWNED: bool> From<TreeEventIsOwned<OWNED>> for CommandEventIsOwned<OWNED> {
1453    fn from(o: TreeEventIsOwned<OWNED>) -> Self {
1454        unsafe { Self::from_ptr(o.as_ptr()) }
1455    }
1456}
1457impl<const OWNED: bool> From<TreeEventIsOwned<OWNED>> for EventIsOwned<OWNED> {
1458    fn from(o: TreeEventIsOwned<OWNED>) -> Self {
1459        unsafe { Self::from_ptr(o.as_ptr()) }
1460    }
1461}
1462impl<const OWNED: bool> From<TreeEventIsOwned<OWNED>> for ObjectIsOwned<OWNED> {
1463    fn from(o: TreeEventIsOwned<OWNED>) -> Self {
1464        unsafe { Self::from_ptr(o.as_ptr()) }
1465    }
1466}
1467impl<const OWNED: bool> DynamicCast for TreeEventIsOwned<OWNED> {
1468    fn class_info() -> ClassInfoIsOwned<false> {
1469        unsafe { ClassInfoIsOwned::from_ptr(ffi::wxTreeEvent_CLASSINFO()) }
1470    }
1471}
1472impl<const OWNED: bool> Drop for TreeEventIsOwned<OWNED> {
1473    fn drop(&mut self) {
1474        if OWNED {
1475            unsafe { ffi::wxObject_delete(self.0) }
1476        }
1477    }
1478}
1479
1480// wxTreeItemData
1481wxwidgets! {
1482    /// wxTreeItemData is some (arbitrary) user class associated with some item.
1483    /// - [`TreeItemData`] represents a C++ `wxTreeItemData` class instance which your code has ownership, [`TreeItemDataIsOwned`]`<false>` represents one which don't own.
1484    /// - Use [`TreeItemData`]'s `new()` or [`Buildable::builder()`] (if available) to create an instance of this class.
1485    /// - See [C++ `wxTreeItemData` class's documentation](https://docs.wxwidgets.org/3.2/classwx_tree_item_data.html) for more details.
1486    #[doc(alias = "wxTreeItemData")]
1487    #[doc(alias = "TreeItemData")]
1488    class TreeItemData
1489        = TreeItemDataIsOwned<true>(wxTreeItemData) impl
1490        TreeItemDataMethods,
1491        ClientDataMethods
1492}
1493impl<const OWNED: bool> TreeItemDataIsOwned<OWNED> {
1494    /// Default constructor.
1495    ///
1496    /// See [C++ `wxTreeItemData::wxTreeItemData()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_tree_item_data.html#a8ebdd1027310183289833bcbb18dba6a).
1497    pub fn new() -> TreeItemDataIsOwned<OWNED> {
1498        unsafe { TreeItemDataIsOwned(ffi::wxTreeItemData_new()) }
1499    }
1500    pub fn none() -> Option<&'static Self> {
1501        None
1502    }
1503}
1504impl Clone for TreeItemDataIsOwned<false> {
1505    fn clone(&self) -> Self {
1506        Self(self.0)
1507    }
1508}
1509impl<const OWNED: bool> From<TreeItemDataIsOwned<OWNED>> for ClientDataIsOwned<OWNED> {
1510    fn from(o: TreeItemDataIsOwned<OWNED>) -> Self {
1511        unsafe { Self::from_ptr(o.as_ptr()) }
1512    }
1513}
1514impl<const OWNED: bool> Drop for TreeItemDataIsOwned<OWNED> {
1515    fn drop(&mut self) {
1516        if OWNED {
1517            unsafe { ffi::wxTreeItemData_delete(self.0) }
1518        }
1519    }
1520}
1521
1522// wxTreeItemId
1523wxwidgets! {
1524    /// An opaque reference to a tree item.
1525    /// - [`TreeItemId`] represents a C++ `wxTreeItemId` class instance which your code has ownership, [`TreeItemIdIsOwned`]`<false>` represents one which don't own.
1526    /// - Use [`TreeItemId`]'s `new()` or [`Buildable::builder()`] (if available) to create an instance of this class.
1527    /// - See [C++ `wxTreeItemId` class's documentation](https://docs.wxwidgets.org/3.2/classwx_tree_item_id.html) for more details.
1528    #[doc(alias = "wxTreeItemId")]
1529    #[doc(alias = "TreeItemId")]
1530    class TreeItemId
1531        = TreeItemIdIsOwned<true>(wxTreeItemId) impl
1532        TreeItemIdMethods
1533}
1534impl<const OWNED: bool> TreeItemIdIsOwned<OWNED> {
1535    /// Default constructor.
1536    ///
1537    /// See [C++ `wxTreeItemId::wxTreeItemId()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_tree_item_id.html#ac1c310e544edbfd2428d1ff91d0e3fb6).
1538    pub fn new() -> TreeItemIdIsOwned<OWNED> {
1539        unsafe { TreeItemIdIsOwned(ffi::wxTreeItemId_new()) }
1540    }
1541    pub fn none() -> Option<&'static Self> {
1542        None
1543    }
1544}
1545impl Clone for TreeItemIdIsOwned<false> {
1546    fn clone(&self) -> Self {
1547        Self(self.0)
1548    }
1549}
1550impl<const OWNED: bool> Drop for TreeItemIdIsOwned<OWNED> {
1551    fn drop(&mut self) {
1552        if OWNED {
1553            unsafe { ffi::wxTreeItemId_delete(self.0) }
1554        }
1555    }
1556}
1557
1558// wxTreeListCtrl
1559wxwidgets! {
1560    /// A control combining wxTreeCtrl and wxListCtrl features.
1561    /// - [`TreeListCtrl`] represents a C++ `wxTreeListCtrl` class instance which your code has ownership, [`TreeListCtrlIsOwned`]`<false>` represents one which don't own.
1562    /// - Use [`TreeListCtrl`]'s `new()` or [`Buildable::builder()`] (if available) to create an instance of this class.
1563    /// - See [C++ `wxTreeListCtrl` class's documentation](https://docs.wxwidgets.org/3.2/classwx_tree_list_ctrl.html) for more details.
1564    #[doc(alias = "wxTreeListCtrl")]
1565    #[doc(alias = "TreeListCtrl")]
1566    class TreeListCtrl
1567        = TreeListCtrlIsOwned<true>(wxTreeListCtrl) impl
1568        TreeListCtrlMethods,
1569        // WindowMethods,
1570        EvtHandlerMethods,
1571        ObjectMethods
1572}
1573impl<const OWNED: bool> TreeListCtrlIsOwned<OWNED> {
1574    /// Default constructor, call Create() later.
1575    ///
1576    /// See [C++ `wxTreeListCtrl::wxTreeListCtrl()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_tree_list_ctrl.html#a844c05440a63f6cf04b36aab91e9449e).
1577    pub fn new_2step() -> TreeListCtrlIsOwned<OWNED> {
1578        unsafe { TreeListCtrlIsOwned(ffi::wxTreeListCtrl_new()) }
1579    }
1580    /// Full constructing, creating the object and its window.
1581    ///
1582    /// See [C++ `wxTreeListCtrl::wxTreeListCtrl()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_tree_list_ctrl.html#aafa1dff7beddda23c685f1c19c68aefb).
1583    pub fn new<W: WindowMethods, P: PointMethods, S: SizeMethods>(
1584        parent: Option<&W>,
1585        id: c_int,
1586        pos: &P,
1587        size: &S,
1588        style: c_long,
1589        name: &str,
1590    ) -> TreeListCtrlIsOwned<OWNED> {
1591        unsafe {
1592            let parent = match parent {
1593                Some(r) => r.as_ptr(),
1594                None => ptr::null_mut(),
1595            };
1596            let pos = pos.as_ptr();
1597            let size = size.as_ptr();
1598            let name = WxString::from(name);
1599            let name = name.as_ptr();
1600            TreeListCtrlIsOwned(ffi::wxTreeListCtrl_new1(parent, id, pos, size, style, name))
1601        }
1602    }
1603    pub fn none() -> Option<&'static Self> {
1604        None
1605    }
1606}
1607impl<const OWNED: bool> Clone for TreeListCtrlIsOwned<OWNED> {
1608    fn clone(&self) -> Self {
1609        Self(self.0)
1610    }
1611}
1612impl<const OWNED: bool> From<TreeListCtrlIsOwned<OWNED>> for WindowIsOwned<OWNED> {
1613    fn from(o: TreeListCtrlIsOwned<OWNED>) -> Self {
1614        unsafe { Self::from_ptr(o.as_ptr()) }
1615    }
1616}
1617impl<const OWNED: bool> From<TreeListCtrlIsOwned<OWNED>> for EvtHandlerIsOwned<OWNED> {
1618    fn from(o: TreeListCtrlIsOwned<OWNED>) -> Self {
1619        unsafe { Self::from_ptr(o.as_ptr()) }
1620    }
1621}
1622impl<const OWNED: bool> From<TreeListCtrlIsOwned<OWNED>> for ObjectIsOwned<OWNED> {
1623    fn from(o: TreeListCtrlIsOwned<OWNED>) -> Self {
1624        unsafe { Self::from_ptr(o.as_ptr()) }
1625    }
1626}
1627impl<const OWNED: bool> DynamicCast for TreeListCtrlIsOwned<OWNED> {
1628    fn class_info() -> ClassInfoIsOwned<false> {
1629        unsafe { ClassInfoIsOwned::from_ptr(ffi::wxTreeListCtrl_CLASSINFO()) }
1630    }
1631}
1632impl<const OWNED: bool> WindowMethods for TreeListCtrlIsOwned<OWNED> {
1633    /// Create the control window.
1634    ///
1635    /// See [C++ `wxTreeListCtrl::Create()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_tree_list_ctrl.html#aca79c6e9b0f49eac98450d8104de8c95).
1636    fn create<W: WindowMethods, P: PointMethods, S: SizeMethods>(
1637        &self,
1638        parent: Option<&W>,
1639        id: c_int,
1640        pos: &P,
1641        size: &S,
1642        style: c_long,
1643        name: &str,
1644    ) -> bool {
1645        unsafe {
1646            let parent = match parent {
1647                Some(r) => r.as_ptr(),
1648                None => ptr::null_mut(),
1649            };
1650            let pos = pos.as_ptr();
1651            let size = size.as_ptr();
1652            let name = WxString::from(name);
1653            let name = name.as_ptr();
1654            ffi::wxTreeListCtrl_Create(self.as_ptr(), parent, id, pos, size, style, name)
1655        }
1656    }
1657}
1658
1659// wxTreeListItem
1660wxwidgets! {
1661    /// Unique identifier of an item in wxTreeListCtrl.
1662    /// - [`TreeListItem`] represents a C++ `wxTreeListItem` class instance which your code has ownership, [`TreeListItemIsOwned`]`<false>` represents one which don't own.
1663    /// - Use [`TreeListItem`]'s `new()` or [`Buildable::builder()`] (if available) to create an instance of this class.
1664    /// - See [C++ `wxTreeListItem` class's documentation](https://docs.wxwidgets.org/3.2/classwx_tree_list_item.html) for more details.
1665    #[doc(alias = "wxTreeListItem")]
1666    #[doc(alias = "TreeListItem")]
1667    class TreeListItem
1668        = TreeListItemIsOwned<true>(wxTreeListItem) impl
1669        TreeListItemMethods
1670}
1671impl<const OWNED: bool> TreeListItemIsOwned<OWNED> {
1672    /// Only the default constructor is publicly accessible.
1673    ///
1674    /// See [C++ `wxTreeListItem::wxTreeListItem()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_tree_list_item.html#ae2de6943754cad1454ab8d797bc3ada0).
1675    pub fn new() -> TreeListItemIsOwned<OWNED> {
1676        unsafe { TreeListItemIsOwned(ffi::wxTreeListItem_new()) }
1677    }
1678    pub fn none() -> Option<&'static Self> {
1679        None
1680    }
1681}
1682impl Clone for TreeListItemIsOwned<false> {
1683    fn clone(&self) -> Self {
1684        Self(self.0)
1685    }
1686}
1687impl<const OWNED: bool> Drop for TreeListItemIsOwned<OWNED> {
1688    fn drop(&mut self) {
1689        if OWNED {
1690            unsafe { ffi::wxTreeListItem_delete(self.0) }
1691        }
1692    }
1693}
1694
1695// wxTreeListItemComparator
1696wxwidgets! {
1697    /// Class defining sort order for the items in wxTreeListCtrl.
1698    /// - [`TreeListItemComparator`] represents a C++ `wxTreeListItemComparator` class instance which your code has ownership, [`TreeListItemComparatorIsOwned`]`<false>` represents one which don't own.
1699    /// - Use [`TreeListItemComparator`]'s `new()` or [`Buildable::builder()`] (if available) to create an instance of this class.
1700    /// - See [C++ `wxTreeListItemComparator` class's documentation](https://docs.wxwidgets.org/3.2/classwx_tree_list_item_comparator.html) for more details.
1701    #[doc(alias = "wxTreeListItemComparator")]
1702    #[doc(alias = "TreeListItemComparator")]
1703    class TreeListItemComparator
1704        = TreeListItemComparatorIsOwned<true>(wxTreeListItemComparator) impl
1705        TreeListItemComparatorMethods
1706}
1707impl<const OWNED: bool> TreeListItemComparatorIsOwned<OWNED> {
1708    // BLOCKED: fn wxTreeListItemComparator()
1709    pub fn none() -> Option<&'static Self> {
1710        None
1711    }
1712}
1713impl Clone for TreeListItemComparatorIsOwned<false> {
1714    fn clone(&self) -> Self {
1715        Self(self.0)
1716    }
1717}
1718impl<const OWNED: bool> Drop for TreeListItemComparatorIsOwned<OWNED> {
1719    fn drop(&mut self) {
1720        if OWNED {
1721            unsafe { ffi::wxTreeListItemComparator_delete(self.0) }
1722        }
1723    }
1724}
1725
1726// wxTreebook
1727wxwidgets! {
1728    /// This class is an extension of the wxNotebook class that allows a tree structured set of pages to be shown in a control.
1729    /// - [`Treebook`] represents a C++ `wxTreebook` class instance which your code has ownership, [`TreebookIsOwned`]`<false>` represents one which don't own.
1730    /// - Use [`Treebook`]'s `new()` or [`Buildable::builder()`] (if available) to create an instance of this class.
1731    /// - See [C++ `wxTreebook` class's documentation](https://docs.wxwidgets.org/3.2/classwx_treebook.html) for more details.
1732    #[doc(alias = "wxTreebook")]
1733    #[doc(alias = "Treebook")]
1734    class Treebook
1735        = TreebookIsOwned<true>(wxTreebook) impl
1736        TreebookMethods,
1737        BookCtrlBaseMethods,
1738        ControlMethods,
1739        // WindowMethods,
1740        EvtHandlerMethods,
1741        ObjectMethods
1742}
1743impl<const OWNED: bool> TreebookIsOwned<OWNED> {
1744    /// Default constructor.
1745    ///
1746    /// See [C++ `wxTreebook::wxTreebook()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_treebook.html#acf521d7cb242cd792756ff6959fec797).
1747    pub fn new_2step() -> TreebookIsOwned<OWNED> {
1748        unsafe { TreebookIsOwned(ffi::wxTreebook_new()) }
1749    }
1750    /// Creates an empty wxTreebook.
1751    ///
1752    /// See [C++ `wxTreebook::wxTreebook()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_treebook.html#a9206f1a4a98bc1defb9244284bb01ab8).
1753    pub fn new<W: WindowMethods, P: PointMethods, S: SizeMethods>(
1754        parent: Option<&W>,
1755        id: c_int,
1756        pos: &P,
1757        size: &S,
1758        style: c_long,
1759        name: &str,
1760    ) -> TreebookIsOwned<OWNED> {
1761        unsafe {
1762            let parent = match parent {
1763                Some(r) => r.as_ptr(),
1764                None => ptr::null_mut(),
1765            };
1766            let pos = pos.as_ptr();
1767            let size = size.as_ptr();
1768            let name = WxString::from(name);
1769            let name = name.as_ptr();
1770            TreebookIsOwned(ffi::wxTreebook_new1(parent, id, pos, size, style, name))
1771        }
1772    }
1773    pub fn none() -> Option<&'static Self> {
1774        None
1775    }
1776}
1777impl<const OWNED: bool> Clone for TreebookIsOwned<OWNED> {
1778    fn clone(&self) -> Self {
1779        Self(self.0)
1780    }
1781}
1782impl<const OWNED: bool> From<TreebookIsOwned<OWNED>> for BookCtrlBaseIsOwned<OWNED> {
1783    fn from(o: TreebookIsOwned<OWNED>) -> Self {
1784        unsafe { Self::from_ptr(o.as_ptr()) }
1785    }
1786}
1787impl<const OWNED: bool> From<TreebookIsOwned<OWNED>> for ControlIsOwned<OWNED> {
1788    fn from(o: TreebookIsOwned<OWNED>) -> Self {
1789        unsafe { Self::from_ptr(o.as_ptr()) }
1790    }
1791}
1792impl<const OWNED: bool> From<TreebookIsOwned<OWNED>> for WindowIsOwned<OWNED> {
1793    fn from(o: TreebookIsOwned<OWNED>) -> Self {
1794        unsafe { Self::from_ptr(o.as_ptr()) }
1795    }
1796}
1797impl<const OWNED: bool> From<TreebookIsOwned<OWNED>> for EvtHandlerIsOwned<OWNED> {
1798    fn from(o: TreebookIsOwned<OWNED>) -> Self {
1799        unsafe { Self::from_ptr(o.as_ptr()) }
1800    }
1801}
1802impl<const OWNED: bool> From<TreebookIsOwned<OWNED>> for ObjectIsOwned<OWNED> {
1803    fn from(o: TreebookIsOwned<OWNED>) -> Self {
1804        unsafe { Self::from_ptr(o.as_ptr()) }
1805    }
1806}
1807impl<const OWNED: bool> DynamicCast for TreebookIsOwned<OWNED> {
1808    fn class_info() -> ClassInfoIsOwned<false> {
1809        unsafe { ClassInfoIsOwned::from_ptr(ffi::wxTreebook_CLASSINFO()) }
1810    }
1811}
1812impl<const OWNED: bool> WindowMethods for TreebookIsOwned<OWNED> {
1813    /// Creates a treebook control.
1814    ///
1815    /// See [C++ `wxTreebook::Create()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_treebook.html#ac6ff8c68c20d71c2c7d4b96bbe7714ce).
1816    fn create<W: WindowMethods, P: PointMethods, S: SizeMethods>(
1817        &self,
1818        parent: Option<&W>,
1819        id: c_int,
1820        pos: &P,
1821        size: &S,
1822        style: c_long,
1823        name: &str,
1824    ) -> bool {
1825        unsafe {
1826            let parent = match parent {
1827                Some(r) => r.as_ptr(),
1828                None => ptr::null_mut(),
1829            };
1830            let pos = pos.as_ptr();
1831            let size = size.as_ptr();
1832            let name = WxString::from(name);
1833            let name = name.as_ptr();
1834            ffi::wxTreebook_Create(self.as_ptr(), parent, id, pos, size, style, name)
1835        }
1836    }
1837}