Back to Devexpress

TdxStatusBarStateIndicatorType Enum

vcl-dxstatusbar-ed739f24.md

latest3.4 KB
Original Source

TdxStatusBarStateIndicatorType Enum

Enumerates predefined state indicator colors.

Declaration

delphi
TdxStatusBarStateIndicatorType = (
    sitOff,
    sitYellow,
    sitBlue,
    sitGreen,
    sitRed,
    sitTeal,
    sitPurple
);

Members

NameDescription
sitOff

Gray ( default ). This option is designed to indicate disabled state for the indicator.

| | sitYellow |

Yellow

| | sitBlue |

Blue

| | sitGreen |

Green

| | sitRed |

Red

| | sitTeal |

Teal

| | sitPurple |

Purple

|

Remarks

Use TdxStatusBarStateIndicatorType values to indicate different feature states in a status bar.

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:

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
  }

Direct TdxStatusBarStateIndicatorType Type Reference

The TdxStatusBarStateIndicatorItem.IndicatorType property references a TdxStatusBarStateIndicatorType value.

See Also

TdxStatusBarEllipsisType Type

TdxStatusBarKeyboardState Type

dxStatusBar Unit