Skip to main content

Module ui

Module ui 

Source
Expand description

User interface components and controls for AppCUI.

This module provides a comprehensive set of UI controls and components for building terminal-based user interfaces in the AppCUI framework. The UI module includes:

§Core Components

  • Desktop: The main container for the application UI
  • Window: Standard application windows
  • Panel: Container for grouping related controls
  • Layout: Management of control positioning and sizing

§Input Controls

§Display Controls

  • Tab: Tabbed interface for organizing content
  • Accordion: Collapsible sections of controls
  • VSplitter/HSplitter: Resizable split views (vertical/horizontal)
  • TreeView: Hierarchical data presentation
  • ListBox: Simple list of selectable items
  • ListView: Multi-column list with headers
  • PathFinder: File system navigation control

§Example

Creating a simple hello world window:

use appcui::prelude::*;

fn main() -> Result<(), appcui::system::Error> {
    // Initialize the application
    let mut app = App::new().build()?;
     
    // Create a window with centered layout and specific size
    let mut win = Window::new(
        "First Window", 
        LayoutBuilder::new().alignment(Alignment::Center).width(30).height(9).build(), 
        window::Flags::Sizeable
    );
     
    // Add a label to the window
    win.add(Label::new("Hello World !", layout!("a:center,width:13,height:1")));
     
    // Add the window to the application and run
    app.add_window(win);
    app.run();
     
    Ok(())
}

Re-exports§

pub use common::ControlBase;
pub use common::ContainerBase;
pub use desktop::Desktop;
pub use checkbox::CheckBox;
pub use radiobox::RadioBox;
pub use password::Password;
pub use textfield::TextField;
pub use threestatebox::ThreeStateBox;
pub use label::Label;
pub use panel::Panel;
pub use window::Window;
pub use window::ModalWindow;
pub use button::Button;
pub use tab::Tab;
pub use accordion::Accordion;
pub use canvas::Canvas;
pub use imageviewer::ImageViewer;
pub use keyselector::KeySelector;
pub use colorpicker::ColorPicker;
pub use charpicker::CharPicker;
pub use selector::Selector;
pub use combobox::ComboBox;
pub use dropdownlist::DropDownList;
pub use command_bar::CommandBar;
pub use layout::Layout;
pub use layout::LayoutBuilder;
pub use layout::Dock;
pub use layout::Alignment;
pub use layout::Pivot;
pub use numericselector::NumericSelector;
pub use vsplitter::VSplitter;
pub use hsplitter::HSplitter;
pub use hline::HLine;
pub use vline::VLine;
pub use datepicker::DatePicker;
pub use listbox::ListBox;
pub use listview::ListView;
pub use togglebutton::ToggleButton;
pub use markdown::Markdown;
pub use pathfinder::PathFinder;
pub use treeview::TreeView;
pub use progressbar::ProgressBar;
pub use textarea::TextArea;
pub use timepicker::TimePicker;
pub use menu::Menu;
pub use appbar::AppBar;
pub use graphview::GraphView;

Modules§

accordion
An accordion UI control that allows multiple panels to be displayed with expandable/collapsible headers.
appbar
button
A button UI control that handles click events and provides various visual styles.
canvas
A canvas UI control for custom drawing and direct surface manipulation.
charpicker
A charpicker UI control for selecting characters from the entire unicode set
checkbox
A checkbox UI control that allows toggling between checked and unchecked states.
colorpicker
A colorpicker UI control for selecting colors from a predefined palette.
combobox
A combobox UI control combining a dropdown list with an editable text field.
command_bar
A command bar UI control for displaying available commands and shortcuts.
common
Common types and utilities used across various UI controls.
components
Common UI components and utilities shared across multiple control types.
datepicker
A datepicker UI control for selecting dates from a calendar interface.
desktop
A desktop UI control that serves as the root container for an application.
dropdownlist
A dropdownlist UI control for selecting an item from a collapsible list.
graphview
A graph view control for displaying and interacting with node-edge graphs.
hline
A horizontal line UI control for creating visual separations between components.
hsplitter
A horizontal splitter UI control for dividing space between components.
imageviewer
An imageviewer UI control for displaying and manipulating images.
keyselector
A keyselector UI control for capturing and configuring keyboard shortcuts.
label
A label UI control for displaying non-editable text.
layout
A layout system for positioning and sizing UI controls.
listbox
A listbox UI control that displays a scrollable list of selectable items.
listview
A listview UI control for displaying data in customizable columns.
markdown
A markdown UI control for displaying formatted text content.
menu
A menu UI control that provides hierarchical command options.
numericselector
A numericselector UI control for entering and adjusting numeric values.
panel
A panel UI control that serves as a container for organizing other controls.
password
A password UI control for secure text input with masked characters.
pathfinder
A pathfinder UI control for navigating and selecting file system paths.
progressbar
A progressbar UI control for displaying task completion status.
radiobox
A radiobox UI control for selecting a single option from a mutually exclusive set.
selector
A selector UI control for choosing items from a categorized selection list.
tab
A tab UI control that organizes content into multiple selectable pages.
textarea
A textarea UI control for multi-line text input and editing.
textfield
A textfield UI control for single-line text input and editing.
threestatebox
A threestatebox UI control that can toggle between three distinct states.
timepicker
A timepicker UI control for selecting and editing time values.
togglebutton
A togglebutton UI control that can be switched between pressed and unpressed states.
treeview
A treeview UI control for displaying hierarchical data.
vline
A vertical line UI control for creating visual separations between components.
vsplitter
A vertical splitter UI control for dividing space between components.
window
A window UI control that serves as a container for other controls.