# Style object states and "why disabled" tooltips

> Choose how buttons, inputs, toggles and selectors look when they are disabled, locked, pressed, on, Bad or not configured - once for the whole project, or per object - preview each state in the designer, and let the tooltip tell the operator why a command is disabled.

Product: eaxScada · Type: How-to guide · Editions: Starter, Pro, Enterprise
Source: https://eaxware.com/docs/eaxscada/how-to/style-object-states/
Status: migrated page, not yet verified against the current code.

## Goal

An operator sees at a glance that a command is disabled, and hovering it says why: "Disabled by interlock: tag('DocsPlant/Pumps/P201/Trip') == 1", "Locked: requires the Process_Supervisor role", "Bad quality", "Not configured (no tag)". You choose the look once for the whole project, and adjust single objects where needed.

## The eight states

| State | When an object is in it |
|---|---|
| **Normal** | nothing below applies |
| **Hover** | the pointer is over it |
| **Pressed** | it is being pressed |
| **On** | its bound feedback is on (a running motor), or it is the navigation button of the page shown |
| **Disabled** | an interlock (disabled condition) is active |
| **Bad quality** | the value it shows, or its interlock, reads a Bad value |
| **Locked** | the signed-in user lacks the role it requires |
| **Not configured** | its action is incomplete (a write without a tag or value, a popup without a screen): pressing it does nothing |

When several apply, the first in this order wins: not configured, locked, disabled, bad, pressed, hover, on, normal.

:::note[Visual only]
A state style changes how an object looks, never whether it works. Whether an object can be operated is decided by its conditions, the user's rights and the server. A style cannot enable a disabled command.
:::

## 1. Set the project's look

1. Open **Project → Open / Switch Project... → Operator runtime → State styles...** (or **Project state styles...** in an object's States section).
2. Choose the **Objects**: Buttons, Inputs, Toggles, Selectors, Faceplate buttons, or All other objects.
3. Click a state, for example **Disabled**, and set what changes: fill, border, border width, text colour, text style, opacity, pattern (**hatched** is visible even in grey-scale), cursor and, for Disabled and Locked, a fixed tooltip (empty: the tooltip says why).
4. Check the preview row: it draws a sample in all eight states with your values.
5. **Save**.
[Image: The State styles editor: the Disabled state of buttons, with a preview of the eight states.]
[Image: The State styles editor: the Disabled state of buttons, with a preview of the eight states.]

The project's disabled buttons: grey, dimmed to 0.45, not-allowed cursor.
Every open screen, in the studio and the runtime, redraws at once. Colours take `#hex` or `token:<name>`, a project colour token that follows the theme. Without any project style, objects look as before: a disabled or locked one dims to 0.45 and uses its own disabled colours.

A conflicting save (someone else saved the styles since you opened them) is refused; the editor reloads and asks you to make your change again.

## 2. Adjust one object

1. Select the object in the designer. Its **States** section is in the inspector's Properties.
2. Click a state chip: the canvas shows the object in that state.
3. Set the fields you want to differ from the project. A field set here is marked ●; the placeholder shows what applies without it.
4. **Reset to project** removes this object's style for the state. **Apply to all buttons on this screen** copies this object's state styles to every object of its family on the screen (it asks first).
[Image: The START button selected in the designer, previewing its Disabled state, with the States section in the inspector.]
[Image: The START button selected in the designer, previewing its Disabled state, with the States section in the inspector.]

The States section: the canvas previews the chosen state.
The order is fixed: the theme, then the project (All other objects, then the family), then the object's own colours (a button's up, down, active and disabled colours, when you changed them), then the object's own state style.

## 3. Let the tooltip say why

Leave the tooltip of Disabled and Locked empty. The runtime then writes it from what actually disables the object:

| Cause | Tooltip |
|---|---|
| An interlock | Disabled by interlock: *the condition* |
| An interlock that reads a Bad value | Disabled: the interlock cannot be read (Bad value): *the condition* |
| A missing role | Locked: requires the *role* role. You are signed in as *role*. |
| A Bad value | Bad quality: the value shown is not reliable, with each tag, its quality and age |
| An incomplete action | Not configured (*what is missing*): pressing it does nothing. |
[Image: The interlocked START button in the runtime, with its tooltip.]
[Image: The interlocked START button in the runtime, with its tooltip.]

The tooltip of a disabled command names its interlock.
The tooltip texts follow the operator's language. A fixed tooltip can be a translation key (`t:pump.locked|Ask the shift lead`).

## 4. Check it

The Problems panel warns with `state-disabled-indistinguishable` when the disabled look is the same as the normal look (same fill and text colour, less than 0.25 difference in opacity, no hatching): operators could not see that a command is disabled. The States section and the editor show the same warning.

## How it works

Every text and every state colour goes through one resolver: the language, then the text style, then the state, then the object's own settings. A new object type gets states, fonts and languages without code of its own. See [How texts, fonts, states and languages are resolved](/docs/eaxscada/explanation/text-and-states/).

## Related

- [Project settings: State styles](/docs/eaxscada/reference/project-settings/#state-styles)
- [Enforce interlocks on the server](/docs/eaxscada/how-to/enforce-interlocks/)
- [Fonts and text styles](/docs/eaxscada/how-to/fonts-and-text-styles/)
- A first state style in context: [Build your first 2D screen](/docs/eaxscada/tutorials/build-your-first-2d-screen/#6-make-a-bad-value-obvious-with-a-state-style). Isometric blocks take their state colours from the map's palette and **State colours (project)...** instead.
