pub struct SharedStreamView(pub SharedView);Expand description
Forwards View calls into a shared StreamView.
Tuple Fields§
§0: SharedViewTrait Implementations§
fn bounds(&self) -> Rect
fn set_bounds(&mut self, bounds: Rect)
fn draw(&mut self, terminal: &mut Terminal)
fn handle_event(&mut self, event: &mut Event)
fn can_focus(&self) -> bool
Source§fn grow_mode(&self) -> GrowFlags
fn grow_mode(&self) -> GrowFlags
Get this view’s grow mode flags (Borland: TView::growMode). Read more
Source§fn set_grow_mode(&mut self, grow_mode: GrowFlags)
fn set_grow_mode(&mut self, grow_mode: GrowFlags)
Set this view’s grow mode flags (Borland: TView::growMode). Read more
Source§fn get_palette(&self) -> Option<Palette>
fn get_palette(&self) -> Option<Palette>
Get this view’s palette for the Borland indirect palette system
Matches Borland: TView::getPalette() Read more
Source§fn set_focus(&mut self, focused: bool)
fn set_focus(&mut self, focused: bool)
Set focus state - default implementation uses SF_FOCUSED flag
Views should override only if they need custom focus behavior
Source§fn window_number(&self) -> Option<u8>
fn window_number(&self) -> Option<u8>
Window number for Alt+1..9 selection (Borland: TWindow::number). Read more
Source§fn is_focused(&self) -> bool
fn is_focused(&self) -> bool
Check if view is focused - reads SF_FOCUSED flag
Source§fn options(&self) -> u16
fn options(&self) -> u16
Get view option flags (OF_SELECTABLE, OF_PRE_PROCESS, OF_POST_PROCESS, etc.)
Source§fn set_options(&mut self, _options: u16)
fn set_options(&mut self, _options: u16)
Set view option flags
Source§fn set_state_flag(&mut self, flag: u16, enable: bool)
fn set_state_flag(&mut self, flag: u16, enable: bool)
Set or clear specific state flag(s)
Matches Borland’s TView::setState(ushort aState, Boolean enable)
If enable is true, sets the flag(s), otherwise clears them
Source§fn get_state_flag(&self, flag: u16) -> bool
fn get_state_flag(&self, flag: u16) -> bool
Check if specific state flag(s) are set
Matches Borland’s TView::getState(ushort aState)
Source§fn has_shadow(&self) -> bool
fn has_shadow(&self) -> bool
Check if view has shadow enabled
Source§fn shadow_bounds(&self) -> Rect
fn shadow_bounds(&self) -> Rect
Get bounds including shadow area
Source§fn update_cursor(&self, _terminal: &mut Terminal)
fn update_cursor(&self, _terminal: &mut Terminal)
Update cursor state (called after draw)
Views that need to show a cursor when focused should override this
Source§fn zoom(&mut self, _max_bounds: Rect)
fn zoom(&mut self, _max_bounds: Rect)
Zoom (maximize/restore) the view with given maximum bounds
Matches Borland: TWindow::zoom() toggles between current and max size
Default implementation does nothing (only windows support zoom)
Source§fn valid(&mut self, _command: u16) -> bool
fn valid(&mut self, _command: u16) -> bool
Validate the view before performing a command (usually closing)
Matches Borland: TView::valid(ushort command) - returns Boolean
Returns true if the view’s state is valid for the given command
Used for “Save before closing?” type scenarios and input validation Read more
Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Downcast to concrete type (immutable)
Allows accessing specific view type methods from trait object
Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Downcast to concrete type (mutable)
Allows accessing specific view type methods from trait object
Source§fn dump_to_file(&self, terminal: &Terminal, path: &str) -> Result<(), Error>
fn dump_to_file(&self, terminal: &Terminal, path: &str) -> Result<(), Error>
Dump this view’s region of the terminal buffer to an ANSI file for debugging
Check if this view is a default button (for Enter key handling at Dialog level)
Corresponds to Borland’s TButton::amDefault flag (tbutton.cc line 239)
Get the command ID for this button (if it’s a button)
Returns None if not a button
Used by Dialog to activate default button on Enter key
Source§fn set_list_selection(&mut self, _index: usize)
fn set_list_selection(&mut self, _index: usize)
Set the selection index for listbox views
Only implemented by ListBox, other views ignore this
Source§fn get_list_selection(&self) -> usize
fn get_list_selection(&self) -> usize
Get the selection index for listbox views
Only implemented by ListBox, other views return 0
Source§fn get_redraw_union(&self) -> Option<Rect>
fn get_redraw_union(&self) -> Option<Rect>
Get the union rect of previous and current bounds for redrawing
Matches Borland: TView::locate() calculates union of old and new bounds
Returns None if the view hasn’t moved since last redraw
Used by Desktop to implement Borland’s drawUnderRect pattern
Source§fn clear_move_tracking(&mut self)
fn clear_move_tracking(&mut self)
Clear movement tracking after redrawing
Matches Borland: Called after drawUnderRect completes
Source§fn get_end_state(&self) -> u16
fn get_end_state(&self) -> u16
Get the end state for modal views
Matches Borland: TGroup::endState field
Returns the command ID that ended modal execution (0 if still running)
Source§fn set_end_state(&mut self, _command: u16)
fn set_end_state(&mut self, _command: u16)
Set the end state for modal views
Called by end_modal() to signal the modal loop should exit
Source§fn make_global(&self, local_x: i16, local_y: i16) -> (i16, i16)
fn make_global(&self, local_x: i16, local_y: i16) -> (i16, i16)
Convert local coordinates to global (screen) coordinates
Matches Borland: TView::makeGlobal(TPoint source, TPoint& dest) Read more
Source§fn make_local(&self, global_x: i16, global_y: i16) -> (i16, i16)
fn make_local(&self, global_x: i16, global_y: i16) -> (i16, i16)
Convert global (screen) coordinates to local view coordinates
Matches Borland: TView::makeLocal(TPoint source, TPoint& dest) Read more
Source§fn draw_shadow(&self, terminal: &mut Terminal)
fn draw_shadow(&self, terminal: &mut Terminal)
Draw shadow for this view
Draws a shadow offset dynamically based on terminal cell aspect ratio
Shadow is semi-transparent - darkens the underlying content by 50%
This matches the Borland Turbo Vision behavior more closely
Source§fn label_link(&self) -> Option<ViewId>
fn label_link(&self) -> Option<ViewId>
Get the linked control ViewId for labels
Matches Borland: TLabel::link field
Returns Some(ViewId) if this is a label with a linked control, None otherwise
Used by Group to implement focus transfer when clicking labels
Source§fn init_after_add(&mut self)
fn init_after_add(&mut self)
Initialize internal owner pointers after view is added to parent and won’t move
This is called by parent’s add() method after the view is in its final position
Views that contain other views by value should override this to set up owner chains
Default implementation does nothing
Source§fn constrain_to_parent_bounds(&mut self)
fn constrain_to_parent_bounds(&mut self)
Constrain view bounds to parent/owner bounds
Used after positioning (e.g., centering) to ensure view stays within valid area
Matches Borland: TView::locate() constrains position to owner bounds
Source§fn set_palette_chain(&mut self, _node: Option<PaletteChainNode>)
fn set_palette_chain(&mut self, _node: Option<PaletteChainNode>)
Set the QCell-based palette chain node for this view.
Called by parent (Group/Window) during draw to establish the safe owner chain.
Source§fn get_palette_chain(&self) -> Option<&PaletteChainNode>
fn get_palette_chain(&self) -> Option<&PaletteChainNode>
Get the QCell-based palette chain node for this view.
Used by
map_color() to safely walk the owner chain.Source§fn set_parent_bounds(&mut self, _bounds: Rect)
fn set_parent_bounds(&mut self, _bounds: Rect)
Set the parent’s bounds for drag/resize limit resolution.
Called by Desktop when adding windows.
Auto Trait Implementations§
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
Mutably borrows from an owned value. Read more