IVZEffects.Add

Fore syntax

Add(Value: IVZEffect): Interger;

Fore.NET syntax

Add(Value: Prognoz.Platform.Interop.Visualizators.IVZEffect): System.Int32;

Parameters

Value. The effect that is used to highlight a control.

Description

The Add add new effect to the collection of effects.

Comments

The effect is added to the end of the collection.

The method returns index of the effect added to the collection.

Fore example

Executing the example requires that the repository contains an express report with a bubble chart. Determine outline for active and non active elements, determine transparency parameters, display the number of effects in the collection for inactive elements to the console.

Place the Button, UiErAnalyzer, EaxBubbleChartBox components named Button1, UiErAnalyzer1 and EaxBubbleChartBox1 correspondingly on the form. For UiErAnalyzer select the Active property to True, OperationMode to Edit and select the express report in the Object property. For EaxBubbleChartBox select the UiErAnalyzer1 component in the Source property (Analyzer for Fore.NET).

Add links to the system assemblies: Express, Drawing, Forms, Visualizators (for the Fore.NET example add links to the Metabase and Forms.NET system assemblies).

The example is the OnClick event handler for the Button1 component.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    EBubbleChart: IVZBubbleChart;
    AlphaEffect: IVZAlphaChannelEffect;
    BoEffect: IVZBorderEffect;
    Color: IGxColor;
    Feather: IGxPen;
    SAE, SIE: IVZEffects;
Begin
    EBubbleChart := UiErAnalyzer1.ErAnalyzer.BubbleChart.BubbleChart;
    
// Determine parameters of the transparency effect for elements
    AlphaEffect := New VZAlphaChannelEffect.Create;
    AlphaEffect.Alpha := 
0.2;
    SIE := 
New VZEffects.Create;
    
// Add an effect to the collection
    SIE.Add(AlphaEffect);
    
// Determine parameters of the outline highlighting with violet
    Color := New GxColor.CreateRGB(15350204);
    Feather := 
New GxPen.CreateSolid(Color, 1);
    BoEffect := 
New VZBorderEffect.Create;
    BoEffect.BorderPen := Feather;
    
// Insert a new effect to the position with index 0 to highlight inactive elements
    SIE.InsertAt(0, BoEffect);
    
// Apply effects to inactive elements
    EBubbleChart.SelectInactiveEffects := SIE;
    
// Create a green outline
    Color := New GxColor.CreateRGB(1412875);
    Feather := 
New GxPen.CreateSolid(Color, 1);
    BoEffect := 
New VZBorderEffect.Create;
    BoEffect.BorderPen := Feather;
    SAE := 
New VZEffects.Create;
    SAE.Add(BoEffect);
    
// Apply effect for active elements
    EBubbleChart.SelectActiveEffects := SAE;
    UiErAnalyzer1.ErAnalyzer.BubbleChart.Refresh;

    // Display the number of effects for inactive elements to the console
    Debug.WriteLine(
"Number of effects in collection for inactive elements: " + SIE.Count.ToString);
End Sub Button1OnClick;

After clicking the button, select the elements of the bubble chart. Active element will be displayed with the green outline, inactive elements will be displayed with the specified transparency and the violet outline. The console displays information about the number of effects for inactive elements in the collection:

The number of effects for inactive elements in the collection: 2

Fore.NET example

The requirements and result of the Fore.NET example execution match with those in the Fore example. Use Fore.NET analogs instead of Fore components.

Imports Prognoz.Platform.Forms.Net;
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Drawing;
Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.Forms;
Imports Prognoz.Platform.Interop.Visualizators;

Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
    EBubbleChart: IVZBubbleChart;
    AlphaEffect: IVZAlphaChannelEffect;
    BoEffect: IVZBorderEffect;
    BoEffect1: IVZBorderEffect;
    Color: GxColorClass_2 = 
New GxColorClass_2.Create();
    Feather: GxPenClass = 
New GxPenClass.Create();
    SAE, SIE: IVZEffects;
Begin
    EBubbleChart := uiErAnalyzerNet1.ErAnalyzer.ErAnalyzer.BubbleChart.BubbleChart;
    
// Determine parameters of the transparency effect for elements
    AlphaEffect := New VZAlphaChannelEffect.Create();
    AlphaEffect.Alpha := 
0.2;   
    SIE := 
New VZEffects.Create();
    
// Add an effect to the collection
    SIE.Add(AlphaEffect);
    
// Determine parameters of the outline highlighting effect with violet 
    Color.CreateRGB(153,50,204);
    Feather.CreateSolid(Color,
1);
    BoEffect := 
New VZBorderEffect.Create();
    BoEffect.BorderPen := Feather;
    
// Insert a new effect to the position with index 0 to highlight inactive elements
    SIE.InsertAt(0, BoEffect);
    
// Apply effects to inactive elements
    EBubbleChart.SelectInactiveEffects.Add(BoEffect);
    
// Create a green outline 
    Color.CreateRGB(14,128,75);
    Feather.CreateSolid(Color,
1);
    BoEffect := 
New VZBorderEffect.Create();
    BoEffect.BorderPen := Feather;
    SAE := New VZEffects.Create();
    SAE.Add(BoEffect);
    
// Apply effect for active elements
    EBubbleChart.SelectActiveEffects.Add(BoEffect);
    uiErAnalyzerNet1.ErAnalyzer.ErAnalyzer.BubbleChart.Refresh();
    
// Display the number of effects for inactive elements to the console
    System.Diagnostics.Debug.WriteLine("Number of effects in the collection for inactive elements: " + SIE.Count.ToString());
End Sub;

See also:

IVZEffects