All actions

Actions spoiler

Reset

Reset a control to a blank state. Always return ActionReturn::None
Action::Reset
ActionReturn::None

GetControlType

Return the type of the control. Always returns a ActionReturn::ControlType member.
Action::GetControlType
ActionReturn::ControlType(constants::ControlType)

Undo

Undo the last action performed on a control. The last action can also be the Undo action. Ex: CTRL-Z on a TextInput. Always returns ActionReturn::None.
Action::Undo
ActionReturn::None

Close

Close a control. Currently only Window controls can be closed. Always returns ActionReturn::None.
Action::Close
ActionReturn::None

GetParent

Return the parent ID of a control of ActionReturn::None if it's a top-level window.
Action::GetParent
ActionReturn::Parent(Box<ID>)  // With parent
ActionReturn::None             // No parent

SetParent

Set the new parent of a Control. Always return ActionReturn::None.
Action::SetParent(Option<Box<ID>>)
ActionReturn::None

GetChildren

Return a Vec containing the IDs of the control children. Do not include the children of the children. If a control do not have children, return an empty Vec.
Action::GetChildren
ActionReturn::Children(Box<Vec<ID>>)

GetDescendants

Return a Vec containing the IDs of the control children. Include the children of the children. If a control do not have children, return an empty Vec.
Action::GetDescendants
ActionReturn::Children(Box<Vec<ID>>)

GetPosition

Return the position (x,y) of the control. The position is relative to the parent.
Action::GetPosition
ActionReturn::Position(i32, i32)

SetPosition

Set the position (x,y) of the control. The position is relative to the parent. Always return ActionReturn::None
Action::SetPosition(i32, i32)
ActionReturn::None

GetSize

Return the width and the height of the control.
Action::GetSize
ActionReturn::Size(u32, u32)

SetSize

Set the width and the height of the control. Always return ActionReturn::None
Action::SetSize(u32, u32)
ActionReturn::None

GetText

Return the text displayed in the control
Action::GetText
ActionReturn::Text(Box<String>)

SetText

Set the text dislayed in the control. Always return ActionReturn::None. The helper actions::helper::set_text<S: Into<String>>(s: S) can be used.
Action::SetText(Box<String>)
ActionReturn::None

GetCheckState

Return the current checkstate of a control. Return one of the following value: CheckState::Checked, CheckState::Unchecked and CheckState::Indeterminate.
Action::GetCheckState
ActionReturn::CheckState(constants::CheckState)

SetCheckState

Set the current checkstate of a control. One of the following value acn be set: CheckState::Checked, CheckState::Unchecked and CheckState::Indeterminate. Always return ActionReturn::None.
Action::SetCheckState(constants::CheckState)
ActionReturn::None

GetEnabled

Return true if the control is "enabled" for false if it is not.
Action::GetEnabled
ActionReturn::Enabled(bool)

SetEnabled

Set the control a enabled or disabled. Always return ActionReturn::None
Action::SetEnabled(bool)
ActionReturn::None

GetVisibility

Return true if the control is visible to the user or false if it not.
Action::GetVisibility
ActionReturn::Visibility(bool)

SetVisibility

Set the visibility of the control. Always return ActionReturn::None
Action::SetVisibility(bool)
ActionReturn::None

GetWindowDisplay

Return the display state of a window. Return one of the following value: WindowDisplay::Maximised, WindowDisplay::Minimised and WindowDisplay::Normal.
Action::GetWindowDisplay
ActionReturn::WindowDisplay(constants::WindowDisplay)

SetWindowDisplay

Set the display state of a window. Can be one of the following values: Return one of the following value: WindowDisplay::Maximised, WindowDisplay::Minimised and WindowDisplay::Normal. Always return ActionReturn::None.
Action::SetWindowDisplay(constants::WindowDisplay)
ActionReturn::None

GetTextLimit

Return the maixmum number of characters that can be inputted in a control
Action::GetTextLimit
ActionReturn::TextLimit(u32)

SetTextLimit

Set the maixmum number of characters that can be inputted in a control
Action::SetTextLimit(u32)
ActionReturn::None

GetSelectedBounds

If the control can have its content selected (ex: TextInput). Return the upper and lower bound of the selected content.
Action::GetSelectedBounds
ActionReturn::SelectBounds((u32, u32))

SetSelectedBounds

If the control can have its content selected (ex: TextInput). Set the upper and lower bound of the selected content. Always return ActionReturn::None.
Action::SetSelectedBounds((u32, u32))
ActionReturn::None

GetReadonly

Return true if the control cannot be edited by the user or false if it is not. (this is not related to 'disabled').
Action::GetReadonly
ActionReturn::ReadOnly(bool)

SetReadonly

Set if the control cannot be edited by the user or not (this is not related to 'disabled'). Always return ActionReturn::None.
Action::SetReadonly(bool)
ActionReturn::None

GetSelectedIndex

Return the selected item index in a control with a collection (ex: combobox). If no item is selected, return ActionReturn::None.
Action::GetSelectedIndex
ActionReturn::ItemIndex(u32) // Index selected
ActionReturn::None           // No index selected

SetSelectedIndex

Set the selected item index in a control with a collection (ex: combobox). If the index is out of bounds, return ActionReturn::Error(constants::Error::INDEX_OUT_OF_BOUNDS) If the set value is None, remove the currently selected item.

actions::helper::remove_selected() can be used to remove the current item.
actions::helper::set_selected_index(i: i32) can be used to set the current item.
Action::SetSelectedIndex(Option<u32>)
ActionReturn::None                            // OK
ActionReturn::Error(constants::Error)         // Index out of bounds

GetPlaceholder

Return the placeholder visible to the user. If there is no placeholder, return ActionReturn::None, otherwise return ActionReturn::Text.
Action::GetPlaceholder
ActionReturn::Text(Box<String>)  // Placeholder
ActionReturn::None               // No placeholder

SetPlaceholder

Set the placeholder visible to the user if a control value is blank. Currently, there is a limit of 255 characters for a placeholder. Always return ActionReturn::None.

actions::helper::set_placeholder<S: Into<String>>(s:S) can be used to set a placeholder.
actions::helper::remove_placeholder() can be used to remove the current placeholder.
Action::SetPlaceholder(Option<Box<String>>)
ActionReturn::None

GetDropdownVisibility

Return true if the dropdown of a control is visible or false otherwise. This might be renamed to "GetMenuVisibility" to include context menu.
Action::GetDropdownVisibility
ActionReturn::Visibility(bool)

SetDropdownVisibility

Set the dropdown visibility of a control. Always return ActionReturn::None. This might be renamed to "SetMenuVisibility" to include context menu.
Action::SetDropdownVisibility(bool)
ActionReturn::None

AddString

Add a string item to a control with a collection. The helper actions::helper::add_string<S: Into<String>>(s: S) can be used.
Action::AddString(Box<String>)
ActionReturn::None

RemoveString

Remove a string item from a control with a collection. The helper actions::helper::remove_string<S: Into<String>>(s: S) can be used. If the string is not found a ActionReturn::Error(constants::Error::ITEM_NOT_FOUND) is returned.
Action::RemoveString(Box<String>)
ActionReturn::None
ActionReturn::Error(constants::Error)         // String not found

FindString

Return the index of a string within a control with a collection. The helper actions::helper::find_string<S: Into<String>>(s: S) can be used. If the string is not found a ActionReturn::Error(constants::Error::ITEM_NOT_FOUND) is returned.
Action::FindString(Box<String>)
ActionReturn::ItemIndex(u32)                  // String found
ActionReturn::Error(constants::Error)         // String not found

InsertString

Insert a string item at a selected position within a control with a collection. If the index is out of bounds, a ActionReturn::Error(constants::Error::INDEX_OUT_OF_BOUNDS) is raised othherwise return a ActionReturn::None.
Action::InsertString(Box<(u32, String)>)
ActionReturn::None
ActionReturn::Error(Error)

GetIndexedString

Return the visible text at the designed position in a control with a collection. If the index is out of bounds, a ActionReturn::Error(constants::Error::INDEX_OUT_OF_BOUNDS) is raised othherwise return a ActionReturn::Text containing the visible text.
Action::GetIndexedString(u32)
ActionReturn::Text(Box<String>)  // Success
ActionReturn::Error(Error)       // Fail

GetStringCollection

Return the string collection of a control
Action::GetStringCollection
ActionReturn::StringCollection(Box<Vec<String>>)

SetStringCollection

Set the string collection of a control. This replace the old collection. Always return ActionReturn::None.
Action::SetStringCollection(Box<Vec<String>>)
ActionReturn::None

CountItems

Return the number of items in a control collection
Action::CountItems
ActionReturn::ItemCount(u32)

RemoveIndexedItem

Return an item at the specified index in a control with a collection. If the index is out of bounds, return ActionReturn::Error(constants::Error::INDEX_OUT_OF_BOUNDS), otherwise return ActionReturn::None.
Action::RemoveIndexedItem(u32)
ActionReturn::None
ActionReturn::Error(constants::Error)

Message

Display a messagebox that block further input to the parent until it is dimissed or accepted. Always return a ActionReturn::MessageChoice.
It is always a great idea to use the helper:
actions::helper::message<S1: Into<String>, S2: Into<String>>(
   title: S1,
   content: S2,
   buttons: constants::MessageButtons,
   icons: constants::MessageIcons
)
// actions::ActMessageParams 
pub struct ActMessageParams {
    pub title: String,
    pub content: String,
    pub buttons: constants::MessageButtons,
    pub icons: constants::MessageIcons
}

Action::Message(Box<actions::ActMessageParams>)
ActionReturn::MessageChoice(constants::MessageChoice)