1use super::*;
2
3wxwidgets! {
5 #[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 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
56wxwidgets! {
58 #[doc(alias = "wxTIFFHandler")]
63 #[doc(alias = "TIFFHandler")]
64 class TIFFHandler
65 = TIFFHandlerIsOwned<true>(wxTIFFHandler) impl
66 TIFFHandlerMethods,
67 ObjectMethods
69}
70impl<const OWNED: bool> TIFFHandlerIsOwned<OWNED> {
71 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 }
111
112wxwidgets! {
114 #[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 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
153wxwidgets! {
155 #[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 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
201wxwidgets! {
203 #[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 pub fn new() -> TextAttrIsOwned<OWNED> {
218 unsafe { TextAttrIsOwned(ffi::wxTextAttr_new()) }
219 }
220 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
246wxwidgets! {
248 #[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 pub fn new_2step() -> TextCtrlIsOwned<OWNED> {
267 unsafe { TextCtrlIsOwned(ffi::wxTextCtrl_new()) }
268 }
269 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}
333impl<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
340wxwidgets! {
342 #[doc(alias = "wxTextDataObject")]
347 #[doc(alias = "TextDataObject")]
348 class TextDataObject
349 = TextDataObjectIsOwned<true>(wxTextDataObject) impl
350 TextDataObjectMethods,
351 DataObjectMethods
353}
354impl<const OWNED: bool> TextDataObjectIsOwned<OWNED> {
355 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 }
394
395wxwidgets! {
397 #[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 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
432wxwidgets! {
434 #[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
462wxwidgets! {
464 #[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 pub fn new_2step() -> TextEntryDialogIsOwned<OWNED> {
485 unsafe { TextEntryDialogIsOwned(ffi::wxTextEntryDialog_new()) }
486 }
487 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
560wxwidgets! {
562 #[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 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 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
623wxwidgets! {
625 #[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 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
671wxwidgets! {
673 #[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 pub fn new_2step() -> TimePickerCtrlIsOwned<OWNED> {
692 unsafe { TimePickerCtrlIsOwned(ffi::wxTimePickerCtrl_new()) }
693 }
694 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
764wxwidgets! {
766 #[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 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
795wxwidgets! {
797 #[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 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
875wxwidgets! {
877 #[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 pub fn new_2step() -> ToggleButtonIsOwned<OWNED> {
897 unsafe { ToggleButtonIsOwned(ffi::wxToggleButton_new()) }
898 }
899 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
969wxwidgets! {
971 #[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 pub fn new_2step() -> ToolBarIsOwned<OWNED> {
990 unsafe { ToolBarIsOwned(ffi::wxToolBar_new()) }
991 }
992 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
1050wxwidgets! {
1052 #[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 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
1101wxwidgets! {
1103 #[doc(alias = "wxToolbook")]
1108 #[doc(alias = "Toolbook")]
1109 class Toolbook
1110 = ToolbookIsOwned<true>(wxToolbook) impl
1111 ToolbookMethods,
1112 BookCtrlBaseMethods,
1113 ControlMethods,
1114 EvtHandlerMethods,
1116 ObjectMethods
1117}
1118impl<const OWNED: bool> ToolbookIsOwned<OWNED> {
1119 pub fn new_2step() -> ToolbookIsOwned<OWNED> {
1123 unsafe { ToolbookIsOwned(ffi::wxToolbook_new()) }
1124 }
1125 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 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
1213wxwidgets! {
1215 #[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 pub fn new_2step() -> TopLevelWindowIsOwned<OWNED> {
1234 unsafe { TopLevelWindowIsOwned(ffi::wxTopLevelWindow_new()) }
1235 }
1236 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
1299wxwidgets! {
1301 #[doc(alias = "wxTreeCtrl")]
1306 #[doc(alias = "TreeCtrl")]
1307 class TreeCtrl
1308 = TreeCtrlIsOwned<true>(wxTreeCtrl) impl
1309 TreeCtrlMethods,
1310 EvtHandlerMethods,
1313 ObjectMethods
1314}
1315impl<const OWNED: bool> TreeCtrlIsOwned<OWNED> {
1316 pub fn new_2step() -> TreeCtrlIsOwned<OWNED> {
1320 unsafe { TreeCtrlIsOwned(ffi::wxTreeCtrl_new()) }
1321 }
1322 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 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 fn set_window_style(&self, styles: c_long) {
1416 unsafe { ffi::wxTreeCtrl_SetWindowStyle(self.as_ptr(), styles) }
1417 }
1418}
1419
1420wxwidgets! {
1422 #[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 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
1480wxwidgets! {
1482 #[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 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
1522wxwidgets! {
1524 #[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 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
1558wxwidgets! {
1560 #[doc(alias = "wxTreeListCtrl")]
1565 #[doc(alias = "TreeListCtrl")]
1566 class TreeListCtrl
1567 = TreeListCtrlIsOwned<true>(wxTreeListCtrl) impl
1568 TreeListCtrlMethods,
1569 EvtHandlerMethods,
1571 ObjectMethods
1572}
1573impl<const OWNED: bool> TreeListCtrlIsOwned<OWNED> {
1574 pub fn new_2step() -> TreeListCtrlIsOwned<OWNED> {
1578 unsafe { TreeListCtrlIsOwned(ffi::wxTreeListCtrl_new()) }
1579 }
1580 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 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
1659wxwidgets! {
1661 #[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 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
1695wxwidgets! {
1697 #[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 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
1726wxwidgets! {
1728 #[doc(alias = "wxTreebook")]
1733 #[doc(alias = "Treebook")]
1734 class Treebook
1735 = TreebookIsOwned<true>(wxTreebook) impl
1736 TreebookMethods,
1737 BookCtrlBaseMethods,
1738 ControlMethods,
1739 EvtHandlerMethods,
1741 ObjectMethods
1742}
1743impl<const OWNED: bool> TreebookIsOwned<OWNED> {
1744 pub fn new_2step() -> TreebookIsOwned<OWNED> {
1748 unsafe { TreebookIsOwned(ffi::wxTreebook_new()) }
1749 }
1750 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 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}