Struct winsafe::gui::Edit [−][src]
pub struct Edit(_);
Implementations
Instantiates a new Edit
object, to be created on the parent window
with HWND::CreateWindowEx
.
Instantiates a new Edit
object, to be loaded from a dialog resource
with HWND::GetDlgItem
.
Returns the underlying handle for this control.
Note: the handle is initially null, receiving an actual value
only after the control is physically created, what usually happens
right before
WM_CREATE
or
WM_INITDIALOG
events.
Focuses the control by sending a
wm::NextDlgCtl
message.
Exposes the subclass events. If at least one event exists, the control will be subclassed.
Note: Subclassing may impact performance, use with care.
Panics
Panics if the control or the parent window are already created. Events must be set before control and parent window creation.
Exposes the control events.
These event methods are just proxies to the
WindowEvents
of the parent
window, who is the real responsible for the child event handling.
Panics
Panics if the control or the parent window are already created. Events must be set before control and parent window creation.
Sets the selection range of the text by sending an
em::SetSel
message.
Examples
Selecting all text in the control:
use winsafe::gui;
let my_edit: gui::Edit; // initialized somewhere
my_edit.set_selection(Some(0), None);
Clearing the selection:
use winsafe::gui;
let my_edit: gui::Edit; // initialized somewhere
my_edit.set_selection(None, None);
Sets the text in the control by calling
SetWindowText
.
Examples
use winsafe::gui;
let my_edit: gui::Edit; // initialized somewhere
my_edit.set_text("This my text")?;
Retrieves the text in the control by calling
HWND::GetWindowText
.
use winsafe::gui;
let my_edit: gui::Edit; // initialized somewhere
println!("The text is: {}", my_edit.text()?);
Trait Implementations
Auto Trait Implementations
Blanket Implementations
Mutably borrows from an owned value. Read more