States determine which styles (CSS class) and which properties to apply to a widget. During the lifetime of a widget, the state(s) that the widget assumes change dynamically depending on many factors: pointer, property settings, focus, etc.
A widget can assume several states at the same time, i.e. it can be Focused and Hovered at the same time. The state of a widget is usually changed by the widget implementation, but it can also be manipulated by the application:
There are some common states that are supported by most widgets, while individual widgets may add their own states. For example, the wisej.web.TabControl.js widget (corresponding to the Wisej.Web.TabControl control) adds states corresponding to the orientation and alignment of the tabs: barTop, barBottom, barRight, barLeft.
States may also get propagated to internal child widgets, in order to allow the child widgets to adapt their behavior and UI to the owner widget's state.
Here you can find the list of the common (shared) states by most widgets. However, specific widgets may have additional states that are not listed here.
- defaultThe default state is always applied first. The styles and properties defined in the default state may be overridden by the additional states.
- activeThis is the state used by a Window, which correspond to Wisej.Web.Form, when it is active. Usually there can be only one active window.
- maximizedThe maximized state is applied to maximized Wisej.Web.Form controls.
- disabledThis is the state applied to disabled widgets. The built-in themes set the opacity property to render the widget grayed out.
- hoveredThis state is applied to a widget when the pointer is over the element, and removed when the pointer moves out.
- checkedThis state is applied to widgets that support a checked state: check boxes, menu items, tree nodes, ...
- undeterminedThis state is applied to widgets that support the undetermined state: check boxes, tree nodes, ...
- pressedThis state is applied to widgets that support the pressed state: buttons, sliders.See how the provided themes use this state to emulate the movement of a button when it is pressed:
"transform": "translate(1px, 1px)"
- focusedThe focused state is applied to all editable widgets when they gain the focus.
- invalidThe invalid state is applied to any editable widget when the application sets the Invalid property to true. Typically a theme can render this state by adding a red border, or an icon, or by changing a color on the widget.
- contextmenuThe contextmenu state is applied to widgets that have been assigned a contextual menu.
- verticalThis state is applied to widgets that support the vertical state: tab control, sliders, scrollbars.
- horizontalThis state is applied to widgets that support the horizontal state: tab control, sliders, scrollbars.
- barTopThe barTop state is assigned to a tab control widget when tabs are docked to the top, regardless of the orientation.
- barLeftThe barLeft state is assigned to a tab control widget when tabs are docked to the left, regardless of the orientation.
- barRightThe barRight state is assigned to a tab control widget when tabs are docked to the right, regardless of the orientation.
- barBottomThe barBottom state is assigned to a tab control widget when tabs are docked to the bottom, regardless of the orientation.
- selectedThe selected state is applied to child items when they are selected: list items, tree nodes.
- sortable ****The sortable state is applied to columns that can be sorted by the user.
- sortedThe sorted state is applied to columns when they are sorted.
- sortedAscendingThe sortedAscending state is applied to columns when they are sorted ascending.
- openedThe opened state is applied to tree nodes when they expanded.
- up, down, left, rightThese states are applied to the scrollbar buttons depending on the orientation of the scrollbar.
- showingPlaceholderThe showingPlaceholder state is applied to editable controls when they show the placeholder (empty value with watermark text).
- dragThe drag state is applied to a widget when it is the target of a drag operation.
Many controls in Wisej have a Tools collection to display small icons inside the control that can be connected to custom actions. These tool icons are managed in a widget using the appearance key "ToolContainer".
You can customize the tools in relation to their container using the following states in the ToolContainer appearance.
- editorComboBox, DateTimePicker, TextBox