Struct native_windows_gui::TabsContainer
source · [−]pub struct TabsContainer {
pub handle: ControlHandle,
/* private fields */
}
Expand description
A tabs container is a frame-like control that can contain Tab
control.
Tabs are added by specifying the TabsContainer
as parent in the Tab
builder.
Do not add other control type as children to the TabsContainer
Requires the tabs
feature
Builder parameters:
parent
: Required. The button parent container.position
: The tab container position.font
: The font used for the tabs titleflags
: A combination of theTabsContainerFlags
values.ex_flags
: A combination of win32 window extended flags. Unlikeflags
, ex_flags must be used straight from winapiimage_list
: The image list specifying the tabs icons
Control events:
TabsContainerChanged
: The select tab of a TabsContainer changedTabsContainerChanging
: The selected tab of a TabsContainer is about to be changedMousePress(_)
: Generic mouse press events on the buttonOnMouseMove
: Generic mouse mouse eventOnMouseWheel
: Generic mouse wheel event
Fields
handle: ControlHandle
Implementations
sourceimpl TabsContainer
impl TabsContainer
pub fn builder<'a>() -> TabsContainerBuilder<'a>
sourcepub fn selected_tab(&self) -> usize
pub fn selected_tab(&self) -> usize
Return the index of the currently selected tab
May return usize::max_value()
if no tab is selected
sourcepub fn set_selected_tab(&self, index: usize)
pub fn set_selected_tab(&self, index: usize)
Set the currently selected tab by index
sourcepub fn set_image_list(&self, list: Option<&ImageList>)
pub fn set_image_list(&self, list: Option<&ImageList>)
Sets the image list of the tab container. Pass None to remove the image list.
This is only available is the feature “image-list” is enabled.
sourcepub fn image_list(&self) -> Option<ImageList>
pub fn image_list(&self) -> Option<ImageList>
Returns a reference to the current image list in the tab container. The image list is not owned and dropping it won’t free the resources.
This is only available is the feature “image-list” is enabled.
sourcepub fn enabled(&self) -> bool
pub fn enabled(&self) -> bool
Return true if the control user can interact with the control, return false otherwise
sourcepub fn set_enabled(&self, v: bool)
pub fn set_enabled(&self, v: bool)
Enable or disable the control
sourcepub fn visible(&self) -> bool
pub fn visible(&self) -> bool
Return true if the control is visible to the user. Will return true even if the control is outside of the parent client view (ex: at the position (10000, 10000))
sourcepub fn set_visible(&self, v: bool)
pub fn set_visible(&self, v: bool)
Show or hide the control to the user
sourcepub fn position(&self) -> (i32, i32)
pub fn position(&self) -> (i32, i32)
Return the position of the tabs container in the parent window
sourcepub fn set_position(&self, x: i32, y: i32)
pub fn set_position(&self, x: i32, y: i32)
Set the position of the tabs container in the parent window
sourcepub fn class_name(&self) -> &'static str
pub fn class_name(&self) -> &'static str
Winapi class name used during control creation
sourcepub fn forced_flags(&self) -> u32
pub fn forced_flags(&self) -> u32
Winapi flags required by the control
Trait Implementations
sourceimpl Default for TabsContainer
impl Default for TabsContainer
sourcefn default() -> TabsContainer
fn default() -> TabsContainer
Returns the “default value” for a type. Read more
sourceimpl Drop for TabsContainer
impl Drop for TabsContainer
sourceimpl From<&TabsContainer> for ControlHandle
impl From<&TabsContainer> for ControlHandle
sourcefn from(control: &TabsContainer) -> Self
fn from(control: &TabsContainer) -> Self
Converts to this type from the input type.
sourceimpl From<&mut TabsContainer> for ControlHandle
impl From<&mut TabsContainer> for ControlHandle
sourcefn from(control: &mut TabsContainer) -> Self
fn from(control: &mut TabsContainer) -> Self
Converts to this type from the input type.
sourceimpl PartialEq<ControlHandle> for TabsContainer
impl PartialEq<ControlHandle> for TabsContainer
sourcefn eq(&self, other: &ControlHandle) -> bool
fn eq(&self, other: &ControlHandle) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourceimpl PartialEq<TabsContainer> for ControlHandle
impl PartialEq<TabsContainer> for ControlHandle
sourcefn eq(&self, other: &TabsContainer) -> bool
fn eq(&self, other: &TabsContainer) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourceimpl PartialEq<TabsContainer> for TabsContainer
impl PartialEq<TabsContainer> for TabsContainer
Auto Trait Implementations
impl !RefUnwindSafe for TabsContainer
impl !Send for TabsContainer
impl !Sync for TabsContainer
impl Unpin for TabsContainer
impl UnwindSafe for TabsContainer
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more