cursive/src/views/mod.rs

84 lines
2.0 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
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;
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;
mod key_event_view;
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;
2016-09-23 05:10:14 +00:00
pub use self::id_view::IdView;
2016-07-28 23:36:01 +00:00
pub use self::box_view::BoxView;
pub use self::button::Button;
pub use self::checkbox::Checkbox;
pub use self::dialog::Dialog;
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::key_event_view::KeyEventView;
pub use self::linear_layout::LinearLayout;
pub use self::list_view::ListView;
pub use self::menubar::Menubar;
pub use self::menu_popup::MenuPopup;
pub use self::panel::Panel;
pub use self::progress_bar::{Counter, ProgressBar};
2016-10-02 21:55:19 +00:00
pub use self::radio::{RadioGroup, RadioButton};
2016-07-28 23:36:01 +00:00
pub use self::select_view::SelectView;
2016-08-13 08:03:40 +00:00
pub use self::slider_view::SliderView;
2016-07-28 23:36:01 +00:00
pub use self::shadow_view::ShadowView;
pub use self::sized_view::SizedView;
pub use self::stack_view::StackView;
2016-08-02 07:32:16 +00:00
pub use self::text_area::TextArea;
2016-07-28 23:36:01 +00:00
pub use self::text_view::TextView;
pub use self::tracked_view::TrackedView;