pub struct Window(/* private fields */);Expand description
Represents a pointer to any wxDragon window object. This is typically used as a base struct or in trait objects. Note: Deliberately NOT Copy or Clone, as it represents unique FFI resource ownership.
Implementations§
Source§impl Window
impl Window
Sourcepub fn as_ptr(&self) -> *mut wxd_Window_t
pub fn as_ptr(&self) -> *mut wxd_Window_t
Returns the raw underlying pointer. Temporary: Made public for FFI callbacks until safe event handling is done.
Sourcepub fn set_sizer(&self, sizer: impl WxSizer, delete_old_sizer: bool)
pub fn set_sizer(&self, sizer: impl WxSizer, delete_old_sizer: bool)
Sets the window’s sizer.
Takes ownership of the Sizer object (caller should std::mem::forget it).
delete_old_sizer: If true, the previous sizer (if any) is deleted.
Sourcepub fn set_sizer_and_fit(&self, sizer: impl WxSizer, delete_old_sizer: bool)
pub fn set_sizer_and_fit(&self, sizer: impl WxSizer, delete_old_sizer: bool)
Sets the window’s sizer and calls Fit() on the window.
Takes ownership of the Sizer object (caller should std::mem::forget it).
delete_old_sizer: If true, the previous sizer (if any) is deleted.
Source§impl Window
impl Window
Sourcepub fn get_class_name(&self) -> Option<String>
pub fn get_class_name(&self) -> Option<String>
Gets the wxWidgets class name for this window using built-in RTTI
Sourcepub fn as_widget<T: FromWindowWithClassName>(&self) -> Option<T>
pub fn as_widget<T: FromWindowWithClassName>(&self) -> Option<T>
Generic method to cast this window to a specific widget type Uses wxWidgets’ built-in RTTI to safely verify the type before casting
Trait Implementations§
Source§impl WxEvtHandler for Window
impl WxEvtHandler for Window
Source§unsafe fn get_event_handler_ptr(&self) -> *mut wxd_EvtHandler_t
unsafe fn get_event_handler_ptr(&self) -> *mut wxd_EvtHandler_t
Source§fn unbind(&self, token: EventToken) -> bool
fn unbind(&self, token: EventToken) -> bool
Source§fn unbind_all(&self) -> usize
fn unbind_all(&self) -> usize
Source§impl WxWidget for Window
impl WxWidget for Window
Source§fn handle_ptr(&self) -> *mut wxd_Window_t
fn handle_ptr(&self) -> *mut wxd_Window_t
Source§fn layout(&self)
fn layout(&self)
Source§fn get_best_size(&self) -> Size
fn get_best_size(&self) -> Size
Source§fn set_background_color(&self, color: Colour)
fn set_background_color(&self, color: Colour)
Source§fn set_background_style(&self, style: BackgroundStyle)
fn set_background_style(&self, style: BackgroundStyle)
Source§fn get_background_style(&self) -> BackgroundStyle
fn get_background_style(&self) -> BackgroundStyle
Source§fn set_min_size(&self, size: Size)
fn set_min_size(&self, size: Size)
Source§fn refresh(&self, erase_background: bool, rect: Option<&Rect>)
fn refresh(&self, erase_background: bool, rect: Option<&Rect>)
Source§fn set_tooltip(&self, tip: &str)
fn set_tooltip(&self, tip: &str)
Source§fn destroy(&self)
fn destroy(&self)
fn set_font(&self, font: &Font)
Source§fn get_sizer(&self) -> Option<Sizer>
fn get_sizer(&self) -> Option<Sizer>
Source§fn is_enabled(&self) -> bool
fn is_enabled(&self) -> bool
true if the widget is enabled, false otherwise.Source§fn get_position(&self) -> Point
fn get_position(&self) -> Point
Source§fn set_size_with_pos(&self, x: i32, y: i32, width: i32, height: i32)
fn set_size_with_pos(&self, x: i32, y: i32, width: i32, height: i32)
Source§fn set_client_size(&self, size: Size)
fn set_client_size(&self, size: Size)
Source§fn get_client_size(&self) -> Size
fn get_client_size(&self) -> Size
Source§fn get_min_size(&self) -> Size
fn get_min_size(&self) -> Size
Source§fn move_window(&self, x: i32, y: i32)
fn move_window(&self, x: i32, y: i32)
Source§fn client_to_screen(&self, pt: Point) -> Point
fn client_to_screen(&self, pt: Point) -> Point
Source§fn screen_to_client(&self, pt: Point) -> Point
fn screen_to_client(&self, pt: Point) -> Point
Source§fn get_label(&self) -> Option<String>
fn get_label(&self) -> Option<String>
None if the label is not set, cannot be converted to UTF-8, or an error occurs.Source§fn set_extra_style(&self, extra_style: ExtraWindowStyle)
fn set_extra_style(&self, extra_style: ExtraWindowStyle)
Source§fn set_extra_style_raw(&self, extra_style: i64)
fn set_extra_style_raw(&self, extra_style: i64)
Source§fn get_extra_style_raw(&self) -> i64
fn get_extra_style_raw(&self) -> i64
Source§fn has_extra_style(&self, style: ExtraWindowStyle) -> bool
fn has_extra_style(&self, style: ExtraWindowStyle) -> bool
Source§fn add_extra_style(&self, style: ExtraWindowStyle)
fn add_extra_style(&self, style: ExtraWindowStyle)
Source§fn remove_extra_style(&self, style: ExtraWindowStyle)
fn remove_extra_style(&self, style: ExtraWindowStyle)
Source§fn set_foreground_color(&self, color: Colour)
fn set_foreground_color(&self, color: Colour)
Source§fn get_foreground_color(&self) -> Colour
fn get_foreground_color(&self) -> Colour
Source§fn get_background_color(&self) -> Colour
fn get_background_color(&self) -> Colour
Source§fn can_accept_focus(&self) -> bool
fn can_accept_focus(&self) -> bool
true if this window can accept focus. Read moreSource§fn accepts_focus_from_keyboard(&self) -> bool
fn accepts_focus_from_keyboard(&self) -> bool
true if this window accepts focus from keyboard navigation. Read moreSource§fn set_can_focus(&self, can_focus: bool)
fn set_can_focus(&self, can_focus: bool)
Source§fn set_max_size(&self, size: Size)
fn set_max_size(&self, size: Size)
Source§fn get_max_size(&self) -> Size
fn get_max_size(&self) -> Size
Source§fn find_window_by_name(&self, name: &str) -> Option<Window>
fn find_window_by_name(&self, name: &str) -> Option<Window>
Source§fn get_cursor(&self) -> Option<Cursor>
fn get_cursor(&self) -> Option<Cursor>
Source§fn capture_mouse(&self)
fn capture_mouse(&self)
Source§fn release_mouse(&self)
fn release_mouse(&self)
Source§fn has_capture(&self) -> bool
fn has_capture(&self) -> bool
true if this window currently has mouse capture.Source§fn get_capture() -> Option<Window>where
Self: Sized,
fn get_capture() -> Option<Window>where
Self: Sized,
Source§fn get_text_extent(&self, text: &str) -> Size
fn get_text_extent(&self, text: &str) -> Size
Source§fn get_full_text_extent(
&self,
text: &str,
font: Option<&Font>,
) -> (Size, i32, i32)
fn get_full_text_extent( &self, text: &str, font: Option<&Font>, ) -> (Size, i32, i32)
Source§fn get_char_height(&self) -> i32
fn get_char_height(&self) -> i32
Source§fn get_char_width(&self) -> i32
fn get_char_width(&self) -> i32
Source§fn set_style(&self, style: WindowStyle)
fn set_style(&self, style: WindowStyle)
Source§fn set_style_raw(&self, style: i64)
fn set_style_raw(&self, style: i64)
Source§fn get_style_raw(&self) -> i64
fn get_style_raw(&self) -> i64
Source§fn has_style(&self, style: WindowStyle) -> bool
fn has_style(&self, style: WindowStyle) -> bool
Source§fn add_style(&self, style: WindowStyle)
fn add_style(&self, style: WindowStyle)
Source§fn remove_style(&self, style: WindowStyle)
fn remove_style(&self, style: WindowStyle)
Source§fn get_handle(&self) -> *mut c_void
fn get_handle(&self) -> *mut c_void
Source§fn move_after_in_tab_order(&self, win: &dyn WxWidget)
fn move_after_in_tab_order(&self, win: &dyn WxWidget)
Source§fn move_before_in_tab_order(&self, win: &dyn WxWidget)
fn move_before_in_tab_order(&self, win: &dyn WxWidget)
Source§fn get_next_sibling(&self) -> Option<Window>
fn get_next_sibling(&self) -> Option<Window>
Source§fn get_prev_sibling(&self) -> Option<Window>
fn get_prev_sibling(&self) -> Option<Window>
impl Copy for Window
impl Eq for Window
impl StructuralPartialEq for Window
Auto Trait Implementations§
impl Freeze for Window
impl RefUnwindSafe for Window
impl !Send for Window
impl !Sync for Window
impl Unpin for Window
impl UnwindSafe for Window
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<W> WindowXrcMethods for Wwhere
W: WxWidget,
impl<W> WindowXrcMethods for Wwhere
W: WxWidget,
Source§fn find_child_by_xrc_name<T: FromXrcPtr<RawFfiType = *mut wxd_Window_t> + WxWidget>(
&self,
name: &str,
) -> Option<T>
fn find_child_by_xrc_name<T: FromXrcPtr<RawFfiType = *mut wxd_Window_t> + WxWidget>( &self, name: &str, ) -> Option<T>
Source§impl<W> WxWidgetDowncast for W
impl<W> WxWidgetDowncast for W
Source§fn downcast_ref<T>(&self) -> Option<&T>where
T: WxWidget + 'static,
fn downcast_ref<T>(&self) -> Option<&T>where
T: WxWidget + 'static,
Some(&T) if the widget is of type T, None otherwise.Source§fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: WxWidget + 'static,
fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: WxWidget + 'static,
Some(&mut T) if the widget is of type T, None otherwise.