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 UIWindow: Standard application windowsPanel: Container for grouping related controlsLayout: Management of control positioning and sizing
§Input Controls
Button: Clickable button controlTextField: Single-line text inputTextArea: Multi-line text input and editingPassword: Masked text input for secure dataCheckBox: Boolean selection controlRadioBox: Single selection from multiple optionsThreeStateBox: Three-state checkbox (checked, unchecked, indeterminate)ComboBox: Editable dropdown listDropDownList: Non-editable dropdown listNumericSelector: Numeric value input and adjustmentDatePicker: Date selection controlKeySelector: Keyboard shortcut selectorColorPicker: Color selection control
§Display Controls
Label: Static text displayProgressBar: Visual representation of progressImageViewer: Display and manipulation of imagesCanvas: Custom drawing surfaceHLine/VLine: Horizontal and vertical separators
§Navigation and Organization
Tab: Tabbed interface for organizing contentAccordion: Collapsible sections of controlsVSplitter/HSplitter: Resizable split views (vertical/horizontal)TreeView: Hierarchical data presentationListBox: Simple list of selectable itemsListView: Multi-column list with headersPathFinder: File system navigation control
§Menus and Commands
Menu: Application menusCommandBar: Shortcut command interface
§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.