Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TdxGaugeScaleCollection.Items Property

Provides zero-based indexed access to scales stored by the collection.

#Declaration

Delphi
property Items[Index: Integer]: TdxGaugeCustomScale read; write; default;

#Property Value

Type
TdxGaugeCustomScale

#Remarks

The Index parameter specifies the index of a particular scale created within the Gauge Control. In order to access a particular scale, it should actually exist within the collection. You can create a scale either by using the collection’s Add method or by invoking the Gauge Control’s AddScale or AddContainer methods.

In order to access the scale-specific settings, you need to cast the returned TdxGaugeCustomScale object to the actual scale type you are currently working with. Refer to the following code example.

var
  ACircularScale TdxGaugeCircularScale;  // Use this variable to address the circular scale-specific properties
  ALinearScale: TdxGaugeLinearScale;  // Use this variable to access the linear scale-specific properties
AMaxIndex: Integer;
//...
  AMaxIndex := 0;
  dxGaugeControl1.Scales.Add(TdxGaugeCircularScale);  // Add a circular scale
  dxGaugeControl1.Scales.Add(TdxGaugeLinearScale);  // Add a linear scale
  if(dxGaugeControl1.Scales.Count > 0) then
    AMaxIndex := dxGaugeControl.Scales.Count - 1;
// Make sure that the collection item stores the required scale type...
  if(dxGaugeControl1.Scales[AMaxIndex - 1].ClassName = 'TdxGaugeCircularScale') then
// Accessing the circular scale within the collection...
    ACircularScale := TdxGaugeCircularScale(dxGaugeControl1.Scales[AMaxIndex - 1]);
// Make sure that the collection item stores the required scale type...
  if(dxGaugeControl1.Scales[AMaxIndex].ClassName = 'TdxGaugeLinearScale') then
// Accessing the linar scale within the collection...
    ALinearScale := TdxGaugeLinearScale(dxGaugeControl1.Scales[AMaxIndex]);

Note

In order to access a particular scale, it should actually exist within the collection. To add a scale of the required type to the collection, use the Add function.

See Also