From 7b61119e0a494108b43cead03ea3a023d65e75da Mon Sep 17 00:00:00 2001 From: David Berneda Date: Fri, 20 May 2016 18:29:34 +0200 Subject: [PATCH] Beta 11 interface sections --- src/delphi/BI.Dashboard.HTML.pas | 8 +- src/delphi/BI.Data.pas | 5 +- src/delphi/BI.DataSource.pas | 1 - src/delphi/BI.Persist.pas | 14 +- src/delphi/BI.Query.pas | 55 + src/delphi/BI.Store.Component.pas | 4 + src/delphi/BI.Summary.pas | 5 +- src/delphi/BI.UI.pas | 1 + src/delphi/BI.Web.pas | 5 +- src/delphi/FMX/BI.FMX.Chart.pas | 238 +++- src/delphi/FMX/BI.FMX.Component.pas | 22 + src/delphi/FMX/BI.FMX.Tree.pas | 15 + src/delphi/Packages/TeeBIAbout.pas | 4 +- src/delphi/Packages/VCLChartProTeeBI.dpk | 4 +- src/delphi/Packages/VCLChartTeeBI.dpk | 1 + src/delphi/Packages/VCLTeeBI.dpk | 3 + src/delphi/VCL/BI.VCL.Chart.pas | 238 +++- src/delphi/VCL/BI.VCL.Component.pas | 22 + src/delphi/VCL/BI.VCL.DataManager.dfm | 18 +- src/delphi/VCL/BI.VCL.DataManager.pas | 3 +- src/delphi/VCL/BI.VCL.DataSelect.dfm | 51 +- src/delphi/VCL/BI.VCL.DataSelect.pas | 28 +- src/delphi/VCL/BI.VCL.DataWorkflow.dfm | 41 +- src/delphi/VCL/BI.VCL.DataWorkflow.pas | 18 +- src/delphi/VCL/BI.VCL.Editor.Chart.dfm | 791 +++++++++++- src/delphi/VCL/BI.VCL.Editor.Chart.pas | 126 +- .../VCL/BI.VCL.Editor.DataComponent.pas | 5 +- src/delphi/VCL/BI.VCL.Editor.DataSet.dfm | 4 + .../VCL/BI.VCL.Editor.DateTimeRange.dfm | 216 ++++ .../VCL/BI.VCL.Editor.DateTimeRange.pas | 78 ++ .../VCL/BI.VCL.Editor.DynamicFilter.dfm | 146 +++ .../VCL/BI.VCL.Editor.DynamicFilter.pas | 119 ++ src/delphi/VCL/BI.VCL.Editor.Expression.dfm | 4 - src/delphi/VCL/BI.VCL.Editor.Expression.pas | 6 +- src/delphi/VCL/BI.VCL.Editor.ListItems.dfm | 80 ++ src/delphi/VCL/BI.VCL.Editor.ListItems.pas | 65 + src/delphi/VCL/BI.VCL.Editor.Query.dfm | 1122 +++++++++-------- src/delphi/VCL/BI.VCL.Editor.Query.pas | 60 +- src/delphi/VCL/BI.VCL.Grid.pas | 4 +- src/delphi/VCL/BI.VCL.Tree.TreeView.pas | 16 + src/delphi/VCL/BI.VCL.Tree.pas | 15 + 41 files changed, 2858 insertions(+), 803 deletions(-) create mode 100644 src/delphi/VCL/BI.VCL.Editor.DateTimeRange.dfm create mode 100644 src/delphi/VCL/BI.VCL.Editor.DateTimeRange.pas create mode 100644 src/delphi/VCL/BI.VCL.Editor.DynamicFilter.dfm create mode 100644 src/delphi/VCL/BI.VCL.Editor.DynamicFilter.pas create mode 100644 src/delphi/VCL/BI.VCL.Editor.ListItems.dfm create mode 100644 src/delphi/VCL/BI.VCL.Editor.ListItems.pas diff --git a/src/delphi/BI.Dashboard.HTML.pas b/src/delphi/BI.Dashboard.HTML.pas index cec1854..a39e427 100644 --- a/src/delphi/BI.Dashboard.HTML.pas +++ b/src/delphi/BI.Dashboard.HTML.pas @@ -54,15 +54,11 @@ THTMLRender=class(TRender) ItemSeparator='%----%'; var - Charts : TStringList; Divs : TDivs; FHTML : TStringList; FMinify : Boolean; FTitle : String; - IAnyGauge : Boolean; - IAnyMap : Boolean; - IBody : String; IRadioCount, IDivCount : Integer; @@ -109,6 +105,10 @@ THTMLRender=class(TRender) var CSS: String; SteemaSources:String; + Charts : TStringList; + + IAnyGauge : Boolean; + IAnyMap : Boolean; Constructor Create; Destructor Destroy; override; diff --git a/src/delphi/BI.Data.pas b/src/delphi/BI.Data.pas index 4e5f1d5..372cb15 100644 --- a/src/delphi/BI.Data.pas +++ b/src/delphi/BI.Data.pas @@ -515,10 +515,13 @@ TMemory=record TDataInfo=class(TDataItem) private FData : TDataItem; + + procedure Fill; + procedure SetData(const Value: TDataItem); public Constructor Create(const AData:TDataItem); overload; - property Data:TDataItem read FData; + property Data:TDataItem read FData write SetData; end; TIdentifiers=record diff --git a/src/delphi/BI.DataSource.pas b/src/delphi/BI.DataSource.pas index f50cee9..0fdf247 100644 --- a/src/delphi/BI.DataSource.pas +++ b/src/delphi/BI.DataSource.pas @@ -28,7 +28,6 @@ TBISource=class FOnError : TBIError; FOnProgress : TBIProgress; - protected IDefinition : TDataDefinition; diff --git a/src/delphi/BI.Persist.pas b/src/delphi/BI.Persist.pas index 558d088..f4e8e30 100644 --- a/src/delphi/BI.Persist.pas +++ b/src/delphi/BI.Persist.pas @@ -44,6 +44,15 @@ TBaseDataImporter=class(TDataProvider) property Data:TDataItem read GetData; end; + TRefreshSettings=record + private + function Increment(const ADate:TDateTime):TDateTime; + public + Period : Integer; + Units : TRefreshUnit; + Enabled : Boolean; + end; + // Abstract class with all settings necessary to import a given data TDataDefinitionKind=(Files,Database,Web,Unknown); @@ -66,8 +75,7 @@ TDataDefinition=class(TBaseDataImporter) protected FStrings : TStrings; - RefreshPeriod : Integer; - RefreshUnit : TRefreshUnit; + Refresh : TRefreshSettings; Volatile : Boolean; // When True, changes to Strings aren't saved @@ -100,7 +108,7 @@ TDataDefinition=class(TBaseDataImporter) class procedure Merge(const AData: TDataItem; const AItems:TDataArray); static; function MultiLineText(const ATag:String):String; - function Title: String; + function Description: String; function NextRefresh:TDateTime; class procedure SetMasters(const AData:TDataItem; const Items:TStrings); static; diff --git a/src/delphi/BI.Query.pas b/src/delphi/BI.Query.pas index 1ac8be2..ef662ef 100644 --- a/src/delphi/BI.Query.pas +++ b/src/delphi/BI.Query.pas @@ -1,3 +1,9 @@ +{*********************************************} +{ TeeBI Software Library } +{ TBIQuery Component } +{ Copyright (c) 2015-2016 by Steema Software } +{ All Rights Reserved } +{*********************************************} unit BI.Query; interface @@ -6,6 +12,25 @@ interface System.Classes, BI.Data, BI.DataSource, BI.Summary, BI.Expression, BI.Persist; +{ + TBIQuery is a component capable of executing queries against TDataItem objects. + + BIQuery.Items collection property contains the desired query output. + Each Item defines a data item (field or table) and an optional aggregation kind. + + BIQuery automatically determines if the calculation must be done using + a TSummary class (because there is at least one item with aggregation), + or a TDataSelect class (a normal "select" query without any "Group By"). + + Items can also define expressions (ie: "sum(a+b)" or "Upper(ProductName)" ) and + can refer to data items from multiple databases or tables without the need to + specify the links between them (no "join" clauses). + + The BIQuery Filter property can be set as a string (ie: City="London") or + as an expression object, and can also refer to any data item even it is not + included in the query output. +} + type TDataCollectionItem=class(TCollectionItem) private @@ -61,12 +86,14 @@ TQueryItem=class(TDataCollectionItem) IActive : Boolean; IAggregate : TAggregate; IDatePart : TDateTimePart; + IExpression : TExpression; function CanChange:Boolean; procedure DoRemove; function GetAggregate: TAggregate; function GetActive: Boolean; function GetDatePart:TDateTimePart; + function GetExpression: TExpression; function Query:TBIQuery; function RealData:TDataItem; procedure Recreate; @@ -74,6 +101,7 @@ TQueryItem=class(TDataCollectionItem) procedure SetActive(const Value: Boolean); procedure SetAggregate(const Value: TAggregate); procedure SetDatePart(const Value: TDateTimePart); + procedure SetExpression(const Value: TExpression); procedure TryReconnect; protected procedure Changed; override; @@ -89,6 +117,8 @@ TQueryItem=class(TDataCollectionItem) function RealStyle:TQueryItemStyle; function ToString:String; override; + + property Expression:TExpression read GetExpression write SetExpression; published property Active:Boolean read GetActive write SetActive default True; property Aggregate:TAggregate read GetAggregate write SetAggregate default TAggregate.Count; @@ -136,6 +166,28 @@ TQueryRemove=class(TPersistent) property Rows:Boolean read GetRows write SetRows default False; end; + (* Pending + TQueryFilter=class(TPersistent) + private + FEnabled : Boolean; + FExpression : TLogicalExpression; + FText : String; + + // Temporary during csLoading + IFilter : String; + public + Constructor Create; + Destructor Destroy; override; + + procedure Assign(Source:TPersistent); override; + + property Expression:TLogicalExpression read FExpression write SetExpression; + published + property Enabled:Boolean read FEnabled write SetEnabled default True; + property Text:String read FText write SetText; + end; + *) + TQueryStyle=(Unknown,Select,Summary); {$IF CompilerVersion>=23} @@ -186,6 +238,8 @@ TBIQuery=class(TBaseDataImporter) procedure Notification(AComponent: TComponent; Operation: TOperation); override; + procedure SetFilterExpression(const AFilter:TLogicalExpression); + property Select:TDataSelect read FSelect write SetSelect; property Summary:TSummary read FSummary write SetSummary; public @@ -202,6 +256,7 @@ TBIQuery=class(TBaseDataImporter) procedure Clear; function IsEmpty:Boolean; + function MainData:TDataItem; function Style:TQueryStyle; diff --git a/src/delphi/BI.Store.Component.pas b/src/delphi/BI.Store.Component.pas index 0691bf1..474e813 100644 --- a/src/delphi/BI.Store.Component.pas +++ b/src/delphi/BI.Store.Component.pas @@ -22,11 +22,13 @@ TComponentImporter=class(TBaseDataImporter) FSource : TComponent; IDataLink : TDataLink; + ILoading : Boolean; procedure SetSource(const Value: TComponent); class function TryFromStrings(const ASource:TComponent):TDataItem; protected function DoImport(const AComponent: TComponent):TDataItem; virtual; + procedure GetItems(const AData:TDataItem); override; procedure Notification(AComponent: TComponent; Operation: TOperation); override; procedure Load(const AData:TDataItem; const Children:Boolean); override; class function StringsOf(const ASource:TComponent):TStrings; virtual; @@ -37,6 +39,8 @@ TComponentImporter=class(TBaseDataImporter) Constructor Create(AOwner:TComponent); override; Destructor Destroy; override; + procedure Refresh; + class function DataOf(const AComponent:TComponent):TDataItem; virtual; class function DataOfProvider(const AData:TDataItem):TDataItem; static; class function From(const AOwner,AComponent:TComponent): TDataItem; overload; static; diff --git a/src/delphi/BI.Summary.pas b/src/delphi/BI.Summary.pas index 9a95435..4e13de7 100644 --- a/src/delphi/BI.Summary.pas +++ b/src/delphi/BI.Summary.pas @@ -320,8 +320,8 @@ TSummary=class(TDataProvider) procedure DoRemoveMissing(const Data:TDataItem); procedure Fill; procedure GetActive; - function GetData: TDataItem; function GetHaving:TSummaryFilter; + function GetMainData: TDataItem; procedure SetFilter(const Value: TExpression); procedure SetHaving(const Value: TSummaryFilter); protected @@ -361,8 +361,9 @@ TSummary=class(TDataProvider) function ToString:String; override; function Valid:Boolean; + property MainData:TDataItem read GetMainData; + published - property Data:TDataItem read GetData; property Description:String read FDescription write FDescription; property Filter:TExpression read FFilter write SetFilter; property Having:TSummaryFilter read GetHaving write SetHaving; diff --git a/src/delphi/BI.UI.pas b/src/delphi/BI.UI.pas index 2392795..165bfa5 100644 --- a/src/delphi/BI.UI.pas +++ b/src/delphi/BI.UI.pas @@ -38,6 +38,7 @@ TCommonUI=record class procedure AddKinds(const AItems:TStrings); static; class function BytesToString(const Bytes: Int64): String; static; class function ToBooleanString(const Bool:Boolean):String; static; + class function UniqueName(const AComponent:TComponent):String; static; end; TCryptoClass=class of TCrypto; diff --git a/src/delphi/BI.Web.pas b/src/delphi/BI.Web.pas index 9a07d70..5f3b5bc 100644 --- a/src/delphi/BI.Web.pas +++ b/src/delphi/BI.Web.pas @@ -142,8 +142,9 @@ TBIWebHistory=class(TDataItem) TSteema=class(TBIWebClient) public - class function Download(const Source,Dest:String):Boolean; - class function GetLatestVersion(out V: TBIWebServer.TVersion; out Error:String):Boolean; + class function CheckNewVersion(out AError:String):Boolean; static; + class function Download(const Source,Dest:String):Boolean; static; + class function GetLatestVersion(out V: TBIWebServer.TVersion; out Error:String):Boolean; static; end; TDelayHandlerWeb=class(TDataDelayProvider) diff --git a/src/delphi/FMX/BI.FMX.Chart.pas b/src/delphi/FMX/BI.FMX.Chart.pas index c624a15..86fb27c 100644 --- a/src/delphi/FMX/BI.FMX.Chart.pas +++ b/src/delphi/FMX/BI.FMX.Chart.pas @@ -7,6 +7,8 @@ unit BI.FMX.Chart; {$DEFINE FMX} +{$SCOPEDENUMS ON} + interface uses @@ -28,56 +30,212 @@ interface {$ENDIF} {$IFDEF FMX} - FMXTee.Chart, FMXTee.Engine, FMXTee.Series, + System.UITypes, FMXTee.Chart, FMXTee.Engine, FMXTee.Series, {$ELSE} - VCL.Controls, VCLTee.Chart, VCLTee.TeEngine, VCLTee.Series, VCLTee.BubbleCh, + VCL.Graphics, VCL.Controls, VCLTee.Chart, VCLTee.TeEngine, VCLTee.Series, VCLTee.BubbleCh, {$ENDIF} {$IFDEF TEEPRO} {$IFDEF FMX} - FMXTee.Series.OHLC, FMXTee.Series.Candle, + FMXTee.Series.OHLC, FMXTee.Series.Candle, FMXTee.Series.Surface, {$ELSE} - VCLTee.OHLChart, VCLTee.CandleCh, + VCLTee.OHLChart, VCLTee.CandleCh, VCLTee.TeeSurfa, {$ENDIF} {$ENDIF} BI.Data, BI.Arrays, BI.Summary, BI.DataSource; +const + WhiteColor={$IFDEF FMX}TAlphaColors.White{$ELSE}clWhite{$ENDIF}; + type + {$IFDEF TEEPRO} + TCustom3DSeriesClass=class of TCustom3DSeries; + {$ENDIF} + + TBIChartDirection=(Automatic, Rows, Columns); + TBITChart=class(TChart) private procedure ClearTitles; + procedure CreateMulti2D(const X,Y,Z:TDataItem; const ADirection:TBIChartDirection); + {$IFDEF TEEPRO} - function CreateFinancial(const AData:TDataArray; const Dimensions:Integer):TOHLCSeries; - procedure CreateGrid3D(const AData:TDataArray; const ANoMeasure:TDataItem; const ByRows:Boolean); - procedure CreateXYZ(const AData:TDataArray); + function CreateFinancial(const ADate,AOpen,AClose,AHigh,ALow, + AVolume:TDataItem; + const AReverseDate:Boolean):TOHLCSeries; + procedure CreateGrid3D(const X,Y,Z:TDataItem; const ADirection:TBIChartDirection); + function Create3DSeries:TCustom3DSeries; + procedure CreateGridTable(const AData:TDataArray; const ADirection:TBIChartDirection); + procedure CreateXYZ(const X,Y,Z:TDataItem); {$ENDIF} - procedure Fill(const AData:TDataArray; const ASeries: TDataItem); - procedure FixDesignTime(const ASeries:TChartSeries); + procedure FinishXYZ; class function GetDateTime(const AData:TDataItem; const Index:TInteger; const Reverse:Boolean):TDateTime; class function GetValue(const AData:TDataItem; const Index:TInteger):TChartValue; static; procedure Init; + function InitCountSeries(const ACount:TInteger):TChartSeries; function NewSeries(const AClass:TChartSeriesClass):TChartSeries; overload; function NewSeries(const Count:Integer):TChartSeries; overload; - function NewSeries(const X,Y:String):TCustomSeries; overload; + function NewSeries(const X,Y:String):TChartSeries; overload; + procedure TryAddUniqueTool(const AClass:TTeeCustomToolClass; const AName:String); + procedure TryDisableTool(const AClass:TTeeCustomToolClass; const ADisable:Boolean); protected - public - SeriesClass : TChartSeriesClass; + FSeries2D : TChartSeriesClass; + {$IFDEF TEEPRO} + FSeries3D : TCustom3DSeriesClass; + {$ENDIF} + + DefaultXYSeries : TChartSeriesClass; + + LinePointer : Boolean; + + procedure ReadState(Reader: TReader); override; + public Constructor Create(AOwner:TComponent); override; + + procedure Fill(const AData:TDataArray; const ASeries: TDataItem); overload; + function Fill(const AData:TInt32Array):TChartSeries; overload; + function Fill(const AData:TInt64Array):TChartSeries; overload; + function Fill(const AData:TDoubleArray):TChartSeries; overload; + function Fill(const AData:TDataItem):TChartSeries; overload; + procedure Fill(const AData:TDataSet; const ValueField:Integer; const TextField:Integer=-1); overload; + + function FillXY(const X,Y:TField):TChartSeries; overload; + function FillXY(const AData:TDataSet; const X,Y:Integer):TChartSeries; overload; + + Function GetParentComponent: TComponent; override; + Function HasParent:Boolean; override; +// procedure SetBounds(X, Y, AWidth, AHeight: Single); override; + procedure SetParentComponent(AParent: TComponent); override; published property Align default TUICommon.AlignClient; property BevelOuter default bvNone; + property Color default WhiteColor; property View3D default False; end; + TBIChartItems=class(TPersistent) + private + IX, + IZ, + IText, + IGroup, + IColors : String; + + IY : TTextArray; + + procedure ExchangeXY; + procedure ExchangeXZ; + procedure ExchangeYZ; + procedure Guess(const AData:TDataArray); + procedure GetXYZ(out AX,AY,AZ:TDataItem); + procedure MoveXToY; + + procedure ReadColors(Reader: TReader); + procedure ReadGroup(Reader: TReader); + procedure ReadText(Reader: TReader); + procedure ReadX(Reader: TReader); + procedure ReadY(Reader: TReader); + procedure ReadZ(Reader: TReader); + procedure WriteColors(Writer: TWriter); + procedure WriteGroup(Writer: TWriter); + procedure WriteText(Writer: TWriter); + procedure WriteX(Writer: TWriter); + procedure WriteY(Writer: TWriter); + procedure WriteZ(Writer: TWriter); + protected + procedure DefineProperties(Filer: TFiler); override; + procedure Loaded(const AData:TDataArray); + public + X, + Z, + Text, + Colors, + Group : TDataItem; + + Y : TDataArray; + + procedure Clear; + + function CanFinancial:Boolean; + function CanGeoGraphic:Boolean; + function CanThreeD:Boolean; + function CanXYZ:Boolean; + end; + {$IFNDEF FPC} TGetText=TFunc; {$ENDIF} - TBIChartMode=(ByRows, ByColumns, XYZ); + TBIChartMode=(Automatic, XY, ThreeD, Financial, Geographic); + TBIChart3DMode=(Automatic, Table, Grid, XYZ); + TBIChartDimensions=(Automatic, View2D, Orthogonal, View3D); + TBIChartLegend=(Automatic, Show, Hide); + TBIChartMarks=(Automatic, Show, Hide); + TBIChartStacked=(Automatic, No, Yes, Stacked100, Side, SideAll, SelfStack); + TBISeriesDirection=(Automatic, Horizontal, Vertical); + + TBIChart=class; + + TBIChartOptions=class(TPersistent) + private + FDimensions: TBIChartDimensions; + FDirection : TBIChartDirection; + FItems : TBIChartItems; + FLegend: TBIChartLegend; + FMarks: TBIChartMarks; + FMode: TBIChartMode; + FSeriesDirection: TBISeriesDirection; + FStacked: TBIChartStacked; + FXYZMode: TBIChart3DMode; + + IChart : TBIChart; + + procedure Finish; + procedure FinishViewDimensions; + procedure SetDimensions(const Value: TBIChartDimensions); + procedure SetDirection(const Value: TBIChartDirection); + procedure SetItems(const Value: TBIChartItems); + procedure SetLegend(const Value: TBIChartLegend); + procedure SetMarks(const Value: TBIChartMarks); + procedure SetMode(const Value: TBIChartMode); + procedure SetSeries2D(const Value: TChartSeriesClass); + procedure SetSeries3D(const Value: TChartSeriesClass); + procedure SetStacked(const Value: TBIChartStacked); + procedure SetXYZMode(const Value: TBIChart3DMode); + procedure SetSeriesDirection(const Value: TBISeriesDirection); + function GetSeries2D: TChartSeriesClass; + function GetSeries3D: TChartSeriesClass; + public + Constructor Create(const AChart:TBIChart); + Destructor Destroy; override; + + procedure Assign(Source:TPersistent); override; + + procedure ChangeSeries2D(const AClass:TChartSeriesClass; + const AHorizontal,ALinePointer:Boolean); + published + property Dimensions:TBIChartDimensions read FDimensions write SetDimensions + default TBIChartDimensions.Automatic; + + property Direction:TBIChartDirection read FDirection write SetDirection default TBIChartDirection.Automatic; + property Items:TBIChartItems read FItems write SetItems; + property Legend:TBIChartLegend read FLegend write SetLegend + default TBIChartLegend.Automatic; + property Marks:TBIChartMarks read FMarks write SetMarks + default TBIChartMarks.Automatic; + property Mode:TBIChartMode read FMode write SetMode default TBIChartMode.Automatic; + property Series2D:TChartSeriesClass read GetSeries2D write SetSeries2D; + property Series3D:TChartSeriesClass read GetSeries3D write SetSeries3D; + property SeriesDirection: TBISeriesDirection read FSeriesDirection write SetSeriesDirection + default TBISeriesDirection.Automatic; + property Stacked:TBIChartStacked read FStacked write SetStacked + default TBIChartStacked.Automatic; + property XYZMode:TBIChart3DMode read FXYZMode write SetXYZMode default TBIChart3DMode.Automatic; + end; {$IF CompilerVersion>=23} [ComponentPlatformsAttribute(pidWin32 or pidWin64 or pidOSX32 @@ -88,53 +246,54 @@ TBITChart=class(TChart) {$ENDIF} TBIChart=class(TBIDataControl) private - tmpNoMeasure : TDataItem; + FOptions : TBIChartOptions; + + IDataInfo : TDataInfo; + + procedure AddXY(const AItems:TBIChartItems); - function AddCount(const AData:TDataItem):TChartSeries; - procedure AddXY(const X,Y,AText:TDataItem; const AData:TDataArray; const Dimensions:Integer); procedure ApplyData(const AData:TDataItem); procedure CreateChart; function CreateSeries(const X,Y:TDataItem):TChartSeries; + function DirectChart:TBITChart; procedure FillSeries(const ASeries:TChartSeries; const X,Y,AText:TDataItem); function GetChart:TBITChart; - function InitCountSeries(const ACount:TInteger):TChartSeries; - + function GuessRealData(const AData:TDataArray):TDataArray; + procedure SetOptions(const Value: TBIChartOptions); protected Index : TCursorIndex; - {$IFDEF TEEPRO} - class function IsFinancial(const AData:TDataArray; const Dimensions:Integer):Boolean; static; - {$ENDIF} + RealMode : TBIChartMode; + RealMode3D : TBIChart3DMode; + + procedure ExchangeXY; + procedure ExchangeYZ; + procedure ExchangeXZ; + procedure DirectRefresh; procedure Loaded; override; procedure ReadState(Reader: TReader); override; + procedure ResetTheme; procedure SetDataDirect(const Value: TDataItem); override; public - Mode : TBIChartMode; - Constructor Create(AOwner:TComponent); override; + Destructor Destroy; override; + procedure Assign(Source:TPersistent); override; procedure Clear; - function Fill(const AData:TInt32Array):TChartSeries; overload; - function Fill(const AData:TInt64Array):TChartSeries; overload; - function Fill(const AData:TDoubleArray):TChartSeries; overload; - {$IFNDEF FPC} procedure Fill(const Map:TDataMap; const Text:TGetText=nil); overload; {$ENDIF} - procedure Fill(const AData:TDataArray; const Dimensions:Integer=0); overload; - procedure Fill(const AData:TDataArray; const ASeries:TDataItem); overload; - procedure Fill(const AItems:TDataItems; const Dimensions:Integer=0); overload; - procedure Fill(const AData:TDataSet; const ValueField:Integer; const TextField:Integer=-1); overload; - function Fill(const AData:TDataItem):TChartSeries; overload; + procedure Fill(const AData:TDataArray); overload; + procedure Fill(const AItems:TDataItems); overload; procedure Fill(const AHistogram:THistogram; const ASource:TDataItem); overload; procedure Fill(const ASummary:TSummary); overload; - procedure Fill(const ACursor:TDataCursor; const AItems:TDataArray=nil; - const ADimensions:Integer=0); overload; - function FillXY(const AData:TDataSet; const X,Y:Integer):TChartSeries; overload; - function FillXY(const X,Y:TField):TChartSeries; overload; + procedure Fill(const ACursor:TDataCursor; const AItems:TDataArray=nil); overload; + + function GetChildOwner: TComponent; override; + Procedure GetChildren(Proc:TGetChildProc; Root:TComponent); override; published property Chart:TBITChart read GetChart; @@ -142,6 +301,8 @@ TBIChart=class(TBIDataControl) property Height default 250; property Width default 400; {$ENDIF} + + property Options:TBIChartOptions read FOptions write SetOptions; end; // Converts data from a Chart or one or more Series to a TDataItem @@ -149,11 +310,16 @@ TChartData=record private class procedure InitNotMandatory(const ASeries:TChartSeries; const ACount:Integer); static; + + class function NewSeries(const AOwner:TComponent; + const AClass:TChartSeriesClass):TChartSeries; static; public class procedure AddSeries(const ASeries: TChartSeries; const ADest: TDataItem); static; + class function From(const AData:TDataItem; const AOwner:TComponent; const AClass:TChartSeriesClass=nil):TChartSeries; overload; static; + class function From(const ASeries:TChartSeries):TDataItem; overload; static; class function From(const AChart:TCustomChart):TDataItem; overload; static; class function From(const ASeries:Array of TChartSeries):TDataItem; overload; static; diff --git a/src/delphi/FMX/BI.FMX.Component.pas b/src/delphi/FMX/BI.FMX.Component.pas index 12fc04a..1a4271c 100644 --- a/src/delphi/FMX/BI.FMX.Component.pas +++ b/src/delphi/FMX/BI.FMX.Component.pas @@ -1,8 +1,30 @@ +{*********************************************} +{ TeeBI Software Library } +{ Importing data from VCL Controls } +{ Copyright (c) 2015-2016 by Steema Software } +{ All Rights Reserved } +{*********************************************} unit BI.FMX.Component; {$DEFINE FMX} interface +{ + This unit contains a TControlImporter component for VCL. + + Its purpose is to obtain data from any VCL TControl that is supported. + + Like for example, using Memo.Lines text to import (in JSON, CSV, XML format), + or using the Data property of a BI control (Grid, Chart, Tree, etc). + + Usage example: + + tmp:=TControlImporter.Create(Self); + tmp.Source:=Memo1; + + BIGrid1.Data:=tmp.Data; +} + uses System.Classes, BI.Data, BI.Store.Component; diff --git a/src/delphi/FMX/BI.FMX.Tree.pas b/src/delphi/FMX/BI.FMX.Tree.pas index 0113c1f..6354bd6 100644 --- a/src/delphi/FMX/BI.FMX.Tree.pas +++ b/src/delphi/FMX/BI.FMX.Tree.pas @@ -57,6 +57,7 @@ TNodeData=class function GetData(const ANode:TBITreeNode):TObject; virtual; abstract; function GetNode(const AIndex:Integer):TBITreeNode; virtual; abstract; function GetOnChange: TNotifyEvent; virtual; abstract; + function GetOnCheck: TNotifyEvent; virtual; abstract; function GetSelected:TBITreeNode; virtual; abstract; function GetSelectedData:TBITreePlugin.TNodeData; virtual; abstract; function NewNodeData(const ATag:TObject; const AIndex:TInteger):TNodeData; @@ -65,11 +66,15 @@ TNodeData=class procedure SetAllowDelete(const Value: Boolean); virtual; abstract; procedure SetData(const ANode:TBITreeNode; const AData:TObject); virtual; abstract; procedure SetOnChange(const Value: TNotifyEvent); virtual; abstract; + procedure SetOnCheck(const Value: TNotifyEvent); virtual; abstract; procedure SetSelected(const Value: TBITreeNode); virtual; abstract; public Constructor Create(const AOwner:TComponent); virtual; abstract; Destructor Destroy; override; + function Children(const ANode:TBITreeNode; const AIndex:Integer):TBITreeNode; virtual; abstract; + function ChildrenCount(const ANode:TBITreeNode):Integer; virtual; abstract; + procedure Expand(const AIndex:Integer); overload; virtual; abstract; procedure Expand(const ANode:TBITreeNode; @@ -78,12 +83,21 @@ TNodeData=class function Find(const ATag:TObject; const AIndex:Integer=-1):TBITreeNode; virtual; abstract; + function FirstNode:TBITreeNode; virtual; abstract; + function NextNode(const ANode:TBITreeNode):TBITreeNode; virtual; abstract; + + function IsChecked(const ANode:TBITreeNode):Boolean; virtual; abstract; + function NewNode(const AParent:TBITreeNode; const AText:String; const ATag:TObject=nil; const AIndex:TInteger=-1):TBITreeNode; virtual; abstract; function ParentOf(const ANode:TBITreeNode):TBITreeNode; virtual; abstract; + procedure SetChecked(const ANode:TBITreeNode; const Value:Boolean); virtual; abstract; + function SiblingIndex(const ANode:TBITreeNode):Integer; virtual; abstract; + function TextOf(const ANode:TBITreeNode):String; virtual; abstract; + property AllowDelete:Boolean read GetAllowDelete write SetAllowDelete; property Control:TControl read GetControl; property Count:Integer read GetCount; @@ -91,6 +105,7 @@ TNodeData=class property SelectedData:TBITreePlugin.TNodeData read GetSelectedData; property OnChange:TNotifyEvent read GetOnChange write SetOnChange; + property OnCheck:TNotifyEvent read GetOnCheck write SetOnCheck; end; TBITreePluginClass=class of TBITreePlugin; diff --git a/src/delphi/Packages/TeeBIAbout.pas b/src/delphi/Packages/TeeBIAbout.pas index 9cc98ce..bec1f3a 100644 --- a/src/delphi/Packages/TeeBIAbout.pas +++ b/src/delphi/Packages/TeeBIAbout.pas @@ -33,8 +33,8 @@ TAboutBI = class(TForm) end; const - TeeBI_Version=20160402; - TeeBI_VersionString='v1 20160402'; + TeeBI_Version=20160512; + TeeBI_VersionString='v1 20160512'; TeeBI_VersionMode='(BETA 11)'; TeeBI_Description='TeeBI'; TeeBI_CopyRight='Copyright '+{$IFDEF LCL}'(C)'{$ELSE}'©'{$ENDIF}+' 2015-2016 by Steema Software'; diff --git a/src/delphi/Packages/VCLChartProTeeBI.dpk b/src/delphi/Packages/VCLChartProTeeBI.dpk index 2bd30fa..d928c8f 100644 --- a/src/delphi/Packages/VCLChartProTeeBI.dpk +++ b/src/delphi/Packages/VCLChartProTeeBI.dpk @@ -49,6 +49,8 @@ contains BI.VCL.Dashboard.Chart in '..\VCL\BI.VCL.Dashboard.Chart.pas', BI.VCL.Visualizer.Chart in '..\VCL\BI.VCL.Visualizer.Chart.pas', BI.VCL.Editor.Visualizer.Chart in '..\VCL\BI.VCL.Editor.Visualizer.Chart.pas' {ChartVisualizerEditor}, - BI.VCL.Chart in '..\VCL\BI.VCL.Chart.pas'; + BI.VCL.Chart in '..\VCL\BI.VCL.Chart.pas', + BI.VCL.Editor.Chart in '..\VCL\BI.VCL.Editor.Chart.pas' {BIChartEditor}; +// dcp Error !! BI.VCL.Chart.Functions in '..\VCL\BI.VCL.Chart.Functions'; end. diff --git a/src/delphi/Packages/VCLChartTeeBI.dpk b/src/delphi/Packages/VCLChartTeeBI.dpk index 589f613..b52d817 100644 --- a/src/delphi/Packages/VCLChartTeeBI.dpk +++ b/src/delphi/Packages/VCLChartTeeBI.dpk @@ -40,6 +40,7 @@ contains BI.VCL.Visualizer.Chart in '..\VCL\BI.VCL.Visualizer.Chart.pas', BI.VCL.Editor.Visualizer.Chart in '..\VCL\BI.VCL.Editor.Visualizer.Chart.pas' {ChartVisualizerEditor}, BI.VCL.Chart in '..\VCL\BI.VCL.Chart.pas', + BI.VCL.Editor.Chart in '..\VCL\BI.VCL.Editor.Chart.pas' {BIChartEditor}, BI.VCL.Chart.Functions in '..\VCL\BI.VCL.Chart.Functions'; end. diff --git a/src/delphi/Packages/VCLTeeBI.dpk b/src/delphi/Packages/VCLTeeBI.dpk index 2c19ead..f7288d0 100644 --- a/src/delphi/Packages/VCLTeeBI.dpk +++ b/src/delphi/Packages/VCLTeeBI.dpk @@ -57,7 +57,10 @@ contains BI.VCL.Editor.DataSet in '..\VCL\BI.VCL.Editor.DataSet.pas' {BIDataSetEditor}, BI.VCL.Editor.Data in '..\VCL\BI.VCL.Editor.Data.pas' {DataEditor}, BI.VCL.Editor.DataComponent in '..\VCL\BI.VCL.Editor.DataComponent.pas' {DataComponent}, + BI.VCL.Editor.DateTimeRange in '..\VCL\BI.VCL.Editor.DateTimeRange.pas' {DateTimeRangeEditor}, + BI.VCL.Editor.DynamicFilter in '..\VCL\BI.VCL.Editor.DynamicFilter.pas' {DynamicFilterEditor}, BI.VCL.Editor.Formats in '..\VCL\BI.VCL.Editor.Formats.pas' {DataFormatEditor}, + BI.VCL.Editor.ListItems in '..\VCL\BI.VCL.Editor.ListItems.pas' {FormListItems}, BI.VCL.Editor.Query in '..\VCL\BI.VCL.Editor.Query.pas' {BIQueryEditor}, BI.VCL.Editor.Stores in '..\VCL\BI.VCL.Editor.Stores.pas' {StoreEditor}, BI.VCL.Editor.WorkflowItem in '..\VCL\BI.VCL.Editor.WorkflowItem.pas' {WorkflowItemEditor}, diff --git a/src/delphi/VCL/BI.VCL.Chart.pas b/src/delphi/VCL/BI.VCL.Chart.pas index 5d11e76..5792fb1 100644 --- a/src/delphi/VCL/BI.VCL.Chart.pas +++ b/src/delphi/VCL/BI.VCL.Chart.pas @@ -7,6 +7,8 @@ unit BI.VCL.Chart; {.$DEFINE FMX} +{$SCOPEDENUMS ON} + interface uses @@ -28,56 +30,212 @@ interface {$ENDIF} {$IFDEF FMX} - FMXTee.Chart, FMXTee.Engine, FMXTee.Series, + System.UITypes, FMXTee.Chart, FMXTee.Engine, FMXTee.Series, {$ELSE} - VCL.Controls, VCLTee.Chart, VCLTee.TeEngine, VCLTee.Series, VCLTee.BubbleCh, + VCL.Graphics, VCL.Controls, VCLTee.Chart, VCLTee.TeEngine, VCLTee.Series, VCLTee.BubbleCh, {$ENDIF} {$IFDEF TEEPRO} {$IFDEF FMX} - FMXTee.Series.OHLC, FMXTee.Series.Candle, + FMXTee.Series.OHLC, FMXTee.Series.Candle, FMXTee.Series.Surface, {$ELSE} - VCLTee.OHLChart, VCLTee.CandleCh, + VCLTee.OHLChart, VCLTee.CandleCh, VCLTee.TeeSurfa, {$ENDIF} {$ENDIF} BI.Data, BI.Arrays, BI.Summary, BI.DataSource; +const + WhiteColor={$IFDEF FMX}TAlphaColors.White{$ELSE}clWhite{$ENDIF}; + type + {$IFDEF TEEPRO} + TCustom3DSeriesClass=class of TCustom3DSeries; + {$ENDIF} + + TBIChartDirection=(Automatic, Rows, Columns); + TBITChart=class(TChart) private procedure ClearTitles; + procedure CreateMulti2D(const X,Y,Z:TDataItem; const ADirection:TBIChartDirection); + {$IFDEF TEEPRO} - function CreateFinancial(const AData:TDataArray; const Dimensions:Integer):TOHLCSeries; - procedure CreateGrid3D(const AData:TDataArray; const ANoMeasure:TDataItem; const ByRows:Boolean); - procedure CreateXYZ(const AData:TDataArray); + function CreateFinancial(const ADate,AOpen,AClose,AHigh,ALow, + AVolume:TDataItem; + const AReverseDate:Boolean):TOHLCSeries; + procedure CreateGrid3D(const X,Y,Z:TDataItem; const ADirection:TBIChartDirection); + function Create3DSeries:TCustom3DSeries; + procedure CreateGridTable(const AData:TDataArray; const ADirection:TBIChartDirection); + procedure CreateXYZ(const X,Y,Z:TDataItem); {$ENDIF} - procedure Fill(const AData:TDataArray; const ASeries: TDataItem); - procedure FixDesignTime(const ASeries:TChartSeries); + procedure FinishXYZ; class function GetDateTime(const AData:TDataItem; const Index:TInteger; const Reverse:Boolean):TDateTime; class function GetValue(const AData:TDataItem; const Index:TInteger):TChartValue; static; procedure Init; + function InitCountSeries(const ACount:TInteger):TChartSeries; function NewSeries(const AClass:TChartSeriesClass):TChartSeries; overload; function NewSeries(const Count:Integer):TChartSeries; overload; - function NewSeries(const X,Y:String):TCustomSeries; overload; + function NewSeries(const X,Y:String):TChartSeries; overload; + procedure TryAddUniqueTool(const AClass:TTeeCustomToolClass; const AName:String); + procedure TryDisableTool(const AClass:TTeeCustomToolClass; const ADisable:Boolean); protected - public - SeriesClass : TChartSeriesClass; + FSeries2D : TChartSeriesClass; + {$IFDEF TEEPRO} + FSeries3D : TCustom3DSeriesClass; + {$ENDIF} + + DefaultXYSeries : TChartSeriesClass; + + LinePointer : Boolean; + + procedure ReadState(Reader: TReader); override; + public Constructor Create(AOwner:TComponent); override; + + procedure Fill(const AData:TDataArray; const ASeries: TDataItem); overload; + function Fill(const AData:TInt32Array):TChartSeries; overload; + function Fill(const AData:TInt64Array):TChartSeries; overload; + function Fill(const AData:TDoubleArray):TChartSeries; overload; + function Fill(const AData:TDataItem):TChartSeries; overload; + procedure Fill(const AData:TDataSet; const ValueField:Integer; const TextField:Integer=-1); overload; + + function FillXY(const X,Y:TField):TChartSeries; overload; + function FillXY(const AData:TDataSet; const X,Y:Integer):TChartSeries; overload; + + Function GetParentComponent: TComponent; override; + Function HasParent:Boolean; override; +// procedure SetBounds(X, Y, AWidth, AHeight: Single); override; + procedure SetParentComponent(AParent: TComponent); override; published property Align default TUICommon.AlignClient; property BevelOuter default bvNone; + property Color default WhiteColor; property View3D default False; end; + TBIChartItems=class(TPersistent) + private + IX, + IZ, + IText, + IGroup, + IColors : String; + + IY : TTextArray; + + procedure ExchangeXY; + procedure ExchangeXZ; + procedure ExchangeYZ; + procedure Guess(const AData:TDataArray); + procedure GetXYZ(out AX,AY,AZ:TDataItem); + procedure MoveXToY; + + procedure ReadColors(Reader: TReader); + procedure ReadGroup(Reader: TReader); + procedure ReadText(Reader: TReader); + procedure ReadX(Reader: TReader); + procedure ReadY(Reader: TReader); + procedure ReadZ(Reader: TReader); + procedure WriteColors(Writer: TWriter); + procedure WriteGroup(Writer: TWriter); + procedure WriteText(Writer: TWriter); + procedure WriteX(Writer: TWriter); + procedure WriteY(Writer: TWriter); + procedure WriteZ(Writer: TWriter); + protected + procedure DefineProperties(Filer: TFiler); override; + procedure Loaded(const AData:TDataArray); + public + X, + Z, + Text, + Colors, + Group : TDataItem; + + Y : TDataArray; + + procedure Clear; + + function CanFinancial:Boolean; + function CanGeoGraphic:Boolean; + function CanThreeD:Boolean; + function CanXYZ:Boolean; + end; + {$IFNDEF FPC} TGetText=TFunc; {$ENDIF} - TBIChartMode=(ByRows, ByColumns, XYZ); + TBIChartMode=(Automatic, XY, ThreeD, Financial, Geographic); + TBIChart3DMode=(Automatic, Table, Grid, XYZ); + TBIChartDimensions=(Automatic, View2D, Orthogonal, View3D); + TBIChartLegend=(Automatic, Show, Hide); + TBIChartMarks=(Automatic, Show, Hide); + TBIChartStacked=(Automatic, No, Yes, Stacked100, Side, SideAll, SelfStack); + TBISeriesDirection=(Automatic, Horizontal, Vertical); + + TBIChart=class; + + TBIChartOptions=class(TPersistent) + private + FDimensions: TBIChartDimensions; + FDirection : TBIChartDirection; + FItems : TBIChartItems; + FLegend: TBIChartLegend; + FMarks: TBIChartMarks; + FMode: TBIChartMode; + FSeriesDirection: TBISeriesDirection; + FStacked: TBIChartStacked; + FXYZMode: TBIChart3DMode; + + IChart : TBIChart; + + procedure Finish; + procedure FinishViewDimensions; + procedure SetDimensions(const Value: TBIChartDimensions); + procedure SetDirection(const Value: TBIChartDirection); + procedure SetItems(const Value: TBIChartItems); + procedure SetLegend(const Value: TBIChartLegend); + procedure SetMarks(const Value: TBIChartMarks); + procedure SetMode(const Value: TBIChartMode); + procedure SetSeries2D(const Value: TChartSeriesClass); + procedure SetSeries3D(const Value: TChartSeriesClass); + procedure SetStacked(const Value: TBIChartStacked); + procedure SetXYZMode(const Value: TBIChart3DMode); + procedure SetSeriesDirection(const Value: TBISeriesDirection); + function GetSeries2D: TChartSeriesClass; + function GetSeries3D: TChartSeriesClass; + public + Constructor Create(const AChart:TBIChart); + Destructor Destroy; override; + + procedure Assign(Source:TPersistent); override; + + procedure ChangeSeries2D(const AClass:TChartSeriesClass; + const AHorizontal,ALinePointer:Boolean); + published + property Dimensions:TBIChartDimensions read FDimensions write SetDimensions + default TBIChartDimensions.Automatic; + + property Direction:TBIChartDirection read FDirection write SetDirection default TBIChartDirection.Automatic; + property Items:TBIChartItems read FItems write SetItems; + property Legend:TBIChartLegend read FLegend write SetLegend + default TBIChartLegend.Automatic; + property Marks:TBIChartMarks read FMarks write SetMarks + default TBIChartMarks.Automatic; + property Mode:TBIChartMode read FMode write SetMode default TBIChartMode.Automatic; + property Series2D:TChartSeriesClass read GetSeries2D write SetSeries2D; + property Series3D:TChartSeriesClass read GetSeries3D write SetSeries3D; + property SeriesDirection: TBISeriesDirection read FSeriesDirection write SetSeriesDirection + default TBISeriesDirection.Automatic; + property Stacked:TBIChartStacked read FStacked write SetStacked + default TBIChartStacked.Automatic; + property XYZMode:TBIChart3DMode read FXYZMode write SetXYZMode default TBIChart3DMode.Automatic; + end; {$IF CompilerVersion>=23} [ComponentPlatformsAttribute(pidWin32 or pidWin64 or pidOSX32 @@ -88,53 +246,54 @@ TBITChart=class(TChart) {$ENDIF} TBIChart=class(TBIDataControl) private - tmpNoMeasure : TDataItem; + FOptions : TBIChartOptions; + + IDataInfo : TDataInfo; + + procedure AddXY(const AItems:TBIChartItems); - function AddCount(const AData:TDataItem):TChartSeries; - procedure AddXY(const X,Y,AText:TDataItem; const AData:TDataArray; const Dimensions:Integer); procedure ApplyData(const AData:TDataItem); procedure CreateChart; function CreateSeries(const X,Y:TDataItem):TChartSeries; + function DirectChart:TBITChart; procedure FillSeries(const ASeries:TChartSeries; const X,Y,AText:TDataItem); function GetChart:TBITChart; - function InitCountSeries(const ACount:TInteger):TChartSeries; - + function GuessRealData(const AData:TDataArray):TDataArray; + procedure SetOptions(const Value: TBIChartOptions); protected Index : TCursorIndex; - {$IFDEF TEEPRO} - class function IsFinancial(const AData:TDataArray; const Dimensions:Integer):Boolean; static; - {$ENDIF} + RealMode : TBIChartMode; + RealMode3D : TBIChart3DMode; + + procedure ExchangeXY; + procedure ExchangeYZ; + procedure ExchangeXZ; + procedure DirectRefresh; procedure Loaded; override; procedure ReadState(Reader: TReader); override; + procedure ResetTheme; procedure SetDataDirect(const Value: TDataItem); override; public - Mode : TBIChartMode; - Constructor Create(AOwner:TComponent); override; + Destructor Destroy; override; + procedure Assign(Source:TPersistent); override; procedure Clear; - function Fill(const AData:TInt32Array):TChartSeries; overload; - function Fill(const AData:TInt64Array):TChartSeries; overload; - function Fill(const AData:TDoubleArray):TChartSeries; overload; - {$IFNDEF FPC} procedure Fill(const Map:TDataMap; const Text:TGetText=nil); overload; {$ENDIF} - procedure Fill(const AData:TDataArray; const Dimensions:Integer=0); overload; - procedure Fill(const AData:TDataArray; const ASeries:TDataItem); overload; - procedure Fill(const AItems:TDataItems; const Dimensions:Integer=0); overload; - procedure Fill(const AData:TDataSet; const ValueField:Integer; const TextField:Integer=-1); overload; - function Fill(const AData:TDataItem):TChartSeries; overload; + procedure Fill(const AData:TDataArray); overload; + procedure Fill(const AItems:TDataItems); overload; procedure Fill(const AHistogram:THistogram; const ASource:TDataItem); overload; procedure Fill(const ASummary:TSummary); overload; - procedure Fill(const ACursor:TDataCursor; const AItems:TDataArray=nil; - const ADimensions:Integer=0); overload; - function FillXY(const AData:TDataSet; const X,Y:Integer):TChartSeries; overload; - function FillXY(const X,Y:TField):TChartSeries; overload; + procedure Fill(const ACursor:TDataCursor; const AItems:TDataArray=nil); overload; + + function GetChildOwner: TComponent; override; + Procedure GetChildren(Proc:TGetChildProc; Root:TComponent); override; published property Chart:TBITChart read GetChart; @@ -142,6 +301,8 @@ TBIChart=class(TBIDataControl) property Height default 250; property Width default 400; {$ENDIF} + + property Options:TBIChartOptions read FOptions write SetOptions; end; // Converts data from a Chart or one or more Series to a TDataItem @@ -149,11 +310,16 @@ TChartData=record private class procedure InitNotMandatory(const ASeries:TChartSeries; const ACount:Integer); static; + + class function NewSeries(const AOwner:TComponent; + const AClass:TChartSeriesClass):TChartSeries; static; public class procedure AddSeries(const ASeries: TChartSeries; const ADest: TDataItem); static; + class function From(const AData:TDataItem; const AOwner:TComponent; const AClass:TChartSeriesClass=nil):TChartSeries; overload; static; + class function From(const ASeries:TChartSeries):TDataItem; overload; static; class function From(const AChart:TCustomChart):TDataItem; overload; static; class function From(const ASeries:Array of TChartSeries):TDataItem; overload; static; diff --git a/src/delphi/VCL/BI.VCL.Component.pas b/src/delphi/VCL/BI.VCL.Component.pas index f824eca..e474f3f 100644 --- a/src/delphi/VCL/BI.VCL.Component.pas +++ b/src/delphi/VCL/BI.VCL.Component.pas @@ -1,8 +1,30 @@ +{*********************************************} +{ TeeBI Software Library } +{ Importing data from VCL Controls } +{ Copyright (c) 2015-2016 by Steema Software } +{ All Rights Reserved } +{*********************************************} unit BI.VCL.Component; {.$DEFINE FMX} interface +{ + This unit contains a TControlImporter component for VCL. + + Its purpose is to obtain data from any VCL TControl that is supported. + + Like for example, using Memo.Lines text to import (in JSON, CSV, XML format), + or using the Data property of a BI control (Grid, Chart, Tree, etc). + + Usage example: + + tmp:=TControlImporter.Create(Self); + tmp.Source:=Memo1; + + BIGrid1.Data:=tmp.Data; +} + uses System.Classes, BI.Data, BI.Store.Component; diff --git a/src/delphi/VCL/BI.VCL.DataManager.dfm b/src/delphi/VCL/BI.VCL.DataManager.dfm index f943709..92dcb0e 100644 --- a/src/delphi/VCL/BI.VCL.DataManager.dfm +++ b/src/delphi/VCL/BI.VCL.DataManager.dfm @@ -201,18 +201,10 @@ object DataManager: TDataManager OnChange = PageControl1Change object TabSettings: TTabSheet Caption = 'Settings' - ExplicitLeft = 0 - ExplicitTop = 0 - ExplicitWidth = 0 - ExplicitHeight = 0 end object TabData: TTabSheet Caption = 'Data' ImageIndex = 1 - ExplicitLeft = 0 - ExplicitTop = 0 - ExplicitWidth = 0 - ExplicitHeight = 0 object Label2: TLabel Left = 11 Top = 16 @@ -278,8 +270,10 @@ object DataManager: TDataManager Width = 312 Height = 89 Align = alBottom + ScrollBars = ssBoth TabOrder = 5 Visible = False + WordWrap = False end object ImportProgress: TProgressBar Left = 11 @@ -290,14 +284,6 @@ object DataManager: TDataManager Visible = False end end - object TabSheet3: TTabSheet - Caption = 'Schedule' - ImageIndex = 2 - ExplicitLeft = 0 - ExplicitTop = 0 - ExplicitWidth = 0 - ExplicitHeight = 0 - end end object PopupMenu1: TPopupMenu Left = 96 diff --git a/src/delphi/VCL/BI.VCL.DataManager.pas b/src/delphi/VCL/BI.VCL.DataManager.pas index 0a34ccb..70219e1 100644 --- a/src/delphi/VCL/BI.VCL.DataManager.pas +++ b/src/delphi/VCL/BI.VCL.DataManager.pas @@ -40,7 +40,6 @@ TDataManager = class(TForm) Splitter1: TSplitter; TabSettings: TTabSheet; TabData: TTabSheet; - TabSheet3: TTabSheet; BViewData: TButton; Label2: TLabel; LLastImport: TLabel; @@ -100,10 +99,10 @@ TDataManager = class(TForm) function ImportingError(const Sender:TObject; const Text:String):Boolean; procedure LogException(const Text:String); function NodeWithData(const AData:TDataItem):TTreeNode; + procedure ReplaceDummy(const Node:TTreeNode); function SelectedText:String; procedure SelectStore; procedure SetLastImport; - procedure SetScheduling; procedure ShowDataInfo(SelectAtEditor:Boolean); procedure TryAdd(const Kind:TDataDefinitionKind); diff --git a/src/delphi/VCL/BI.VCL.DataSelect.dfm b/src/delphi/VCL/BI.VCL.DataSelect.dfm index 1ceea0a..10281f6 100644 --- a/src/delphi/VCL/BI.VCL.DataSelect.dfm +++ b/src/delphi/VCL/BI.VCL.DataSelect.dfm @@ -21,16 +21,42 @@ object DataSelector: TDataSelector Top = 0 Width = 426 Height = 457 - ActivePage = TabStore + ActivePage = TabComponent Align = alClient TabOrder = 0 OnChange = PageControl1Change object TabStore: TTabSheet Caption = 'Store' + ExplicitLeft = 0 + ExplicitTop = 0 + ExplicitWidth = 0 + ExplicitHeight = 0 end object TabComponent: TTabSheet Caption = 'Component' ImageIndex = 1 + ExplicitLeft = 0 + ExplicitTop = 0 + ExplicitWidth = 0 + ExplicitHeight = 0 + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 418 + Height = 41 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object Button1: TButton + Left = 8 + Top = 8 + Width = 75 + Height = 25 + Caption = '&New...' + TabOrder = 0 + OnClick = Button1Click + end + end end end object PanelButtons: TPanel @@ -82,4 +108,27 @@ object DataSelector: TDataSelector OnClick = BClearClick end end + object PopupMenu2: TPopupMenu + Left = 142 + Top = 312 + object Import1: TMenuItem + Caption = '&Import' + object Database1: TMenuItem + Caption = '&Database...' + OnClick = Database1Click + end + object Files1: TMenuItem + Caption = '&Files...' + OnClick = Files1Click + end + object Web1: TMenuItem + Caption = '&BI Web...' + OnClick = Web1Click + end + end + object Query1: TMenuItem + Caption = '&Query...' + OnClick = Query1Click + end + end end diff --git a/src/delphi/VCL/BI.VCL.DataSelect.pas b/src/delphi/VCL/BI.VCL.DataSelect.pas index 1351f0f..75f7274 100644 --- a/src/delphi/VCL/BI.VCL.DataSelect.pas +++ b/src/delphi/VCL/BI.VCL.DataSelect.pas @@ -24,7 +24,8 @@ interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ComCtrls, Vcl.StdCtrls, Vcl.ExtCtrls, - BI.Data, BI.VCL.DataManager, BI.VCL.Editor.DataComponent; + BI.Data, BI.VCL.DataManager, BI.VCL.Editor.DataComponent, Vcl.Menus, + BI.Persist, BI.VCL.DataControl; type TDataSelector = class(TForm) @@ -36,11 +37,24 @@ TDataSelector = class(TForm) BOK: TButton; BCancel: TButton; BClear: TButton; + PopupMenu2: TPopupMenu; + Files1: TMenuItem; + Database1: TMenuItem; + Web1: TMenuItem; + Import1: TMenuItem; + Query1: TMenuItem; + Panel1: TPanel; + Button1: TButton; procedure FormCreate(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormShow(Sender: TObject); procedure BClearClick(Sender: TObject); procedure PageControl1Change(Sender: TObject); + procedure Query1Click(Sender: TObject); + procedure Button1Click(Sender: TObject); + procedure Database1Click(Sender: TObject); + procedure Files1Click(Sender: TObject); + procedure Web1Click(Sender: TObject); private { Private declarations } @@ -48,15 +62,25 @@ TDataSelector = class(TForm) IComp : TDataComponent; FOnSelect: TNotifyEvent; + IEdited : TComponent; + procedure FilterSelf(Sender: TComponent; var Valid:Boolean); + procedure FinishAddNew(const AComponent:TComponent); + function IsEmbedded:Boolean; + function NewOwner:TComponent; function SelectedHasData:Boolean; procedure SelectedItem(Sender: TObject); + procedure SetEdited(const AEdited:TComponent); + procedure TryAddImport(const AKind:TDataDefinitionKind); public { Public declarations } + class procedure Choose(const AOwner:TComponent; + const AEdited:TBIDataControl); overload; static; + class function Choose(const AOwner:TComponent; const AEdited:TComponent; - out AData:TDataItem):Boolean; static; + out AData:TDataItem):Boolean; overload; static; class function Embedd(const AOwner:TComponent; const AParent:TWinControl; diff --git a/src/delphi/VCL/BI.VCL.DataWorkflow.dfm b/src/delphi/VCL/BI.VCL.DataWorkflow.dfm index 9a49a0a..8d850eb 100644 --- a/src/delphi/VCL/BI.VCL.DataWorkflow.dfm +++ b/src/delphi/VCL/BI.VCL.DataWorkflow.dfm @@ -83,40 +83,21 @@ object BIWorkflowEditor: TBIWorkflowEditor ParentFont = False end object BAdd: TButton - Left = 96 + Left = 289 Top = 10 Width = 75 Height = 25 - Caption = 'Add...' - Enabled = False + Caption = '&Add...' TabOrder = 0 OnClick = BAddClick end - object Button1: TButton - Left = 194 - Top = 10 - Width = 75 - Height = 25 - Caption = '&Import...' - TabOrder = 1 - OnClick = Button1Click - end - object Button2: TButton - Left = 295 - Top = 10 - Width = 75 - Height = 25 - Caption = '&Query' - TabOrder = 2 - OnClick = Button2Click - end object BDelete: TButton Left = 392 Top = 10 Width = 75 Height = 25 Caption = 'Delete' - TabOrder = 3 + TabOrder = 1 OnClick = BDeleteClick end end @@ -182,20 +163,4 @@ object BIWorkflowEditor: TBIWorkflowEditor end end end - object PopupMenu2: TPopupMenu - Left = 424 - Top = 56 - object Files1: TMenuItem - Caption = '&Files...' - OnClick = Files1Click - end - object Database1: TMenuItem - Caption = '&Database...' - OnClick = Database1Click - end - object Web1: TMenuItem - Caption = '&BI Web...' - OnClick = Web1Click - end - end end diff --git a/src/delphi/VCL/BI.VCL.DataWorkflow.pas b/src/delphi/VCL/BI.VCL.DataWorkflow.pas index 247d597..4fc2aa0 100644 --- a/src/delphi/VCL/BI.VCL.DataWorkflow.pas +++ b/src/delphi/VCL/BI.VCL.DataWorkflow.pas @@ -16,7 +16,6 @@ TBIWorkflowEditor = class(TForm) BIGrid1: TBIGrid; PanelSelector: TPanel; Panel2: TPanel; - BAdd: TButton; PopupMenu1: TPopupMenu; Splitter1: TSplitter; Splitter2: TSplitter; @@ -27,38 +26,29 @@ TBIWorkflowEditor = class(TForm) Sort1: TMenuItem; Reorder1: TMenuItem; Filter1: TMenuItem; - Button1: TButton; + BAdd: TButton; ranspose1: TMenuItem; Change1: TMenuItem; PanelEditor: TPanel; LError: TLabel; - PopupMenu2: TPopupMenu; - Files1: TMenuItem; - Database1: TMenuItem; - Web1: TMenuItem; N1: TMenuItem; Algorithm1: TMenuItem; Function1: TMenuItem; MachineLearning1: TMenuItem; - Button2: TButton; BITree1: TBITree; BDelete: TButton; procedure FormCreate(Sender: TObject); procedure Tree1DragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); procedure Tree1DragDrop(Sender, Source: TObject; X, Y: Integer); - procedure BAddClick(Sender: TObject); procedure Add1Click(Sender: TObject); - procedure Button1Click(Sender: TObject); + procedure BAddClick(Sender: TObject); procedure ranspose1Click(Sender: TObject); procedure Delete1Click(Sender: TObject); procedure Rename1Click(Sender: TObject); procedure Query1Click(Sender: TObject); - procedure Files1Click(Sender: TObject); - procedure Database1Click(Sender: TObject); procedure Web1Click(Sender: TObject); procedure Function1Click(Sender: TObject); - procedure Button2Click(Sender: TObject); procedure BITree1Change(Sender: TObject); procedure BDeleteClick(Sender: TObject); procedure FormShow(Sender: TObject); @@ -73,6 +63,7 @@ TBIWorkflowEditor = class(TForm) procedure AddNewRoot(const AData:TDataItem; const X,Y:Integer); function DataOf(const ANode:TBITreeNode):TDataItem; function DoAddNode(const AParent:TBITreeNode; const AItem:TWorkflowItem):TBITreeNode; + procedure DoChangeWorkflow(const Value: TBIWorkflow); procedure FillTree; procedure FilterSelf(Sender: TComponent; var Valid:Boolean); @@ -88,8 +79,9 @@ TBIWorkflowEditor = class(TForm) const AName:String):TBITreeNode; overload; procedure SetWorkflow(const Value: TBIWorkflow); - procedure TryAddImport(const AKind:TDataDefinitionKind); procedure TryRefresh(const ANode:TBITreeNode); + protected + procedure Notification(AComponent: TComponent; Operation: TOperation); override; public { Public declarations } diff --git a/src/delphi/VCL/BI.VCL.Editor.Chart.dfm b/src/delphi/VCL/BI.VCL.Editor.Chart.dfm index 9222735..c3f5129 100644 --- a/src/delphi/VCL/BI.VCL.Editor.Chart.dfm +++ b/src/delphi/VCL/BI.VCL.Editor.Chart.dfm @@ -3,8 +3,8 @@ object BIChartEditor: TBIChartEditor Top = 0 ActiveControl = BOK Caption = 'BIChart Editor' - ClientHeight = 450 - ClientWidth = 503 + ClientHeight = 397 + ClientWidth = 491 Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText @@ -19,81 +19,754 @@ object BIChartEditor: TBIChartEditor object PageControl1: TPageControl Left = 0 Top = 0 - Width = 503 - Height = 413 - ActivePage = TabOptions + Width = 491 + Height = 360 + ActivePage = TabView Align = alClient TabOrder = 0 OnChange = PageControl1Change object TabOptions: TTabSheet Caption = 'Options' - ExplicitLeft = 8 - ExplicitTop = 28 - object GroupBox1: TGroupBox - Left = 16 - Top = 16 - Width = 185 - Height = 153 - Caption = '&Style:' + ExplicitLeft = 0 + ExplicitTop = 0 + ExplicitWidth = 0 + ExplicitHeight = 0 + object PageMode: TPageControl + Left = 129 + Top = 0 + Width = 354 + Height = 332 + ActivePage = Tab2D + Align = alClient TabOrder = 0 - object RBAuto: TRadioButton - Left = 16 - Top = 24 - Width = 137 - Height = 17 - Caption = '&Automatic' - TabOrder = 0 - OnClick = RBAutoClick + object Tab2D: TTabSheet + Caption = '2D' + ImageIndex = 1 + ExplicitLeft = 0 + ExplicitTop = 0 + ExplicitWidth = 0 + ExplicitHeight = 0 + object Panel3: TPanel + Left = 0 + Top = 0 + Width = 111 + Height = 304 + Align = alLeft + BevelOuter = bvNone + TabOrder = 0 + object GroupBox2: TLabel + Left = 8 + Top = 3 + Width = 28 + Height = 13 + Caption = '&Style:' + end + object Label11: TLabel + Left = 8 + Top = 193 + Width = 42 + Height = 13 + Caption = 'Sta&cked:' + FocusControl = CBStacked + end + object LB2D: TListBox + Left = 8 + Top = 22 + Width = 97 + Height = 134 + ItemHeight = 13 + Items.Strings = ( + 'Automatic' + 'Area' + 'Bar' + 'Line' + 'Line and Point' + 'Pie' + 'Point XY' + 'Polar' + 'Radar') + TabOrder = 0 + OnClick = LB2DClick + end + object CBStacked: TComboBox + Left = 8 + Top = 212 + Width = 97 + Height = 21 + Style = csDropDownList + ItemIndex = 0 + TabOrder = 1 + Text = 'Automatic' + OnChange = CBStackedChange + Items.Strings = ( + 'Automatic' + 'No' + 'Yes' + '100%' + 'Side' + 'Side All' + 'Self') + end + object CBHoriz2D: TComboBox + Left = 8 + Top = 164 + Width = 97 + Height = 21 + Style = csDropDownList + ItemIndex = 0 + TabOrder = 2 + Text = 'Automatic' + OnChange = CBHoriz2DChange + Items.Strings = ( + 'Automatic' + 'Horizontal' + 'Vertical') + end + end + object Panel4: TPanel + Left = 111 + Top = 0 + Width = 235 + Height = 304 + Align = alClient + BevelOuter = bvNone + TabOrder = 1 + object PanelItems: TPanel + Left = 0 + Top = 0 + Width = 235 + Height = 102 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object Label1: TLabel + Left = 10 + Top = 20 + Width = 10 + Height = 13 + Caption = 'X:' + end + object Label2: TLabel + Left = 10 + Top = 47 + Width = 31 + Height = 13 + Caption = 'Texts:' + end + object Label3: TLabel + Left = 10 + Top = 74 + Width = 33 + Height = 13 + Caption = '&Group:' + end + object CBX2D: TComboBox + Left = 47 + Top = 17 + Width = 121 + Height = 21 + Style = csDropDownList + TabOrder = 0 + OnChange = CBX2DChange + end + object CBText: TComboBox + Left = 47 + Top = 44 + Width = 121 + Height = 21 + Style = csDropDownList + TabOrder = 1 + OnChange = CBTextChange + end + object CBColors: TComboBox + Left = 47 + Top = 71 + Width = 121 + Height = 21 + Style = csDropDownList + TabOrder = 2 + end + end + object PanelY: TPanel + Left = 0 + Top = 102 + Width = 235 + Height = 202 + Align = alClient + BevelOuter = bvNone + TabOrder = 1 + end + end end - object RBXY: TRadioButton - Left = 16 - Top = 47 - Width = 137 - Height = 17 - Caption = '&2D XY' - TabOrder = 1 - OnClick = RBXYClick + object Tab3D: TTabSheet + Caption = '3D' + ImageIndex = 2 + ExplicitLeft = 0 + ExplicitTop = 0 + ExplicitWidth = 0 + ExplicitHeight = 0 + object Panel3D: TPanel + Left = 3 + Top = 163 + Width = 212 + Height = 123 + BevelOuter = bvNone + TabOrder = 0 + object BSwapXY: TSpeedButton + Left = 181 + Top = 27 + Width = 23 + Height = 22 + Glyph.Data = { + 36050000424D3605000000000000360400002800000010000000100000000100 + 08000000000000010000C40E0000C40E00000001000000000000000000000000 + 80000080000000808000800000008000800080800000C0C0C000C0DCC000F0CA + A6000020400000206000002080000020A0000020C0000020E000004000000040 + 20000040400000406000004080000040A0000040C0000040E000006000000060 + 20000060400000606000006080000060A0000060C0000060E000008000000080 + 20000080400000806000008080000080A0000080C0000080E00000A0000000A0 + 200000A0400000A0600000A0800000A0A00000A0C00000A0E00000C0000000C0 + 200000C0400000C0600000C0800000C0A00000C0C00000C0E00000E0000000E0 + 200000E0400000E0600000E0800000E0A00000E0C00000E0E000400000004000 + 20004000400040006000400080004000A0004000C0004000E000402000004020 + 20004020400040206000402080004020A0004020C0004020E000404000004040 + 20004040400040406000404080004040A0004040C0004040E000406000004060 + 20004060400040606000406080004060A0004060C0004060E000408000004080 + 20004080400040806000408080004080A0004080C0004080E00040A0000040A0 + 200040A0400040A0600040A0800040A0A00040A0C00040A0E00040C0000040C0 + 200040C0400040C0600040C0800040C0A00040C0C00040C0E00040E0000040E0 + 200040E0400040E0600040E0800040E0A00040E0C00040E0E000800000008000 + 20008000400080006000800080008000A0008000C0008000E000802000008020 + 20008020400080206000802080008020A0008020C0008020E000804000008040 + 20008040400080406000804080008040A0008040C0008040E000806000008060 + 20008060400080606000806080008060A0008060C0008060E000808000008080 + 20008080400080806000808080008080A0008080C0008080E00080A0000080A0 + 200080A0400080A0600080A0800080A0A00080A0C00080A0E00080C0000080C0 + 200080C0400080C0600080C0800080C0A00080C0C00080C0E00080E0000080E0 + 200080E0400080E0600080E0800080E0A00080E0C00080E0E000C0000000C000 + 2000C0004000C0006000C0008000C000A000C000C000C000E000C0200000C020 + 2000C0204000C0206000C0208000C020A000C020C000C020E000C0400000C040 + 2000C0404000C0406000C0408000C040A000C040C000C040E000C0600000C060 + 2000C0604000C0606000C0608000C060A000C060C000C060E000C0800000C080 + 2000C0804000C0806000C0808000C080A000C080C000C080E000C0A00000C0A0 + 2000C0A04000C0A06000C0A08000C0A0A000C0A0C000C0A0E000C0C00000C0C0 + 2000C0C04000C0C06000C0C08000C0C0A000F0FBFF00A4A0A000808080000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00FFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFF00000000000000FFFFFF00FFFFFFFFFF00FFFFFFFF + FF00FFFF0000FFFFFFFFFF00FFFFFFFFFF00FF000000000000FFFF00FFFFFFFF + FF00FFFF0000FFFF00FFFF00000000000000FFFFFF00FFFF00FFFFFFFFFFFFFF + FFFFFFFFFFFFFFFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFF00FFFFFFFF + FFFFFFFFFFFFFFFFFFFFFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFF00FF + FFFF00000000000000FFFF00FFFF0000FFFF00FFFFFFFFFF00FFFF0000000000 + 00FF00FFFFFFFFFF00FFFFFFFFFF0000FFFF00FFFFFFFFFF00FFFFFFFFFF00FF + FFFF00000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF} + OnClick = BSwapXYClick + end + object BSwapYZ: TSpeedButton + Left = 181 + Top = 70 + Width = 23 + Height = 22 + Glyph.Data = { + 36050000424D3605000000000000360400002800000010000000100000000100 + 08000000000000010000C40E0000C40E00000001000000000000000000000000 + 80000080000000808000800000008000800080800000C0C0C000C0DCC000F0CA + A6000020400000206000002080000020A0000020C0000020E000004000000040 + 20000040400000406000004080000040A0000040C0000040E000006000000060 + 20000060400000606000006080000060A0000060C0000060E000008000000080 + 20000080400000806000008080000080A0000080C0000080E00000A0000000A0 + 200000A0400000A0600000A0800000A0A00000A0C00000A0E00000C0000000C0 + 200000C0400000C0600000C0800000C0A00000C0C00000C0E00000E0000000E0 + 200000E0400000E0600000E0800000E0A00000E0C00000E0E000400000004000 + 20004000400040006000400080004000A0004000C0004000E000402000004020 + 20004020400040206000402080004020A0004020C0004020E000404000004040 + 20004040400040406000404080004040A0004040C0004040E000406000004060 + 20004060400040606000406080004060A0004060C0004060E000408000004080 + 20004080400040806000408080004080A0004080C0004080E00040A0000040A0 + 200040A0400040A0600040A0800040A0A00040A0C00040A0E00040C0000040C0 + 200040C0400040C0600040C0800040C0A00040C0C00040C0E00040E0000040E0 + 200040E0400040E0600040E0800040E0A00040E0C00040E0E000800000008000 + 20008000400080006000800080008000A0008000C0008000E000802000008020 + 20008020400080206000802080008020A0008020C0008020E000804000008040 + 20008040400080406000804080008040A0008040C0008040E000806000008060 + 20008060400080606000806080008060A0008060C0008060E000808000008080 + 20008080400080806000808080008080A0008080C0008080E00080A0000080A0 + 200080A0400080A0600080A0800080A0A00080A0C00080A0E00080C0000080C0 + 200080C0400080C0600080C0800080C0A00080C0C00080C0E00080E0000080E0 + 200080E0400080E0600080E0800080E0A00080E0C00080E0E000C0000000C000 + 2000C0004000C0006000C0008000C000A000C000C000C000E000C0200000C020 + 2000C0204000C0206000C0208000C020A000C020C000C020E000C0400000C040 + 2000C0404000C0406000C0408000C040A000C040C000C040E000C0600000C060 + 2000C0604000C0606000C0608000C060A000C060C000C060E000C0800000C080 + 2000C0804000C0806000C0808000C080A000C080C000C080E000C0A00000C0A0 + 2000C0A04000C0A06000C0A08000C0A0A000C0A0C000C0A0E000C0C00000C0C0 + 2000C0C04000C0C06000C0C08000C0C0A000F0FBFF00A4A0A000808080000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00FFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFF00000000000000FFFFFF00FFFFFFFFFF00FFFFFFFF + FF00FFFF0000FFFFFFFFFF00FFFFFFFFFF00FF000000000000FFFF00FFFFFFFF + FF00FFFF0000FFFF00FFFF00000000000000FFFFFF00FFFF00FFFFFFFFFFFFFF + FFFFFFFFFFFFFFFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFF00FFFFFFFF + FFFFFFFFFFFFFFFFFFFFFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFF00FF + FFFF00000000000000FFFF00FFFF0000FFFF00FFFFFFFFFF00FFFF0000000000 + 00FF00FFFFFFFFFF00FFFFFFFFFF0000FFFF00FFFFFFFFFF00FFFFFFFFFF00FF + FFFF00000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF} + OnClick = BSwapYZClick + end + object BSwapXZ: TSpeedButton + Left = 2 + Top = 50 + Width = 23 + Height = 22 + Glyph.Data = { + 36050000424D3605000000000000360400002800000010000000100000000100 + 08000000000000010000C40E0000C40E00000001000000000000000000000000 + 80000080000000808000800000008000800080800000C0C0C000C0DCC000F0CA + A6000020400000206000002080000020A0000020C0000020E000004000000040 + 20000040400000406000004080000040A0000040C0000040E000006000000060 + 20000060400000606000006080000060A0000060C0000060E000008000000080 + 20000080400000806000008080000080A0000080C0000080E00000A0000000A0 + 200000A0400000A0600000A0800000A0A00000A0C00000A0E00000C0000000C0 + 200000C0400000C0600000C0800000C0A00000C0C00000C0E00000E0000000E0 + 200000E0400000E0600000E0800000E0A00000E0C00000E0E000400000004000 + 20004000400040006000400080004000A0004000C0004000E000402000004020 + 20004020400040206000402080004020A0004020C0004020E000404000004040 + 20004040400040406000404080004040A0004040C0004040E000406000004060 + 20004060400040606000406080004060A0004060C0004060E000408000004080 + 20004080400040806000408080004080A0004080C0004080E00040A0000040A0 + 200040A0400040A0600040A0800040A0A00040A0C00040A0E00040C0000040C0 + 200040C0400040C0600040C0800040C0A00040C0C00040C0E00040E0000040E0 + 200040E0400040E0600040E0800040E0A00040E0C00040E0E000800000008000 + 20008000400080006000800080008000A0008000C0008000E000802000008020 + 20008020400080206000802080008020A0008020C0008020E000804000008040 + 20008040400080406000804080008040A0008040C0008040E000806000008060 + 20008060400080606000806080008060A0008060C0008060E000808000008080 + 20008080400080806000808080008080A0008080C0008080E00080A0000080A0 + 200080A0400080A0600080A0800080A0A00080A0C00080A0E00080C0000080C0 + 200080C0400080C0600080C0800080C0A00080C0C00080C0E00080E0000080E0 + 200080E0400080E0600080E0800080E0A00080E0C00080E0E000C0000000C000 + 2000C0004000C0006000C0008000C000A000C000C000C000E000C0200000C020 + 2000C0204000C0206000C0208000C020A000C020C000C020E000C0400000C040 + 2000C0404000C0406000C0408000C040A000C040C000C040E000C0600000C060 + 2000C0604000C0606000C0608000C060A000C060C000C060E000C0800000C080 + 2000C0804000C0806000C0808000C080A000C080C000C080E000C0A00000C0A0 + 2000C0A04000C0A06000C0A08000C0A0A000C0A0C000C0A0E000C0C00000C0C0 + 2000C0C04000C0C06000C0C08000C0C0A000F0FBFF00A4A0A000808080000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00FFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFF00000000000000FFFFFF00FFFFFFFFFF00FFFFFFFF + FF00FFFF0000FFFFFFFFFF00FFFFFFFFFF00FF000000000000FFFF00FFFFFFFF + FF00FFFF0000FFFF00FFFF00000000000000FFFFFF00FFFF00FFFFFFFFFFFFFF + FFFFFFFFFFFFFFFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFF00FFFFFFFF + FFFFFFFFFFFFFFFFFFFFFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFF00FF + FFFF00000000000000FFFF00FFFF0000FFFF00FFFFFFFFFF00FFFF0000000000 + 00FF00FFFFFFFFFF00FFFFFFFFFF0000FFFF00FFFFFFFFFF00FFFFFFFFFF00FF + FFFF00000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF} + OnClick = BSwapXZClick + end + object Shape1: TShape + Left = 13 + Top = 10 + Width = 1 + Height = 31 + end + object Shape2: TShape + Left = 13 + Top = 82 + Width = 1 + Height = 31 + end + object Label4: TLabel + Left = 33 + Top = 11 + Width = 10 + Height = 13 + Caption = 'X:' + end + object Label5: TLabel + Left = 33 + Top = 53 + Width = 10 + Height = 13 + Caption = 'Y:' + end + object Label6: TLabel + Left = 33 + Top = 99 + Width = 10 + Height = 13 + Caption = 'Z:' + end + object CBX: TComboBox + Left = 54 + Top = 8 + Width = 121 + Height = 21 + Style = csDropDownList + TabOrder = 0 + OnChange = CBXChange + end + object CBY: TComboBox + Left = 54 + Top = 50 + Width = 121 + Height = 21 + Style = csDropDownList + TabOrder = 1 + OnChange = CBYChange + end + object CBZ: TComboBox + Left = 54 + Top = 96 + Width = 121 + Height = 21 + Style = csDropDownList + TabOrder = 2 + OnChange = CBZChange + end + end + object LB3D: TListBox + Left = 113 + Top = 11 + Width = 98 + Height = 94 + ItemHeight = 13 + Items.Strings = ( + 'Automatic' + 'Contour' + 'Grid' + 'Surface' + 'Tower' + 'Tri Surface') + TabOrder = 1 + OnClick = LB3DClick + end + object LBXYZ: TListBox + Left = 113 + Top = 11 + Width = 98 + Height = 65 + ItemHeight = 13 + Items.Strings = ( + 'Automatic' + 'Point 3D' + 'Ternary' + 'Tri Surface') + TabOrder = 2 + OnClick = LBXYZClick + end + object RG3D: TRadioGroup + Left = 8 + Top = 6 + Width = 90 + Height = 122 + Caption = '&Mode:' + Items.Strings = ( + 'Automatic' + 'Table' + 'Grid' + 'XYZ') + TabOrder = 3 + OnClick = RG3DClick + end + object CB3D: TCheckBox + Left = 9 + Top = 142 + Width = 128 + Height = 17 + Caption = '&Automatic' + Checked = True + State = cbChecked + TabOrder = 4 + end + object PanelYTable: TPanel + Left = 9 + Top = 165 + Width = 202 + Height = 128 + BevelOuter = bvNone + TabOrder = 5 + end end - object RB3D: TRadioButton - Left = 16 - Top = 70 - Width = 137 - Height = 17 - Caption = '&3D XYZ' - TabOrder = 2 - OnClick = RB3DClick + object TabFinancial: TTabSheet + Caption = 'Financial' + ImageIndex = 2 + ExplicitLeft = 0 + ExplicitTop = 0 + ExplicitWidth = 0 + ExplicitHeight = 0 + object Label7: TLabel + Left = 10 + Top = 40 + Width = 30 + Height = 13 + Caption = '&Open:' + end + object Label8: TLabel + Left = 10 + Top = 67 + Width = 30 + Height = 13 + Caption = '&Close:' + end + object Label9: TLabel + Left = 10 + Top = 94 + Width = 25 + Height = 13 + Caption = '&High:' + end + object Label10: TLabel + Left = 10 + Top = 121 + Width = 23 + Height = 13 + Caption = '&Low:' + end + object Label12: TLabel + Left = 10 + Top = 154 + Width = 38 + Height = 13 + Caption = '&Volume:' + end + object CBOpen: TComboBox + Left = 71 + Top = 37 + Width = 121 + Height = 21 + Style = csDropDownList + TabOrder = 0 + OnChange = CBOpenChange + end + object CBAutoFinancial: TCheckBox + Left = 10 + Top = 9 + Width = 151 + Height = 17 + Caption = '&Automatic' + Checked = True + State = cbChecked + TabOrder = 1 + end + object CBClose: TComboBox + Left = 71 + Top = 64 + Width = 121 + Height = 21 + Style = csDropDownList + TabOrder = 2 + OnChange = CBCloseChange + end + object CBHigh: TComboBox + Left = 71 + Top = 91 + Width = 121 + Height = 21 + Style = csDropDownList + TabOrder = 3 + OnChange = CBHighChange + end + object CBLow: TComboBox + Left = 71 + Top = 118 + Width = 121 + Height = 21 + Style = csDropDownList + TabOrder = 4 + OnChange = CBLowChange + end + object LBFinancial: TListBox + Left = 71 + Top = 194 + Width = 121 + Height = 49 + ItemHeight = 13 + Items.Strings = ( + 'Automatic' + 'Candle' + 'Point and Figure') + TabOrder = 5 + end + object CBVolume: TComboBox + Left = 71 + Top = 151 + Width = 121 + Height = 21 + Style = csDropDownList + TabOrder = 6 + OnChange = CBVolumeChange + end end - object RBFinancial: TRadioButton - Left = 16 - Top = 93 - Width = 137 - Height = 17 - Caption = '&Financial' - TabOrder = 3 - OnClick = RBFinancialClick + object TabGeo: TTabSheet + Caption = 'Geographic' + ImageIndex = 3 + ExplicitLeft = 0 + ExplicitTop = 0 + ExplicitWidth = 0 + ExplicitHeight = 0 end - object RBGeo: TRadioButton - Left = 16 - Top = 116 - Width = 137 - Height = 17 - Caption = '&Geographic Maps' - TabOrder = 4 - OnClick = RBGeoClick + end + object Panel2: TPanel + Left = 0 + Top = 0 + Width = 129 + Height = 332 + Align = alLeft + BevelOuter = bvNone + TabOrder = 1 + object GroupBox1: TGroupBox + Left = 3 + Top = 3 + Width = 112 + Height = 149 + Caption = '&Mode:' + TabOrder = 0 + object RBAuto: TRadioButton + Left = 8 + Top = 19 + Width = 88 + Height = 17 + Caption = '&Automatic' + TabOrder = 0 + OnClick = RBAutoClick + end + object RBXY: TRadioButton + Left = 8 + Top = 43 + Width = 66 + Height = 17 + Caption = '&2D' + TabOrder = 1 + OnClick = RBXYClick + end + object RB3D: TRadioButton + Left = 8 + Top = 68 + Width = 89 + Height = 17 + Caption = '&3D' + TabOrder = 2 + OnClick = RB3DClick + end + object RBFinancial: TRadioButton + Left = 8 + Top = 94 + Width = 89 + Height = 17 + Caption = '&Financial' + TabOrder = 3 + OnClick = RBFinancialClick + end + object RBGeo: TRadioButton + Left = 8 + Top = 119 + Width = 88 + Height = 17 + Caption = '&Geographic' + TabOrder = 4 + OnClick = RBGeoClick + end end + object RGDirection: TRadioGroup + Left = 3 + Top = 162 + Width = 112 + Height = 89 + Caption = 'Direction:' + Items.Strings = ( + 'Automatic' + 'By Rows' + 'By Columns') + TabOrder = 1 + OnClick = RGDirectionClick + end + end + end + object TabView: TTabSheet + Caption = 'View' + ImageIndex = 3 + ExplicitLeft = 0 + ExplicitTop = 0 + ExplicitWidth = 0 + ExplicitHeight = 0 + object RGView: TRadioGroup + Left = 11 + Top = 16 + Width = 134 + Height = 137 + Caption = '&Dimensions:' + ItemIndex = 0 + Items.Strings = ( + 'Automatic' + '2D' + '2D Orthogonal' + '3D') + TabOrder = 0 + OnClick = RGViewClick + end + object CBOpenGL: TCheckBox + Left = 19 + Top = 166 + Width = 110 + Height = 17 + Caption = '&Open GL' + TabOrder = 1 + OnClick = CBOpenGLClick + end + object RGLegend: TRadioGroup + Left = 160 + Top = 16 + Width = 105 + Height = 89 + Caption = '&Legend:' + Items.Strings = ( + 'Automatic' + 'Show' + 'Hide') + TabOrder = 2 + OnClick = RGLegendClick + end + object RGMarks: TRadioGroup + Left = 160 + Top = 111 + Width = 105 + Height = 90 + Caption = '&Marks:' + Items.Strings = ( + 'Automatic' + 'Show' + 'Hide') + TabOrder = 3 + OnClick = RGMarksClick end end object TabChart: TTabSheet Caption = 'Chart' ImageIndex = 1 + ExplicitLeft = 0 + ExplicitTop = 0 + ExplicitWidth = 0 + ExplicitHeight = 0 + object ChartEditorPanel1: TChartEditorPanel + Left = 0 + Top = 0 + Width = 483 + Height = 332 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + end end object TabData: TTabSheet Caption = 'Data' ImageIndex = 2 + ExplicitLeft = 0 + ExplicitTop = 0 + ExplicitWidth = 0 + ExplicitHeight = 0 object Panel1: TPanel Left = 0 Top = 0 - Width = 495 + Width = 483 Height = 41 Align = alTop BevelOuter = bvNone @@ -111,8 +784,8 @@ object BIChartEditor: TBIChartEditor object BIGrid1: TBIGrid Left = 0 Top = 41 - Width = 495 - Height = 344 + Width = 483 + Height = 291 Align = alClient UseDockManager = False ParentBackground = False @@ -123,14 +796,14 @@ object BIChartEditor: TBIChartEditor end object PanelButtons: TPanel Left = 0 - Top = 413 - Width = 503 + Top = 360 + Width = 491 Height = 37 Align = alBottom BevelOuter = bvNone TabOrder = 1 object Panel9: TPanel - Left = 400 + Left = 388 Top = 0 Width = 103 Height = 37 diff --git a/src/delphi/VCL/BI.VCL.Editor.Chart.pas b/src/delphi/VCL/BI.VCL.Editor.Chart.pas index fd1a57c..00e7938 100644 --- a/src/delphi/VCL/BI.VCL.Editor.Chart.pas +++ b/src/delphi/VCL/BI.VCL.Editor.Chart.pas @@ -1,12 +1,26 @@ +{*********************************************} +{ TeeBI Software Library } +{ BIChart Editor dialog } +{ Copyright (c) 2015-2016 by Steema Software } +{ All Rights Reserved } +{*********************************************} unit BI.VCL.Editor.Chart; interface +{ + This dialog is used to edit BIChart controls. + + It offers the UI to change all properties that BIChart has in addition of the + normal TChart properties, as well as allowing changing the Data to chart. +} + uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ComCtrls, Vcl.StdCtrls, Vcl.ExtCtrls, VclTee.TeeConst, VclTee.TeeEditCha, BI.VCL.Chart, BI.VCL.DataControl, - BI.VCL.Grid; + BI.VCL.Grid, Vcl.Buttons, Vcl.CheckLst, BI.Data, + BI.VCL.Editor.ListItems, VCLTee.TeeProcs, VCLTee.TeeEdit; type TBIChartEditor = class(TForm) @@ -20,12 +34,69 @@ TBIChartEditor = class(TForm) Panel1: TPanel; Button1: TButton; BIGrid1: TBIGrid; + PageMode: TPageControl; + Tab2D: TTabSheet; + Tab3D: TTabSheet; + Panel3D: TPanel; + BSwapXY: TSpeedButton; + BSwapYZ: TSpeedButton; + BSwapXZ: TSpeedButton; + Shape1: TShape; + Shape2: TShape; + Label4: TLabel; + Label5: TLabel; + Label6: TLabel; + CBX: TComboBox; + CBY: TComboBox; + CBZ: TComboBox; + LB3D: TListBox; + LBXYZ: TListBox; + RG3D: TRadioGroup; + Panel2: TPanel; GroupBox1: TGroupBox; RBAuto: TRadioButton; RBXY: TRadioButton; RB3D: TRadioButton; RBFinancial: TRadioButton; RBGeo: TRadioButton; + RGDirection: TRadioGroup; + TabFinancial: TTabSheet; + TabGeo: TTabSheet; + Label7: TLabel; + CBOpen: TComboBox; + CBAutoFinancial: TCheckBox; + CBClose: TComboBox; + Label8: TLabel; + Label9: TLabel; + CBHigh: TComboBox; + Label10: TLabel; + CBLow: TComboBox; + LBFinancial: TListBox; + CB3D: TCheckBox; + PanelYTable: TPanel; + TabView: TTabSheet; + RGView: TRadioGroup; + CBOpenGL: TCheckBox; + RGLegend: TRadioGroup; + RGMarks: TRadioGroup; + ChartEditorPanel1: TChartEditorPanel; + Label12: TLabel; + CBVolume: TComboBox; + Panel3: TPanel; + GroupBox2: TLabel; + LB2D: TListBox; + Label11: TLabel; + CBStacked: TComboBox; + Panel4: TPanel; + PanelItems: TPanel; + Label1: TLabel; + Label2: TLabel; + Label3: TLabel; + CBX2D: TComboBox; + CBText: TComboBox; + CBColors: TComboBox; + PanelY: TPanel; + CBHoriz2D: TComboBox; procedure PageControl1Change(Sender: TObject); procedure Button1Click(Sender: TObject); procedure FormCreate(Sender: TObject); @@ -35,16 +106,65 @@ TBIChartEditor = class(TForm) procedure RB3DClick(Sender: TObject); procedure RBFinancialClick(Sender: TObject); procedure RBGeoClick(Sender: TObject); + procedure RG3DClick(Sender: TObject); + procedure LB2DClick(Sender: TObject); + procedure BSwapXYClick(Sender: TObject); + procedure BSwapYZClick(Sender: TObject); + procedure BSwapXZClick(Sender: TObject); + procedure CBTextChange(Sender: TObject); + procedure LB3DClick(Sender: TObject); + procedure CBX2DChange(Sender: TObject); + procedure RGDirectionClick(Sender: TObject); + procedure LBXYZClick(Sender: TObject); + procedure CBXChange(Sender: TObject); + procedure CBYChange(Sender: TObject); + procedure CBZChange(Sender: TObject); + procedure RGViewClick(Sender: TObject); + procedure CBOpenGLClick(Sender: TObject); + procedure RGLegendClick(Sender: TObject); + procedure RGMarksClick(Sender: TObject); + procedure CBOpenChange(Sender: TObject); + procedure CBCloseChange(Sender: TObject); + procedure CBHighChange(Sender: TObject); + procedure CBLowChange(Sender: TObject); + procedure CBVolumeChange(Sender: TObject); + procedure CBStackedChange(Sender: TObject); + procedure CBHoriz2DChange(Sender: TObject); private { Private declarations } - Chart : TBIChart; + FChart : TBIChart; + + IChanging : Boolean; + + IListY, + IListYTable : TFormListItems; - IEditor : TChartEditForm; + procedure Changed3DItem; + procedure ChangeY(const AIndex:Integer; const ACombo:TComboBox); + function CurrentText:TDataItem; + function DataOf(const ACombo:TComboBox):TDataItem; + procedure DoExchange(const A,B:TComboBox); + procedure Recreate; + procedure RecreateY(Sender:TObject); + procedure ResetEditor; + procedure SetModeOptions; + procedure SetPostSettings; + procedure SetChart(const Value: TBIChart); + protected + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + procedure RefreshData(const AItems:TBIChartItems); overload; public { Public declarations } class procedure Edit(const AOwner:TComponent; const AChart:TBIChart); static; + + class function Embedd(const AOwner:TComponent; const AParent:TWinControl; + const AChart:TBIChart):TBIChartEditor; static; + + procedure RefreshData; overload; + + property Chart:TBIChart read FChart write SetChart; end; implementation diff --git a/src/delphi/VCL/BI.VCL.Editor.DataComponent.pas b/src/delphi/VCL/BI.VCL.Editor.DataComponent.pas index befe8fd..b28d50b 100644 --- a/src/delphi/VCL/BI.VCL.Editor.DataComponent.pas +++ b/src/delphi/VCL/BI.VCL.Editor.DataComponent.pas @@ -46,12 +46,15 @@ TDataComponent = class(TForm) FOnFilter : TFilterEvent; FOnSelected : TNotifyEvent; - procedure Add(const AParent:TTreeNode; const AComponent:TComponent; const AName:String); + function CalcName(const AComponent:TComponent; const AName:String):String; function CanAdd(const AComponent:TComponent):Boolean; procedure FillTree; protected FCurrent : TObject; + procedure Add(const AParent:TTreeNode; const AComponent:TComponent; const AName:String); overload; + procedure Add(const AParent,AComponent:TComponent); overload; + function NodeOf(const AObject:TObject):TTreeNode; function SelectedHasData:Boolean; procedure TryFreeData; public diff --git a/src/delphi/VCL/BI.VCL.Editor.DataSet.dfm b/src/delphi/VCL/BI.VCL.Editor.DataSet.dfm index 4094b31..27d5515 100644 --- a/src/delphi/VCL/BI.VCL.Editor.DataSet.dfm +++ b/src/delphi/VCL/BI.VCL.Editor.DataSet.dfm @@ -91,6 +91,8 @@ object BIDataSetEditor: TBIDataSetEditor ExplicitHeight = 347 object TabOptions: TTabSheet Caption = 'Options' + ExplicitLeft = 0 + ExplicitTop = 0 ExplicitWidth = 514 ExplicitHeight = 319 object Panel3: TPanel @@ -147,6 +149,8 @@ object BIDataSetEditor: TBIDataSetEditor object TabData: TTabSheet Caption = 'Data' ImageIndex = 1 + ExplicitLeft = 0 + ExplicitTop = 0 ExplicitWidth = 514 ExplicitHeight = 319 end diff --git a/src/delphi/VCL/BI.VCL.Editor.DateTimeRange.dfm b/src/delphi/VCL/BI.VCL.Editor.DateTimeRange.dfm new file mode 100644 index 0000000..172f8bf --- /dev/null +++ b/src/delphi/VCL/BI.VCL.Editor.DateTimeRange.dfm @@ -0,0 +1,216 @@ +object DateTimeRangeEditor: TDateTimeRangeEditor + Left = 0 + Top = 0 + Caption = 'DateTime Range Editor' + ClientHeight = 260 + ClientWidth = 449 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + OnCreate = FormCreate + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 0 + Top = 0 + Width = 449 + Height = 260 + ActivePage = TabRange + Align = alClient + TabOrder = 0 + ExplicitLeft = 328 + ExplicitTop = 96 + ExplicitWidth = 289 + ExplicitHeight = 193 + object TabRange: TTabSheet + Caption = 'Range' + ExplicitWidth = 281 + ExplicitHeight = 165 + object Label1: TLabel + Left = 6 + Top = 6 + Width = 28 + Height = 13 + Caption = 'From:' + end + object Label2: TLabel + Left = 6 + Top = 50 + Width = 16 + Height = 13 + Caption = 'To:' + end + object CBDay: TComboBox + Left = 6 + Top = 23 + Width = 51 + Height = 21 + Style = csDropDownList + DropDownCount = 31 + TabOrder = 0 + OnChange = CBDayChange + end + object CBMonth: TComboBox + Left = 75 + Top = 23 + Width = 110 + Height = 21 + Style = csDropDownList + DropDownCount = 13 + TabOrder = 1 + OnChange = CBMonthChange + end + object CBYear: TComboBox + Left = 203 + Top = 23 + Width = 70 + Height = 21 + Style = csDropDownList + DropDownCount = 13 + TabOrder = 2 + OnChange = CBYearChange + end + object CBDayTo: TComboBox + Left = 6 + Top = 66 + Width = 51 + Height = 21 + Style = csDropDownList + DropDownCount = 31 + TabOrder = 3 + OnChange = CBDayToChange + end + object CBMonthTo: TComboBox + Left = 75 + Top = 66 + Width = 110 + Height = 21 + Style = csDropDownList + DropDownCount = 13 + TabOrder = 4 + OnChange = CBMonthToChange + end + object CBYearTo: TComboBox + Left = 203 + Top = 66 + Width = 70 + Height = 21 + Style = csDropDownList + DropDownCount = 13 + TabOrder = 5 + OnChange = CBYearToChange + end + object CBPeriod: TComboBox + Left = 6 + Top = 104 + Width = 115 + Height = 21 + Style = csDropDownList + TabOrder = 6 + OnChange = CBPeriodChange + Items.Strings = ( + 'Custom' + 'All time' + 'Today' + 'Yesterday' + 'This' + 'Last' + 'Next') + end + object CBPeriod2: TComboBox + Left = 134 + Top = 104 + Width = 115 + Height = 21 + Style = csDropDownList + Enabled = False + TabOrder = 7 + OnChange = CBPeriod2Change + Items.Strings = ( + 'Week' + 'Month' + 'Quarter' + 'Year') + end + end + object TabCalendar: TTabSheet + Caption = 'Calendar' + ImageIndex = 1 + ExplicitWidth = 281 + ExplicitHeight = 165 + object Label3: TLabel + Left = 5 + Top = 3 + Width = 28 + Height = 13 + Caption = '&From:' + FocusControl = CalendarFrom + end + object Label4: TLabel + Left = 192 + Top = 3 + Width = 16 + Height = 13 + Caption = '&To:' + FocusControl = CalendarTo + end + object CalendarFrom: TMonthCalendar + Left = 3 + Top = 20 + Width = 170 + Height = 143 + Date = 42509.598440671300000000 + ShowToday = False + ShowTodayCircle = False + TabOrder = 0 + OnClick = CalendarFromClick + end + object CalendarTo: TMonthCalendar + Left = 192 + Top = 20 + Width = 169 + Height = 143 + Date = 42509.599302245370000000 + ShowToday = False + ShowTodayCircle = False + TabOrder = 1 + OnClick = CalendarFromClick + end + end + object TabSheet3: TTabSheet + Caption = 'Selected' + ImageIndex = 2 + ExplicitLeft = 8 + ExplicitTop = 28 + object PanelMonths: TPanel + Left = 0 + Top = 0 + Width = 185 + Height = 232 + Align = alLeft + BevelOuter = bvNone + TabOrder = 0 + ExplicitLeft = 128 + ExplicitTop = 96 + ExplicitHeight = 41 + end + object PanelWeeks: TPanel + Left = 185 + Top = 0 + Width = 185 + Height = 232 + Align = alLeft + BevelOuter = bvNone + TabOrder = 1 + ExplicitLeft = 128 + ExplicitTop = 96 + ExplicitHeight = 41 + end + end + end +end diff --git a/src/delphi/VCL/BI.VCL.Editor.DateTimeRange.pas b/src/delphi/VCL/BI.VCL.Editor.DateTimeRange.pas new file mode 100644 index 0000000..e579136 --- /dev/null +++ b/src/delphi/VCL/BI.VCL.Editor.DateTimeRange.pas @@ -0,0 +1,78 @@ +unit BI.VCL.Editor.DateTimeRange; + +interface + +uses + Winapi.Windows, Winapi.Messages, System.SysUtils, System.Classes, Vcl.Graphics, + Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, + BI.Data, Vcl.ComCtrls, BI.VCL.Editor.ListItems, Vcl.ExtCtrls, + BI.Expression; + +type + TDateTimeRangeEditor = class(TForm) + PageControl1: TPageControl; + TabRange: TTabSheet; + TabCalendar: TTabSheet; + TabSheet3: TTabSheet; + Label1: TLabel; + CBDay: TComboBox; + CBMonth: TComboBox; + CBYear: TComboBox; + Label2: TLabel; + CBDayTo: TComboBox; + CBMonthTo: TComboBox; + CBYearTo: TComboBox; + CBPeriod: TComboBox; + CBPeriod2: TComboBox; + CalendarFrom: TMonthCalendar; + CalendarTo: TMonthCalendar; + Label3: TLabel; + Label4: TLabel; + PanelMonths: TPanel; + PanelWeeks: TPanel; + procedure CBYearChange(Sender: TObject); + procedure CBMonthChange(Sender: TObject); + procedure CBYearToChange(Sender: TObject); + procedure CBMonthToChange(Sender: TObject); + procedure CBPeriodChange(Sender: TObject); + procedure CBPeriod2Change(Sender: TObject); + procedure CalendarFromClick(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure CBDayChange(Sender: TObject); + procedure CBDayToChange(Sender: TObject); + private + { Private declarations } + + IChanging : Boolean; + + FOnChanged : TNotifyEvent; + + IMonths, + IWeeks : TFormListItems; + + procedure ChangedSelected(Sender: TObject); + function DateFrom(const AYear,AMonth,ADay:TComboBox):TDateTime; + procedure DoAddDays(const AYear,AMonth,ADay:TComboBox; First:Boolean); + procedure DoAddMonths(const AYear,AMonth:TComboBox; First:Boolean); + procedure Modified; + procedure SelectCombos(const AFrom,ATo:TDateTime); + procedure SetCustom; + public + { Public declarations } + + Data : TDataItem; + + function Filter:TLogicalExpression; + + function FromDate:TDateTime; + function ToDate:TDateTime; + + procedure Refresh(const AData:TDataItem); + procedure SelectRange(const AFrom,ATo:TDateTime); overload; + procedure SelectRange(const AData:TDataItem); overload; + + property OnChanged:TNotifyEvent read FOnChanged write FOnChanged; + end; + +implementation diff --git a/src/delphi/VCL/BI.VCL.Editor.DynamicFilter.dfm b/src/delphi/VCL/BI.VCL.Editor.DynamicFilter.dfm new file mode 100644 index 0000000..bb3232a --- /dev/null +++ b/src/delphi/VCL/BI.VCL.Editor.DynamicFilter.dfm @@ -0,0 +1,146 @@ +object DynamicFilterEditor: TDynamicFilterEditor + Left = 0 + Top = 0 + Caption = 'Filter Editor' + ClientHeight = 623 + ClientWidth = 418 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + Position = poOwnerFormCenter + OnCreate = FormCreate + OnDestroy = FormDestroy + PixelsPerInch = 96 + TextHeight = 13 + object BITree1: TBITree + Left = 0 + Top = 57 + Width = 418 + Height = 295 + Align = alClient + UseDockManager = False + ParentBackground = False + ParentColor = False + TabOrder = 0 + OnChange = BITree1Change + ExplicitHeight = 525 + end + object PanelCustom: TPanel + Left = 0 + Top = 0 + Width = 418 + Height = 57 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + OnResize = PanelCustomResize + object SBCustom: TSpeedButton + Left = 386 + Top = 8 + Width = 23 + Height = 22 + Caption = '...' + OnClick = SBCustomClick + end + object LError: TLabel + Left = 95 + Top = 38 + Width = 3 + Height = 13 + Font.Charset = DEFAULT_CHARSET + Font.Color = clMaroon + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + ParentFont = False + end + object Panel2: TPanel + Left = 0 + Top = 0 + Width = 89 + Height = 57 + Align = alLeft + BevelOuter = bvNone + TabOrder = 0 + object CBCustom: TComboBox + Left = 8 + Top = 9 + Width = 65 + Height = 21 + Style = csDropDownList + ItemIndex = 0 + TabOrder = 0 + Text = 'and' + OnChange = CBCustomChange + Items.Strings = ( + 'and' + 'or') + end + end + object ECustom: TEdit + Left = 95 + Top = 9 + Width = 282 + Height = 21 + TabOrder = 1 + OnChange = ECustomChange + end + end + object PanelButtons: TPanel + Left = 0 + Top = 582 + Width = 418 + Height = 41 + Align = alBottom + BevelOuter = bvNone + TabOrder = 2 + object Panel1: TPanel + Left = 233 + Top = 0 + Width = 185 + Height = 41 + Align = alRight + BevelOuter = bvNone + TabOrder = 0 + object Button1: TButton + Left = 8 + Top = 8 + Width = 75 + Height = 25 + Caption = 'OK' + ModalResult = 1 + TabOrder = 0 + end + object Button2: TButton + Left = 96 + Top = 8 + Width = 75 + Height = 25 + Cancel = True + Caption = 'Cancel' + Default = True + ModalResult = 2 + TabOrder = 1 + end + end + end + object PageItem: TPageControl + Left = 0 + Top = 352 + Width = 418 + Height = 230 + ActivePage = TabDateTime + Align = alBottom + TabOrder = 3 + Visible = False + object TabDateTime: TTabSheet + Caption = 'Date Time' + ExplicitTop = 6 + ExplicitHeight = 108 + end + end +end diff --git a/src/delphi/VCL/BI.VCL.Editor.DynamicFilter.pas b/src/delphi/VCL/BI.VCL.Editor.DynamicFilter.pas new file mode 100644 index 0000000..74ad343 --- /dev/null +++ b/src/delphi/VCL/BI.VCL.Editor.DynamicFilter.pas @@ -0,0 +1,119 @@ +{*********************************************} +{ TeeBI Software Library } +{ Dynamic Filter Editor } +{ Copyright (c) 2015-2016 by Steema Software } +{ All Rights Reserved } +{*********************************************} +unit BI.VCL.Editor.DynamicFilter; + +interface + +{ + This dialog fills a tree with all possible Data Values that can be accessed + from a given AData parameter. + + The tree enables checking and unchecking individual items to build a Filter + expression that can be then used in for example a BIGrid to display rows that + match the selected items. + + Example 1: + Using this editor embedded into a Form: + + uses + BI.Persist, BI.VCL.Editor.DynamicFilter; + + var IEditor : TDynamicFilterEditor; + + procedure TFormTest.FilterChanged(Sender: TObject); + begin + BIGrid1.SetFilter(IEditor.Filter); + end; + + procedure TFormTest.FormCreate(Sender: TObject); + begin + BIGrid1.Data:=TStore.load('SQLite_Demo')['"Order Details"']; + + IEditor:=TDynamicFilterEditor.Embedd(Self,Panel1,BIGrid1.Data); + IEditor.OnChange:=FilterChanged; + end; + + + Example 2: + Using this editor as a modal dialog: + + procedure TForm23.Button2Click(Sender: TObject); + begin + BIGrid1.SetFilter(TDynamicFilterEditor.Choose(Self,BIGrid1.Data)); + end; + +} + +uses + Winapi.Windows, Winapi.Messages, System.SysUtils, System.Classes, Vcl.Graphics, + Vcl.Controls, Vcl.Forms, Vcl.Dialogs, BI.VCL.DataControl, + BI.VCL.Tree, BI.Data, Vcl.StdCtrls, Vcl.ExtCtrls, Vcl.ComCtrls, BI.Expression, + BI.VCL.Editor.Expression, Vcl.Buttons, BI.VCL.Editor.DateTimeRange; + +type + TDynamicFilterEditor = class(TForm) + BITree1: TBITree; + PanelCustom: TPanel; + Panel2: TPanel; + CBCustom: TComboBox; + PanelButtons: TPanel; + Panel1: TPanel; + Button1: TButton; + Button2: TButton; + ECustom: TEdit; + SBCustom: TSpeedButton; + LError: TLabel; + PageItem: TPageControl; + TabDateTime: TTabSheet; + procedure FormCreate(Sender: TObject); + procedure ECustomChange(Sender: TObject); + procedure FormDestroy(Sender: TObject); + procedure CBCustomChange(Sender: TObject); + procedure SBCustomClick(Sender: TObject); + procedure PanelCustomResize(Sender: TObject); + procedure BITree1Change(Sender: TObject); + private + { Private declarations } + + IChecking : Boolean; + + ICustom : TLogicalExpression; + + IData, + IMainData : TDataItem; + + IDateTimeRange : TDateTimeRangeEditor; + + FOnChange: TNotifyEvent; + + procedure AddMapValues(const AParent:TBITreeNode; const AData:TDataItem); + procedure ChangedDateTime(Sender: TObject); + procedure DoChanged; + procedure Expanding(Sender: TObject; Node: TTreeNode; var AllowExpansion: Boolean); + function HasDummy(const ANode:TBITreeNode):Boolean; + function Resolver(const S:String; IsFunction:Boolean):TExpression; + procedure TreeChecked(Sender: TObject); + procedure TryChangeExpression(const AExp:TExpression); + public + { Public declarations } + + class function Choose(const AData:TDataItem; + const AMain:TDataItem=nil):TLogicalExpression; static; + + class function Embedd(const AOwner:TComponent; + const AParent:TWinControl; + const AData:TDataItem; + const AMain:TDataItem=nil):TDynamicFilterEditor; static; + + function Filter:TLogicalExpression; + + procedure Refresh(const AData:TDataItem; const AMain:TDataItem=nil); + + property OnChange:TNotifyEvent read FOnChange write FOnChange; + end; + +implementation diff --git a/src/delphi/VCL/BI.VCL.Editor.Expression.dfm b/src/delphi/VCL/BI.VCL.Editor.Expression.dfm index de78047..49cafdc 100644 --- a/src/delphi/VCL/BI.VCL.Editor.Expression.dfm +++ b/src/delphi/VCL/BI.VCL.Editor.Expression.dfm @@ -54,7 +54,6 @@ object ExpressionEditor: TExpressionEditor BevelOuter = bvNone TabOrder = 1 OnResize = Panel2Resize - ExplicitLeft = 239 object BITree2: TBITree Left = 0 Top = 113 @@ -68,8 +67,6 @@ object ExpressionEditor: TExpressionEditor OnDragDrop = BITree2DragDrop OnDragOver = BITree2DragOver OnChange = BITree2Change - ExplicitLeft = 3 - ExplicitHeight = 389 end object Panel3: TPanel Left = 0 @@ -129,7 +126,6 @@ object ExpressionEditor: TExpressionEditor Align = alBottom BevelOuter = bvNone TabOrder = 2 - ExplicitLeft = 3 object BDelete: TButton Left = 16 Top = 6 diff --git a/src/delphi/VCL/BI.VCL.Editor.Expression.pas b/src/delphi/VCL/BI.VCL.Editor.Expression.pas index c5bca50..3d19544 100644 --- a/src/delphi/VCL/BI.VCL.Editor.Expression.pas +++ b/src/delphi/VCL/BI.VCL.Editor.Expression.pas @@ -57,8 +57,10 @@ TExpressionEditor = class(TForm) Resolver : TResolveProc; - class function EditNew(const AOwner:TComponent):TExpression; static; - class function Edit(const AOwner:TComponent; var AExpression:TExpression):Boolean; static; + class function EditNew(const AOwner:TComponent; + const AResolver:TResolveProc=nil):TExpression; static; + class function Edit(const AOwner:TComponent; var AExpression:TExpression; + const AResolver:TResolveProc=nil):Boolean; static; class function Embedd(const AOwner:TComponent; const AParent:TWinControl):TExpressionEditor; static; procedure Refresh(const AExpression:TExpression); diff --git a/src/delphi/VCL/BI.VCL.Editor.ListItems.dfm b/src/delphi/VCL/BI.VCL.Editor.ListItems.dfm new file mode 100644 index 0000000..f30bc0c --- /dev/null +++ b/src/delphi/VCL/BI.VCL.Editor.ListItems.dfm @@ -0,0 +1,80 @@ +object FormListItems: TFormListItems + Left = 0 + Top = 0 + Caption = 'Items' + ClientHeight = 291 + ClientWidth = 331 + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + PixelsPerInch = 96 + TextHeight = 13 + object LBItems: TCheckListBox + Left = 0 + Top = 33 + Width = 331 + Height = 258 + OnClickCheck = LBItemsClickCheck + Align = alClient + DragMode = dmAutomatic + ItemHeight = 13 + TabOrder = 0 + OnClick = LBItemsClick + OnDragDrop = LBItemsDragDrop + OnDragOver = LBItemsDragOver + end + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 331 + Height = 33 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + OnResize = Panel1Resize + object SBUp: TSpeedButton + Left = 5 + Top = 4 + Width = 23 + Height = 22 + Caption = '^' + Enabled = False + Flat = True + OnClick = SBUpClick + end + object SBDown: TSpeedButton + Left = 34 + Top = 4 + Width = 23 + Height = 22 + Caption = 'v' + Enabled = False + Flat = True + OnClick = SBDownClick + end + object BAll: TButton + Left = 71 + Top = 2 + Width = 50 + Height = 25 + Caption = '&All' + Enabled = False + TabOrder = 0 + OnClick = BAllClick + end + object BNone: TButton + Left = 133 + Top = 2 + Width = 57 + Height = 25 + Caption = '&None' + Enabled = False + TabOrder = 1 + OnClick = BNoneClick + end + end +end diff --git a/src/delphi/VCL/BI.VCL.Editor.ListItems.pas b/src/delphi/VCL/BI.VCL.Editor.ListItems.pas new file mode 100644 index 0000000..07246dd --- /dev/null +++ b/src/delphi/VCL/BI.VCL.Editor.ListItems.pas @@ -0,0 +1,65 @@ +unit BI.VCL.Editor.ListItems; + +interface + +uses + Winapi.Windows, Winapi.Messages, System.SysUtils, System.Classes, Vcl.Graphics, + Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.Buttons, Vcl.ExtCtrls, Vcl.StdCtrls, + Vcl.CheckLst, BI.Data; + +type + TListItemsEvent=procedure(const AItems:TDataArray; const ARefresh:Boolean) of object; + + TFormListItems = class(TForm) + LBItems: TCheckListBox; + Panel1: TPanel; + SBUp: TSpeedButton; + SBDown: TSpeedButton; + BAll: TButton; + BNone: TButton; + procedure LBItemsClick(Sender: TObject); + procedure LBItemsDragDrop(Sender, Source: TObject; X, Y: Integer); + procedure LBItemsDragOver(Sender, Source: TObject; X, Y: Integer; + State: TDragState; var Accept: Boolean); + procedure LBItemsClickCheck(Sender: TObject); + procedure SBDownClick(Sender: TObject); + procedure SBUpClick(Sender: TObject); + procedure BAllClick(Sender: TObject); + procedure BNoneClick(Sender: TObject); + procedure Panel1Resize(Sender: TObject); + private + { Private declarations } + + FOnChanged : TNotifyEvent; + + procedure DoChanged; + procedure EnableCheckButtons; + procedure Exchange(const A,B:Integer); + procedure Recreate; + + public + { Public declarations } + + class procedure AddCombo(const ACombo:TComboBox; const AData:Array of TDataItem); static; + + class procedure AddItems(const AItems:TStrings; const AData:Array of TDataItem; + const AddBlank:Boolean=True); overload; static; + + procedure AddItems(const AData:Array of TDataItem; + const AddBlank:Boolean=True); overload; + + procedure CheckAll(const ACheck:Boolean); + function CheckedCount:Integer; + + procedure EnableDrag(const AEnabled:Boolean); + + class procedure DoAddItems(const AItems:TStrings; const AData:Array of TDataItem); static; + + function Items:TDataArray; + + procedure TryAdd(const AData:TDataItem); + + property OnChanged:TNotifyEvent read FOnChanged write FOnChanged; + end; + +implementation diff --git a/src/delphi/VCL/BI.VCL.Editor.Query.dfm b/src/delphi/VCL/BI.VCL.Editor.Query.dfm index 91f4c8e..983484e 100644 --- a/src/delphi/VCL/BI.VCL.Editor.Query.dfm +++ b/src/delphi/VCL/BI.VCL.Editor.Query.dfm @@ -14,6 +14,7 @@ object BIQueryEditor: TBIQueryEditor OnCloseQuery = FormCloseQuery OnCreate = FormCreate OnDestroy = FormDestroy + OnShow = FormShow PixelsPerInch = 96 TextHeight = 13 object SplitterSelector: TSplitter @@ -32,612 +33,624 @@ object BIQueryEditor: TBIQueryEditor Align = alLeft BevelOuter = bvNone TabOrder = 0 - ExplicitHeight = 627 + object PageData: TPageControl + Left = 0 + Top = 0 + Width = 257 + Height = 619 + ActivePage = TabFilter + Align = alClient + TabOrder = 0 + OnChange = PageDataChange + object TabData: TTabSheet + Caption = 'Data' + end + object TabFilter: TTabSheet + Caption = 'Filter' + ImageIndex = 1 + object PanelFilter: TPanel + Left = 0 + Top = 0 + Width = 249 + Height = 50 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object CBFilter: TCheckBox + Left = 10 + Top = 11 + Width = 79 + Height = 17 + Caption = 'Enabled' + TabOrder = 0 + OnClick = CBFilterClick + end + end + end + end end - object PanelEdit: TPanel + object OuterPanel: TPanel Left = 260 Top = 0 Width = 644 Height = 619 Align = alClient - BevelOuter = bvNone TabOrder = 1 - ExplicitHeight = 627 - object Splitter1: TSplitter - Left = 0 - Top = 326 - Width = 644 - Height = 3 - Cursor = crVSplit - Align = alBottom - ExplicitTop = 0 - ExplicitWidth = 312 - end - object BIGrid1: TBIGrid - Left = 0 - Top = 329 - Width = 644 - Height = 290 - Align = alBottom - UseDockManager = False - ParentBackground = False - ParentColor = False - TabOrder = 0 - ExplicitTop = 337 - end - object PanelRows: TPanel - Left = 0 - Top = 75 - Width = 185 - Height = 210 - Align = alLeft - Color = clWhite - ParentBackground = False + object PanelEdit: TPanel + Left = 1 + Top = 1 + Width = 642 + Height = 312 + Align = alTop + BevelOuter = bvNone TabOrder = 1 - ExplicitHeight = 218 - object Panel1: TPanel - Left = 1 - Top = 1 - Width = 183 - Height = 41 - Align = alTop - BevelOuter = bvNone + object Splitter1: TSplitter + Left = 0 + Top = 309 + Width = 642 + Height = 3 + Cursor = crVSplit + Align = alBottom + ExplicitTop = 0 + ExplicitWidth = 312 + end + object PanelRows: TPanel + Left = 0 + Top = 75 + Width = 185 + Height = 234 + Align = alLeft + Color = clWhite + ParentBackground = False TabOrder = 0 - object Label2: TLabel - Left = 8 - Top = 14 - Width = 26 - Height = 13 - Caption = 'Rows' - end - object SBRowUp: TSpeedButton - Left = 119 - Top = 9 - Width = 23 - Height = 22 - Caption = '^' - Enabled = False - OnClick = SBRowUpClick + object Panel1: TPanel + Left = 1 + Top = 1 + Width = 183 + Height = 41 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object Label2: TLabel + Left = 8 + Top = 14 + Width = 26 + Height = 13 + Caption = 'Rows' + end + object SBRowUp: TSpeedButton + Left = 119 + Top = 9 + Width = 23 + Height = 22 + Caption = '^' + Enabled = False + OnClick = SBRowUpClick + end + object SBRowDown: TSpeedButton + Left = 147 + Top = 9 + Width = 23 + Height = 22 + Caption = 'v' + Enabled = False + OnClick = SBRowDownClick + end + object BDeleteRow: TButton + Left = 51 + Top = 7 + Width = 59 + Height = 25 + Caption = 'Delete' + Enabled = False + TabOrder = 0 + OnClick = BDeleteRowClick + end end - object SBRowDown: TSpeedButton - Left = 147 - Top = 9 - Width = 23 - Height = 22 - Caption = 'v' - Enabled = False - OnClick = SBRowDownClick + object ListRows: TCheckListBox + Left = 1 + Top = 42 + Width = 183 + Height = 103 + OnClickCheck = ListRowsClickCheck + Align = alClient + ItemHeight = 13 + TabOrder = 1 + OnClick = ListRowsClick + OnDragDrop = ListRowsDragDrop + OnDragOver = ListRowsDragOver end - object BDeleteRow: TButton - Left = 51 - Top = 7 - Width = 59 - Height = 25 - Caption = 'Delete' - Enabled = False - TabOrder = 0 - OnClick = BDeleteRowClick + object Panel4: TPanel + Left = 1 + Top = 145 + Width = 183 + Height = 88 + Align = alBottom + TabOrder = 2 + object LMax: TLabel + Left = 10 + Top = 57 + Width = 24 + Height = 13 + Caption = '&Max:' + end + object CBDistinct: TCheckBox + Left = 10 + Top = 8 + Width = 77 + Height = 17 + Caption = 'Distinct' + Enabled = False + TabOrder = 0 + OnClick = CBDistinctClick + end + object CBRemoveRows: TCheckBox + Left = 10 + Top = 30 + Width = 137 + Height = 17 + Caption = 'Remove Missing' + Enabled = False + TabOrder = 1 + OnClick = CBRemoveRowsClick + end + object EMax: TEdit + Left = 50 + Top = 54 + Width = 83 + Height = 21 + TabOrder = 2 + OnChange = EMaxChange + end end end - object ListRows: TCheckListBox - Left = 1 - Top = 42 - Width = 183 - Height = 79 - OnClickCheck = ListRowsClickCheck - Align = alClient - ItemHeight = 13 + object PanelColumns: TPanel + Left = 0 + Top = 0 + Width = 642 + Height = 75 + Align = alTop + Color = clWhite + ParentBackground = False TabOrder = 1 - OnClick = ListRowsClick - OnDragDrop = ListRowsDragDrop - OnDragOver = ListRowsDragOver - ExplicitHeight = 87 - end - object Panel4: TPanel - Left = 1 - Top = 121 - Width = 183 - Height = 88 - Align = alBottom - TabOrder = 2 - ExplicitTop = 129 - object LMax: TLabel - Left = 10 - Top = 57 - Width = 24 - Height = 13 - Caption = '&Max:' - end - object CBDistinct: TCheckBox - Left = 10 - Top = 8 - Width = 77 - Height = 17 - Caption = 'Distinct' - Enabled = False + object Panel2: TPanel + Left = 1 + Top = 1 + Width = 183 + Height = 73 + Align = alLeft + Alignment = taRightJustify + BevelOuter = bvNone + Caption = 'Columns: ' TabOrder = 0 - OnClick = CBDistinctClick + object SBSwap: TSpeedButton + Left = 147 + Top = 46 + Width = 23 + Height = 22 + Glyph.Data = { + 36050000424D3605000000000000360400002800000010000000100000000100 + 08000000000000010000C40E0000C40E00000001000000000000000000000000 + 80000080000000808000800000008000800080800000C0C0C000C0DCC000F0CA + A6000020400000206000002080000020A0000020C0000020E000004000000040 + 20000040400000406000004080000040A0000040C0000040E000006000000060 + 20000060400000606000006080000060A0000060C0000060E000008000000080 + 20000080400000806000008080000080A0000080C0000080E00000A0000000A0 + 200000A0400000A0600000A0800000A0A00000A0C00000A0E00000C0000000C0 + 200000C0400000C0600000C0800000C0A00000C0C00000C0E00000E0000000E0 + 200000E0400000E0600000E0800000E0A00000E0C00000E0E000400000004000 + 20004000400040006000400080004000A0004000C0004000E000402000004020 + 20004020400040206000402080004020A0004020C0004020E000404000004040 + 20004040400040406000404080004040A0004040C0004040E000406000004060 + 20004060400040606000406080004060A0004060C0004060E000408000004080 + 20004080400040806000408080004080A0004080C0004080E00040A0000040A0 + 200040A0400040A0600040A0800040A0A00040A0C00040A0E00040C0000040C0 + 200040C0400040C0600040C0800040C0A00040C0C00040C0E00040E0000040E0 + 200040E0400040E0600040E0800040E0A00040E0C00040E0E000800000008000 + 20008000400080006000800080008000A0008000C0008000E000802000008020 + 20008020400080206000802080008020A0008020C0008020E000804000008040 + 20008040400080406000804080008040A0008040C0008040E000806000008060 + 20008060400080606000806080008060A0008060C0008060E000808000008080 + 20008080400080806000808080008080A0008080C0008080E00080A0000080A0 + 200080A0400080A0600080A0800080A0A00080A0C00080A0E00080C0000080C0 + 200080C0400080C0600080C0800080C0A00080C0C00080C0E00080E0000080E0 + 200080E0400080E0600080E0800080E0A00080E0C00080E0E000C0000000C000 + 2000C0004000C0006000C0008000C000A000C000C000C000E000C0200000C020 + 2000C0204000C0206000C0208000C020A000C020C000C020E000C0400000C040 + 2000C0404000C0406000C0408000C040A000C040C000C040E000C0600000C060 + 2000C0604000C0606000C0608000C060A000C060C000C060E000C0800000C080 + 2000C0804000C0806000C0808000C080A000C080C000C080E000C0A00000C0A0 + 2000C0A04000C0A06000C0A08000C0A0A000C0A0C000C0A0E000C0C00000C0C0 + 2000C0C04000C0C06000C0C08000C0C0A000F0FBFF00A4A0A000808080000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00FFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFF00000000000000FFFFFF00FFFFFFFFFF00FFFFFFFF + FF00FFFF0000FFFFFFFFFF00FFFFFFFFFF00FF000000000000FFFF00FFFFFFFF + FF00FFFF0000FFFF00FFFF00000000000000FFFFFF00FFFF00FFFFFFFFFFFFFF + FFFFFFFFFFFFFFFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFF00FFFFFFFF + FFFFFFFFFFFFFFFFFFFFFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFF00FF + FFFF00000000000000FFFF00FFFF0000FFFF00FFFFFFFFFF00FFFF0000000000 + 00FF00FFFFFFFFFF00FFFFFFFFFF0000FFFF00FFFFFFFFFF00FFFFFFFFFF00FF + FFFF00000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF} + OnClick = SBSwapClick + end + object SBSelector: TSpeedButton + Left = 5 + Top = 2 + Width = 23 + Height = 22 + Caption = '<<' + Flat = True + OnClick = SBSelectorClick + end end - object CBRemoveRows: TCheckBox - Left = 10 - Top = 30 - Width = 137 - Height = 17 - Caption = 'Remove Missing' - Enabled = False + object ListColumns: TCheckListBox + Left = 184 + Top = 1 + Width = 324 + Height = 73 + OnClickCheck = ListRowsClickCheck + Align = alClient + ItemHeight = 13 TabOrder = 1 - OnClick = CBRemoveRowsClick + OnClick = ListColumnsClick end - object EMax: TEdit - Left = 50 - Top = 54 - Width = 83 - Height = 21 + object Panel7: TPanel + Left = 508 + Top = 1 + Width = 133 + Height = 73 + Align = alRight + BevelOuter = bvNone TabOrder = 2 - OnChange = EMaxChange - end - end - end - object PanelColumns: TPanel - Left = 0 - Top = 0 - Width = 644 - Height = 75 - Align = alTop - Color = clWhite - ParentBackground = False - TabOrder = 2 - object Panel2: TPanel - Left = 1 - Top = 1 - Width = 183 - Height = 73 - Align = alLeft - Alignment = taRightJustify - BevelOuter = bvNone - Caption = 'Columns: ' - TabOrder = 0 - object SBSwap: TSpeedButton - Left = 147 - Top = 46 - Width = 23 - Height = 22 - Glyph.Data = { - 36050000424D3605000000000000360400002800000010000000100000000100 - 08000000000000010000C40E0000C40E00000001000000000000000000000000 - 80000080000000808000800000008000800080800000C0C0C000C0DCC000F0CA - A6000020400000206000002080000020A0000020C0000020E000004000000040 - 20000040400000406000004080000040A0000040C0000040E000006000000060 - 20000060400000606000006080000060A0000060C0000060E000008000000080 - 20000080400000806000008080000080A0000080C0000080E00000A0000000A0 - 200000A0400000A0600000A0800000A0A00000A0C00000A0E00000C0000000C0 - 200000C0400000C0600000C0800000C0A00000C0C00000C0E00000E0000000E0 - 200000E0400000E0600000E0800000E0A00000E0C00000E0E000400000004000 - 20004000400040006000400080004000A0004000C0004000E000402000004020 - 20004020400040206000402080004020A0004020C0004020E000404000004040 - 20004040400040406000404080004040A0004040C0004040E000406000004060 - 20004060400040606000406080004060A0004060C0004060E000408000004080 - 20004080400040806000408080004080A0004080C0004080E00040A0000040A0 - 200040A0400040A0600040A0800040A0A00040A0C00040A0E00040C0000040C0 - 200040C0400040C0600040C0800040C0A00040C0C00040C0E00040E0000040E0 - 200040E0400040E0600040E0800040E0A00040E0C00040E0E000800000008000 - 20008000400080006000800080008000A0008000C0008000E000802000008020 - 20008020400080206000802080008020A0008020C0008020E000804000008040 - 20008040400080406000804080008040A0008040C0008040E000806000008060 - 20008060400080606000806080008060A0008060C0008060E000808000008080 - 20008080400080806000808080008080A0008080C0008080E00080A0000080A0 - 200080A0400080A0600080A0800080A0A00080A0C00080A0E00080C0000080C0 - 200080C0400080C0600080C0800080C0A00080C0C00080C0E00080E0000080E0 - 200080E0400080E0600080E0800080E0A00080E0C00080E0E000C0000000C000 - 2000C0004000C0006000C0008000C000A000C000C000C000E000C0200000C020 - 2000C0204000C0206000C0208000C020A000C020C000C020E000C0400000C040 - 2000C0404000C0406000C0408000C040A000C040C000C040E000C0600000C060 - 2000C0604000C0606000C0608000C060A000C060C000C060E000C0800000C080 - 2000C0804000C0806000C0808000C080A000C080C000C080E000C0A00000C0A0 - 2000C0A04000C0A06000C0A08000C0A0A000C0A0C000C0A0E000C0C00000C0C0 - 2000C0C04000C0C06000C0C08000C0C0A000F0FBFF00A4A0A000808080000000 - FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00FFFFFFFFFFFF - FFFFFFFFFFFFFFFFFFFFFF00000000000000FFFFFF00FFFFFFFFFF00FFFFFFFF - FF00FFFF0000FFFFFFFFFF00FFFFFFFFFF00FF000000000000FFFF00FFFFFFFF - FF00FFFF0000FFFF00FFFF00000000000000FFFFFF00FFFF00FFFFFFFFFFFFFF - FFFFFFFFFFFFFFFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFF00FFFFFFFF - FFFFFFFFFFFFFFFFFFFFFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFF00FF - FFFF00000000000000FFFF00FFFF0000FFFF00FFFFFFFFFF00FFFF0000000000 - 00FF00FFFFFFFFFF00FFFFFFFFFF0000FFFF00FFFFFFFFFF00FFFFFFFFFF00FF - FFFF00000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF} - OnClick = SBSwapClick - end - object SBSelector: TSpeedButton - Left = 5 - Top = 2 - Width = 23 - Height = 22 - Caption = '<<' - Flat = True - OnClick = SBSelectorClick + object SBColUp: TSpeedButton + Left = 78 + Top = 10 + Width = 23 + Height = 22 + Caption = '^' + Enabled = False + OnClick = SBColUpClick + end + object SBColDown: TSpeedButton + Left = 106 + Top = 10 + Width = 23 + Height = 22 + Caption = 'v' + Enabled = False + OnClick = SBColDownClick + end + object BDeleteColumn: TButton + Left = 7 + Top = 9 + Width = 63 + Height = 25 + Caption = 'Delete' + Enabled = False + TabOrder = 0 + OnClick = BDeleteColumnClick + end + object CBRemoveCols: TCheckBox + Left = 9 + Top = 43 + Width = 119 + Height = 17 + Caption = 'Remove Missing' + Enabled = False + TabOrder = 1 + OnClick = CBRemoveColsClick + end end end - object ListColumns: TCheckListBox - Left = 184 - Top = 1 - Width = 326 - Height = 73 - OnClickCheck = ListRowsClickCheck + object PanelMeasures: TPanel + Left = 185 + Top = 75 + Width = 457 + Height = 234 Align = alClient - ItemHeight = 13 - TabOrder = 1 - OnClick = ListColumnsClick - end - object Panel7: TPanel - Left = 510 - Top = 1 - Width = 133 - Height = 73 - Align = alRight - BevelOuter = bvNone TabOrder = 2 - object SBColUp: TSpeedButton - Left = 78 - Top = 10 - Width = 23 - Height = 22 - Caption = '^' - Enabled = False - OnClick = SBColUpClick - end - object SBColDown: TSpeedButton - Left = 106 - Top = 10 - Width = 23 - Height = 22 - Caption = 'v' - Enabled = False - OnClick = SBColDownClick - end - object BDeleteColumn: TButton - Left = 7 - Top = 9 - Width = 63 - Height = 25 - Caption = 'Delete' - Enabled = False + object Panel3: TPanel + Left = 1 + Top = 1 + Width = 455 + Height = 41 + Align = alTop + BevelOuter = bvNone + Color = clWhite + ParentBackground = False TabOrder = 0 - OnClick = BDeleteColumnClick + object Label1: TLabel + Left = 10 + Top = 14 + Width = 46 + Height = 13 + Caption = 'Measures' + end + object SBMeasureUp: TSpeedButton + Left = 163 + Top = 9 + Width = 23 + Height = 22 + Caption = '^' + Enabled = False + OnClick = SBMeasureUpClick + end + object SBMeasureDown: TSpeedButton + Left = 191 + Top = 9 + Width = 23 + Height = 22 + Caption = 'v' + Enabled = False + OnClick = SBMeasureDownClick + end + object BDeleteMeasure: TButton + Left = 75 + Top = 7 + Width = 75 + Height = 25 + Caption = 'Delete' + Enabled = False + TabOrder = 0 + OnClick = BDeleteMeasureClick + end end - object CBRemoveCols: TCheckBox - Left = 9 - Top = 43 - Width = 119 - Height = 17 - Caption = 'Remove Missing' - Enabled = False + object ListMeasures: TCheckListBox + Left = 1 + Top = 42 + Width = 181 + Height = 191 + OnClickCheck = ListRowsClickCheck + Align = alClient + ItemHeight = 13 TabOrder = 1 - OnClick = CBRemoveColsClick - end - end - end - object PanelMeasures: TPanel - Left = 185 - Top = 75 - Width = 459 - Height = 210 - Align = alClient - TabOrder = 3 - ExplicitHeight = 218 - object Panel3: TPanel - Left = 1 - Top = 1 - Width = 457 - Height = 41 - Align = alTop - BevelOuter = bvNone - Color = clWhite - ParentBackground = False - TabOrder = 0 - object Label1: TLabel - Left = 10 - Top = 14 - Width = 46 - Height = 13 - Caption = 'Measures' + OnClick = ListMeasuresClick + OnDragOver = ListMeasuresDragOver end - object SBMeasureUp: TSpeedButton - Left = 163 - Top = 9 - Width = 23 - Height = 22 - Caption = '^' - Enabled = False - OnClick = SBMeasureUpClick - end - object SBMeasureDown: TSpeedButton - Left = 191 - Top = 9 - Width = 23 - Height = 22 - Caption = 'v' - Enabled = False - OnClick = SBMeasureDownClick - end - object BDeleteMeasure: TButton - Left = 75 - Top = 7 - Width = 75 - Height = 25 - Caption = 'Delete' - Enabled = False - TabOrder = 0 - OnClick = BDeleteMeasureClick - end - end - object ListMeasures: TCheckListBox - Left = 1 - Top = 42 - Width = 183 - Height = 167 - OnClickCheck = ListRowsClickCheck - Align = alClient - ItemHeight = 13 - TabOrder = 1 - OnClick = ListMeasuresClick - OnDragOver = ListMeasuresDragOver - ExplicitHeight = 175 - end - object Panel5: TPanel - Left = 184 - Top = 42 - Width = 274 - Height = 167 - Align = alRight - BevelOuter = bvNone - TabOrder = 2 - ExplicitHeight = 175 - object PageOptions: TPageControl - Left = 0 - Top = 0 + object Panel5: TPanel + Left = 182 + Top = 42 Width = 274 - Height = 167 - ActivePage = TabMeasureOptions - Align = alClient - TabOrder = 0 - Visible = False - ExplicitHeight = 175 - object TabItem: TTabSheet - Caption = 'Options' - ExplicitHeight = 147 - object Label3: TLabel - Left = 9 - Top = 4 - Width = 52 - Height = 13 - Caption = 'Date Time:' - FocusControl = CBDatePart - end - object CBDatePart: TComboBox - Left = 9 - Top = 23 - Width = 145 - Height = 21 - Style = csDropDownList - TabOrder = 0 - OnChange = CBDatePartChange - end - object GBHistogram: TGroupBox - Left = 9 - Top = 51 - Width = 145 - Height = 81 - Caption = 'Histogram:' - TabOrder = 1 - object Label6: TLabel - Left = 11 - Top = 46 - Width = 23 + Height = 191 + Align = alRight + BevelOuter = bvNone + TabOrder = 2 + object PageOptions: TPageControl + Left = 0 + Top = 0 + Width = 274 + Height = 191 + ActivePage = TabItem + Align = alClient + TabOrder = 0 + Visible = False + object TabItem: TTabSheet + Caption = 'Options' + object Label3: TLabel + Left = 9 + Top = 4 + Width = 52 Height = 13 - Caption = 'Bins:' + Caption = 'Date Time:' + FocusControl = CBDatePart end - object CBHistoActive: TCheckBox + object CBDatePart: TComboBox Left = 9 - Top = 20 - Width = 120 - Height = 17 - Caption = 'Active' + Top = 23 + Width = 145 + Height = 21 + Style = csDropDownList TabOrder = 0 - OnClick = CBHistoActiveClick + OnChange = CBDatePartChange end - object EBins: TEdit - Left = 44 - Top = 43 - Width = 49 - Height = 21 + object GBHistogram: TGroupBox + Left = 9 + Top = 51 + Width = 145 + Height = 77 + Caption = 'Histogram:' TabOrder = 1 - Text = '0' - OnChange = EBinsChange - end - object UDBins: TUpDown - Left = 93 - Top = 43 - Width = 16 - Height = 21 - Associate = EBins - Max = 32767 - TabOrder = 2 - end - end - end - object TabMeasureOptions: TTabSheet - Caption = 'Options' - ImageIndex = 1 - ExplicitHeight = 147 - object PageMeasures: TPageControl - Left = 0 - Top = 0 - Width = 266 - Height = 139 - ActivePage = TabCalc - Align = alClient - TabOrder = 0 - ExplicitHeight = 147 - object TabMeasure: TTabSheet - Caption = 'Aggregate' - ExplicitHeight = 119 - object CBAggregate: TComboBox - Left = 8 - Top = 14 - Width = 145 - Height = 21 - Style = csDropDownList - ItemIndex = 0 - TabOrder = 0 - Text = 'Count' - OnChange = CBAggregateChange - Items.Strings = ( - 'Count' - 'Sum' - 'Average' - 'Minimum' - 'Maximum') - end - object CBMissingAsZero: TCheckBox - Left = 8 + object Label6: TLabel + Left = 11 Top = 46 - Width = 136 - Height = 17 - Caption = 'Missing as &Zero' - TabOrder = 1 - OnClick = CBMissingAsZeroClick + Width = 23 + Height = 13 + Caption = 'Bins:' end - end - object TabCalc: TTabSheet - Caption = 'Calculation' - ImageIndex = 3 - ExplicitHeight = 119 - object RGRunning: TRadioGroup - Left = 135 - Top = 3 - Width = 113 - Height = 78 - Caption = '&Running:' - ItemIndex = 0 - Items.Strings = ( - 'None' - 'Cumulative' - 'Difference') + object CBHistoActive: TCheckBox + Left = 9 + Top = 20 + Width = 120 + Height = 17 + Caption = 'Active' TabOrder = 0 - OnClick = RGRunningClick + OnClick = CBHistoActiveClick end - object CBRunningRows: TCheckBox - Left = 140 - Top = 86 - Width = 108 - Height = 17 - Caption = 'By R&ows' + object EBins: TEdit + Left = 44 + Top = 43 + Width = 49 + Height = 21 TabOrder = 1 - OnClick = CBRunningRowsClick + Text = '0' + OnChange = EBinsChange end - object RGPercentage: TRadioGroup - Left = 5 - Top = 3 - Width = 113 - Height = 100 - Caption = '&Percentage:' - ItemIndex = 0 - Items.Strings = ( - 'No' - 'Column' - 'Row' - 'Total') + object UDBins: TUpDown + Left = 93 + Top = 43 + Width = 16 + Height = 21 + Associate = EBins + Max = 32767 TabOrder = 2 - OnClick = RGPercentageClick end end - object TabMeasureInfo: TTabSheet - Caption = 'Data' - ImageIndex = 2 - ExplicitHeight = 119 - object Label4: TLabel - Left = 9 - Top = 82 - Width = 24 - Height = 13 - Caption = 'Kind:' - end - object LabelMeasureKind: TLabel - Left = 9 - Top = 100 - Width = 3 - Height = 13 - end - object Label5: TLabel - Left = 9 - Top = 4 - Width = 56 - Height = 13 - Caption = '&Expression:' - end - object LMeasureError: TLabel - Left = 9 - Top = 49 - Width = 3 - Height = 13 - Font.Charset = DEFAULT_CHARSET - Font.Color = clMaroon - Font.Height = -11 - Font.Name = 'Tahoma' - Font.Style = [] - ParentFont = False + end + object TabMeasureOptions: TTabSheet + Caption = 'Options' + ImageIndex = 1 + object PageMeasures: TPageControl + Left = 0 + Top = 0 + Width = 266 + Height = 163 + ActivePage = TabCalc + Align = alClient + TabOrder = 0 + object TabMeasure: TTabSheet + Caption = 'Aggregate' + object CBAggregate: TComboBox + Left = 8 + Top = 14 + Width = 145 + Height = 21 + Style = csDropDownList + ItemIndex = 0 + TabOrder = 0 + Text = 'Count' + OnChange = CBAggregateChange + Items.Strings = ( + 'Count' + 'Sum' + 'Average' + 'Minimum' + 'Maximum') + end + object CBMissingAsZero: TCheckBox + Left = 8 + Top = 46 + Width = 136 + Height = 17 + Caption = 'Missing as &Zero' + TabOrder = 1 + OnClick = CBMissingAsZeroClick + end end - object EMeasureExpression: TEdit - Left = 9 - Top = 22 - Width = 240 - Height = 21 - TabOrder = 0 - OnChange = EMeasureExpressionChange + object TabCalc: TTabSheet + Caption = 'Calculation' + ImageIndex = 3 + object RGRunning: TRadioGroup + Left = 135 + Top = 3 + Width = 113 + Height = 78 + Caption = '&Running:' + ItemIndex = 0 + Items.Strings = ( + 'None' + 'Cumulative' + 'Difference') + TabOrder = 0 + OnClick = RGRunningClick + end + object CBRunningRows: TCheckBox + Left = 140 + Top = 86 + Width = 108 + Height = 17 + Caption = 'By R&ows' + TabOrder = 1 + OnClick = CBRunningRowsClick + end + object RGPercentage: TRadioGroup + Left = 5 + Top = 3 + Width = 113 + Height = 100 + Caption = '&Percentage:' + ItemIndex = 0 + Items.Strings = ( + 'No' + 'Column' + 'Row' + 'Total') + TabOrder = 2 + OnClick = RGPercentageClick + end end end end + object TabItemData: TTabSheet + Caption = 'Data' + ImageIndex = 2 + object SpeedButton1: TSpeedButton + Left = 231 + Top = 21 + Width = 23 + Height = 22 + Caption = '...' + OnClick = SpeedButton1Click + end + object LExpressionError: TLabel + Left = 9 + Top = 49 + Width = 3 + Height = 13 + Font.Charset = DEFAULT_CHARSET + Font.Color = clMaroon + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + ParentFont = False + end + object Label5: TLabel + Left = 9 + Top = 4 + Width = 56 + Height = 13 + Caption = '&Expression:' + end + object Label4: TLabel + Left = 9 + Top = 82 + Width = 24 + Height = 13 + Caption = 'Kind:' + end + object LabelItemKind: TLabel + Left = 9 + Top = 100 + Width = 3 + Height = 13 + end + object EItemExpression: TEdit + Left = 9 + Top = 23 + Width = 216 + Height = 21 + TabOrder = 0 + OnChange = EItemExpressionChange + end + end end end end end - object PanelFilter: TPanel - Left = 0 - Top = 285 - Width = 644 - Height = 41 - Align = alBottom - BevelOuter = bvNone - TabOrder = 4 - ExplicitTop = 293 - object LFilterError: TLabel - Left = 354 - Top = 16 - Width = 3 - Height = 13 - Font.Charset = DEFAULT_CHARSET - Font.Color = clMaroon - Font.Height = -11 - Font.Name = 'Tahoma' - Font.Style = [] - ParentFont = False - end - object EFilter: TEdit - Left = 71 - Top = 9 - Width = 271 - Height = 21 - TabOrder = 0 - OnChange = EFilterChange + object PagePreview: TPageControl + Left = 1 + Top = 313 + Width = 642 + Height = 305 + ActivePage = TabGrid + Align = alClient + TabOrder = 0 + object TabGrid: TTabSheet + Caption = 'Grid' + object BIGrid1: TBIGrid + Left = 0 + Top = 0 + Width = 634 + Height = 277 + Align = alClient + UseDockManager = False + ParentBackground = False + ParentColor = False + TabOrder = 0 + end end - object CBFilter: TCheckBox - Left = 10 - Top = 11 - Width = 55 - Height = 17 - Caption = 'Filter:' - TabOrder = 1 - OnClick = CBFilterClick + object TabChart: TTabSheet + Caption = 'Chart' + ImageIndex = 1 end end end @@ -649,7 +662,6 @@ object BIQueryEditor: TBIQueryEditor Align = alBottom BevelOuter = bvNone TabOrder = 2 - ExplicitTop = 633 object Label7: TLabel Left = 16 Top = 14 diff --git a/src/delphi/VCL/BI.VCL.Editor.Query.pas b/src/delphi/VCL/BI.VCL.Editor.Query.pas index dac9239..69d436d 100644 --- a/src/delphi/VCL/BI.VCL.Editor.Query.pas +++ b/src/delphi/VCL/BI.VCL.Editor.Query.pas @@ -21,16 +21,20 @@ interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Classes, Vcl.Graphics, - Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls, BI.VCL.Grid, Vcl.ComCtrls, - BI.Data, BI.Summary, BI.DataSource, BI.VCL.DataSelect, Vcl.StdCtrls, BI.Query, - VCL.CheckLst, Vcl.Buttons, BI.VCL.DataControl, BI.Persist, + Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls, Vcl.StdCtrls, Vcl.ComCtrls, + Vcl.CheckLst, Vcl.Buttons, + + BI.Data, BI.Summary, BI.DataSource, BI.VCL.DataSelect, BI.Query, + BI.VCL.Grid, BI.VCL.DataControl, BI.Persist, BI.VCL.Editor.DynamicFilter, BI.Expression; type + TOnShowQueryEditor=procedure(const AEditor:TForm); + TBIQueryEditor = class(TForm) PanelSelector: TPanel; PanelEdit: TPanel; - BIGrid1: TBIGrid; + OuterPanel: TPanel; Splitter1: TSplitter; SplitterSelector: TSplitter; PanelRows: TPanel; @@ -55,12 +59,11 @@ TBIQueryEditor = class(TForm) RGRunning: TRadioGroup; CBRunningRows: TCheckBox; RGPercentage: TRadioGroup; - TabMeasureInfo: TTabSheet; Label4: TLabel; - LabelMeasureKind: TLabel; + LabelItemKind: TLabel; Label5: TLabel; - LMeasureError: TLabel; - EMeasureExpression: TEdit; + LExpressionError: TLabel; + EItemExpression: TEdit; CBRemoveRows: TCheckBox; CBRemoveCols: TCheckBox; PanelButtons: TPanel; @@ -69,9 +72,6 @@ TBIQueryEditor = class(TForm) Button1: TButton; LMax: TLabel; EMax: TEdit; - PanelFilter: TPanel; - EFilter: TEdit; - CBFilter: TCheckBox; Label1: TLabel; BDeleteMeasure: TButton; Label2: TLabel; @@ -89,7 +89,6 @@ TBIQueryEditor = class(TForm) SBMeasureDown: TSpeedButton; SBColUp: TSpeedButton; SBColDown: TSpeedButton; - LFilterError: TLabel; Label6: TLabel; EBins: TEdit; UDBins: TUpDown; @@ -98,6 +97,17 @@ TBIQueryEditor = class(TForm) SBSelector: TSpeedButton; Label7: TLabel; ETitle: TEdit; + SpeedButton1: TSpeedButton; + TabItemData: TTabSheet; + PagePreview: TPageControl; + TabGrid: TTabSheet; + BIGrid1: TBIGrid; + TabChart: TTabSheet; + PageData: TPageControl; + TabData: TTabSheet; + TabFilter: TTabSheet; + PanelFilter: TPanel; + CBFilter: TCheckBox; procedure FormCreate(Sender: TObject); procedure ListRowsDragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); @@ -114,7 +124,7 @@ TBIQueryEditor = class(TForm) procedure RGPercentageClick(Sender: TObject); procedure RGRunningClick(Sender: TObject); procedure CBRunningRowsClick(Sender: TObject); - procedure EMeasureExpressionChange(Sender: TObject); + procedure EItemExpressionChange(Sender: TObject); procedure CBRemoveRowsClick(Sender: TObject); procedure CBRemoveColsClick(Sender: TObject); procedure CBDatePartChange(Sender: TObject); @@ -122,7 +132,6 @@ TBIQueryEditor = class(TForm) State: TDragState; var Accept: Boolean); procedure ListRowsClickCheck(Sender: TObject); procedure EMaxChange(Sender: TObject); - procedure EFilterChange(Sender: TObject); procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); procedure BOKClick(Sender: TObject); procedure FormDestroy(Sender: TObject); @@ -138,6 +147,9 @@ TBIQueryEditor = class(TForm) procedure SBSwapClick(Sender: TObject); procedure SBSelectorClick(Sender: TObject); procedure ETitleChange(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure SpeedButton1Click(Sender: TObject); + procedure PageDataChange(Sender: TObject); private { Private declarations } @@ -146,13 +158,20 @@ TBIQueryEditor = class(TForm) CompTree, DataTree : TTreeView; + IFilter : TDynamicFilterEditor; + + IChanging, IModified : Boolean; ICurrent : TQueryItem; function AddData(const AList:TCheckListBox; const AData:TDataItem; const IsActive:Boolean=True):TQueryItem; procedure AddItem(const AList:TCheckListBox; const AItem:TQueryItem); - procedure ChangeItem(const AList:TCheckListBox); + procedure ChangeCurrentBy; + procedure ChangeCurrentMeasure; + procedure ChangeItem(const AList:TCheckListBox); overload; + procedure ChangeItem(const AItem:TQueryItem); overload; + procedure ChangedFilter(Sender: TObject); function ChangingQuery:Boolean; procedure DeleteItem(const AList:TCheckListBox); procedure DoExchangeItem(const AList:TCheckListBox; const A,B:Integer); overload; @@ -169,13 +188,18 @@ TBIQueryEditor = class(TForm) function Measure:TMeasure; procedure Modified; procedure RemoveFromList(const AList:TCheckListBox); - procedure SetByProperties(const ACurrent:TQueryItem); - procedure SetMeasureProperties(const ACurrent:TQueryItem); + function Resolver(const S:String; IsFunction:Boolean):TExpression; + procedure SetDataProperties(const AItem:TQueryItem); + procedure SetItemProperties(const ACurrent:TQueryItem; const IsMeasure:Boolean); procedure SetPart(const ACombo:TComboBox; const APart:TDateTimePart); public { Public declarations } - Selector : TDataSelector; + class + var OnShowEditor : TOnShowQueryEditor; + + var + Selector : TDataSelector; class function Edit(const AOwner:TComponent; const AQuery:TBIQuery):Boolean; static; class function Embedd(const AOwner: TComponent; const AParent: TWinControl): TBIQueryEditor; static; diff --git a/src/delphi/VCL/BI.VCL.Grid.pas b/src/delphi/VCL/BI.VCL.Grid.pas index b84c619..b45f612 100644 --- a/src/delphi/VCL/BI.VCL.Grid.pas +++ b/src/delphi/VCL/BI.VCL.Grid.pas @@ -15,7 +15,7 @@ interface {$ENDIF} VCL.Controls, VCL.Forms, VCL.Grids, Data.DB, BI.Data, BI.DataSource, BI.Dataset, VCL.Graphics, Vcl.Menus, BI.UI.Colors, BI.UI, - BI.VCL.DataControl; + BI.VCL.DataControl, BI.Expression; type TBIGridPluginClass=class of TBIGridPlugin; @@ -126,6 +126,8 @@ TBIGrid = class(TBIDataControl) procedure Duplicates(const AData:TDataItem; const Hide:Boolean); procedure Invalidate; override; + procedure SetFilter(const AFilter:TLogicalExpression); + property Plugin:TBIGridPlugin read IPlugin write SetPlugin; published property Alternate:TAlternateColor read FAlternate write SetAlternate; diff --git a/src/delphi/VCL/BI.VCL.Tree.TreeView.pas b/src/delphi/VCL/BI.VCL.Tree.TreeView.pas index 6c7efb5..9673335 100644 --- a/src/delphi/VCL/BI.VCL.Tree.TreeView.pas +++ b/src/delphi/VCL/BI.VCL.Tree.TreeView.pas @@ -12,8 +12,11 @@ TBITreeViewPlugin=class(TBITreePlugin) FAllowDelete : Boolean; FTree : TTreeView; FTreeOnChange : TNotifyEvent; + FTreeOnCheck : TNotifyEvent; procedure ChangedTree(Sender: TObject; Node: TTreeNode); + procedure ToggleChecked(const ANode:TBITreeNode); + procedure TreeClick(Sender:TObject); procedure TreeKeyUp(Sender:TObject; var Key:Word; Shift:TShiftState); protected procedure BeginUpdating; override; @@ -25,6 +28,7 @@ TBITreeViewPlugin=class(TBITreePlugin) function GetData(const ANode:TBITreeNode):TObject; override; function GetNode(const AIndex:Integer):TBITreeNode; override; function GetOnChange: TNotifyEvent; override; + function GetOnCheck: TNotifyEvent; override; function GetSelected:TBITreeNode; override; function GetSelectedData: TBITreePlugin.TNodeData; override; function NodeAt(const X,Y:Integer):TBITreeNode; override; @@ -32,17 +36,29 @@ TBITreeViewPlugin=class(TBITreePlugin) procedure SetAllowDelete(const Value: Boolean); override; procedure SetData(const ANode: TBITreeNode; const AData: TObject); override; procedure SetOnChange(const Value: TNotifyEvent); override; + procedure SetOnCheck(const Value: TNotifyEvent); override; procedure SetSelected(const Value: TBITreeNode); override; public Constructor Create(const AOwner:TComponent); override; + function Children(const ANode:TBITreeNode; const AIndex:Integer):TBITreeNode; override; + function ChildrenCount(const ANode:TBITreeNode):Integer; override; + procedure Expand(const AIndex:Integer); override; procedure Expand(const ANode:TBITreeNode; const DoExpand:Boolean=True; const Recursive:Boolean=False); override; function Find(const ATag:TObject; const AIndex:Integer):TBITreeNode; override; + + function FirstNode:TBITreeNode; override; + function NextNode(const ANode:TBITreeNode):TBITreeNode; override; + + function IsChecked(const ANode:TBITreeNode):Boolean; override; function NewNode(const AParent:TBITreeNode; const AText:String; const ATag:TObject=nil; const AIndex:TInteger=-1):TBITreeNode; override; function ParentOf(const ANode:TBITreeNode):TBITreeNode; override; + procedure SetChecked(const ANode:TBITreeNode; const Value:Boolean); override; + function SiblingIndex(const ANode:TBITreeNode):Integer; override; + function TextOf(const ANode:TBITreeNode):String; override; end; implementation diff --git a/src/delphi/VCL/BI.VCL.Tree.pas b/src/delphi/VCL/BI.VCL.Tree.pas index 6c32399..0315a5a 100644 --- a/src/delphi/VCL/BI.VCL.Tree.pas +++ b/src/delphi/VCL/BI.VCL.Tree.pas @@ -57,6 +57,7 @@ TNodeData=class function GetData(const ANode:TBITreeNode):TObject; virtual; abstract; function GetNode(const AIndex:Integer):TBITreeNode; virtual; abstract; function GetOnChange: TNotifyEvent; virtual; abstract; + function GetOnCheck: TNotifyEvent; virtual; abstract; function GetSelected:TBITreeNode; virtual; abstract; function GetSelectedData:TBITreePlugin.TNodeData; virtual; abstract; function NewNodeData(const ATag:TObject; const AIndex:TInteger):TNodeData; @@ -65,11 +66,15 @@ TNodeData=class procedure SetAllowDelete(const Value: Boolean); virtual; abstract; procedure SetData(const ANode:TBITreeNode; const AData:TObject); virtual; abstract; procedure SetOnChange(const Value: TNotifyEvent); virtual; abstract; + procedure SetOnCheck(const Value: TNotifyEvent); virtual; abstract; procedure SetSelected(const Value: TBITreeNode); virtual; abstract; public Constructor Create(const AOwner:TComponent); virtual; abstract; Destructor Destroy; override; + function Children(const ANode:TBITreeNode; const AIndex:Integer):TBITreeNode; virtual; abstract; + function ChildrenCount(const ANode:TBITreeNode):Integer; virtual; abstract; + procedure Expand(const AIndex:Integer); overload; virtual; abstract; procedure Expand(const ANode:TBITreeNode; @@ -78,12 +83,21 @@ TNodeData=class function Find(const ATag:TObject; const AIndex:Integer=-1):TBITreeNode; virtual; abstract; + function FirstNode:TBITreeNode; virtual; abstract; + function NextNode(const ANode:TBITreeNode):TBITreeNode; virtual; abstract; + + function IsChecked(const ANode:TBITreeNode):Boolean; virtual; abstract; + function NewNode(const AParent:TBITreeNode; const AText:String; const ATag:TObject=nil; const AIndex:TInteger=-1):TBITreeNode; virtual; abstract; function ParentOf(const ANode:TBITreeNode):TBITreeNode; virtual; abstract; + procedure SetChecked(const ANode:TBITreeNode; const Value:Boolean); virtual; abstract; + function SiblingIndex(const ANode:TBITreeNode):Integer; virtual; abstract; + function TextOf(const ANode:TBITreeNode):String; virtual; abstract; + property AllowDelete:Boolean read GetAllowDelete write SetAllowDelete; property Control:TControl read GetControl; property Count:Integer read GetCount; @@ -91,6 +105,7 @@ TNodeData=class property SelectedData:TBITreePlugin.TNodeData read GetSelectedData; property OnChange:TNotifyEvent read GetOnChange write SetOnChange; + property OnCheck:TNotifyEvent read GetOnCheck write SetOnCheck; end; TBITreePluginClass=class of TBITreePlugin;