pub struct Window { /* private fields */ }Expand description
A framed, selectable window: a Group that builds a
Frame around itself.
Build with Window::new, then drive it as any other View.
§Turbo Vision heritage
Ports TWindow (twindow.cpp). The base-class container becomes an embedded
Group (deviation D2); the window pushes the frame’s data down rather than
letting the frame reach up (deviation D3).
Implementations§
Source§impl Window
impl Window
Sourcepub const MIN_WIN_SIZE: Point
pub const MIN_WIN_SIZE: Point
The absolute minimum a framed window may shrink to and still render its
title bar and corner icons legibly. Ports minWinSize (twindow.cpp:30).
The default size_limits minimum; a larger floor
can be set with set_min_size.
Sourcepub fn new(bounds: Rect, title: Option<String>, number: i16) -> Self
pub fn new(bounds: Rect, title: Option<String>, number: i16) -> Self
Construct a window over bounds with an optional title and a window
number.
number: pass a positive value (1–9) to make the window reachable
via the Alt-N keyboard shortcut; Program broadcasts
Command::SELECT_WINDOW_NUM and the
desktop finds the matching window by its number. Pass 0 (the
wnNoNumber sentinel from Turbo Vision) for an unnumbered window that is
never a select-by-number target — this is the common case for document
windows that are cycled with NEXT/PREV instead of by number.
Defaults set at construction: all four decoration flags enabled (move/grow/close/zoom); not maximized (no restore rect) and bordered; the blue colour scheme; a drop shadow; selectable + top-of-select-group; and a relative grow-all mode (children resize proportionally with the window).
Frame data is pushed down at construction. We build the Frame
concretely so we can call its owner-data-down setters
(set_title/set_flags/
set_number) before boxing + inserting.
A frame is mandatory: frame_id is non-optional. A frameless variant
has no consumer here, and supporting it would force an Option<ViewId>
ripple for a path no caller exercises, so we always build the frame.
Sourcepub fn frame_id(&self) -> ViewId
pub fn frame_id(&self) -> ViewId
The ViewId of the Frame child that draws the
window border, title, and icons.
Use this id to reach the frame via child_mut + downcast when you need to
call a frame-specific method (e.g. to read Frame::zoomed). The window
itself never holds a direct &mut Frame reference across calls; instead it
always resolves the id on demand — the push-down pattern that avoids upward
parent pointers.
Sourcepub fn flags(&self) -> WindowFlags
pub fn flags(&self) -> WindowFlags
The current decoration flags (which of move / grow / close / zoom are enabled).
Read these to check which operations the window permits; for example,
flags().zoom is true when the zoom icon is shown and the zoom command is
accepted. To change the flags after construction use set_flags (crate-internal).
Sourcepub fn restore_rect(&self) -> Option<Rect>
pub fn restore_rect(&self) -> Option<Rect>
The saved pre-maximize bounds, or None when the window is not maximized.
maximize stores the current bounds here before growing
to fill the owner; restore consumes them. This is the
single restore slot shared by the ZOOM command and fullscreen-Desktop.
Primarily useful for testing; normal application code reads
is_maximized instead.
Sourcepub fn is_maximized(&self) -> bool
pub fn is_maximized(&self) -> bool
Whether the window is currently maximized (filling its owner via
maximize). Equivalent to restore_rect().is_some().
Sourcepub fn bordered(&self) -> bool
pub fn bordered(&self) -> bool
Whether the frame border is drawn. An independent primitive (decoupled from
fullscreen); toggle with
set_bordered.
Sourcepub fn palette(&self) -> WindowPalette
pub fn palette(&self) -> WindowPalette
The colour scheme used to draw this window’s frame.
Plain windows use WindowPalette::Blue (the default); dialogs use
WindowPalette::Gray (set automatically by Dialog).
Inspect this to branch on the active scheme; to change it after construction
use set_palette (crate-internal).
Sourcepub fn title(&self) -> Option<&str>
pub fn title(&self) -> Option<&str>
The window title displayed in the frame’s title bar, or None for an
untitled window.
Pass the title at construction via Window::new. To rename the window
after construction (e.g. after a save-as), use set_title (crate-internal),
which updates both this field and the frame child. The frame truncates the
title to the available title-bar width at draw time; no explicit length limit
is needed here.
Sourcepub fn fullscreen(&self) -> Fullscreen
pub fn fullscreen(&self) -> Fullscreen
The window’s current Fullscreen state.
Sourcepub fn set_flags(&mut self, flags: WindowFlags)
pub fn set_flags(&mut self, flags: WindowFlags)
Override the decoration flags after construction. Re-pushes to the frame
child: construction pushes the flags once, so a later change must re-push
or the frame would still draw the original zoom/grow icons. Resolves the
frame child then downcasts then calls Frame::set_flags, the same seam
zoom uses.
Sourcepub fn set_palette(&mut self, palette: WindowPalette)
pub fn set_palette(&mut self, palette: WindowPalette)
Override the colour scheme after construction. Re-pushes to the frame
child (the set_flags pattern) so the frame renders
the matching role family: Blue → Role::Frame*, Cyan →
Role::FrameCyan*, Gray → Role::FrameGray*.
Sourcepub fn set_grow_mode(&mut self, grow_mode: GrowMode)
pub fn set_grow_mode(&mut self, grow_mode: GrowMode)
Override the grow mode after construction (a dialog uses an empty grow mode — it does not track its owner’s resize).
Sourcepub fn set_drag_mode(&mut self, drag_mode: DragMode)
pub fn set_drag_mode(&mut self, drag_mode: DragMode)
Override the drag mode after construction (the screen-edge limits the window
honors while being dragged). Mirrors set_grow_mode:
a plain write to the embedded group’s ViewState::drag_mode.
Sourcepub fn set_min_size(&mut self, min: Point)
pub fn set_min_size(&mut self, min: Point)
Raise the window’s interactive-resize floor. The argument is clamped up
to at least Self::MIN_WIN_SIZE per axis (title/icons must stay
legible), so this can only grow the minimum. Consulted by every
size-clamp path — mouse corner drag, keyboard resize, ZOOM/restore,
owner-driven resize — via size_limits.
§Turbo Vision heritage
In C++ a window subclass raises its floor by overriding the virtual
sizeLimits (e.g. TFileDialog, TEditWindow), which every clamp
path calls virtually. Embed-and-delegate composition (D2) has no upward
dispatch, so the wrapper pushes its floor down into the window instead.
Sourcepub fn with_flags(self, flags: WindowFlags) -> Self
pub fn with_flags(self, flags: WindowFlags) -> Self
Builder form of set_flags.
Sourcepub fn with_palette(self, palette: WindowPalette) -> Self
pub fn with_palette(self, palette: WindowPalette) -> Self
Builder form of set_palette.
Sourcepub fn with_grow_mode(self, grow_mode: GrowMode) -> Self
pub fn with_grow_mode(self, grow_mode: GrowMode) -> Self
Builder form of set_grow_mode.
Sourcepub fn with_drag_mode(self, drag_mode: DragMode) -> Self
pub fn with_drag_mode(self, drag_mode: DragMode) -> Self
Builder form of set_drag_mode.
Sourcepub fn with_min_size(self, min: Point) -> Self
pub fn with_min_size(self, min: Point) -> Self
Builder form of set_min_size.
Sourcepub fn insert_child(&mut self, view: Box<dyn View>) -> ViewId
pub fn insert_child(&mut self, view: Box<dyn View>) -> ViewId
Insert a child view into the embedded group.
Used by the history window (which inserts the history viewer after the
scroll bars), by Dialog, and by the message box.
Exposed publicly so that example/application code can build custom windows with child views.
Sourcepub fn child_mut(&mut self, id: ViewId) -> Option<&mut dyn View>
pub fn child_mut(&mut self, id: ViewId) -> Option<&mut dyn View>
Reach a direct child of the embedded group by id.
Used by the history window to run the viewer’s post-insert setup and to
read its selection via as_any_mut + downcast. Mirrors Group::child_mut
without exposing the group itself.
Sourcepub fn gather_list(&self) -> FieldValue
pub fn gather_list(&self) -> FieldValue
Gather the embedded group’s whole record as one ordered
FieldValue::List. Forwards to
Group::gather_list.
Sourcepub fn scatter_list(&mut self, record: &FieldValue, ctx: &mut Context<'_>)
pub fn scatter_list(&mut self, record: &FieldValue, ctx: &mut Context<'_>)
Scatter an ordered FieldValue::List record
back into the embedded group. Forwards to
Group::scatter_list.
Sourcepub fn client_rect(&self) -> Rect
pub fn client_rect(&self) -> Rect
The window’s interior content rectangle (view-local). Inset by the frame
border when bordered. Scroll-bar lanes are always
excluded — the right column when a vertical bar is present, the bottom row
when a horizontal bar is present — so placing content at client_rect
never overlaps the bars regardless of border state. Apps placing window
content should key off this rather than hardcoding the frame inset.
Sourcepub fn set_bordered(&mut self, bordered: bool, ctx: &mut Context<'_>)
pub fn set_bordered(&mut self, bordered: bool, ctx: &mut Context<'_>)
Show or hide the frame border, reflowing content to the new client area.
Border visibility is an independent primitive (decoupled from
fullscreen and maximize). Toggling it:
- flips the
Frame’sborder_visible(the inline downcast seam — the only path that reaches the frame), and - reflows content via
reflow_client: the client area grows/shrinks by the border thickness, so each content child reacts through its existinggrow_modeplus a(∓1, ∓1)origin shift, exactly as on a normal resize. Owned scroll bars are re-derived from theclient_rectformula (they are chrome, not content).
Idempotent if bordered is unchanged.
Sourcepub fn set_fullscreen(&mut self, mode: Fullscreen, ctx: &mut Context<'_>)
pub fn set_fullscreen(&mut self, mode: Fullscreen, ctx: &mut Context<'_>)
Set the window’s frameless-fullscreen mode by composing the
independent primitives:
The window-local work (maximize/restore + border + content reflow) is done
inline (the pump cannot downcast to Window); the emitted
Deferred::SetFullscreen tells the
pump to do the cross-tree work (menu bar / desktop) and to track the window
for resize re-fit and removal-restore.
§Turbo Vision heritage
tvision-rs extension to TWindow.
Sourcepub fn standard_scroll_bar(&mut self, opts: ScrollBarOptions) -> ViewId
pub fn standard_scroll_bar(&mut self, opts: ScrollBarOptions) -> ViewId
Insert a standard scroll bar on the right or bottom edge and return its
ViewId.
Pass ScrollBarOptions to choose vertical (right edge) or horizontal
(bottom edge) placement, and whether the bar handles keyboard arrow keys
when it is not the focused view (handle_keyboard).
The bar is sized to fit exactly inside the frame without covering the frame corners:
- Vertical (right edge): one cell wide, flush against the right frame
edge. Bordered:
(width−1, 1) .. (width, height−1)(frame-corner inset). Frameless: spans from the top screen edge to the bottom, stopping one row above the horizontal bar’s row when both bars are present. - Horizontal (bottom edge): one cell tall. Bordered:
(2, height−1) .. (width−2, height)(frame-corner inset). Frameless: starts at the left screen edge and runs to just before the vertical bar’s column when both bars are present (no left inset).
Call this method after construction and before the window is shown. The
returned ViewId can be passed to a scroller or list viewer as its
linked scroll bar.
For handle_keyboard, post-processing is enabled on the ScrollBar
before boxing + inserting (the insert call consumes the box, so
the flag must be set first).
Sourcepub fn maximize(&mut self, ctx: &mut Context<'_>)
pub fn maximize(&mut self, ctx: &mut Context<'_>)
Grow the window to fill its owner, saving the pre-maximize bounds into the
single restore_rect slot (if not already maximized).
The maximum size (the owner’s size) is reached via the owner-extent-down
channel (Context::owner_size) instead
of an up-pointer. The window’s own size_limits
override (max = owner size, min = min_size, default 16×6) is used. Shared
by the ZOOM command and fullscreen-Desktop, so they cannot desync.
Sourcepub fn restore(&mut self, ctx: &mut Context<'_>)
pub fn restore(&mut self, ctx: &mut Context<'_>)
Restore the window to its saved pre-maximize bounds (consuming the
restore_rect slot). A no-op on the bounds if the
window was not maximized; always clears the frame’s zoomed icon.
Trait Implementations§
Source§impl View for Window
impl View for Window
Source§fn draw(&mut self, ctx: &mut DrawCtx<'_>)
fn draw(&mut self, ctx: &mut DrawCtx<'_>)
Always delegates the draw to the group; first, if this window hosts a
Splitter body, it reads that splitter’s
divider abutment marks (parent→child) and pushes them to the frame child
(owner-data-down) so the frame composes connected tees. The marks are empty
unless the splitter opted in via
Splitter::joined, so a plain window —
or one whose splitter is not joined — is byte-for-byte unchanged (an empty
mark set reverts the frame to a plain border). Both child borrows are
sequential (the marks Vec is owned between them, so only one &mut child
is live at a time).
Source§fn handle_event(&mut self, ev: &mut Event, ctx: &mut Context<'_>)
fn handle_event(&mut self, ev: &mut Event, ctx: &mut Context<'_>)
Delegate to the group first, then handle the window’s own commands and the focus-cycling keys:
- zoom command (if zoom is allowed) →
maximize/restorethrough the single restore slot + consume. No “is this the right window?” target guard is needed here: it is provably vacuous in this architecture. The frame emits the zoom/close commands only while it is active, so the target is always the active window; these are focused command events, which the desktop routes solely to its current child = the active window; and the internal queue drains fully before the next event poll, so the active window cannot change between emit and dispatch. A zoom/close therefore always reaches exactly the window it targets. Trip-wire: revisit only if a future emitter targets a non-active window via a command. - close command (if close is allowed) →
request_close(the loop drains it intoremove_descendant), or post a cancel command if modal. Same vacuous target-guard reasoning as zoom. The modal-cancel branch is wired here; the broader modal teardown lives in the dialog layer. - Tab → cycle focus forward + consume.
- Shift+Tab → cycle focus backward + consume. Shift+Tab is
Key::Tab+ theshiftmodifier (there is no separate back-tab key). - A surviving title-bar / bottom-corner / middle-button
MouseDown→start_drag(which pushes aDragCapture). - resize command → enable the
Draggingflag and push aKeyboardResizeCapturethat handles arrow keys until Enter (accept) or Esc (restore). The resize command is enabled inset_statewhen the window is selected and move or grow is allowed. - select-window-by-number is not handled here. The window number is
an integer argument, so the broadcast-source substrate does not serve
it; instead
program_handle_eventasks the desktop (Desktop::select_window_num) to select the child whosenumbermatches (Group::focus_by_number).
Source§fn set_state(&mut self, flag: StateFlag, enable: bool, ctx: &mut Context<'_>)
fn set_state(&mut self, flag: StateFlag, enable: bool, ctx: &mut Context<'_>)
The activation half of state changes.
Delegate to Group::set_state (flips the flag + propagates to children),
then — iff the Selected flag is being set — also set the Active flag on
the group. That Active propagation flips every child (incl. the frame)
active / passive, so the frame does not need to be pushed manually.
On selection, the window-command set is enabled (and disabled on deselection):
- next/prev window: unconditional (handled by the desktop).
- zoom: if zoom is allowed (handled in
handle_event). - close: if close is allowed (handled in
handle_event). - resize: if move or grow is allowed (handled in
handle_event→KeyboardResizeCapture).
Source§fn size_limits(&self, owner_size: Point) -> (Point, Point)
fn size_limits(&self, owner_size: Point) -> (Point, Point)
The window’s size limits: the owner-derived maximum with the minimum forced
to min_size (defaults to Self::MIN_WIN_SIZE,
16×6) — the smallest a window can be while still showing its frame icons
legibly.
This size_limits override is intentionally not in the #[delegate]
skip list, while calc_bounds is skipped: calc_bounds therefore routes
through the trait default, which calls this size_limits override
(giving the min_size floor, default 16×6). If calc_bounds were delegated to the inner Group, it would
use the group’s own size_limits (min 0×0) and silently bypass the window
minimum on owner-driven resizes.
Source§fn number(&self) -> Option<i16>
fn number(&self) -> Option<i16>
The window number (1–9), or None for an unnumbered window.
A positive number makes the window reachable by Alt+N (where N is the
digit). The program’s event handler broadcasts cmSelectWindowNum and the
desktop walks its children calling View::number() on each; the first
window whose number matches N is focused
(Group::focus_by_number). A window constructed with
number == 0 (or any non-positive value) returns None and is never a
select-by-number target.
Source§fn as_any_mut(&mut self) -> Option<&mut dyn Any>
fn as_any_mut(&mut self) -> Option<&mut dyn Any>
Concrete-reach hook so the pump’s fullscreen layout engine can push the
kebab-reservation flag (via the crate-internal set_menu_chrome_above).
Mirrors the menu-bar collapse downcast; without it the engine cannot reach
a Window behind &mut dyn View.
Source§fn valid(&mut self, cmd: Command, ctx: &mut Context<'_>) -> bool
fn valid(&mut self, cmd: Command, ctx: &mut Context<'_>) -> bool
cmd (e.g. a modal end / focus
release). Base is always true. Read moreSource§fn set_modal_answer(&mut self, cmd: Command)
fn set_modal_answer(&mut self, cmd: Command)
Context::request_message_box (the
answer_to/RouteModalAnswer round-trip). Default: no-op. Overridden by
views that drive a Yes/No/Cancel prompt out of valid (e.g.
FileEditor caches it for the re-validate).Source§fn set_modal_data(&mut self, data: FieldValue)
fn set_modal_data(&mut self, data: FieldValue)
Source§fn set_value_ctx(&mut self, v: FieldValue, ctx: &mut Context<'_>)
fn set_value_ctx(&mut self, v: FieldValue, ctx: &mut Context<'_>)
FieldValue into this control with a Context. Default:
calls set_value (the context-free setter). Override
when scatter needs deferred publishing (e.g.
ListBox republishes its vertical scrollbar via
focus_item).Source§fn awaken(&mut self)
fn awaken(&mut self)
Source§fn change_bounds(&mut self, bounds: Rect)
fn change_bounds(&mut self, bounds: Rect)
bounds to this view and propagate as needed. Read moreSource§fn on_bounds_changed(&mut self, ctx: &mut Context<'_>)
fn on_bounds_changed(&mut self, ctx: &mut Context<'_>)
change_bounds is applied via
Deferred::ChangeBounds — provides a
Context for re-publishing state that depends on the new bounds (e.g. scrollbar
params). Default implementation is a no-op. Read moreSource§fn cursor_request(&self) -> Option<Point>
fn cursor_request(&self) -> Option<Point>
None to
hide it. Base: Some(cursor) iff the view is focused with a visible cursor,
else None. Read moreSource§fn caret_size(&self) -> u8
fn caret_size(&self) -> u8
CARET_INSERT (a block) when the
cursor_ins state is set, else
CARET_NORMAL (the normal caret).
The event loop reads it along the same focused chain as
cursor_request;
Group overrides it to descend into its current
child. Read moreSource§fn find_mut(&mut self, id: ViewId) -> Option<&mut dyn View>
fn find_mut(&mut self, id: ViewId) -> Option<&mut dyn View>
id to a descendant of this view (never self — the parent
identifies a view by id). A leaf has no descendants, so the base returns
None; a Group overrides to search its children
and recurse; a Group-embedding view delegates to its inner group. This is
the “tree-walk via Context” — the uniform way the event loop
/ a capture handler acts on a view it holds only by id (move a window’s
bounds, flip the dragging flag, …).Source§fn remove_descendant(&mut self, id: ViewId, ctx: &mut Context<'_>) -> bool
fn remove_descendant(&mut self, id: ViewId, ctx: &mut Context<'_>) -> bool
id from whichever group owns it.
Returns true if it was found+removed. Distinct
from find_mut because removal happens in the owner’s
child Vec (a view cannot remove itself — it doesn’t know its owner)
and must run the owning group’s reset_current. Base: false (a leaf owns
nothing).Source§fn focus_descendant(&mut self, id: ViewId, ctx: &mut Context<'_>) -> bool
fn focus_descendant(&mut self, id: ViewId, ctx: &mut Context<'_>) -> bool
id within whichever group owns it
— the tree-op behind a label focusing its linked control. Returns true
if id was found in this subtree (selectable or not — finding it stops the
walk). Distinct from find_mut because focusing happens in
the owning group (a view cannot select itself within itself): the
owning Group calls focus_child after applying the
selectable gate. Base: false (a leaf owns nothing). Read moreSource§fn has_focusable_leaf(&self) -> bool
fn has_focusable_leaf(&self) -> bool
Group
overrides to recurse into children; wrapper views delegate. Used by the
hierarchical Tab traversal to skip selectable-but-empty subtrees.Source§fn focus_to_edge(&mut self, backward: bool, ctx: &mut Context<'_>) -> bool
fn focus_to_edge(&mut self, backward: bool, ctx: &mut Context<'_>) -> bool
backward = false) or last (Shift-Tab,
backward = true) focusable leaf in this view’s subtree, establishing the
full focus path down to it. Returns true if a focusable leaf was focused. Read moreSource§fn reset_current(&mut self, ctx: &mut Context<'_>)
fn reset_current(&mut self, ctx: &mut Context<'_>)
Group::insert, so
exec_view calls this on a freshly-inserted modal BEFORE focusing it, so
the modal’s first selectable child is current on open (otherwise the modal
is keyboard-dead until a nav event — see the seam note in exec_view).
Base: no-op (a leaf has no internal currency); Group overrides;
Window/Dialog delegate.Source§fn settle_currency(&mut self, ctx: &mut Context<'_>)
fn settle_currency(&mut self, ctx: &mut Context<'_>)
Source§fn set_visible_descendant(
&mut self,
id: ViewId,
visible: bool,
ctx: &mut Context<'_>,
) -> bool
fn set_visible_descendant( &mut self, id: ViewId, visible: bool, ctx: &mut Context<'_>, ) -> bool
visible flag of the descendant named by id from its
OWNING group, running the owning group’s currency tail. Toggling
visibility on a selectable view re-picks the owner’s current child, in both
directions (show and hide). Returns true if id was found in this
subtree. Read moreSource§fn tile(&mut self, r: Rect)
fn tile(&mut self, r: Rect)
Desktop lays out
windows). r is the desktop-local layout rect. Mirrors
select_window_num: the live loop drives the
desktop by id through &mut dyn View.Source§fn cascade(&mut self, r: Rect)
fn cascade(&mut self, r: Rect)
Desktop overrides.menu::menu_view::update_menu_commands
implements the re-gray walk. Read moreMenuBar / MenuBox)
override to set their
MenuViewState::current — the write-only
display cache their draw reads to pick the selected colour. Read moreSource§fn get_help_ctx(&self) -> HelpCtx
fn get_help_ctx(&self) -> HelpCtx
HelpCtx::DRAGGING while the view is being dragged, otherwise the
view’s own ViewState::help_ctx. Read moreSource§fn descendant_global_bounds(&self, id: ViewId, acc: Point) -> Option<Rect>
fn descendant_global_bounds(&self, id: ViewId, acc: Point) -> Option<Rect>
id to its absolute bounds, given acc = this
view’s own absolute origin. Base returns None (a leaf owns no
descendants); a Group overrides to walk its children
accumulating origins, and a Group-embedding view delegates to its inner
group. The THistory open path needs its linked
input line’s bounds in the root/absolute frame, because exec_view
root-inserts the modal and the modal frame hit-tests in absolute coords (the
documented ROOT-INSERT + (0,0) caveat). Mirrors
find_mut’s recursion but returns geometry, not a borrow.Source§fn set_indicator_value(&mut self, location: Point, modified: bool)
fn set_indicator_value(&mut self, location: Point, modified: bool)
Indicator overrides it to store the new
cursor location + modified flag. Driven by
Deferred::IndicatorSetValue:
the editor (a leaf) cannot reach its indicator sibling inline, so it requests
this and the pump calls the method by id — virtual dispatch, not a downcast.Source§fn apply_page_sync(&mut self, idx: usize, ctx: &mut Context<'_>)
fn apply_page_sync(&mut self, idx: usize, ctx: &mut Context<'_>)
PageStack overrides it to make page idx
active. Driven by
Deferred::PageStackSync: the pump
reads the bound tab bar’s value and calls this method by id — virtual
dispatch, not a downcast.Source§fn value(&self) -> Option<FieldValue>
fn value(&self) -> Option<FieldValue>
FieldValue, or None for a view
that carries no transferable data. Read moreSource§fn set_value(&mut self, _v: FieldValue)
fn set_value(&mut self, _v: FieldValue)
FieldValue into this control. Read moreSource§fn calc_bounds(&mut self, owner_size: Point, delta: Point) -> Rect
fn calc_bounds(&mut self, owner_size: Point, delta: Point) -> Rect
owner_size (delta = new - old). Computes the size limits via the overridable
size_limits hook — so a widget override (e.g. a
window’s minimum) participates — then delegates the grow math to
ViewState::calc_bounds (the single source). Returns the bounds; it does
not apply them (change_bounds does).Source§fn grabs_focus_on_click(&self) -> bool
fn grabs_focus_on_click(&self) -> bool
Group::route_event). Default true (the common case); a
Button overrides to return its grab-focus flag.
A view returning false is not focused by a click but still
receives the click (so it can act, e.g. press, without becoming the
current view).Source§fn select_window_num(&mut self, num: i16, ctx: &mut Context<'_>) -> bool
fn select_window_num(&mut self, num: i16, ctx: &mut Context<'_>) -> bool
num. Returns
whether one matched. Consistent with the find_mut /
remove_descendant tree-op family: the live
loop holds a subtree only by id (here, the desktop) and asks it to act.
Default: no-op (false). Desktop overrides.Source§fn apply_scroll_sync(
&mut self,
_h: Option<i32>,
_v: Option<i32>,
_ctx: &mut Context<'_>,
)
fn apply_scroll_sync( &mut self, _h: Option<i32>, _v: Option<i32>, _ctx: &mut Context<'_>, )
None if that bar
is absent or unresolved), each read via View::value. Overridden by the
list viewers (delegate to
list_viewer::apply_scroll),
Scroller, the outline viewer, and the editor —
every sibling-scrollbar read sync routes through this one method instead of
a pump downcast. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for Window
impl !Send for Window
impl !Sync for Window
impl !UnwindSafe for Window
impl Freeze for Window
impl Unpin for Window
impl UnsafeUnpin for Window
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.