📄 teengine.pas
字号:
property IsDepthAxis : Boolean read IDepthAxis;
property Items : TAxisItems read FItems;
property MasterAxis : TChartAxis read FMaster write FMaster;
property PosAxis : Integer read FPosAxis;
property PosLabels : Integer read FPosLabels;
property PosTitle : Integer read FPosTitle;
property ParentChart : TCustomAxisPanel read FParentChart;
published
property Automatic:Boolean read FAutomatic write SetAutomatic default True;
property AutomaticMaximum:Boolean read FAutomaticMaximum write SetAutomaticMaximum default True;
property AutomaticMinimum:Boolean read FAutomaticMinimum write SetAutomaticMinimum default True;
property Axis:TChartAxisPen read FAxis write SetAxis;
property AxisValuesFormat:String read FAxisValuesFormat
write SetValuesFormat stored IsAxisValuesFormatStored;
property DateTimeFormat:String read FDateTimeFormat write SetDateTimeFormat;
property ExactDateTime:Boolean read FExactDateTime write SetExactDateTime default True;
property Grid:TAxisGridPen read FGrid write SetGrid;
property GridCentered:Boolean read GetGridCentered write SetGridCentered default False;
property Increment:Double read FDesiredIncrement write SetDesiredIncrement;
property Inverted:Boolean read FInverted write SetInverted default False;
property Horizontal : Boolean read FHorizontal write SetHorizontal stored IsCustom;
property OtherSide : Boolean read FOtherSide write SetOtherSide stored IsCustom;
property Labels:Boolean read GetLabels write SetLabels default True;
property LabelsAlign:TAxisLabelAlign read FLabelsAlign write SetLabelsAlign default alDefault;
property LabelsAlternate:Boolean read FLabelsAlternate write SetLabelsAlternate default False;
property LabelsAngle:Integer read FLabelsAngle write SetLabelsAngle default 0;
property LabelsExponent:Boolean read FLabelsExponent write SetLabelsExponent default False;
property LabelsFont:TTeeFont read GetLabelsFont write SetLabelsFont;
property LabelsMultiLine:Boolean read FLabelsMultiLine write SetLabelsMultiLine default False;
property LabelsOnAxis:Boolean read FLabelsOnAxis write SetLabelsOnAxis default True;
property LabelsSeparation:Integer read FLabelsSeparation
write SetLabelsSeparation default TeeDefaultLabelsSeparation;
property LabelsSize:Integer read FLabelsSize write SetLabelsSize default 0;
property LabelStyle:TAxisLabelStyle read FLabelStyle write SetLabelStyle default talAuto;
property Logarithmic:Boolean read FLogarithmic write SetLogarithmic default False;
property LogarithmicBase:Double read FLogarithmicBase write SetLogarithmicBase stored IsLogBaseStored;
property Maximum:Double read FMaximumValue write SetMaximum stored IsMaxStored;
property MaximumOffset:Integer read FMaximumOffset write SetMaximumOffset default 0;
property MaximumRound:Boolean read FMaximumRound write SetMaximumRound default False;
property Minimum:Double read FMinimumValue write SetMinimum stored IsMinStored;
property MinimumOffset:Integer read FMinimumOffset write SetMinimumOffset default 0;
property MinimumRound:Boolean read FMinimumRound write SetMinimumRound default False;
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;
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,
cpAxisTitle );
TChartClickedPart=Packed Record
Part : TChartClickedPartStyle;
PointIndex : Integer;
ASeries : TChartSeries;
AAxis : TChartAxis;
end;
{$IFDEF D9}
TSeriesEnumerator=class
private
FIndex: Integer;
FList: TCustomSeriesList;
public
constructor Create(List:TCustomSeriesList);
function GetCurrent:TChartSeries; inline;
function MoveNext: Boolean;
property Current:TChartSeries read GetCurrent;
end;
{$ENDIF}
TCustomSeriesList=class(TList)
private
FOwner : TCustomAxisPanel;
function Get(Index:Integer):TChartSeries; {$IFDEF D9}inline;{$ENDIF}
procedure Put(Index:Integer; Value:TChartSeries);
public
procedure ClearValues;
procedure FillSampleValues(Num:Integer=0);
function First:TChartSeries;
{$IFDEF D9}
function GetEnumerator: TSeriesEnumerator; // 7.05
{$ENDIF}
function Last:TChartSeries;
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);
procedure SetGroups(const Value: TSeriesGroups);
public
Destructor Destroy; override;
Function AddGroup(const Name:String):TSeriesGroup;
procedure Assign(Source:TChartSeriesList);
property AllActive:Boolean read GetAllActive write SetAllActive;
//published <-- Not possible, as it derives from TList.
property Groups:TSeriesGroups read FGroups write SetGroups;
end;
TSeriesGroupActive=(gaYes, gaNo, gaSome);
TSeriesGroup=class {$IFDEF CLR}sealed{$ENDIF} (TCollectionItem)
private
FName : String;
FSeries : TCustomSeriesList;
function GetActive: TSeriesGroupActive;
function IsSeriesStored: Boolean;
procedure SetActive(const Value:TSeriesGroupActive);
procedure SetSeries(const Value: TCustomSeriesList);
public
Constructor Create(Collection:TCollection); {$IFDEF D5}overload;{$ENDIF} override;
Destructor Destroy; override;
procedure Add(Series:TChartSeries);
procedure Assign(Source:TPersistent); override;
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;
function FindByName(const Name:String; CaseSensitive:Boolean=False):TSeriesGroup; // 8.0
property Items[Index:Integer]:TSeriesGroup read Get write Put; default;
end;
TAxisCalcPosLabels=function(Axis:TChartAxis; Value:Integer):Integer of object; // 7.06
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);
{$IFDEF CLR}
public
{$ELSE}
protected
{$ENDIF}
CalcPosLabels : TAxisCalcPosLabels;
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);
TWheelMouseEvent=( wmeDown, wmeMove, wmeUp);
TTeeCustomTool=class(TCustomChartElement)
protected
Procedure ChartEvent(AEvent:TChartToolEvent); virtual;
Procedure ChartMouseEvent( AEvent: TChartMouseEvent;
Button:TMouseButton;
Shift: TShiftState; X, Y: Integer); virtual;
Procedure SeriesEvent(AEvent:TChartToolEvent); virtual;
procedure SetParentChart(const Value: TCustomAxisPanel); override;
Procedure WheelMouseEvent( AEvent: TWheelMouseEvent;
WheelDelta:Integer;
X, Y: Integer); virtual;
public
class Function Description:String; virtual;
class Function LongDescription:String; virtual;
end;
TTeeCustomToolClass=class of TTeeCustomTool;
TChartTools=class(TList)
private
FOwner : TCustomAxisPanel;
Function Get(Index:Integer):TTeeCustomTool;
procedure SetActive(Value:Boolean);
public
Function Add(Tool:TTeeCustomTool):TTeeCustomTool; overload;
Function Add({$IFNDEF BCB}const{$ENDIF} Tool:TTeeCustomToolClass):TTeeCustomTool; overload;
procedure Clear; override;
property Active:Boolean write SetActive;
property Items[Index:Integer]:TTeeCustomTool read Get; default;
property Owner:TCustomAxisPanel read FOwner;
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
Procedure Assign(Source:TPersistent); override;
property Series:TChartSeries read FSeries write SetSeries;
end;
// Base object for tools that have an Axis property
TTeeCustomToolAxis=class(TTeeCustomTool)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -