Background: IGxBrush;
Background: Prognoz.Platform.Interop.Drawing.IGxBrush;
The Background property determines the control background.
Executing the example requires that the repository contains an express report with the EXPRESS_REPORT identifier that contains bubble tree. Bubble tree timeline looks as shown on the IVZBubbleTree interface description page. Set new values for the timeline properties: background, border, font, font color, indents, margins and shadow color:
Add links to the Metabase, Express, Drawing, Visualizators system assemblies. This procedure should be called from the Main entry point.
Sub UserProc;
Var
Metabase: IMetabase; // Repository
EaxAnalyzer: IEaxAnalyzer; // Express report
BubbleTree: IVZBubbleTree; // Bubble tree
Timeline: IVZTimeLine; // Time scale
Style: IVZControlStyle; // Time scale style
Begin
// Get repository object
Metabase := MetabaseClass.Active;
// Get express report object
EaxAnalyzer := Metabase.ItemById("EXPRESS_REPORT").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.Background := New GxSolidBrush.Create(New GxColor.CreateRGB(206, 157, 182));
// Set new border color
Style.BorderPen := New GxPen.CreateSolid(New GxColor.CreateRGB(167, 84, 125), 2);
// Set border rounding radius
Style.BorderRadius := 1;
// Set new font
Style.Font := New GxFont.Create("Tahoma", 15);
// Set new font color
Style.FontColor := New GxColor.CreateRGB(0, 0, 0);
// Determine shadow color
Style.FontShadowColor := New GxColor.CreateRGB(255, 0, 0);
// Set element indents
Style.Margin := New GxRectF.Create(15, 15, 15, 15);
// Set element margins
Style.Padding := New GxRectF.Create(10, 10, 10, 10);
// Set shadow color
Style.ShadowColor := New GxColor.CreateRGB(255, 0, 0);
// Set changed style
Timeline.Style := Style;
// Set changed time scale
BubbleTree.TimeLine := Timeline;
// Save changes to the express report
(EaxAnalyzer As IMetabaseObject).Save;
End Sub UserProc;
After executing the example bubble tree timeline properties are changed in the express report: background, border, font, font color, indents, margins and shadow color:
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.Interop.Metabase;
Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.Drawing;
Imports Prognoz.Platform.Interop.Visualizators;
…
Public Shared Sub Main(Params: StartParams);
Var
Metabase: IMetabase; // Repository
EaxAnalyzer: IEaxAnalyzer; // Express report
BubbleTree: IVZBubbleTree; // Bubble tree
Timeline: IVZTimeLine; // Time scale
Style: IVZControlStyle; // Time scale style
BackgroundBrush: GxSolidBrush; // Background color brush
BackgroundColor: GxColor; // Background color
BorderPen: GxPen; // Border color
BorderColor: GxColor; // Border color
Font: GxFont; // Font
FontColor: GxColor; // Font color
Margin: GxRectF; // Element indents
Padding: GxRectF; // Element margins
ShadowColor: GxColor; // Shadow color
Begin
// Get repository object
Metabase := Params.Metabase;
// Get express report object
EaxAnalyzer := Metabase.ItemById["EXPRESS_REPORT"].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(206, 157, 182);
BackgroundBrush := New GxSolidBrush();
BackgroundBrush.Create(BackgroundColor);
Style.Background := BackgroundBrush;
// Set new border color
BorderColor := New GxColor();
BorderColor.CreateRGB(167, 84, 125);
BorderPen := New GxPen();
BorderPen.CreateSolid(BorderColor, 2);
Style.BorderPen := BorderPen;
// Determine border smoothing
Style.BorderRadius := 10;
// Determine border smoothing radius
Style.BorderRadius := 1;
// Set new font
Font := New GxFont();
Font.Create("Tahoma", 15, GxFontStyle.gfsRegular, GxUnit.guInch);
Style.Font := Font;
// Set new font color
FontColor := New GxColor();
FontColor.CreateRGB(0, 0, 0);
Style.FontColor := FontColor;
// Set element indents
Margin := New GxRectF();
Margin.Create(15, 15, 15, 15);
Style.Margin := Margin;
// Set element margins
Padding := New GxRectF();
Padding.Create(10, 10, 10, 10);
Style.Padding := Padding;
// Set shadow color
ShadowColor := New GxColor();
ShadowColor.CreateRGB(255, 0, 0);
Style.ShadowColor := ShadowColor;
// Save changes to the express report
(EaxAnalyzer As IMetabaseObject).Save();
End Sub;
See also: