📄 teengine.pas
字号:
property MaximumOffset:Integer read FMaximumOffset write SetMaximumOffset default 0;
property Minimum:Double read FMinimumValue write SetMinimum stored IsMinStored;
property MinimumOffset:Integer read FMinimumOffset write SetMinimumOffset default 0;
property MinorGrid:TChartHiddenPen read FMinorGrid write SetMinorGrid;
property MinorTickCount:Integer read FMinorTickCount write SetMinorTickCount default 3;
property MinorTickLength:Integer read FMinorTickLength write SetMinorTickLength default 2;
property MinorTicks:TDarkGrayPen read FMinorTicks write SetMinorTicks;
property StartPosition:Double read FStartPosition write SetStartPosition
stored IsStartStored;
property EndPosition:Double read FEndPosition write SetEndPosition
stored IsEndStored;
property PositionPercent:Double read FPositionPercent write SetPositionPercent
stored IsPosStored;
property PositionUnits:TTeeUnits read FPosUnits write SetPosUnits default muPercent;
property RoundFirstLabel:Boolean read FRoundFirstLabel write SetRoundFirstLabel default True;
property TickInnerLength:Integer read FTickInnerLength write SetTickInnerLength default 0;
property TickLength:Integer read FTickLength write SetTickLength default 4;
property Ticks:TDarkGrayPen read FTicks write SetTicks;
property TicksInner:TDarkGrayPen read FTicksInner write SetTicksInner;
property TickOnLabelsOnly:Boolean read FTickOnLabelsOnly write SetTickOnLabelsOnly default True;
property Title:TChartAxisTitle read FAxisTitle write SetAxisTitle;
property TitleSize:Integer read FTitleSize write SetTitleSize default 0;
property Visible:Boolean read FVisible write SetVisible default True;
property ZPosition:Double read FZPosition write SetZPosition stored IsZStored;
// Events
property OnDrawLabel:TAxisDrawLabelEvent read FOnDrawLabel write FOnDrawLabel; // 7.0
end;
TChartDepthAxis=class(TChartAxis)
protected
Function InternalCalcLabelStyle:TAxisLabelStyle; override;
Procedure SetInverted(Value:Boolean); override;
published
property Visible default False;
end;
TAxisOnGetLabel=Procedure( Sender:TChartAxis; Series:TChartSeries;
ValueIndex:Integer; Var LabelText:String) of object;
TAxisOnGetNextLabel=Procedure( Sender:TChartAxis; LabelIndex:Integer;
Var LabelValue:Double; Var Stop:Boolean) of object;
TSeriesClick=procedure( Sender:TChartSeries;
ValueIndex:Integer;
Button:TMouseButton;
Shift: TShiftState;
X, Y: Integer) of object;
TValueEvent=(veClear,veAdd,veDelete,veRefresh,veModify);
THorizAxis = (aTopAxis,aBottomAxis,aBothHorizAxis,aCustomHorizAxis);
TVertAxis = (aLeftAxis,aRightAxis,aBothVertAxis,aCustomVertAxis);
TChartClickedPartStyle=( cpNone,
cpLegend,
cpAxis,
cpSeries,
cpTitle,
cpFoot,
cpChartRect,
cpSeriesMarks,
cpSubTitle,
cpSubFoot );
TChartClickedPart=Packed Record
Part : TChartClickedPartStyle;
PointIndex : Integer;
ASeries : TChartSeries;
AAxis : TChartAxis;
end;
TCustomSeriesList=class(TList)
private
FOwner : TCustomAxisPanel;
procedure Put(Index:Integer; Value:TChartSeries);
function Get(Index:Integer):TChartSeries;
public
procedure ClearValues;
procedure FillSampleValues(Num:Integer=0);
property Items[Index:Integer]:TChartSeries read Get write Put; default;
property Owner:TCustomAxisPanel read FOwner;
end;
TSeriesGroup=class;
TSeriesGroups=class;
TChartSeriesList=class {$IFDEF CLR}sealed{$ENDIF} (TCustomSeriesList)
private
FGroups : TSeriesGroups;
function GetAllActive: Boolean;
procedure SetAllActive(const Value: Boolean);
public
Destructor Destroy; override;
Function AddGroup(const Name:String):TSeriesGroup;
property AllActive:Boolean read GetAllActive write SetAllActive;
property Groups:TSeriesGroups read FGroups;
end;
TSeriesGroupActive=(gaYes, gaNo, gaSome);
TSeriesGroup=class {$IFDEF CLR}sealed{$ENDIF} (TCollectionItem)
private
FName : String;
FSeries : TCustomSeriesList;
procedure SetActive(const Value:TSeriesGroupActive);
function IsSeriesStored: Boolean;
procedure SetSeries(const Value: TCustomSeriesList);
function GetActive: TSeriesGroupActive;
public
Constructor Create(Collection:TCollection); {$IFDEF D5}overload;{$ENDIF} override;
Destructor Destroy; override;
procedure Add(Series:TChartSeries);
procedure Hide;
procedure Show;
published
property Active:TSeriesGroupActive read GetActive write SetActive default gaYes;
property Name:String read FName write FName;
property Series:TCustomSeriesList read FSeries write SetSeries stored IsSeriesStored;
end;
TSeriesGroups=class {$IFDEF CLR}sealed{$ENDIF} (TOwnedCollection)
private
Function Get(Index:Integer):TSeriesGroup;
Procedure Put(Index:Integer; Const Value:TSeriesGroup);
public
Function Contains(Series:TChartSeries):Integer;
property Items[Index:Integer]:TSeriesGroup read Get write Put; default;
end;
TChartAxes=class {$IFDEF CLR}sealed{$ENDIF} (TList)
private
FChart : TCustomAxisPanel;
IFastCalc : Boolean; // default False
function Get(Index:Integer):TChartAxis;
function GetBottomAxis:TChartAxis;
function GetDepthAxis:TChartDepthAxis;
function GetDepthTopAxis:TChartDepthAxis;
function GetLeftAxis:TChartAxis;
function GetRightAxis:TChartAxis;
function GetTopAxis:TChartAxis;
procedure SetFastCalc(const Value: Boolean);
function GetBehind: Boolean;
function GetVisible: Boolean;
procedure SetBehind(const Value: Boolean);
procedure SetVisible(const Value: Boolean);
public
procedure Clear; override;
procedure Hide; // 7.04
procedure Reset;
property Items[Index:Integer]:TChartAxis read Get; default;
property Bottom:TChartAxis read GetBottomAxis;
property Depth:TChartDepthAxis read GetDepthAxis;
property DepthTop:TChartDepthAxis read GetDepthTopAxis;
property Left:TChartAxis read GetLeftAxis;
property Right:TChartAxis read GetRightAxis;
property Top:TChartAxis read GetTopAxis;
property Behind:Boolean read GetBehind write SetBehind;
property FastCalc:Boolean read IFastCalc write SetFastCalc;
property Visible:Boolean read GetVisible write SetVisible;
end;
TChartCustomAxes=class {$IFDEF CLR}sealed{$ENDIF} (TOwnedCollection)
private
Function Get(Index:Integer):TChartAxis;
Procedure Put(Index:Integer; Const Value:TChartAxis);
public
procedure ResetScales(Axis:TChartAxis);
property Items[Index:Integer]:TChartAxis read Get write Put; default;
end;
TTeeCustomDesigner=class(TObject)
public
Procedure Refresh; dynamic;
Procedure Repaint; dynamic;
end;
TChartSeriesEvent=( seAdd, seRemove, seChangeTitle, seChangeColor, seSwap,
seChangeActive, seDataChanged);
TChartChangePage=class {$IFDEF CLR}sealed{$ENDIF} (TTeeEvent);
TChartToolEvent=( cteAfterDraw,
cteBeforeDrawSeries,
cteBeforeDraw,
cteBeforeDrawAxes, // 7.0
cteAfterDrawSeries, // 7.0
cteMouseLeave); // 7.0
TChartMouseEvent=(cmeDown,cmeMove,cmeUp);
TTeeCustomTool=class(TCustomChartElement)
protected
Procedure ChartEvent(AEvent:TChartToolEvent); virtual;
Procedure ChartMouseEvent( AEvent: TChartMouseEvent;
Button:TMouseButton;
Shift: TShiftState; X, Y: Integer); virtual;
procedure SetParentChart(const Value: TCustomAxisPanel); override;
public
class Function Description:String; virtual;
end;
TTeeCustomToolClass=class of TTeeCustomTool;
TChartTools=class {$IFDEF CLR}sealed{$ENDIF} (TList)
private
Owner : TCustomAxisPanel;
Function Get(Index:Integer):TTeeCustomTool;
procedure SetActive(Value:Boolean);
public
Function Add(Tool:TTeeCustomTool):TTeeCustomTool;
procedure Clear; override;
property Active:Boolean write SetActive;
property Items[Index:Integer]:TTeeCustomTool read Get; default;
end;
// Base object for tools that have a Series property
TTeeCustomToolSeries=class(TTeeCustomTool)
private
FSeries : TChartSeries;
protected
class Function GetEditorClass:String; override;
Function GetHorizAxis:TChartAxis;
Function GetVertAxis:TChartAxis;
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
procedure SetSeries(const Value: TChartSeries); virtual;
public
property Series:TChartSeries read FSeries write SetSeries;
end;
// Base object for tools that have an Axis property
TTeeCustomToolAxis=class(TTeeCustomTool)
private
FAxis: TChartAxis;
procedure ReadAxis(Reader: TReader);
procedure WriteAxis(Writer: TWriter);
protected
procedure DefineProperties(Filer: TFiler); override;
class Function GetEditorClass:String; override;
procedure SetAxis(const Value: TChartAxis); virtual;
public
property Axis:TChartAxis read FAxis write SetAxis stored False;
end;
TTeeEventClass=class of TTeeEvent;
TTeeSeriesEvent=class(TTeeEvent)
Event : TChartSeriesEvent;
Series : TCustomChartSeries;
end;
TChartSeriesClass=class of TChartSeries;
TCustomAxisPanel=class(TCustomTeePanelExtended)
private
{ Private declarations }
F3DPercent : Integer;
FAxes : TChartAxes;
FAxisBehind : Boolean;
FAxisVisible : Boolean;
FClipPoints : Boolean;
FCustomAxes : TChartCustomAxes;
FSeriesList : TChartSeriesList;
FDepthAxis : TChartDepthAxis;
FDepthTopAxis : TChartDepthAxis;
FTopAxis : TChartAxis;
FBottomAxis : TChartAxis;
FLeftAxis : TChartAxis;
FRightAxis : TChartAxis;
FView3DWalls : Boolean;
FOnGetAxisLabel : TAxisOnGetLabel;
FOnGetNextAxisLabel:TAxisOnGetNextLabel;
FOnPageChange : TNotifyEvent;
FOnBeforeDrawChart: TNotifyEvent;
FOnBeforeDrawAxes : TNotifyEvent;
FOnBeforeDrawSeries:TNotifyEvent;
FPage : Integer;
FMaxPointsPerPage : Integer;
FScaleLastPage : Boolean;
FMaxZOrder : Integer;
FSeriesWidth3D : Integer;
FSeriesHeight3D : Integer;
FTools : TChartTools;
InvertedRotation : Boolean;
Procedure BroadcastTeeEventClass(Event:TTeeEventClass);
Procedure BroadcastToolEvent(AEvent:TChartToolEvent);
Procedure CalcInvertedRotation;
Procedure CheckOtherSeries(Dest,Source:TChartSeries);
Function GetAxisSeriesMaxPoints(Axis:TChartAxis):TChartSeries;
Function GetSeries(Index:Integer):TChartSeries; {$IFDEF D9}inline;{$ENDIF}
Procedure InternalAddSeries(ASeries:TCustomChartSeries);
Function InternalMinMax(AAxis:TChartAxis; IsMin,IsX:Boolean):Double;
Function NoActiveSeries(AAxis:TChartAxis):Boolean;
Procedure Set3DPercent(Value:Integer);
Procedure SetAxisBehind(Value:Boolean);
Procedure SetAxisVisible(Value:Boolean);
Procedure SetBottomAxis(Value:TChartAxis);
procedure SetClipPoints(Value:Boolean);
Procedure SetCustomAxes(Value:TChartCustomAxes);
Procedure SetDepthAxis(Value:TChartDepthAxis);
procedure SetDepthTopAxis(const Value: TChartDepthAxis);
Procedure SetLeftAxis(Value:TChartAxis);
Procedure SetMaxPointsPerPage(Value:Integer);
Procedure SetRightAxis(Value:TChartAxis);
Procedure SetScaleLastPage(Value:Boolean);
Procedure SetTopAxis(Value:TChartAxis);
procedure SetView3DWalls(Value:Boolean);
function IsCustomAxesStored: Boolean;
protected
{ Protected declarations }
LegendColor : TColor;
LegendPen : TChartPen;
Procedure BroadcastSeriesEvent(ASeries:TCustomChartSeries; Event:TChartSeriesEvent);
Function CalcIsAxisVisible(Axis:TChartAxis):Boolean;
Procedure CalcWallsRect; virtual; abstract;
Function CalcWallSize(Axis:TChartAxis):Integer; virtual; abstract;
Function CheckMouseSeries(x,y:Integer):Boolean;
procedure ColorPaletteChanged;
procedure DoOnAfterDraw; virtual;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -