/// Rearranges all child controls to fit the new width/height of parent
/// window.

Rearranges all child controls to fit the new width/height of parent
window.
Rearranges all child controls to fit the new width / height of parent window .
pub(in crate::gui) fn rearrange(&self, p: &wm::Size) {
		if self.0.ctrls.is_empty() // no controls
			|| p.request == co::SIZE_R::MINIMIZED { // we're minimized
			return;
		}
		let hdwp = HDWP::BeginDeferWindowPos(self.0.ctrls.len() as _).unwrap();
		for ctrl in self.0.ctrls.iter() {
			let mut uflags = co::SWP::NOZORDER;
			if ctrl.horz == Horz::Repos && ctrl.vert == Vert::Repos { // reposition both vert & horz
				uflags |= co::SWP::NOSIZE;
			} else if ctrl.horz == Horz::Resize && ctrl.vert == Vert::Resize { // resize both vert & horz
				uflags |= co::SWP::NOMOVE;
			}
			let sz_parent_orig = *self.0.sz_parent_orig;
			hdwp.DeferWindowPos(
				ctrl.hchild,
				HwndPlace::None,
				POINT::new(
					match ctrl.horz {
						Horz::Repos => p.client_area.cx - sz_parent_orig.cx + ctrl.rc_orig.left,
						_ => ctrl.rc_orig.left // keep original x pos
					},
					match ctrl.vert {
						Vert::Repos => p.client_area.cy - sz_parent_orig.cy + ctrl.rc_orig.top,
						_ => ctrl.rc_orig.top // keep original y pos
					},
				),
				SIZE::new(
					match ctrl.horz {
						Horz::Resize => p.client_area.cx - sz_parent_orig.cx + ctrl.rc_orig.right - ctrl.rc_orig.left,
						_ => ctrl.rc_orig.right - ctrl.rc_orig.left // keep original width
					},
					match ctrl.vert {
						Vert::Resize => p.client_area.cy - sz_parent_orig.cy + ctrl.rc_orig.bottom - ctrl.rc_orig.top,
						_ =>ctrl.rc_orig.bottom - ctrl.rc_orig.top // keep original height
					},
				),
				uflags,
			).unwrap();
		}
		hdwp.EndDeferWindowPos().unwrap();
	}
pub ( in crate :: gui ) fn rearrange ( & self , p : & wm :: Size ) { if self . 0 . ctrls . is_empty ( ) // no controls
 || p . request == co :: SIZE_R :: MINIMIZED { // we're minimized
 return ; } let hdwp = HDWP :: BeginDeferWindowPos ( self . 0 . ctrls . len ( ) as _ ) . unwrap ( ) ; for ctrl in self . 0 . ctrls . iter ( ) { let mut uflags = co :: SWP :: NOZORDER ; if ctrl . horz == Horz :: Repos && ctrl . vert == Vert :: Repos { // reposition both vert & horz
 uflags |= co :: SWP :: NOSIZE ; } else if ctrl . horz == Horz :: Resize && ctrl . vert == Vert :: Resize { // resize both vert & horz
 uflags |= co :: SWP :: NOMOVE ; } let sz_parent_orig = * self . 0 . sz_parent_orig ; hdwp . DeferWindowPos ( ctrl . hchild , HwndPlace :: None , POINT :: new ( match ctrl . horz { Horz :: Repos => p . client_area . cx - sz_parent_orig . cx + ctrl . rc_orig . left , _ => ctrl . rc_orig . left // keep original x pos
 } , match ctrl . vert { Vert :: Repos => p . client_area . cy - sz_parent_orig . cy + ctrl . rc_orig . top , _ => ctrl . rc_orig . top // keep original y pos
 } , ) , SIZE :: new ( match ctrl . horz { Horz :: Resize => p . client_area . cx - sz_parent_orig . cx + ctrl . rc_orig . right - ctrl . rc_orig . left , _ => ctrl . rc_orig . right - ctrl . rc_orig . left // keep original width
 } , match ctrl . vert { Vert :: Resize => p . client_area . cy - sz_parent_orig . cy + ctrl . rc_orig . bottom - ctrl . rc_orig . top , _ => ctrl . rc_orig . bottom - ctrl . rc_orig . top // keep original height
 } , ) , uflags , ) . unwrap ( ) ; } hdwp . EndDeferWindowPos ( ) . unwrap ( ) ; }
Rearranges all child controls to fit the new width/height of parent
window.
Rearranges all child controls to fit the new width / height of parent window .
&self
p
&wm::Size