Skip to main content

TdxStatusBarKeyboardStatePanelStyle Class

This defines the display style and behavior of the keyboard state panels.

Declaration

TdxStatusBarKeyboardStatePanelStyle = class(
    TdxStatusBarPanelStyle
)

Remarks

The TdxStatusBarKeyboardStatePanelStyle class defines the options of style and behavior that are applied to the status bar panels that track the state of keyboard modifiers, namely CAPS LOCK, NUM LOCK, SCROLL LOCK, and INSERT. Status bars with various kinds of keyboard state panels are widely used in text processing applications. By editing TdxStatusBarKeyboardStatePanelStyle properties, you may select which keyboard modifiers to track, enable or disable the boxes around each indicator, change the indicators’ text and more.

Below are several samples of keyboard state panels:

The keyboard state properties are available both at design and at run-time. For example, if you wish to remove the INSERT/OVERWRITE indicator from the standard keyboard panel at design time, follow the instructions below:

  • Select the status bar object.

  • Switch to the Object Inspector and click the ellipsis button next to the Panels property.

  • In the Panels collection editor, select the relevant container panel.

  • In the Object Inspector, find and expand the PanelStyle property.

  • Reset the dxksInsert flag.

To perform the same operation at runtime, use the following code:

if (dxStatusBar1.Panels[2].PanelStyle is TdxStatusBarKeyboardStatePanelStyle) then
  TdxStatusBarKeyboardStatePanelStyle(dxStatusBar1.Panels[2].PanelStyle).KeyboardStates := [dxksCapsLock, dxksScrollLock];

Before the above code is executed, the status bar may look like the following:

After:

You can use the status bar’s SimplePanelStyle.Active property to optionally switch the status bar to display a single text panel rather than all the created panels. This functionality is similar to the SimplePanel property found in the standard VCL TStatusBar component.

Inheritance

See Also