[][src]Trait rg3d_ui::Control

pub trait Control<M: 'static, C: 'static + Control<M, C>>: Deref<Target = Widget<M, C>> + DerefMut {
    fn raw_copy(&self) -> UINode<M, C>;
fn handle_routed_message(
        &mut self,
        ui: &mut UserInterface<M, C>,
        message: &mut UiMessage<M, C>
    ); fn resolve(&mut self, _node_map: &NodeHandleMapping<M, C>) { ... }
fn measure_override(
        &self,
        ui: &UserInterface<M, C>,
        available_size: Vec2
    ) -> Vec2 { ... }
fn arrange_override(
        &self,
        ui: &UserInterface<M, C>,
        final_size: Vec2
    ) -> Vec2 { ... }
fn arrange(&self, ui: &UserInterface<M, C>, final_rect: &Rect<f32>) { ... }
fn is_measure_valid(&self, ui: &UserInterface<M, C>) -> bool { ... }
fn is_arrange_valid(&self, ui: &UserInterface<M, C>) -> bool { ... }
fn measure(&self, ui: &UserInterface<M, C>, available_size: Vec2) { ... }
fn draw(&self, _drawing_context: &mut DrawingContext) { ... }
fn update(&mut self, _dt: f32) { ... }
fn preview_message(
        &mut self,
        _ui: &mut UserInterface<M, C>,
        _message: &mut UiMessage<M, C>
    ) { ... }
fn handle_os_event(
        &mut self,
        _self_handle: Handle<UINode<M, C>>,
        _ui: &mut UserInterface<M, C>,
        _event: &OsEvent
    ) { ... }
fn remove_ref(&mut self, _handle: Handle<UINode<M, C>>) { ... } }

Trait for all UI controls in library.

Required methods

fn raw_copy(&self) -> UINode<M, C>

fn handle_routed_message(
    &mut self,
    ui: &mut UserInterface<M, C>,
    message: &mut UiMessage<M, C>
)

Performs event-specific actions. Must call widget.handle_message()!

Notes

Do not try to borrow node by self_handle in UI - at this moment node has been moved out of pool and attempt of borrowing will cause panic! self_handle should be used only to check if event came from/for this node or to capture input on node.

Loading content...

Provided methods

fn resolve(&mut self, _node_map: &NodeHandleMapping<M, C>)

fn measure_override(
    &self,
    ui: &UserInterface<M, C>,
    available_size: Vec2
) -> Vec2

fn arrange_override(&self, ui: &UserInterface<M, C>, final_size: Vec2) -> Vec2

fn arrange(&self, ui: &UserInterface<M, C>, final_rect: &Rect<f32>)

fn is_measure_valid(&self, ui: &UserInterface<M, C>) -> bool

fn is_arrange_valid(&self, ui: &UserInterface<M, C>) -> bool

fn measure(&self, ui: &UserInterface<M, C>, available_size: Vec2)

fn draw(&self, _drawing_context: &mut DrawingContext)

fn update(&mut self, _dt: f32)

fn preview_message(
    &mut self,
    _ui: &mut UserInterface<M, C>,
    _message: &mut UiMessage<M, C>
)

fn handle_os_event(
    &mut self,
    _self_handle: Handle<UINode<M, C>>,
    _ui: &mut UserInterface<M, C>,
    _event: &OsEvent
)

Provides a way to respond to OS specific events. Can be useful to detect if a key or mouse button was pressed. This method significantly differs from handle_message because os events are not dispatched - they'll be passed to this method in any case.

fn remove_ref(&mut self, _handle: Handle<UINode<M, C>>)

Called when a node is deleted from container thus giving a chance to remove dangling handles which may cause panic.

Loading content...

Implementors

impl Control<(), StubNode> for StubNode[src]

impl<M: 'static, C: 'static + Control<M, C>> Control<M, C> for UINode<M, C>[src]

impl<M: 'static, C: 'static + Control<M, C>> Control<M, C> for Border<M, C>[src]

impl<M: 'static, C: 'static + Control<M, C>> Control<M, C> for Button<M, C>[src]

impl<M: 'static, C: 'static + Control<M, C>> Control<M, C> for Canvas<M, C>[src]

impl<M: 'static, C: 'static + Control<M, C>> Control<M, C> for CheckBox<M, C>[src]

impl<M: 'static, C: 'static + Control<M, C>> Control<M, C> for Decorator<M, C>[src]

impl<M: 'static, C: 'static + Control<M, C>> Control<M, C> for DockingManager<M, C>[src]

impl<M: 'static, C: 'static + Control<M, C>> Control<M, C> for Tile<M, C>[src]

impl<M: 'static, C: 'static + Control<M, C>> Control<M, C> for DropdownList<M, C>[src]

impl<M: 'static, C: 'static + Control<M, C>> Control<M, C> for FileBrowser<M, C>[src]

impl<M: 'static, C: 'static + Control<M, C>> Control<M, C> for Grid<M, C>[src]

impl<M: 'static, C: 'static + Control<M, C>> Control<M, C> for Image<M, C>[src]

impl<M: 'static, C: 'static + Control<M, C>> Control<M, C> for ListView<M, C>[src]

impl<M: 'static, C: 'static + Control<M, C>> Control<M, C> for ListViewItem<M, C>[src]

impl<M: 'static, C: 'static + Control<M, C>> Control<M, C> for Menu<M, C>[src]

impl<M: 'static, C: 'static + Control<M, C>> Control<M, C> for MenuItem<M, C>[src]

impl<M: 'static, C: 'static + Control<M, C>> Control<M, C> for MessageBox<M, C>[src]

impl<M: 'static, C: 'static + Control<M, C>> Control<M, C> for NumericUpDown<M, C>[src]

impl<M: 'static, C: 'static + Control<M, C>> Control<M, C> for Popup<M, C>[src]

impl<M: 'static, C: 'static + Control<M, C>> Control<M, C> for ProgressBar<M, C>[src]

impl<M: 'static, C: 'static + Control<M, C>> Control<M, C> for ScrollBar<M, C>[src]

impl<M: 'static, C: 'static + Control<M, C>> Control<M, C> for ScrollPanel<M, C>[src]

impl<M: 'static, C: 'static + Control<M, C>> Control<M, C> for ScrollViewer<M, C>[src]

impl<M: 'static, C: 'static + Control<M, C>> Control<M, C> for StackPanel<M, C>[src]

impl<M: 'static, C: 'static + Control<M, C>> Control<M, C> for TabControl<M, C>[src]

impl<M: 'static, C: 'static + Control<M, C>> Control<M, C> for Text<M, C>[src]

impl<M: 'static, C: 'static + Control<M, C>> Control<M, C> for TextBox<M, C>[src]

impl<M: 'static, C: 'static + Control<M, C>> Control<M, C> for Tree<M, C>[src]

impl<M: 'static, C: 'static + Control<M, C>> Control<M, C> for TreeRoot<M, C>[src]

impl<M: 'static, C: 'static + Control<M, C>> Control<M, C> for Vec3Editor<M, C>[src]

impl<M: 'static, C: 'static + Control<M, C>> Control<M, C> for Window<M, C>[src]

impl<M: 'static, C: 'static + Control<M, C>> Control<M, C> for WrapPanel<M, C>[src]

Loading content...