Back to Devexpress

TdxStatusBarStateIndicatorPanelStyle.Indicators Property

vcl-dxstatusbar-dot-tdxstatusbarstateindicatorpanelstyle.md

latest3.8 KB
Original Source

TdxStatusBarStateIndicatorPanelStyle.Indicators Property

Provides access to the state indicator collection.

Declaration

delphi
property Indicators: TdxStatusBarStateIndicators read; write;

Property Value

TypeDescription
TdxStatusBarStateIndicators

A state indicator collection.

|

Remarks

Use the Indicators property to access and manage state indicator in the indicator panel. To adjust the distance between indicators, use the Spacing property.

Available Options

Call Indicators.Add and Indicators.Insert functions to create state indicators. The Indicators.Items property provides indexed access to all stored state indicators.

Refer to the TdxStatusBarStateIndicators class description for detailed information on all available options.

Code Example: Create and Populate Indicator Panels

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

delphi
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;
cpp
#include "dxStatusBar.hpp" // Declares the TdxStatusBarPanel component and all related types

// Add the following linker directive to the corresponding CPP source file:
#pragma link "dxStatusBar" // Required to use dxStatusBar.hpp declarations

  // ...
  TdxStatusBarPanel *AIndicatorPanel;
  TdxStatusBarStateIndicators *AIndicators;

  AIndicatorPanel = dxStatusBar1->Panels->Add();
  AIndicatorPanel->PanelStyleClass = __classid(TdxStatusBarStateIndicatorPanelStyle);
  AIndicators = dynamic_cast<TdxStatusBarStateIndicatorPanelStyle*>(AIndicatorPanel->PanelStyle)->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
  }

See Also

TdxStatusBarStateIndicatorPanelStyle Class

TdxStatusBarStateIndicatorPanelStyle Members

dxStatusBar Unit