Struct winsafe::gui::Resizer [−][src]
pub struct Resizer(_);
Expand description
When the parent window is resized, automatically adjusts position and size of child controls.
Implementations
Instantiates a new Resizer
, receiving the controls along with their
horizontal and vertical behaviors when the owner window is resized.
Examples
ⓘ
use winsafe::gui::{Button, Edit, Resizer, Resz, WindowMain};
let wnd: WindowMain; // initialized somewhere
let txt_name: Edit;
let txt_surname: Edit;
let txt_another: Edit;
let btn_click: Button;
let rads_countries: gui::RadioGroup,
let layout_resizer = Resizer::new(&wnd, &[
// The first parameter of the tuple is the horizontal behavior,
// the second one is the vertical behavior,
// and the third specifies all controls to which the behaviors apply.
//
// Horizontally: stretch or shrink.
// Vertically: don't move or stretch/shrink; do nothing.
(Resz::Resize, Resz::Nothing, &[&txt_name, &txt_surname]),
// Horizontally: don't move or stretch/shrink; do nothing.
// Vertically: move up or down.
(Resz::Resize, Resz::Repos, &[&txt_another]),
// Horizontally: move left or right.
// Vertically: move up or down.
(Resz::Repos, Resz::Repos, &[&btn_click]),
// Add all radio buttons of the radio group at once.
(Resz::Repos, Resz::Repos, &rads_countries.as_child_vec()),
]);
Panics
Panics if no child controls are passed.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Resizer
impl !UnwindSafe for Resizer
Blanket Implementations
Mutably borrows from an owned value. Read more