DataViewListCtrl

Struct DataViewListCtrl 

Source
pub struct DataViewListCtrl { /* private fields */ }
Expand description

A simplified DataViewCtrl that displays data in a list format.

DataViewListCtrl is a convenience wrapper around DataViewCtrl that simplifies the display of tabular data without requiring a custom model.

Implementations§

Source§

impl DataViewListCtrl

Source

pub fn builder(parent: &dyn WxWidget) -> DataViewListCtrlBuilder<'_>

Creates a builder for configuring and constructing a DataViewListCtrl.

Source

pub fn append_text_column( &self, label: &str, model_column: usize, align: DataViewAlign, width: i32, flags: DataViewColumnFlags, ) -> bool

Appends a text column to this list control.

§Parameters
  • label - The header label for the column
  • model_column - The column index in the data model
  • align - The text alignment
  • width - The column width (in pixels)
  • flags - Column flags (e.g., resizable, sortable)
§Returns

true if the column was successfully appended, false otherwise.

Source

pub fn append_toggle_column( &self, label: &str, model_column: usize, align: DataViewAlign, width: i32, flags: DataViewColumnFlags, ) -> bool

Appends a toggle column to this list control.

§Parameters
  • label - The header label for the column
  • model_column - The column index in the data model
  • align - The alignment of the checkbox
  • width - The column width (in pixels)
  • flags - Column flags
§Returns

true if the column was successfully appended, false otherwise.

Source

pub fn append_progress_column( &self, label: &str, model_column: usize, width: i32, flags: DataViewColumnFlags, ) -> bool

Appends a progress column to this list control.

§Parameters
  • label - The header label for the column
  • model_column - The column index in the data model
  • width - The column width (in pixels)
  • flags - Column flags
§Returns

true if the column was successfully appended, false otherwise.

Source

pub fn select_row(&self, row: usize) -> bool

Selects the specified row.

§Parameters
  • row - The row index to select
§Returns

true if the row was successfully selected, false otherwise.

Source

pub fn get_selected_row(&self) -> Option<usize>

Gets the currently selected row.

§Returns

An Option containing the index of the selected row, or None if no row is selected.

Source

pub fn unselect_all(&self)

Deselects all currently selected items.

Methods from Deref<Target = Window>§

Source

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.

Source

pub fn is_null(&self) -> bool

Checks if the underlying pointer is null.

Source

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.

Source

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

pub fn get_class_name(&self) -> Option<String>

Gets the wxWidgets class name for this window using built-in RTTI

Source

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 DataViewEventHandler for DataViewListCtrl

Source§

fn bind_dataview_event<F>(&self, event: DataViewEvent, callback: F)
where F: FnMut(DataViewEventData) + 'static,

Bind an event handler for DataView events
Source§

fn on_selection_changed<F>(&self, callback: F)
where F: FnMut(DataViewEventData) + 'static,

Binds a handler to the selection changed event
Source§

fn on_item_activated<F>(&self, callback: F)
where F: FnMut(DataViewEventData) + 'static,

Binds a handler to the item activated event
Source§

fn on_item_editing_started<F>(&self, callback: F)
where F: FnMut(DataViewEventData) + 'static,

Binds a handler to the item editing started event
Source§

fn on_item_editing_done<F>(&self, callback: F)
where F: FnMut(DataViewEventData) + 'static,

Binds a handler to the item editing done event
Source§

fn on_item_editing_cancelled<F>(&self, callback: F)
where F: FnMut(DataViewEventData) + 'static,

Binds a handler to the item editing cancelled event
Source§

fn on_column_header_click<F>(&self, callback: F)
where F: FnMut(DataViewEventData) + 'static,

Binds a handler to the column header click event
Source§

fn on_column_header_right_click<F>(&self, callback: F)
where F: FnMut(DataViewEventData) + 'static,

Binds a handler to the column header right click event
Source§

fn on_column_sorted<F>(&self, callback: F)
where F: FnMut(DataViewEventData) + 'static,

Binds a handler to the column sorted event
Source§

fn on_column_reordered<F>(&self, callback: F)
where F: FnMut(DataViewEventData) + 'static,

Binds a handler to the column reordered event
Source§

fn on_item_context_menu<F>(&self, callback: F)
where F: FnMut(DataViewEventData) + 'static,

Binds a handler to the item context menu event Read more
Source§

impl DerefMut for DataViewListCtrl

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl Drop for DataViewListCtrl

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl MenuEvents for DataViewListCtrl

Source§

fn on_menu_selected<F>(&self, callback: F)
where F: FnMut(MenuEventData) + 'static,

Binds a handler for menu selection events (wxEVT_MENU)
Source§

fn on_menu_opened<F>(&self, callback: F)
where F: FnMut(MenuEventData) + 'static,

Binds a handler for menu open events (wxEVT_MENU_OPEN)
Source§

fn on_menu_closed<F>(&self, callback: F)
where F: FnMut(MenuEventData) + 'static,

Binds a handler for menu close events (wxEVT_MENU_CLOSE)
Source§

fn on_menu_highlighted<F>(&self, callback: F)
where F: FnMut(MenuEventData) + 'static,

Binds a handler for menu highlight events (wxEVT_MENU_HIGHLIGHT)
Source§

fn on_context_menu<F>(&self, callback: F)
where F: FnMut(MenuEventData) + 'static,

Binds a handler for context menu events (wxEVT_CONTEXT_MENU)
Source§

impl WindowEvents for DataViewListCtrl

Source§

fn on_mouse_left_down<F>(&self, callback: F)
where F: FnMut(WindowEventData) + 'static,

Binds a handler to a category-specific event
Source§

fn on_mouse_left_up<F>(&self, callback: F)
where F: FnMut(WindowEventData) + 'static,

Binds a handler to a category-specific event
Source§

fn on_mouse_right_down<F>(&self, callback: F)
where F: FnMut(WindowEventData) + 'static,

Binds a handler to a category-specific event
Source§

fn on_mouse_right_up<F>(&self, callback: F)
where F: FnMut(WindowEventData) + 'static,

Binds a handler to a category-specific event
Source§

fn on_mouse_middle_down<F>(&self, callback: F)
where F: FnMut(WindowEventData) + 'static,

Binds a handler to a category-specific event
Source§

fn on_mouse_middle_up<F>(&self, callback: F)
where F: FnMut(WindowEventData) + 'static,

Binds a handler to a category-specific event
Source§

fn on_mouse_motion<F>(&self, callback: F)
where F: FnMut(WindowEventData) + 'static,

Binds a handler to a category-specific event
Source§

fn on_mouse_wheel<F>(&self, callback: F)
where F: FnMut(WindowEventData) + 'static,

Binds a handler to a category-specific event
Source§

fn on_mouse_enter<F>(&self, callback: F)
where F: FnMut(WindowEventData) + 'static,

Binds a handler to a category-specific event
Source§

fn on_mouse_leave<F>(&self, callback: F)
where F: FnMut(WindowEventData) + 'static,

Binds a handler to a category-specific event
Source§

fn on_key_down<F>(&self, callback: F)
where F: FnMut(WindowEventData) + 'static,

Binds a handler to a category-specific event
Source§

fn on_key_up<F>(&self, callback: F)
where F: FnMut(WindowEventData) + 'static,

Binds a handler to a category-specific event
Source§

fn on_char<F>(&self, callback: F)
where F: FnMut(WindowEventData) + 'static,

Binds a handler to a category-specific event
Source§

fn on_size<F>(&self, callback: F)
where F: FnMut(WindowEventData) + 'static,

Binds a handler to a category-specific event
Source§

fn on_move_event<F>(&self, callback: F)
where F: FnMut(WindowEventData) + 'static,

Binds a handler to a category-specific event
Source§

fn on_paint<F>(&self, callback: F)
where F: FnMut(WindowEventData) + 'static,

Binds a handler to a category-specific event
Source§

fn on_erase_background<F>(&self, callback: F)
where F: FnMut(WindowEventData) + 'static,

Binds a handler to a category-specific event
Source§

fn on_set_focus<F>(&self, callback: F)
where F: FnMut(WindowEventData) + 'static,

Binds a handler to a category-specific event
Source§

fn on_kill_focus<F>(&self, callback: F)
where F: FnMut(WindowEventData) + 'static,

Binds a handler to a category-specific event
Source§

fn on_idle<F>(&self, callback: F)
where F: FnMut(WindowEventData) + 'static,

Binds a handler to a category-specific event
Source§

fn on_close<F>(&self, callback: F)
where F: FnMut(WindowEventData) + 'static,

Binds a handler to a category-specific event
Source§

fn on_destroy<F>(&self, callback: F)
where F: FnMut(WindowEventData) + 'static,

Binds a handler to a category-specific event
Source§

impl WxEvtHandler for DataViewListCtrl

Source§

unsafe fn get_event_handler_ptr(&self) -> *mut wxd_EvtHandler_t

Returns the raw event handler pointer for this widget. Read more
Source§

impl WxWidget for DataViewListCtrl

Source§

fn handle_ptr(&self) -> *mut wxd_Window_t

Returns the raw underlying window pointer. Unsafe because the lifetime is not tied to self. Primarily for internal use or passing back to FFI.
Source§

fn get_id(&self) -> i32

Returns the window ID for this widget.
Source§

fn fit(&self)

Adjusts the window size to fit its contents or its sizer.
Source§

fn layout(&self)

Forces the window to recalculate its layout using its sizer. This is called when the window size changes to update the positions and sizes of child widgets according to the sizer constraints.
Source§

fn get_best_size(&self) -> Size

Gets the window’s sizer-calculated best size.
Source§

fn show(&self, show: bool)

Shows or hides the widget.
Source§

fn set_background_color(&self, color: Colour)

Sets the window’s background color.
Source§

fn set_background_style(&self, style: BackgroundStyle)

Sets the background style for the window. Read more
Source§

fn get_background_style(&self) -> BackgroundStyle

Gets the background style for the window.
Source§

fn set_min_size(&self, size: Size)

Sets the window’s minimum size.
Source§

fn refresh(&self, erase_background: bool, rect: Option<&Rect>)

Refreshes the window, optionally erasing the background and specifying a rectangle.
Source§

fn set_tooltip(&self, tip: &str)

Sets the tooltip string for this widget.
Source§

fn destroy(&self)

Explicitly destroys the underlying wxWidgets object. After calling this, the widget wrapper should not be used further. This is useful for dynamically creating and destroying widgets.
Source§

fn set_font(&self, font: &Font)

Source§

fn get_font(&self) -> Option<Font>

Gets the font currently used for this widget. Read more
Source§

fn get_sizer(&self) -> Option<Sizer>

Gets the sizer currently assigned to this widget. Read more
Source§

fn enable(&self, enable: bool)

Enables or disables the widget. Read more
Source§

fn is_enabled(&self) -> bool

Returns true if the widget is enabled, false otherwise.
Source§

fn get_position(&self) -> Point

Gets the window’s position relative to its parent.
Source§

fn get_size(&self) -> Size

Gets the window’s size.
Source§

fn set_size(&self, size: Size)

Sets the window’s size.
Source§

fn set_size_with_pos(&self, x: i32, y: i32, width: i32, height: i32)

Sets the window’s position and size.
Source§

fn set_client_size(&self, size: Size)

Sets the window’s client area size (the area inside borders, scrollbars, etc).
Source§

fn get_client_size(&self) -> Size

Gets the client area size.
Source§

fn get_min_size(&self) -> Size

Gets the window’s minimum size.
Source§

fn move_window(&self, x: i32, y: i32)

Moves the window to the specified position.
Source§

fn center(&self)

Centers the window relative to its parent.
Source§

fn centre(&self)

UK spelling alias for center()
Source§

fn client_to_screen(&self, pt: Point) -> Point

Converts client coordinates to screen coordinates.
Source§

fn screen_to_client(&self, pt: Point) -> Point

Converts screen coordinates to client coordinates.
Source§

fn get_label(&self) -> Option<String>

Gets the window label (title or text). Returns None if the label is not set, cannot be converted to UTF-8, or an error occurs.
Source§

fn set_label(&self, label: &str)

Sets the window label (title or text). Read more
Source§

fn set_extra_style(&self, extra_style: ExtraWindowStyle)

Sets the extra window style flags. Read more
Source§

fn set_extra_style_raw(&self, extra_style: i64)

Sets extra window style flags using raw i64 value. Read more
Source§

fn get_extra_style_raw(&self) -> i64

Gets the current extra window style flags as raw value. Read more
Source§

fn has_extra_style(&self, style: ExtraWindowStyle) -> bool

Checks if a specific extra window style flag is set. Read more
Source§

fn add_extra_style(&self, style: ExtraWindowStyle)

Adds extra window style flags to the current set. Read more
Source§

fn remove_extra_style(&self, style: ExtraWindowStyle)

Removes extra window style flags from the current set. Read more
Source§

fn get_parent(&self) -> Option<Window>

Gets the parent window of this widget. Read more
Source§

fn set_foreground_color(&self, color: Colour)

Sets the foreground color of the window. Read more
Source§

fn get_foreground_color(&self) -> Colour

Gets the foreground color of the window. Read more
Source§

fn get_background_color(&self) -> Colour

Gets the background color of the window. Read more
Source§

fn set_focus(&self)

Sets the focus to this window. Read more
Source§

fn has_focus(&self) -> bool

Returns true if this window currently has focus.
Source§

fn can_accept_focus(&self) -> bool

Returns true if this window can accept focus. Read more
Source§

fn accepts_focus_from_keyboard(&self) -> bool

Returns true if this window accepts focus from keyboard navigation. Read more
Source§

fn set_can_focus(&self, can_focus: bool)

Sets whether this window can accept focus. Read more
Source§

fn is_shown(&self) -> bool

Returns true if the window is currently shown. Read more
Source§

fn hide(&self)

Hides the window. Read more
Source§

fn set_max_size(&self, size: Size)

Sets the maximum size for the window. Read more
Source§

fn get_max_size(&self) -> Size

Gets the maximum size for the window. Read more
Source§

fn set_name(&self, name: &str)

Sets the window name. Read more
Source§

fn get_name(&self) -> String

Gets the window name. Read more
Source§

fn close(&self, force: bool) -> bool

Attempts to close the window. Read more
Source§

fn find_window_by_name(&self, name: &str) -> Option<Window>

Finds a child window by name. Read more
Source§

fn find_window_by_id(&self, id: i32) -> Option<Window>

Finds a child window by ID. Read more
Source§

fn set_cursor(&self, cursor: Option<&Cursor>)

Sets the cursor for this window. Read more
Source§

fn get_cursor(&self) -> Option<Cursor>

Gets the cursor currently associated with this window. Read more
Source§

fn raise(&self)

Raises the window to the top of the window hierarchy (Z-order). Read more
Source§

fn lower(&self)

Lowers the window to the bottom of the window hierarchy (Z-order). Read more
Source§

fn capture_mouse(&self)

Directs all mouse input to this window. Read more
Source§

fn release_mouse(&self)

Releases mouse capture. Read more
Source§

fn has_capture(&self) -> bool

Returns true if this window currently has mouse capture.
Source§

fn get_capture() -> Option<Window>
where Self: Sized,

Returns the window that currently has mouse capture. Read more
Source§

fn freeze(&self)

Freeze the window: don’t redraw it until it is thawed
Source§

fn thaw(&self)

Thaw the window: redraw it after it had been frozen
Source§

fn is_frozen(&self) -> bool

Return true if window had been frozen and not unthawed yet
Source§

fn get_text_extent(&self, text: &str) -> Size

Gets the dimensions of the string as it would be drawn on the window with the currently selected font. Read more
Source§

fn get_full_text_extent( &self, text: &str, font: Option<&Font>, ) -> (Size, i32, i32)

Gets the full dimensions of the string as it would be drawn on the window. Read more
Source§

fn get_char_height(&self) -> i32

Returns the character height for this window using the current font. Read more
Source§

fn get_char_width(&self) -> i32

Returns the average character width for this window using the current font. Read more
Source§

fn set_style(&self, style: WindowStyle)

Sets the window style flags. Read more
Source§

fn set_style_raw(&self, style: i64)

Sets window style flags using raw i64 value. Read more
Source§

fn get_style_raw(&self) -> i64

Gets the current window style flags as raw value. Read more
Source§

fn has_style(&self, style: WindowStyle) -> bool

Checks if a specific window style flag is set. Read more
Source§

fn add_style(&self, style: WindowStyle)

Adds window style flags to the current set. Read more
Source§

fn remove_style(&self, style: WindowStyle)

Removes window style flags from the current set. Read more
Source§

fn get_handle(&self) -> *mut c_void

Gets the native handle of the window (platform-specific). Read more
Source§

fn move_after_in_tab_order(&self, win: &dyn WxWidget)

Moves this window to appear after the specified window in the tab order. Read more
Source§

fn move_before_in_tab_order(&self, win: &dyn WxWidget)

Moves this window to appear before the specified window in the tab order. Read more
Source§

fn get_next_sibling(&self) -> Option<Window>

Gets the next sibling window in the parent’s child list. Read more
Source§

fn get_prev_sibling(&self) -> Option<Window>

Gets the previous sibling window in the parent’s child list. Read more
Source§

fn navigate(&self, forward: bool) -> bool

Navigates to the next or previous control. Read more
Source§

fn popup_menu(&self, menu: &Menu, pos: Option<Point>) -> bool

Shows a popup menu at the specified position or at the current mouse position. Read more
Source§

impl Deref for DataViewListCtrl

Source§

type Target = Window

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<W> WxWidgetDowncast for W
where W: WxWidget + Any,

Source§

fn downcast_ref<T>(&self) -> Option<&T>
where T: WxWidget + 'static,

Attempts to downcast this widget to a specific type. Returns 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,

Attempts to downcast this widget to a specific type (mutable). Returns Some(&mut T) if the widget is of type T, None otherwise.
Source§

fn widget_type_name(&self) -> &'static str

Returns the type name of this widget for debugging purposes.