kas_widgets/lib.rs
1// Licensed under the Apache License, Version 2.0 (the "License");
2// you may not use this file except in compliance with the License.
3// You may obtain a copy of the License in the LICENSE-APACHE file or at:
4// https://www.apache.org/licenses/LICENSE-2.0
5
6//! KAS widget library
7//!
8//! ## Complex widgets
9//!
10//! - [`EventConfig`] provides an editor for event configuration
11//! - [`TitleBar`] is a window title-bar (including buttons)
12//! - [`TitleBarButtons`] is the standard minimize/maximize/close button cluster on a title-bar
13//!
14//! ## Sub-modules
15//!
16//! - [`adapt`] provides [`Adapt`], [`AdaptWidget`], [`AdaptWidgetAny`] and supporting items
17//! (the items mentioned are re-export here).
18//! - [`dialog`] provides [`MessageBox`](dialog::MessageBox), ...
19//! - [`edit`] provides [`EditBox`], [`EditField`] widgets, [`EditGuard`] trait and some impls
20//! - [`menu`] provides a [`MenuBar`](menu::MenuBar), [`SubMenu`](menu::SubMenu), ...
21//!
22//! ## Container widgets
23//!
24//! - [`Frame`]: a frame around content
25//! - [`ScrollRegion`], [`ScrollBarRegion`]: larger on the inside
26//! - [`Stack`], [`TabStack`]: a stack of widgets in the same rect
27//! - [`List`]: a row / column of children
28//! - [`Splitter`]: like [`List`] but with resizing handles
29//! - [`Grid`]: a container using grid layout
30//!
31//! ## Controls
32//!
33//! - [`Button`], [`MarkButton`]: button widgets
34//! - [`CheckBox`], [`CheckButton`]: checkable boxes
35//! - [`RadioBox`], [`RadioButton`]: linked checkable boxes
36//! - [`ComboBox`]: a drop-down menu over a list
37//! - [`ScrollBar`]: a scroll bar; [`ScrollBars`]: a wrapper adding scroll
38//! bars around an inner widget
39//! - [`Slider`]: a slider
40//! - [`SpinBox`]: numeric entry
41//!
42//! ## Displays
43//!
44//! - [`Filler`]: an empty widget, sometimes used to fill space
45//! - [`Image`]: a pixmap image
46//! - [`Label`], [`AccessLabel`]: are static text labels
47//! - [`Text`]: a dynamic (input-data derived) text label
48//! - [`Mark`]: a small mark
49//! - [`ScrollLabel`]: static text label supporting scrolling and selection
50//! - [`ScrollText`]: dynamic text label supporting scrolling and selection
51//! - [`Separator`]: a visible bar to separate things
52//! - [`format_value`] and [`format_data`] are constructors for [`Text`],
53//! displaying a text label derived from input data
54//! - [`ProgressBar`]: show completion level
55//!
56//! ## Components
57//!
58//! - [`AccessLabel`]: a label which parses access keys
59//! - [`GripPart`]: a handle (e.g. for a slider, splitter or scroll_bar)
60
61#![cfg_attr(docsrs, feature(doc_auto_cfg))]
62
63pub mod adapt;
64#[doc(no_inline)]
65pub use adapt::{Adapt, AdaptWidget, AdaptWidgetAny};
66
67mod access_label;
68mod button;
69mod check_box;
70mod combobox;
71pub mod dialog;
72pub mod edit;
73mod event_config;
74mod filler;
75mod float;
76mod frame;
77mod grid;
78mod grip;
79mod image;
80mod list;
81pub mod menu;
82mod progress;
83mod radio_box;
84mod scroll;
85mod scroll_bar;
86mod scroll_label;
87mod separator;
88mod slider;
89mod spin_box;
90mod splitter;
91mod stack;
92mod tab_stack;
93mod text;
94
95#[doc(inline)] pub use kas::widgets::*;
96
97pub use crate::image::Image;
98#[cfg(feature = "image")] pub use crate::image::ImageError;
99pub use access_label::AccessLabel;
100pub use button::Button;
101pub use check_box::{CheckBox, CheckButton};
102pub use combobox::ComboBox;
103pub use edit::{EditBox, EditField, EditGuard};
104pub use event_config::EventConfig;
105pub use filler::Filler;
106pub use float::Float;
107pub use frame::Frame;
108pub use grid::Grid;
109pub use grip::{GripMsg, GripPart};
110pub use list::*;
111pub use progress::ProgressBar;
112pub use radio_box::{RadioBox, RadioButton};
113pub use scroll::ScrollRegion;
114pub use scroll_bar::{ScrollBar, ScrollBarMode, ScrollBarRegion, ScrollBars, ScrollMsg};
115pub use scroll_label::{ScrollLabel, ScrollText, SelectableLabel, SelectableText};
116pub use separator::Separator;
117pub use slider::{Slider, SliderValue};
118pub use spin_box::{SpinBox, SpinValue};
119pub use splitter::Splitter;
120pub use stack::{Page, Stack};
121pub use tab_stack::{BoxTabStack, Tab, TabStack};
122pub use text::Text;