Struct winsafe::gui::ProgressBar
source · pub struct ProgressBar(/* private fields */);
gui
only.Expand description
Native progress bar control.
Implementations§
source§impl ProgressBar
impl ProgressBar
sourcepub fn new(parent: &impl GuiParent, opts: ProgressBarOpts) -> Self
pub fn new(parent: &impl GuiParent, opts: ProgressBarOpts) -> Self
Instantiates a new ProgressBar
object, to be created on the parent
window with
HWND::CreateWindowEx
.
§Panics
Panics if the parent window was already created – that is, you cannot
dynamically create a ProgressBar
in an event closure.
sourcepub fn new_dlg(
parent: &impl GuiParent,
ctrl_id: u16,
resize_behavior: (Horz, Vert)
) -> Self
pub fn new_dlg( parent: &impl GuiParent, ctrl_id: u16, resize_behavior: (Horz, Vert) ) -> Self
Instantiates a new ProgressBar
object, to be loaded from a dialog
resource with
HWND::GetDlgItem
.
§Panics
Panics if the parent dialog was already created – that is, you cannot
dynamically create a ProgressBar
in an event closure.
sourcepub fn position(&self) -> u32
pub fn position(&self) -> u32
Retrieves the current position by sending a
pbm::GetPos
message.
sourcepub fn range(&self) -> (u32, u32)
pub fn range(&self) -> (u32, u32)
Retrieves the current minimum and maximum values by sending a
pbm::GetRange
message. Default values are
0 and 100.
sourcepub fn set_marquee(&self, marquee: bool)
pub fn set_marquee(&self, marquee: bool)
Sets or unsets the marquee mode by sending a
pbm::SetMarquee
message combined with a
SetWindowLongPtr
call
for a style change.
sourcepub fn set_position(&self, position: u32) -> u32
pub fn set_position(&self, position: u32) -> u32
Sets the current position by sending a
pbm::SetPos
message, returning the previous
position.
sourcepub fn set_range(&self, min: u32, max: u32)
pub fn set_range(&self, min: u32, max: u32)
Sets the minimum and maximum values by sending a
pbm::SetRange32
message. Default values
are 0 and 100.
sourcepub fn set_state(&self, state: PBST) -> PBST
pub fn set_state(&self, state: PBST) -> PBST
Sets the current state by sending a
pbm::SetState
message, retuning the
previous state.
sourcepub fn state(&self) -> PBST
pub fn state(&self) -> PBST
Retrieves the current state by sending a
pbm::GetState
message.
Trait Implementations§
source§impl Clone for ProgressBar
impl Clone for ProgressBar
source§fn clone(&self) -> ProgressBar
fn clone(&self) -> ProgressBar
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more