Struct widgetry::widgets::panel::Panel [−][src]
pub struct Panel { top_level: Widget, cached_flexbox: Option<(Stretch, Vec<Node>, ScreenDims)>, horiz: HorizontalAlignment, vert: VerticalAlignment, dims: Dims, scrollable_x: bool, scrollable_y: bool, contents_dims: ScreenDims, container_dims: ScreenDims, clip_rect: Option<ScreenRectangle>, }
Fields
top_level: Widget
cached_flexbox: Option<(Stretch, Vec<Node>, ScreenDims)>
horiz: HorizontalAlignment
vert: VerticalAlignment
dims: Dims
scrollable_x: bool
scrollable_y: bool
contents_dims: ScreenDims
container_dims: ScreenDims
clip_rect: Option<ScreenRectangle>
Implementations
impl Panel
[src]
impl Panel
[src]pub fn new_builder(top_level: Widget) -> PanelBuilder
[src]
pub fn empty(ctx: &mut EventCtx<'_>) -> Panel
[src]
Returns an empty panel. event
and draw
will have no effect.
fn update_container_dims_for_canvas_dims(&mut self, canvas_dims: ScreenDims)
[src]
fn recompute_scrollbar_layout(&mut self, ctx: &EventCtx<'_>)
[src]
fn recompute_layout(&mut self, ctx: &EventCtx<'_>, recompute_bg: bool)
[src]
fn invalidate_flexbox(&mut self)
[src]
fn compute_flexbox(&self) -> (Stretch, Vec<Node>, ScreenDims)
[src]
fn recompute_layout_if_needed(&mut self, ctx: &EventCtx<'_>, recompute_bg: bool)
[src]
fn scroll_offset(&self) -> (f64, f64)
[src]
fn update_scroll_sliders(
&mut self,
ctx: &EventCtx<'_>,
offset: (f64, f64)
) -> bool
[src]
&mut self,
ctx: &EventCtx<'_>,
offset: (f64, f64)
) -> bool
fn set_scroll_offset(&mut self, ctx: &EventCtx<'_>, offset: (f64, f64))
[src]
pub fn event(&mut self, ctx: &mut EventCtx<'_>) -> Outcome
[src]
pub fn draw(&self, g: &mut GfxCtx<'_>)
[src]
pub fn get_all_click_actions(&self) -> HashSet<String>
[src]
pub fn restore(&mut self, ctx: &mut EventCtx<'_>, prev: &Panel)
[src]
pub fn scroll_to_member(&mut self, ctx: &EventCtx<'_>, name: String)
[src]
pub fn has_widget(&self, name: &str) -> bool
[src]
pub fn slider(&self, name: &str) -> &Slider
[src]
pub fn slider_mut(&mut self, name: &str) -> &mut Slider
[src]
pub fn take_menu_choice<T: 'static>(&mut self, name: &str) -> T
[src]
pub fn is_checked(&self, name: &str) -> bool
[src]
pub fn maybe_is_checked(&self, name: &str) -> Option<bool>
[src]
pub fn text_box(&self, name: &str) -> String
[src]
pub fn spinner<T: 'static + SpinnerValue>(&self, name: &str) -> T
[src]
pub fn modify_spinner<T: 'static + SpinnerValue>(
&mut self,
ctx: &EventCtx<'_>,
name: &str,
delta: T
)
[src]
&mut self,
ctx: &EventCtx<'_>,
name: &str,
delta: T
)
pub fn dropdown_value<T: 'static + PartialEq + Clone, I: AsRef<str>>(
&self,
name: I
) -> T
[src]
&self,
name: I
) -> T
pub fn maybe_dropdown_value<T: 'static + PartialEq + Clone, I: AsRef<str>>(
&self,
name: I
) -> Option<T>
[src]
&self,
name: I
) -> Option<T>
pub fn persistent_split_value<T: 'static + PartialEq + Clone>(
&self,
name: &str
) -> T
[src]
&self,
name: &str
) -> T
pub fn autocomplete_done<T: 'static + Clone>(
&self,
name: &str
) -> Option<Vec<T>>
[src]
&self,
name: &str
) -> Option<Vec<T>>
pub fn stash<T: 'static>(&self, name: &str) -> Rc<RefCell<T>>
[src]
Grab a stashed value, with the ability to pass it around and modify it.
pub fn clone_stashed<T: 'static + Clone>(&self, name: &str) -> T
[src]
Grab a stashed value and clone it.
pub fn is_button_enabled(&self, name: &str) -> bool
[src]
pub fn maybe_find(&self, name: &str) -> Option<&Widget>
[src]
pub fn find<T: WidgetImpl>(&self, name: &str) -> &T
[src]
pub fn find_mut<T: WidgetImpl>(&mut self, name: &str) -> &mut T
[src]
pub(crate) fn swap_inner_content(
&mut self,
ctx: &EventCtx<'_>,
container_name: &str,
new_inner_content: &mut Widget
)
[src]
&mut self,
ctx: &EventCtx<'_>,
container_name: &str,
new_inner_content: &mut Widget
)
Swap the inner content of a container
widget with new_inner_content
.
pub fn rect_of(&self, name: &str) -> &ScreenRectangle
[src]
pub fn center_of(&self, name: &str) -> ScreenPt
[src]
pub fn center_of_panel(&self) -> ScreenPt
[src]
pub fn panel_dims(&self) -> ScreenDims
[src]
pub fn align(&mut self, horiz: HorizontalAlignment, vert: VerticalAlignment)
[src]
pub fn replace(&mut self, ctx: &mut EventCtx<'_>, id: &str, new: Widget)
[src]
All margins/padding/etc from the previous widget are retained. The ID is set on the new widget; no need to do that yourself.
pub fn take(&mut self, id: &str) -> Widget
[src]
Removes a widget from the panel. Does not recalculate layout!