SetBackground(state: VisualizatorControlState; Value: IGxBrush);
SetBackground(state: Prognoz.Platform.Interop.Visualizators.VisualizatorControlState; Value: Prognoz.Platform.Interop.Drawing.IGxBrush);
state. Control state.
Value. Control background brush.
The SetBackground method determines the brush used to set control background for the specified state.
Executing the example requires that the repository contains an express report with the EXP identifier. The module containing the example should have links to the Express, Metabase, Drawing and Visualizators system assemblies. The selected procedure should be called from the Main entry point.
Before executing the example, the bubble tree time line looks as shown on the IVZBubbleTree property description page. Set new values of background and borders for this scale, get type of background brush and width of the border line:
Sub UserProc;
Var
Metabase: IMetabase; // Metabase
EaxAnalyzer: IEaxAnalyzer; // Express report
BubbleTree: IVZBubbleTree; // Bubble tree
Timeline: IVZTimeLine; // Time scale
Style: IVZControlStyle; // Style
Begin
// Get metabase object
Metabase := MetabaseClass.Active;
// Get express report object
EaxAnalyzer := Metabase.ItemById("EXP").Edit As IEaxAnalyzer;
// Get bubble tree
BubbleTree := EaxAnalyzer.BubbleTree.BubbleTree;
// Get time line
Timeline := BubbleTree.TimeLine;
// Get time line style
Style := Timeline.Style;
// Set new background
Style.SetBackground(VisualizatorControlState.ControlStateReleased,
New GxSolidBrush.Create(New GxColor.CreateRGB(127, 199, 255)));
// Set new border color
Style.SetBorderPen(VisualizatorControlState.ControlStateReleased,
New GxPen.CreateSolid(New GxColor.CreateRGB(255, 0, 0), 3));
// Display background color brush type
Select Case Style.GetBackground(VisualizatorControlState.ControlStateReleased).BrushType
Case GxBrushType.SolidColor: Debug.WriteLine("Background fill brush type - SolidColor");
Case GxBrushType.HatchFill: Debug.WriteLine("Background fill brush type - HatchFill");
Case GxBrushType.TextureFill: Debug.WriteLine("Background fill brush type - TextureFill");
Case GxBrushType.PathGradient: Debug.WriteLine("Background fill brush type - PathGradient");
Case GxBrushType.LinearGradient: Debug.WriteLine("Background fill brush type - LinearGradient");
End Select;
// Output border line width
Debug.WriteLine("Border line width: " +
Style.GetBorderPen(VisualizatorControlState.ControlStateReleased).Width.ToString);
// Save express report
(EaxAnalyzer As IMetabaseObject).Save;
End Sub UserProc;
After executing the example, color of background fill and time line border line are changed in the bubble tree:
Also, the background color brush type and border line width are shown in the development environment console window:
Background color brush type - SolidColor
Border line width: 3
Executing the example requires that the repository contains an express report with the EXP identifier. The selected procedure is the Main entry point in the Program module of the .NET assembly. The Express, Metabase, Drawing and Visualizators assemblies should be imported to this module from the Prognoz.Platform.Interop system assembly.
Before executing the example, the bubble tree time line looks as shown on the IVZBubbleTree property description page. Set new values of background and borders for this scale, get type of background brush and width of the border line:
Public Shared Sub Main(Params: StartParams);
Var
Metabase: IMetabase; // Metabase
EaxAnalyzer: IEaxAnalyzer; // Express report
BubbleTree: IVZBubbleTree; // Bubble tree
Timeline: IVZTimeLine; // Time scale
Style: IVZControlStyle; // Style
BackgroundBrush: GxSolidBrush; // Background color brush
BackgroundColor: GxColor; // Background color
BorderPen: GxPen; // Border color
BorderColor: GxColor; // Border color
Begin
// Get metabase object
Metabase := Params.Metabase;
// Get express report object
EaxAnalyzer := Metabase.ItemById["EXP"].Edit() As IEaxAnalyzer;
// Get bubble tree
BubbleTree := EaxAnalyzer.BubbleTree.BubbleTree;
// Get time line
Timeline := BubbleTree.TimeLine;
// Get time line style
Style := Timeline.Style;
// Set new background
BackgroundColor := New GxColor();
BackgroundColor.CreateRGB(127, 199, 255);
BackgroundBrush := New GxSolidBrush();
BackgroundBrush.Create(BackgroundColor);
Style.SetBackground(VisualizatorControlState.vcsControlStateReleased, BackgroundBrush);
// Set new border color
BorderColor := New GxColor();
BorderColor.CreateRGB(0, 0, 255);
BorderPen := New GxPen();
BorderPen.CreateSolid(BorderColor, 3);
Style.SetBorderPen(VisualizatorControlState.vcsControlStateReleased, BorderPen);
// Display background color brush type
Select Case Style.GetBackground(VisualizatorControlState.vcsControlStateReleased).BrushType
Case GxBrushType.gbtSolidColor:
System.Diagnostics.Debug.WriteLine("Background color brush type - SolidColor");
Case GxBrushType.gbtHatchFill:
System.Diagnostics.Debug.WriteLine("Background color brush type - HatchFill");
Case GxBrushType.gbtTextureFill:
System.Diagnostics.Debug.WriteLine("Background color brush type - TextureFill");
Case GxBrushType.gbtPathGradient:
System.Diagnostics.Debug.WriteLine("Background color brush type - PathGradient");
Case GxBrushType.gbtLinearGradient:
System.Diagnostics.Debug.WriteLine("Background color brush type - LinearGradient");
End Select;
// Output border line width
System.Diagnostics.Debug.WriteLine("Border line width: " +
Style.GetBorderPen(VisualizatorControlState.vcsControlStateReleased).Width.ToString());
// Save express report
(EaxAnalyzer As IMetabaseObject).Save();
End Sub;
The result of the executed example is the same as that, executed for Fore language.
See also: