Struct winsafe::gui::WindowControl
source · pub struct WindowControl(/* private fields */);
Available on crate feature
gui
only.Expand description
An user child window, which can handle events. Can be programmatically
created or load a dialog resource from a .res
file.
Implementations§
source§impl WindowControl
impl WindowControl
sourcepub fn new(parent: &impl GuiParent, opts: WindowControlOpts) -> Self
pub fn new(parent: &impl GuiParent, opts: WindowControlOpts) -> Self
Instantiates a new WindowControl
object, to be created internally with
HWND::CreateWindowEx
.
§Panics
Panics if the parent window was already created – that is, you cannot
dynamically create a WindowControl
in an event closure.
sourcepub fn new_dlg(
parent: &impl GuiParent,
dialog_id: u16,
position: POINT,
resize_behavior: (Horz, Vert),
ctrl_id: Option<u16>
) -> Self
pub fn new_dlg( parent: &impl GuiParent, dialog_id: u16, position: POINT, resize_behavior: (Horz, Vert), ctrl_id: Option<u16> ) -> Self
Instantiates a new WindowControl
object, to be loaded from a dialog
resource with
HINSTANCE::CreateDialogParam
.
If the parent window is a dialog, position is in Dialog Template Units; otherwise in pixels, which will be multiplied to match current system DPI.
§Panics
Panics if the parent dialog was already created – that is, you cannot
dynamically create a WindowControl
in an event closure.
Trait Implementations§
source§impl Clone for WindowControl
impl Clone for WindowControl
source§fn clone(&self) -> WindowControl
fn clone(&self) -> WindowControl
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl GuiChild for WindowControl
impl GuiChild for WindowControl
source§impl GuiParent for WindowControl
impl GuiParent for WindowControl
source§fn on(&self) -> &WindowEvents
fn on(&self) -> &WindowEvents
Exposes methods to handle the basic window messages, plus timer and
native control notifications. Read more
source§fn spawn_new_thread<F>(&self, func: F)
fn spawn_new_thread<F>(&self, func: F)
This method calls
std::thread::spawn
, but it allows the returning of
an error value. This error value will be forwarded to the original UI
thread, allowing it to be caught at
WindowMain::run_main
. Read moresource§impl GuiWindow for WindowControl
impl GuiWindow for WindowControl
impl Send for WindowControl
Auto Trait Implementations§
impl Freeze for WindowControl
impl !RefUnwindSafe for WindowControl
impl !Sync for WindowControl
impl Unpin for WindowControl
impl !UnwindSafe for WindowControl
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
Mutably borrows from an owned value. Read more