cursive/src/views/mod.rs

89 lines
2.2 KiB
Rust
Raw Normal View History

2016-07-29 06:05:08 +00:00
//! Various views to use when creating the layout.
2016-07-28 23:36:01 +00:00
/// A macro to help with creating toggleable views.
2016-10-02 21:55:19 +00:00
macro_rules! impl_enabled {
(self.$x:ident) => {
/// Disables this view.
///
/// A disabled view cannot be selected.
pub fn disable(&mut self) {
self.$x = false;
}
/// Disables this view.
///
/// Chainable variant.
pub fn disabled(self) -> Self {
self.with(Self::disable)
}
/// Re-enables this view.
pub fn enable(&mut self) {
self.$x = true;
}
/// Enable or disable this view.
pub fn set_enabled(&mut self, enabled: bool) {
self.$x = enabled;
}
/// Returns `true` if this view is enabled.
pub fn is_enabled(&self) -> bool {
self.$x
}
}
}
2016-07-28 23:36:01 +00:00
mod box_view;
mod button;
2017-01-24 06:01:25 +00:00
mod canvas;
2016-07-28 23:36:01 +00:00
mod checkbox;
mod dialog;
2016-07-30 06:36:40 +00:00
mod dummy;
2016-07-28 23:36:01 +00:00
mod edit_view;
mod id_view;
2017-06-12 23:39:12 +00:00
mod on_event_view;
mod layer;
2016-07-28 23:36:01 +00:00
mod linear_layout;
mod list_view;
mod menubar;
mod menu_popup;
mod panel;
mod progress_bar;
2016-10-02 21:55:19 +00:00
mod radio;
2016-07-28 23:36:01 +00:00
mod select_view;
2016-08-13 08:03:40 +00:00
mod slider_view;
2016-08-02 07:32:16 +00:00
mod shadow_view;
2016-07-28 23:36:01 +00:00
mod sized_view;
mod stack_view;
2016-08-02 07:32:16 +00:00
mod text_area;
2016-07-28 23:36:01 +00:00
mod text_view;
mod tracked_view;
pub use self::box_view::BoxView;
pub use self::button::Button;
2017-01-24 06:01:25 +00:00
pub use self::canvas::Canvas;
2016-07-28 23:36:01 +00:00
pub use self::checkbox::Checkbox;
pub use self::dialog::{Dialog, DialogFocus};
2016-07-30 06:36:40 +00:00
pub use self::dummy::DummyView;
2016-07-28 23:36:01 +00:00
pub use self::edit_view::EditView;
pub use self::id_view::{IdView, ViewRef};
pub use self::layer::Layer;
2016-07-28 23:36:01 +00:00
pub use self::linear_layout::LinearLayout;
pub use self::list_view::{ListChild, ListView};
2016-07-28 23:36:01 +00:00
pub use self::menu_popup::MenuPopup;
2016-10-02 22:22:29 +00:00
pub use self::menubar::Menubar;
2017-10-12 23:38:55 +00:00
pub use self::on_event_view::OnEventView;
2016-07-28 23:36:01 +00:00
pub use self::panel::Panel;
pub use self::progress_bar::{Counter, ProgressBar};
2017-10-12 23:38:55 +00:00
pub use self::radio::{RadioButton, RadioGroup};
2016-07-28 23:36:01 +00:00
pub use self::select_view::SelectView;
pub use self::shadow_view::ShadowView;
pub use self::sized_view::SizedView;
2016-10-02 22:22:29 +00:00
pub use self::slider_view::SliderView;
2017-12-30 22:03:42 +00:00
pub use self::stack_view::{LayerPosition, StackView};
2016-08-02 07:32:16 +00:00
pub use self::text_area::TextArea;
2017-12-30 22:03:42 +00:00
pub use self::text_view::{TextContent, TextContentRef, TextView};
2016-07-28 23:36:01 +00:00
pub use self::tracked_view::TrackedView;