Skip to main content

TdxStatusBarStateIndicatorItem Class

A state indicator.

Declaration

TdxStatusBarStateIndicatorItem = class(
    TCollectionItem
)

Remarks

State indicators are simple colored UI elements designed to display enabled/disabled states for individual features in an application.

Main API Members

The list below outlines key members of the TdxStatusBarStateIndicatorItem class. These members allow you to configure state indicators.

State Indicator Settings

IndicatorType
Allows you to switch between available state indicator colors.
Visible
Specifies if the state indicator is visible.
Collection
Provides access to the parent state indicator collection.
Index
Specifies the indicator’s index in the parent collection.

Code Example: Create State Indicators

The following code example creates an indicator panel in an existing TdxStatusBarPanel component and populates the panel with five different indicators:

uses
  dxStatusBar;  // Declares the TdxStatusBarPanel component and all related types
// ...

var
  AIndicatorPanel: TdxStatusBarPanel;
  AIndicators: TdxStatusBarStateIndicators;
begin
  AIndicatorPanel := dxStatusBar1.Panels.Add;
  AIndicatorPanel.PanelStyleClass := TdxStatusBarStateIndicatorPanelStyle;
  AIndicators := (AIndicatorPanel.PanelStyle as TdxStatusBarStateIndicatorPanelStyle).Indicators;
  AIndicators.BeginUpdate;  // Initiates the following batch change
  try
    AIndicators.Add.IndicatorType := sitRed;
    AIndicators.Add.IndicatorType := sitYellow;
    AIndicators.Add.IndicatorType := sitGreen;
    AIndicators.Add.IndicatorType := sitPurple;
    AIndicators.Add.IndicatorType := sitOff;
  finally
    AIndicators.EndUpdate;  // Calls EndUpdate regardless of the batch operation's success
  end;
end;

VCL Editors: A Populated Indicator Panel Example

Direct TdxStatusBarStateIndicatorItem Class References

The following public API members reference a TdxStatusBarStateIndicatorItem object:

TdxStatusBarStateIndicators.Add
Creates a state indicator and adds it to the collection.
TdxStatusBarStateIndicators.Insert
Creates a state indicator and inserts it at the specified position in the collection.
TdxStatusBarStateIndicators.Items
Provides indexed access to all state indicators stored in the collection.

Inheritance

TObject
TPersistent
TCollectionItem
TdxStatusBarStateIndicatorItem
See Also