use crate::prelude::*;
pub mod thecheckbutton;
pub mod thecolorbutton;
pub mod thecolorpicker;
pub mod thedirectionpicker;
pub mod thedropdownmenu;
pub mod thegroupbutton;
pub mod thehdivider;
pub mod thehorizontalscrollbar;
pub mod theiconview;
pub mod thelistitem;
pub mod themarkdownview;
pub mod themenu;
pub mod themenubar;
pub mod themenubarbutton;
pub mod themenubarseparator;
pub mod thenodecanvasview;
pub mod thepaletteindexpicker;
pub mod thepalettepicker;
pub mod therenderview;
pub mod thergbaview;
pub mod therowlistitem;
pub mod thesdfview;
pub mod thesectionbar;
pub mod thesectionbarbutton;
pub mod theseparator;
pub mod theslider;
pub mod thesnapperbar;
pub mod thespacer;
pub mod thestatusbar;
pub mod theswitchbar;
pub mod thetabbar;
pub mod thetext;
pub mod thetextareaedit;
pub mod thetextedit;
pub mod thetextlineedit;
pub mod thetextview;
pub mod thetimeslider;
pub mod thetoolbar;
pub mod thetoolbarbutton;
pub mod thetoollistbar;
pub mod thetoollistbutton;
pub mod thetraybar;
pub mod thetraybarbutton;
pub mod thetreeicons;
pub mod thetreeitem;
pub mod thetreetext;
pub mod theverticalscrollbar;
use std::any::Any;
pub mod prelude {
pub use crate::theui::thewidget::thetreeicons::{TheTreeIcons, TheTreeIconsTrait};
pub use crate::theui::thewidget::thetreeitem::{TheTreeItem, TheTreeItemTrait};
pub use crate::theui::thewidget::thetreetext::{TheTreeText, TheTreeTextTrait};
pub use crate::theui::thewidget::thecolorbutton::TheColorButton;
pub use crate::theui::thewidget::thedropdownmenu::TheDropdownMenu;
pub use crate::theui::thewidget::thedropdownmenu::TheDropdownMenuTrait;
pub use crate::theui::thewidget::themenu::{TheMenu, TheMenuTrait};
pub use crate::theui::thewidget::themenubar::{TheMenubar, TheMenubarTrait};
pub use crate::theui::thewidget::themenubarbutton::{TheMenubarButton, TheMenubarButtonTrait};
pub use crate::theui::thewidget::themenubarseparator::TheMenubarSeparator;
pub use crate::theui::thewidget::thetoolbar::TheToolbar;
pub use crate::theui::thewidget::thetoolbarbutton::{TheToolbarButton, TheToolbarButtonTrait};
pub use crate::theui::thewidget::thehorizontalscrollbar::{
TheHorizontalScrollbar, TheHorizontalScrollbarTrait,
};
pub use crate::theui::thewidget::thelistitem::{TheListItem, TheListItemTrait};
pub use crate::theui::thewidget::therowlistitem::{TheRowListItem, TheRowListItemTrait};
pub use crate::theui::thewidget::thesectionbar::TheSectionbar;
pub use crate::theui::thewidget::thesectionbarbutton::TheSectionbarButton;
pub use crate::theui::thewidget::thesectionbarbutton::TheSectionbarButtonTrait;
pub use crate::theui::thewidget::theslider::{TheSlider, TheSliderTrait};
pub use crate::theui::thewidget::thesnapperbar::{TheSnapperbar, TheSnapperbarTrait};
pub use crate::theui::thewidget::theswitchbar::{TheSwitchbar, TheSwitchbarTrait};
pub use crate::theui::thewidget::thetext::{TheText, TheTextTrait};
pub use crate::theui::thewidget::theverticalscrollbar::{
TheVerticalScrollbar, TheVerticalScrollbarTrait,
};
pub use crate::theui::thewidget::thegroupbutton::{TheGroupButton, TheGroupButtonTrait};
pub use crate::theui::thewidget::thecheckbutton::TheCheckButton;
pub use crate::theui::thewidget::thehdivider::TheHDivider;
pub use crate::theui::thewidget::theiconview::{TheIconView, TheIconViewTrait};
pub use crate::theui::thewidget::themarkdownview::{
TheMarkdownStyles, TheMarkdownView, TheMarkdownViewTrait,
};
pub use crate::theui::thewidget::thergbaview::{
TheRGBAView, TheRGBAViewMode, TheRGBAViewTrait,
};
pub use crate::theui::thewidget::thesdfview::{TheSDFView, TheSDFViewTrait};
pub use crate::theui::thewidget::thespacer::TheSpacer;
pub use crate::theui::thewidget::thestatusbar::{TheStatusbar, TheStatusbarTrait};
pub use crate::theui::thewidget::thetabbar::{TheTabbar, TheTabbarTrait};
pub use crate::theui::thewidget::thetextareaedit::{
TheCodeEditorSettings, TheTextAreaEdit, TheTextAreaEditTrait,
};
pub use crate::theui::thewidget::thetextedit::TheTextStyle;
pub use crate::theui::thewidget::thetextlineedit::{TheTextLineEdit, TheTextLineEditTrait};
pub use crate::theui::thewidget::thetextview::{
TheTextView, TheTextViewBlock, TheTextViewSpan, TheTextViewTrait,
};
pub use crate::theui::thewidget::thetraybar::TheTraybar;
pub use crate::theui::thewidget::thetraybarbutton::{TheTraybarButton, TheTraybarButtonTrait};
pub use crate::theui::thewidget::TheWidget;
pub use crate::theui::thewidget::TheWidgetState;
pub use crate::theui::thewidget::thecolorpicker::{TheColorPicker, TheColorPickerTrait};
pub use crate::theui::thewidget::thedirectionpicker::TheDirectionPicker;
pub use crate::theui::thewidget::thenodecanvasview::{
TheNodeCanvasView, TheNodeCanvasViewTrait,
};
pub use crate::theui::thewidget::thepaletteindexpicker::{
ThePaletteIndexPicker, ThePaletteIndexPickerTrait,
};
pub use crate::theui::thewidget::thepalettepicker::{ThePalettePicker, ThePalettePickerTrait};
pub use crate::theui::thewidget::theseparator::TheSeparator;
pub use crate::theui::thewidget::thetimeslider::{TheTimeSlider, TheTimeSliderTrait};
pub use crate::theui::thewidget::thetoollistbar::TheToolListBar;
pub use crate::theui::thewidget::thetoollistbutton::*;
pub use crate::theui::thewidget::therenderview::{TheRenderView, TheRenderViewTrait};
}
#[derive(Copy, Clone, PartialEq, Debug, Default)]
pub enum TheWidgetState {
#[default]
None,
Clicked,
Selected,
}
#[allow(unused)]
pub trait TheWidget: Send {
fn new(id: TheId) -> Self
where
Self: Sized;
fn id(&self) -> &TheId;
fn calculate_size(&mut self, ctx: &mut TheContext) {}
fn dim(&self) -> &TheDim;
fn dim_mut(&mut self) -> &mut TheDim;
fn limiter(&self) -> &TheSizeLimiter;
fn limiter_mut(&mut self) -> &mut TheSizeLimiter;
fn set_dim(&mut self, dim: TheDim, ctx: &mut TheContext) {}
fn state(&self) -> TheWidgetState {
TheWidgetState::None
}
fn is_open(&self) -> bool {
false
}
fn set_state(&mut self, state: TheWidgetState) {}
fn set_embedded(&mut self, embedded: bool) {}
fn set_parent_id(&mut self, parent_id: TheId) {}
fn parent_id(&self) -> Option<&TheId> {
None
}
fn has_parent_focus(&self, ctx: &TheContext) -> bool {
if let Some(parent_id) = self.parent_id() {
ctx.ui.has_focus(parent_id)
} else {
false
}
}
fn cursor_icon(&self) -> Option<TheCursorIcon> {
None
}
fn set_cursor_icon(&mut self, _icon: Option<TheCursorIcon>) {}
fn value(&self) -> TheValue {
TheValue::Empty
}
fn set_value(&mut self, value: TheValue) {}
fn status_text(&self) -> Option<String> {
None
}
fn set_status_text(&mut self, text: &str) {}
fn draw(
&mut self,
buffer: &mut TheRGBABuffer,
style: &mut Box<dyn TheStyle>,
ctx: &mut TheContext,
) {
}
fn draw_overlay(
&mut self,
style: &mut Box<dyn TheStyle>,
ctx: &mut TheContext,
) -> TheRGBABuffer {
TheRGBABuffer::empty()
}
fn supports_hover(&mut self) -> bool {
false
}
fn supports_text_input(&self) -> bool {
false
}
fn supports_clipboard(&mut self) -> bool {
false
}
fn needs_redraw(&mut self) -> bool {
false
}
fn supports_undo_redo(&mut self) -> bool {
false
}
fn set_needs_redraw(&mut self, redraw: bool) {}
fn disabled(&self) -> bool {
false
}
fn set_disabled(&mut self, disabled: bool) {}
fn on_event(&mut self, event: &TheEvent, ctx: &mut TheContext) -> bool {
false
}
fn set_context_menu(&mut self, menu: Option<TheContextMenu>) {}
fn as_list_item(&mut self) -> Option<&mut dyn TheListItemTrait> {
None
}
fn as_tree_item(&mut self) -> Option<&mut dyn TheTreeItemTrait> {
None
}
fn as_rowlist_item(&mut self) -> Option<&mut dyn TheRowListItemTrait> {
None
}
fn as_drop_down_menu(&mut self) -> Option<&mut dyn TheDropdownMenuTrait> {
None
}
fn as_horizontal_scrollbar(&mut self) -> Option<&mut dyn TheHorizontalScrollbarTrait> {
None
}
fn as_vertical_scrollbar(&mut self) -> Option<&mut dyn TheVerticalScrollbarTrait> {
None
}
fn as_rgba_view(&mut self) -> Option<&mut dyn TheRGBAViewTrait> {
None
}
fn as_render_view(&mut self) -> Option<&mut dyn TheRenderViewTrait> {
None
}
fn as_node_canvas_view(&mut self) -> Option<&mut dyn TheNodeCanvasViewTrait> {
None
}
fn as_text(&mut self) -> Option<&mut dyn TheTextTrait> {
None
}
fn as_tabbar(&mut self) -> Option<&mut dyn TheTabbarTrait> {
None
}
fn as_text_area_edit(&mut self) -> Option<&mut dyn TheTextAreaEditTrait> {
None
}
fn as_text_line_edit(&mut self) -> Option<&mut dyn TheTextLineEditTrait> {
None
}
fn as_text_view(&mut self) -> Option<&mut dyn TheTextViewTrait> {
None
}
fn as_markdown_view(&mut self) -> Option<&mut dyn TheMarkdownViewTrait> {
None
}
fn as_icon_view(&mut self) -> Option<&mut dyn TheIconViewTrait> {
None
}
fn as_group_button(&mut self) -> Option<&mut dyn TheGroupButtonTrait> {
None
}
fn as_statusbar(&mut self) -> Option<&mut dyn TheStatusbarTrait> {
None
}
fn as_menubar_button(&mut self) -> Option<&mut dyn TheMenubarButtonTrait> {
None
}
fn as_time_slider(&mut self) -> Option<&mut dyn TheTimeSliderTrait> {
None
}
fn as_palette_picker(&mut self) -> Option<&mut dyn ThePalettePickerTrait> {
None
}
fn as_palette_index_picker(&mut self) -> Option<&mut dyn ThePaletteIndexPickerTrait> {
None
}
fn as_menu(&mut self) -> Option<&mut dyn TheMenuTrait> {
None
}
fn as_tree_icons(&mut self) -> Option<&mut dyn TheTreeIconsTrait> {
None
}
fn as_tree_text(&mut self) -> Option<&mut dyn TheTreeTextTrait> {
None
}
fn as_any(&mut self) -> &mut dyn Any;
}