const
defLRim = 50; { default left rim in component CHART }
defRRim = 10; { default right rim in component CHART }
defTRim = 16; { default top rim in component CHART }
defBRim = 32; { default bottom rim in component CHART }
defShadowWidth = 0; { default width of shadow }
defPenStyle = psSolid; { default pen style }
defDataCol = clblack; { default data color }
defChartFrameCol = clBlack; { default chart frame color }
defFillCol = clSilver; { default fill color }
defChartCol = clWhite; { default chart background color }
defWindCol = clBtnFace; { default window background color }
defGridCol = clBlack; { default grid color }
defLineWid = 1; { default line width }
defRCHeight = 200; { default height }
defRCWidth = 280; { default width }
MinRCWidth = 80; { minimum width of RChart control }
MinRCHeight = 20; { minimum height of RChart control }
MaxTickPos = 50; { maximum number of synchronized grid lines }
MaxZoomStack = 16; { depth of zoom stack }
MaxCrossH = 4; { number of crosshairs }
MaxTxtLbl = 30; { number of text labels }
MaxDataUsers = 4; { maximum number of data shares }
{$IFDEF PAIDVERS}
SDLVersionInfo = 'rchart_r900_full'; { version info }
IsLightEd = false;
{$ELSE}
SDLVersionInfo = 'rchart_r900_lighted';
IsLightEd = true;
{$ENDIF}
Release = 900;
type
ESDLRChartError = class(ESDLError); { exception type to indicate errors }
TLayerSet = set of 1..MAXNUMRCLAYERS;
TCaptionAnchorHoriz = (cahControlLeft, cahChartLeft, cahChartCenter,
cahChartRight, cahControlRight);
TCaptionAnchorVert = (cavControlTop, cavChartTop, cavChartCenter,
cavChartBottom, cavControlBottom);
TBGAreaMode = (bamNone, bamLeft, bamRight, bamTop, bamBottom,
bamVStripe, bamHStripe, bamRect);
TBakGndImg = class (TPersistent) { background bitmap }
private
FName : string; { name of bitmap file to load }
FOnChange : TNotifyEvent;
FIncldPath : boolean; { if TRUE, include path info }
FFillMode : TBkgFill; { fill of background image }
FBGAreaMode : TBgAreaMode; { background area mode }
FBGAreaColor : TColor; { background area color }
FBGAreaLeft : double; { background area coordinates }
FBGAreaRight : double;
FBGAreaTop : double;
FBGAreaBottom : double;
procedure SetName (fn: string);
procedure SetIncldPath (x: boolean);
procedure SetFillMode (x: TBkgFill);
procedure SetBGAreaColor (c: TColor);
procedure SetBGAreaMode (m: TBgAreaMode);
procedure SetBGAreaLeft (coords: double);
procedure SetBGAreaRight (coords: double);
procedure SetBGAreaTop (coords: double);
procedure SetBGAreaBottom (coords: double);
protected
public
constructor Create(AOwner: TComponent);
destructor Destroy; override;
procedure Changed;
property OnChange: TNotifyEvent read FOnChange write FOnChange;
published
property Name: string read FName write SetName;
property IncludePath: boolean read FIncldPath write SetIncldPath;
property FillMode: TBkgFill read FFillMode write SetFillMode;
property AreaMode: TBgAreaMode
read FBgAreaMode write SetBgAreaMode;
property AreaColor: TColor
read FBGAreaColor write SetBgAreaColor;
property AreaLeft: double read FBGAreaLeft write SetBgAreaLeft;
property AreaRight: double
read FBGAreaRight write SetBgAreaRight;
property AreaTop: double read FBGAreaTop write SetBgAreaTop;
property AreaBottom: double
read FBGAreaBottom write SetBgAreaBottom;
end;
TJointLayers = class(TPersistent)
private
FMasterLayerX : array [1..MAXNUMRCLAYERS] of integer;
FMasterLayerY : array [1..MAXNUMRCLAYERS] of integer;
FOnChange : TNotifyEvent;
FOwner : TComponent;
function GetControlledLayerX (Index: Integer): integer;
function GetControlledLayerY (Index: Integer): integer;
procedure SetControlledLayerX (Index: Integer; Value: integer);
procedure SetControlledLayerY (Index: Integer; Value: integer);
protected
procedure Changed;
procedure AssignTo(Dest: TPersistent); override;
property OnChange: TNotifyEvent read FOnChange write FOnChange;
public
constructor Create(AOwner: TComponent);
destructor Destroy; override;
procedure Reset;
published
property L01xControlledBy: integer index 1
read GetControlledLayerX write SetControlledLayerX;
property L01yControlledBy: integer index 1
read GetControlledLayerY write SetControlledLayerY;
property L02xControlledBy: integer index 2
read GetControlledLayerX write SetControlledLayerX;
property L02yControlledBy: integer index 2
read GetControlledLayerY write SetControlledLayerY;
{$IFDEF PAIDVERS}
property L03xControlledBy: integer index 3
read GetControlledLayerX write SetControlledLayerX;
property L03yControlledBy: integer index 3
read GetControlledLayerY write SetControlledLayerY;
property L04xControlledBy: integer index 4
read GetControlledLayerX write SetControlledLayerX;
property L04yControlledBy: integer index 4
read GetControlledLayerY write SetControlledLayerY;
property L05xControlledBy: integer index 5
read GetControlledLayerX write SetControlledLayerX;
property L05yControlledBy: integer index 5
read GetControlledLayerY write SetControlledLayerY;
property L06xControlledBy: integer index 6
read GetControlledLayerX write SetControlledLayerX;
property L06yControlledBy: integer index 6
read GetControlledLayerY write SetControlledLayerY;
property L07xControlledBy: integer index 7
read GetControlledLayerX write SetControlledLayerX;
property L07yControlledBy: integer index 7
read GetControlledLayerY write SetControlledLayerY;
property L08xControlledBy: integer index 8
read GetControlledLayerX write SetControlledLayerX;
property L08yControlledBy: integer index 8
read GetControlledLayerY write SetControlledLayerY;
property L09xControlledBy: integer index 9
read GetControlledLayerX write SetControlledLayerX;
property L09yControlledBy: integer index 9
read GetControlledLayerY write SetControlledLayerY;
property L10xControlledBy: integer index 10
read GetControlledLayerX write SetControlledLayerX;
property L10yControlledBy: integer index 10
read GetControlledLayerY write SetControlledLayerY;
property L11xControlledBy: integer index 11
read GetControlledLayerX write SetControlledLayerX;
property L11yControlledBy: integer index 11
read GetControlledLayerY write SetControlledLayerY;
property L12xControlledBy: integer index 12
read GetControlledLayerX write SetControlledLayerX;
property L12yControlledBy: integer index 12
read GetControlledLayerY write SetControlledLayerY;
property L13xControlledBy: integer index 13
read GetControlledLayerX write SetControlledLayerX;
property L13yControlledBy: integer index 13
read GetControlledLayerY write SetControlledLayerY;
property L14xControlledBy: integer index 14
read GetControlledLayerX write SetControlledLayerX;
property L14yControlledBy: integer index 14
read GetControlledLayerY write SetControlledLayerY;
property L15xControlledBy: integer index 15
read GetControlledLayerX write SetControlledLayerX;
property L15yControlledBy: integer index 15
read GetControlledLayerY write SetControlledLayerY;
property L16xControlledBy: integer index 16
read GetControlledLayerX write SetControlledLayerX;
property L16yControlledBy: integer index 16
read GetControlledLayerY write SetControlledLayerY;
{$ENDIF}
end;
TScaleProps = class (TPersistent) // published properties of scales
private
FCaption : string;
FCaptionPosX : integer;
FCaptionPosY : integer;
FCaptAlign : TAlignment;
FCaptAnchor : TScaleUnitAnchor;
FColorScale : TColor;
FOnChange : TNotifyEvent;
FDTFormat : TDTLabel;
FDecPlaces : integer;
FLogAx : boolean;
FLabelType : TFigType;
FFont : TFont;
FMinTicks : integer;
FNotYetLoaded : boolean; { flag to prevent problems with
log. scales during component loading }
FRangeLow : double;
FRangeHigh : double;
FShortTicks : boolean;
FScaleInscript: string;
FScaleType : TScaleType;
FScalePosX : integer;
FScalePosY : integer;
FMinRngDiff : double; { minimum range of axis }
FUserTickText : string;
FVisible : boolean;
function GetScalePos: integer;
procedure SetCaption (txt: string);
procedure SetCaptionPosX (x: integer);
procedure SetCaptionPosY (y: integer);
procedure SetCaptAlign (al: TAlignment);
procedure SetCaptAnchor (ca: TScaleUnitAnchor);
procedure SetColorScale (color: TColor);
procedure SetDTFormat (dtf: TDTLabel);
procedure SetDecPlaces (dp: integer);
procedure SetLogAx (logar: boolean);
procedure SetLabelType (lt: TFigType);
procedure SetMinTicks (nt: integer);
procedure SetMinRngDiff (minrng: double);
procedure SetScalePos (p: integer);
procedure SetRangeLow (rl: double);
procedure SetRangeHigh (rh: double);
procedure SetShortTicks (st: boolean);
procedure SetScaleInscript (scinsc: string);
procedure SetScaleType (sct: TScaleType);
procedure SetUserTickText (utt: string);
procedure SetVisible (vis: boolean);
procedure SetScaleFont (ft: TFont);
protected
procedure FontStyleChanged(Sender: TObject);
public
constructor Create;
destructor Destroy; override;
procedure Changed;
property ScaleType: TScaleType read FScaleType write SetScaleType;
published
property Caption: string read FCaption write SetCaption;
property CaptionPosX: integer
read FCaptionPosX write SetCaptionPosX;
property CaptionPosY: integer
read FCaptionPosY write SetCaptionPosY;
property CaptionAlignment: TAlignment
read FCaptAlign write SetCaptAlign;
property CaptionAnchor: TScaleUnitAnchor
read FCaptAnchor write SetCaptAnchor;
property ColorScale: TColor read FColorScale write SetColorScale;
property DateFormat: TDTLabel read FDTFormat write SetDTFormat;
property DecPlaces: integer read FDecPlaces write SetDecPlaces;
property Font: TFont read FFont write SetScaleFont;
property Logarithmic: boolean read FLogAx write SetLogAx;
property LabelType: TFigType read FLabelType write SetLabelType;
property MinTicks: integer read FMinTicks write SetMinTicks;
property MinRange: double read FMinRngDiff write SetMinRngDiff;
property RangeLow: double read FRangeLow write SetRangeLow;
property RangeHigh: double read FRangeHigh write SetRangeHigh;
property ShortTicks: boolean
read FShortTicks write SetShortTicks;
property ScaleInscript: string
read FScaleInscript write SetScaleInscript;
property ScalePos: integer read GetScalePos write SetScalePos;
property UserTickText: string
read FUserTickText write SetUserTickText;
property Visible: boolean read FVisible write SetVisible;
property OnChange: TNotifyEvent read FOnChange write FOnChange;
end;
TScaleLocationHoriz = (slTop, slBottom);
TScalePropsHoriz = class (TScaleProps)
private
FScaleLoc : TScaleLocationHoriz;
public
constructor Create;
procedure SetScaleLoc (value: TScaleLocationHoriz);
published
property ScaleLocation : TScaleLocationHoriz
read FScaleLoc write SetScaleLoc;
end;
TScaleLocationVert = (slLeft, slRight);
TScalePropsVert = class (TScaleProps)
private
FScaleLoc : TScaleLocationVert;
public
constructor Create;
procedure SetScaleLoc (value: TScaleLocationVert);
published
property ScaleLocation : TScaleLocationVert
read FScaleLoc write SetScaleLoc;
end;
TTextLabel = class (TCustomTextLabel)
private
public
published
property PosX;
property PosY;
property Layer;
property AttachToData;
property ColorBkg;
property ColorBorder;
property ColorShadow;
property ShadowDx;
property ShadowDy;
property Transparent;
property Alignment;
property VerticalAlignment;
property Font;
property Mode;
property Caption;
property Visible;
property OnChange;
end;
TrcItem = (tkNone, tkMarkAt, tkLine, tkLineto, tkRect, tkRectFrame,
tk3DBar, tkText, tkMoveTo, tkEllipse, tkEverything,
tkNotMoveTo, tkMoveRelPix, tkLineRelPix, tkArrow);
{ Attention: if the Itemtype is changed, the array
FItemCount should also be adjusted }
TrcChartItem = record
x, y : double; { coordinates of chart item }
x2, y2 : double; { other corner of rectangles
or halfaxes ha, hb of ellipses }
Color : TColor; { color of item }
FillColor : TColor; { fill color }
ShadowColor : TColor; { shadow color }
HiLightColor : TColor; { highlight color }
PenStyle : TPenStyle; { pen style used for this item }
Tag : longint; { user defined tag }
LWid : integer; { line width }
ItemClass : byte; { class number of item }
ItemKind : TrcItem; { kind of chart item }
Layer : integer; { coordinate system layer of item }
Transp : boolean; { transparency }
FrameStyle : TFrameStyle; { frame style }
Text : string[15]; { text }
SizeOrAngle : integer; { text font size, or arrow head size,
or angle of 3D bars }
Depth : integer; { depth of 3D bars }
mark : byte; { mark }
end;
GridStyleType = (gsNone, gsPoints, gsVertLines, gsHorizLines, gsLines,
gsHorizDotLines, gsVertDotLines, gsDotLines);
{$IFDEF PAIDVERS}
TrcLayout = (rcl_X1Bottom_Y1Left, rcl_X1Bottom_Y2Left, rcl_X1Bottom_Y3Left,
rcl_X1Bottom_Y4Left, rcl_X1Bottom_Y2Both, rcl_X2Bottom_Y2Left,
rcl_X2Both_Y2Both);
{$ELSE}
TrcLayout = (rcl_X1Bottom_Y1Left, rcl_X1Bottom_Y2Left, rcl_X1Bottom_Y2Both,
rcl_X2Bottom_Y2Left, rcl_X2Both_Y2Both);
{$ENDIF}
TTextBkg = (tbClear, tbSolid);
{ event for mouse pos. in chart coords }
TMouseMoveInChartEvent = procedure (Sender: TObject; InChart: boolean;
Shift: TShiftState;
rMousePosX, rMousePosY: double) of object;
TRenderEvent = procedure (Sender: TObject; var Canvas: TCanvas;
Top, Left: integer) of object;
TCrossHairMoveEvent = procedure (Sender: TObject;
WhichCrossHair: TCrossHair) of object;
TTextLabelMoveEvent = procedure (Sender: TObject;
WhichTextLabel: TTextLabel) of object;
TCustomRChart = class (TCustomControl)
private
{$IFDEF DEBUG}
StartSystime : double;
{$ENDIF}
FNumChartItems : longint;{no. of chart items in data container }
FNumAllocated : longint;{ number of allocated container cells }
FAllocSize : integer; { allocation size for data container }
LButtonWasDown : boolean; { global identifier to track panning
by left mouse button }
FMAnchorScrX : array[1..MAXNUMRCLAYERS] of integer;
{ anchor mouse pos. on TRChart canvas }
FMAnchorScrY : array[1..MAXNUMRCLAYERS] of integer;
FMAnchorRcLoX : array[1..MAXNUMRCLAYERS] of double;
FMAnchorRcLoY : array[1..MAXNUMRCLAYERS] of double;
FMAnchorRcHiX : array[1..MAXNUMRCLAYERS] of double;
FMAnchorRcHiY : array[1..MAXNUMRCLAYERS] of double;
{$IFDEF PAIDVERS}
ColBakShadow : TColor;
ColBakShadowBgnd : TColor;
ColBakWindow : TColor;
ColBakChart : TColor;
ColBakFrame : TColor;
ColBakFont : TColor;
ColBakScalesX : array[1..MAXNUMRCLAYERS] of TColor;
ColBakScalesY : array[1..MAXNUMRCLAYERS] of TColor;
{$ENDIF}
FZoomState : TZoomState;
FStdLayout : TRcLayout;
MouseBoxState : TMouseBoxState;
LastMouseX : integer;
LastMouseY : integer;
MouseBoxX1 : integer;
MouseBoxX2 : integer;
MouseBoxY1 : integer;
MouseBoxY2 : integer;
WindAnchorX : integer;
WindAnchorY : integer;
WindOldCornerX : integer;
WindOldCornerY : integer;
FUseDataOf : TCustomRChart; { assigned shared data chart }
FDataUsers : array[1..MaxDataUsers] of TCustomRChart;
FDataUsersNum : integer;
FItClassVisib : array[0..255] of boolean; { visibility of
item classes }
FLayerVisib : array[1..MAXNUMRCLAYERS] of boolean; { visib.
of layers }
FOnMMvInChart : TMouseMoveInChartEvent;
FOnZoomPan : TZoomPanEvent;
FOnScaleTickDrawn: TScaleTickDrawnEvent;
FOnDataRendered : TRenderEvent;
FOnBefRenderData : TRenderEvent;
FOnScalesRendered: TRenderEvent;
FOnCrossHMove : TCrossHairMoveEvent;
FOnTxtLblMove : TTextLabelMoveEvent;
FOnMouseLeave : TNotifyEvent;
FOnMouseEnter : TNotifyEvent;
AuxBmp : TBitMap; { bitmap to hold background picture }
GrafBmp : TBitmap; { off-screen graphics bitmap }
ChartBmp : TBitmap; { off-screen chart bitmap }
FBakGndFile : TBakGndImg; { background file }
FJointLayers : TJointLayers; { joint layer }
FDataTag : longint; { user defined tag }
RcGridStyle : GridStyleType; { style of grid }
RcGridCol : TColor; { color of grid }
RcGridDx : double; { x-distance of grid points }
RcGridDy : double; { y-distance of grid points }
RcLRim : integer; { left rim }
RcRRim : integer; { right rim }
RcTRim : integer; { top rim }
RcBRim : integer; { bottom rim }
F3DRim : integer; { width of shadow }
RcShadowStyle : TShadowStyle; { style of shadow }
FShadowColor : TColor; { color of shadow }
RcShadowBakCol : TColor; { color of shadow background }
RcMouseAction : TMouseActMode; { type of allowed mouse action }
RcDataCol : TColor; { color of data }
FChartFrameCol : TColor; { color of chart frame }
RcFillCol : TColor; { fill color of rect/ellipse }
RcChartCol : TColor; { color of chart background }
RcPenStyle : TPenStyle; { pen style of drawing }
RcWindCol : TColor; { color of window background }
RcLineWid : byte; { line width of tkLine and tkLineTo }
FChartCaption : string; { caption of chart }
FCaptPosX : integer; { x position of caption }
FCaptPosY : integer; { y position of caption }
FCaptAlignment : TAlignment; { alignment of chart caption }
FCaptAnchorX : TCaptionAnchorHoriz;
FCaptAnchorY : TCaptionAnchorVert;
RcClassDefault : byte; { default class number for new items }
FActiveLayer : integer; { index of currently active layer }
FMouseAffLayer : array[1..MAXNUMRCLAYERS] of boolean;
{ TRUE: mouse affects layer }
Cpkx, Cpdx : array[1..MAXNUMRCLAYERS] of extended;
{ params for scaling on x-axis }
Cpky, Cpdy : array[1..MAXNUMRCLAYERS] of extended;
{ params for scaling on y-axis }
RcXLabelType : TFigType; { type of labeling }
RcYLabelType : TFigType; { type of labeling }
FMousePosX : double; { mouse x position - real coords }
FMousePosY : double; { mouse y position - real coords }
FMCurFixed : boolean; { TRUE: fixed mouse cursor }
FCrossHair : array[1..MaxCrossH] of TCrossHair;{cross hairs }
FTextLabels : array[1..MaxTxtLbl] of TTextLabel;{text labels }
FScalesX : array[1..MAXNUMRCLAYERS] of TScale;
FScalesY : array[1..MAXNUMRCLAYERS] of TScale;
FScalePropsX : array[1..MAXNUMRCLAYERS] of TScalePropsHoriz;
FScalePropsY : array[1..MAXNUMRCLAYERS] of TScalePropsVert;
CHNext : integer; { index of crosshair picked by mouse }
TLNext : integer; { index of text label picked by mouse }
FAutoRedraw : boolean; {TRUE: automatic redraw on any change }
FNumPPa : longint; { number of polyline segments }
FTextFontStyle : TFontStyles; { font style of text labels }
FTextBkStyle : TTextBkg; { background style of text labels }
FTextBkColor : TColor; { background color of text labels }
FTextAlignment : TAlignment; { alignment of text }
Fxasp, Fyasp : integer; { pixel widths of canvas }
FIsometric : boolean; { TRUE: scales are isometric }
FTranspItems : boolean;{TRUE: transparent ellipse & rectangle }
FZoomStack : array[1..MAXNUMRCLAYERS, 1..MaxZoomStack] of
TRectDouble;
FZStackPoi : integer; { zoom stack pointer }
FZoomRange : array[1..4] of extended; { confined zoom range }
function AddScaleInscription (Instring: string;
Inscr: string): string;
procedure AdjustCanInfoOfSharedCharts;
procedure AdjustScaling; virtual;
{$IFDEF DEBUG}
function CompStateAsText: string;
{$ENDIF}
function ExtractUserText (TickText: string; ix: integer): string;
procedure ForceRange (Layer: integer; xLo, yLo, xHi, yHi: extended;
EnterToZoomStack: boolean; ConfineRange: boolean);
procedure ForceRngIntern (Layer: integer; xLo, yLo, xHi,
yHi: extended; EnterToZoomStack: boolean;
ConfineRange: boolean);
procedure SetRangeIntern (Layer: integer; xLo, yLo, xHi,
yHi: extended; EnterToZoomStack: boolean;
ConfineRange: boolean);
function GetTypeOfFirstItem: TrcItem;
function GetTypeOfLastItem: TrcItem;
function GetClassVisib (cnum: byte): boolean;
function GetChartItem (idx: longint): TrcChartItem;
function GetCHPosX (chnum: integer): double;
function GetCHPosY (chnum: integer): double;
function GetCrossHair1: TCrossHair;
function GetCrossHair2: TCrossHair;
function GetCrossHair3: TCrossHair;
function GetCrossHair4: TCrossHair;
function GetLayerVisib (Layer: integer): boolean;
function GetMAffLayer (layer: integer): boolean;
function GetScalePropsX1: TScalePropsHoriz;
function GetScalePropsY1: TScalePropsVert;
function GetScalePropsX2: TScalePropsHoriz;
function GetScalePropsY2: TScalePropsVert;
{$IFDEF PAIDVERS}
function GetScalePropsX3: TScalePropsHoriz;
function GetScalePropsY3: TScalePropsVert;
function GetScalePropsX4: TScalePropsHoriz;
function GetScalePropsY4: TScalePropsVert;
procedure BackupColorsAndMakeBW;
procedure ReloadBackupColors;
{$ENDIF}
function GetScalePropsX (sclix: integer): TScalePropsHoriz;
function GetScalePropsY (sclix: integer): TScalePropsVert;
function GetItemCount (it: TrcItem): longint;
function GetFTextLabel (ix: integer): TTextLabel;
function GetTickPosX (ix: integer): double;
function GetTickPosXCnt: integer;
function GetTickPosY (ix: integer): double;
function GetTickPosYCnt: integer;
function GetMousePosX: double;
function GetMousePosY: double;
function GetZoomStackEntry (Layer, StackIx: integer): TRectDouble;
procedure LLCalcExtents (Layer: integer; Rim, MinRng: double;
var xLo, yLo, xHi, yHi: double);
procedure LLCalcMinMax (Layer: integer; RangeLoX, RangeLoY, RangeHiX,
RangeHiY: double; var xLo, yLo, xHi, yHi: double);
procedure SetAllocSize (alloc: integer);
procedure SetActiveLayer (lay: integer);
procedure SetChartitem (idx: longint; item: TrcChartItem);
procedure SetClassVisib (cnum: byte; value: boolean);
procedure SetCHPosX (chnum: integer; value: double);
procedure SetCHPosY (chnum: integer; value: double);
procedure SetLRim (r: integer);
procedure SetRRim (r: integer);
procedure SetTRim (r: INTEGER);
procedure SetBRim (r: integer);
procedure SetIsoMetric (im: boolean);
procedure SetLayerVisib (Layer: integer; value: boolean);
procedure SetMAffLayer (layer: integer; value: boolean);
procedure SetUseDataOf (orc: TCustomRChart);
procedure SetF3DRim (r: integer);
procedure SetDataTag (tag: longint);
procedure SetShadowStyle (ss: TShadowStyle);
procedure SetShadowColor (c: TColor);
procedure SetShadowBakColor (c: TColor);
procedure SetClassDefault (DefClass: byte);
procedure SetCrossHair1 (x: TCrossHair);
procedure SetCrossHair2 (x: TCrossHair);
procedure SetCrossHair3 (x: TCrossHair);
procedure SetCrossHair4 (x: TCrossHair);
procedure SetScalePropsX1 (x: TScalePropsHoriz);
procedure SetScalePropsY1 (x: TScalePropsVert);
procedure SetScalePropsX2 (x: TScalePropsHoriz);
procedure SetScalePropsY2 (x: TScalePropsVert);
{$IFDEF PAIDVERS}
procedure SetScalePropsX3 (x: TScalePropsHoriz);
procedure SetScalePropsY3 (x: TScalePropsVert);
procedure SetScalePropsX4 (x: TScalePropsHoriz);
procedure SetScalePropsY4 (x: TScalePropsVert);
{$ENDIF}
procedure SetScalePropsX (sclix: integer; x: TScalePropsHoriz);
procedure SetScalePropsY (sclix: integer; x: TScalePropsVert);
procedure SetScaleProps (var Scl: TScale; SclProps: TScaleProps);
procedure SetSuppressPaint (supp: boolean);
procedure SetGridStyle (gs: GridStyleType);
procedure SetGridDx (dx: double);
procedure SetGridDy (dy: double);
procedure SetDataCol (c: TColor);
procedure SetScaleCol (c: TColor);
procedure SetFillCol (c: TColor);
procedure SetChartCol (c: TColor);
procedure SetWindCol (c: TColor);
procedure SetGridCol (c: TColor);
procedure SetChartCaption (hstr: string);
procedure SetCaptPosX (p: integer);
procedure SetCaptPosY (p: integer);
procedure SetCaptAlignment (al: TAlignment);
procedure SetCaptAnchorX (ca: TCaptionAnchorHoriz);
procedure SetCaptAnchorY (ca: TCaptionAnchorVert);
procedure SetPenStyle (ps: TPenStyle);
procedure SetLineWid (w: byte);
procedure WMMouseMoveInChart(var Message: TWMMouse);
message WM_MOUSEMOVE;
{$IFNDEF ISCLX} //&&& DHACK
procedure CMMouseLeave(var msg:TMessage); message CM_MOUSELeave;
procedure CMMouseEnter(var msg:TMessage); message CM_MOUSEEnter;
{$ENDIF}
procedure WMGetDlgCode(var message: TWMGetDlgCode);
message WM_GETDLGCODE;
procedure SetTextFontStyle (tfs: TFontStyles);
procedure SetTextBkStyle (bs: TTextBkg);
procedure SetTextBkColor (bc: TColor);
procedure SetTextAlignment (al: TAlignment);
procedure SetFTextLabel (ix: integer; value: TTextLabel);
procedure SetJointLayers (value: TJointLayers);
procedure SetBakGndFile (x: TBakGndImg);
procedure SetStdLayout (lyt: TRCLayout);
procedure ZoomStateOnStack;
protected
FDataContainer : array of TrcChartItem;{ array of drawing items }
FLastElemOnShow : longint; { index of last entry when
ShowGraf is called }
FItemCount : array[TrcItem] of longint; { element count }
FSuppressPaint : boolean; { TRUE: suppress all paint calls }
procedure Paint; override;
procedure Loaded; override;
procedure InitGraf (cv: TCanvas; PosX, PosY: integer); virtual;
procedure ConstructChartBmp(cv: TCanvas);
procedure ConstructDataBmp (cv: TCanvas; PosX, PosY: integer;
BlkWhite: boolean; FirstItem: integer);
procedure DrawFinish (xPos, yPos: integer; SrcBmp: TBitMap);
procedure MouseMove (Shift: TShiftState; X,Y: integer); override;
procedure MouseMoveInChart (InChart: boolean; Shift: TShiftState;
RMousePosX, RMousePosY: double);
procedure MouseDown (Button: TMouseButton;
Shift: TShiftState; X, Y: Integer); override;
procedure MouseUp (Button: TMouseButton;
Shift: TShiftState; X, Y: Integer); override;
procedure StyleChanged (Sender: TObject);
procedure ScalePropsChanged(Sender: TObject);
procedure DoOnScaleTickDrawn (Sender: TObject; var Canvas: TCanvas;
ScaleType: TScaleType; CurrentTickPos: double;
ChartX, ChartY: integer);
procedure DoZoomPanEvent;
procedure DoCrossHMoveEvent (WhichCH: TCrossHair);
procedure DoTxtLblMoveEvent (WhichTL: TTextLabel);
// properties and method to be public
procedure M2R (Layer: integer; xin,yin: longint;
var xout,yout: double);
procedure R2M (Layer: integer; xin,yin: double;
var xout,yout: longint);
procedure ClearGraf;
procedure ConfineZoomRange (xLo, yLo, xHi, yHi: double);
procedure ShowGraf;
procedure ShowGrafNewOnly;
function MouseBox (var xLo, yLo, xHi, yHi: double): boolean;
procedure MouseBoxAbort;
{ draw }
property ActiveLayer: integer
read FActiveLayer write SetActiveLayer;
function AddTextLabel (PosX, PosY: double; TxtColor: TColor;
Txt: string; PropertyTemplate: integer): integer;
procedure AllTextLabelsOff;
procedure Arrow (x1,y1, x2,y2: double; HeadSize: integer);
procedure Bar3D (llx, lly, urx, ury: double;
Depth: integer; Angle: integer);
procedure ClearZoomHistory;
procedure CopyToBitmap (ABitmap: TBitmap; BlkWhite: boolean);
procedure CopyToBMP (FName: string; BlkWhite: boolean);
procedure CopyToClipboard (BlkWhite: boolean);
{$IFNDEF ISCLX}
procedure CopyToClipboardWMF (BlkWhite: boolean);
procedure CopyToWMF (FName: string; BlkWhite: boolean);
procedure CopyToOpenPrinter (var x,y: integer; ScaleF: double;
BlkWhite: boolean);
procedure PrintIt (ScaleF: double; BlkWhite: boolean);
{$ENDIF}
property DataContainer[idx: longint]: TrcChartItem
read GetChartItem write SetChartItem;
property CrossHairPosX [chnum: integer]: double
read GetCHPosX write SetCHPosX;
property CrossHairPosY [chnum: integer]: double
read GetCHPosY write SetCHPosY;
procedure CrossHairSetPos (chnum: integer; x,y: double);
procedure CrossHairSetup (ch: integer; chColor: TColor;
Mode: TCrossHMode; LineType: TPenStyle;
LineWidth: integer);
property DataTag: longint read FDataTag write SetDataTag;
procedure DrawTo (x,y: double);
procedure DrawToRelPix (dx,dy: integer);
procedure Ellipse (cx, cy, HorizAxLeng, VertAxLeng: double);
procedure Line (x1,y1, x2, y2: double);
procedure MoveTo (x,y: double);
procedure MoveToRelPix (dx,dy: integer);
procedure MarkAt (x,y: double; mk: byte);
procedure Rectangle (x1,y1, x2, y2: double);
procedure RectFrame (x1,y1, x2, y2: double; FrameStyle: TFrameStyle;
ShadowColor, HiLightColor: TColor);
procedure SaveDataASC (FName: string);
{$IFNDEF DOTNET}
procedure SaveData (FName: string);
procedure LoadData (FName: string; AppendIt: boolean);
{$ENDIF}
procedure SetRange (Layer: integer; xLo, yLo, xHi, yHi: extended);
procedure AutoRange (Layer: integer; Margin: double); overload;
procedure AutoRange (Layer: integer; Margin, MinRange: double); overload;
procedure AutoRangeXOnly (Layer: integer;
Margin: double); overload;
procedure AutoRangeXOnly (Layer: integer;
Margin, MinRange: double); overload;
procedure AutoRangeYOnly (Layer: integer;
Margin: double); overload;
procedure AutoRangeYOnly (Layer: integer;
Margin, MinRange: double); overload;
procedure SetEqualRange (Layers: TLayerSet);
procedure SetEqualRangeXOnly (Layers: TLayerSet);
procedure SetEqualRangeYOnly (Layers: TLayerSet);
procedure Text (x,y: double; size: integer; txt: string);
{ process single item }
procedure RemoveLastItem;
procedure RemoveFirstItem;
procedure RemoveItem (Index: longint);
function RemoveItemsByClass (ClassNumber: byte): longint;
procedure FindMinMax (Layer: integer; RangeLoX, RangeLoY, RangeHiX,
RangeHiY: double; var MinX, MinY, MaxX, MaxY: double);
function FindNearestItemReal (mx, my: double; ItemID: TrcItem;
ClassNumber: byte; var Dist: double): longint;
function FindNearestItemScreen (mx, my: double; ItemID: TrcItem;
ClassNumber: byte; var Dist: double): longint;
function FindUsedLayers: TLayerSet;
function GetItemParams (Item: longint): TrcChartItem;
property ItemCount[it: TrcItem]: longint read GetItemCount;
procedure SetItemParams (Item: longint; ItParams: TrcChartItem);
procedure ScaleItem (Item: longint; kx, dx, ky, dy: double);
{ process more items }
function MarkItemsInWindow (xLo, YLo, XHi, YHi: double;
ItemID: TrcItem; ClassNumber: byte): longint;
procedure MarkAllItems (ItemID: TrcItem; ClassNumber: byte);
property MouseAffectsLayer[Layer: integer]: boolean
read GetMAffLayer write SetMAffLayer;
property MousePosX: double read GetMousePosX;
property MousePosY: double read GetMousePosY;
property NumItems: longint read FNumChartItems;
property ClassVisible [cnum:byte]: boolean
read GetClassVisib write SetClassVisib;
property LayerVisible [layer: integer]: boolean
read GetLayerVisib write SetLayerVisib;
procedure ScaleAllItems (kx, dx, ky, dy: double);
property ScalePropsX [SclIx: integer]: TScalePropsHoriz
read GetScalePropsX write setScalePropsX;
property ScalePropsY [SclIx: integer]: TScalePropsVert
read GetScalePropsY write setScalePropsY;
procedure ScaleSelectedItems (kx, dx, ky, dy: double;
ClassNumber: byte);
procedure SetTextLabel (Idx: integer; PosX, PosY: double;
TxtColor: TColor; Txt: string;
PropertyTemplate: integer);
property SuppressPaint: boolean
read FSuppressPaint write SetSuppressPaint;
property TransparentItems: boolean
read FTranspItems write FTranspItems;
property TypeOfLastItem: TrcItem read GetTypeOfLastItem;
property TypeOfFirstItem: TrcItem read GetTypeOfFirstItem;
procedure NewColorOfClassItems (Newcol: TColor; ClassNumber: byte);
property TextLabels[ix: integer]: TTextLabel
read GetFTextLabel write SetFTextLabel;
property TickPosX [ix: integer]: double read GetTickPosX;
property TickPosY [iy: integer]: double read GetTickPosY;
property TickNumX: integer read GetTickPosXCnt;
property TickNumY: integer read GetTickPosYCnt;
property ZoomState: TZoomState read FZoomState;
procedure ZoomHistory (Index: integer);
property ZoomStack [Layer, StackIx: integer]: TRectDouble
read GetZoomStackEntry;
// properties to be published
property Font;
property Align;
property Visible;
property ShowHint;
property PopupMenu;
property Anchors;
property Constraints;
{$IFNDEF ISCLX}
property DragKind;
property DragCursor;
property DragMode;
{$ENDIF}
property AllocSize: integer read FAllocSize write SetAllocSize;
property AutoRedraw: boolean read FAutoRedraw write FAutoRedraw;
property LRim: integer read RcLrim write SetLRim default DefLRim;
property RRim: integer read RcRRim write SetRRim default DefRRim;
property TRim: integer read RcTRim write SetTRim default DefTRim;
property BRim: integer read RcBRim write SetBRim default DefBRim;
property MarginLeft: integer read RcLrim write SetLRim default DefLRim;
property MarginRight: integer read RcRRim write SetRRim default DefRRim;
property MarginTop: integer read RcTRim write SetTRim default DefTRim;
property MarginBottom: integer read RcBRim write SetBRim default DefBRim;
property BackGroundImg: TBakGndImg read FBakGndFile write SetBakGndFile;
property ClassDefault: byte read RcClassDefault write SetClassDefault;
property GridStyle: GridStyleType read RcGridStyle write SetGridStyle;
property GridDx: double read RcGridDx write SetGridDx;
property GridDy: double read RcGridDy write SetGridDy;
property Isometric: boolean read FIsoMetric write SetIsoMetric;
property DataColor: TColor
read RcDataCol write SetDataCol default DefDataCol;
property PenStyle: TPenStyle
read RcPenStyle write SetPenStyle default DefPenStyle;
property ChartFrameColor: TColor
read FChartFrameCol write SetScaleCol
default DefChartFrameCol;
property FillColor: TColor
read RcFillCol write SetFillCol default DefFillCol;
property ChartColor: TColor
read RcChartCol write SetChartCol default DefChartCol;
property WindColor: TColor
read RcWindCol write SetWindCol default DefWindCol;
property GridColor: TColor
read RcGridCol write SetGridCol default DefGridCol;
property JointLayers: TJointLayers
read FJointLayers write SetJointLayers;
property LineWidth: byte
read RcLineWid write SetLineWid default DefLineWid;
property Caption: string read FChartCaption write SetChartCaption;
property CaptionPosX: integer read FCaptPosX write SetCaptPosX;
property CaptionPosY: integer read FCaptPosY write SetCaptPosY;
property CaptionAlignment: TAlignment
read FCaptAlignment write SetCaptAlignment;
property CaptionAnchorHoriz: TCaptionAnchorHoriz
read FCaptAnchorX write SetCaptAnchorX;
property CaptionAnchorVert: TCaptionAnchorVert
read FCaptAnchorY write SetCaptAnchorY;
property CrossHair1: TCrossHair
read GetCrossHair1 write SetCrossHair1;
property CrossHair2: TCrossHair
read GetCrossHair2 write SetCrossHair2;
property CrossHair3: TCrossHair
read GetCrossHair3 write SetCrossHair3;
property CrossHair4: TCrossHair
read GetCrossHair4 write SetCrossHair4;
property MouseAction: TMouseActMode
read RcMouseAction write RcMouseAction;
property MouseCursorFixed: boolean
read FMCurFixed write FMCurFixed;
property Scale1X: TScalePropsHoriz
read GetScalePropsX1 write SetScalePropsX1;
property Scale1Y: TScalePropsVert
read GetScalePropsY1 write SetScalePropsY1;
property Scale2X: TScalePropsHoriz
read GetScalePropsX2 write SetScalePropsX2;
property Scale2Y: TScalePropsVert
read GetScalePropsY2 write SetScalePropsY2;
{$IFDEF PAIDVERS}
property Scale3X: TScalePropsHoriz
read GetScalePropsX3 write SetScalePropsX3;
property Scale3Y: TScalePropsVert
read GetScalePropsY3 write SetScalePropsY3;
property Scale4X: TScalePropsHoriz
read GetScalePropsX4 write SetScalePropsX4;
property Scale4Y: TScalePropsVert
read GetScalePropsY4 write SetScalePropsY4;
{$ENDIF}
property StandardLayout: TRCLayout
read FStdLayout write SetStdLayout stored false;
property ShadowWidth: integer
read F3DRim write SetF3DRim default DefShadowWidth;
property ShadowStyle: TShadowStyle
read RcShadowStyle write SetShadowStyle;
property ShadowColor: TColor
read FShadowColor write SetShadowColor;
property ShadowBakColor: TColor
read RcShadowBakCol write SetShadowBakColor;
property UseDataOf: TCustomRChart
read FUseDataOf write SetUseDataOf;
property TextFontStyle: TFontStyles
read FTextFontStyle write SetTextFontStyle;
property TextBkStyle: TTextBkg
read FTextBkStyle write SetTextBkStyle;
property TextBkColor: TColor
read FTextBkColor write SetTextBkColor;
property TextAlignment: TAlignment
read FTextAlignment write SetTextAlignment;
property OnClick;
property OnDblClick;
property OnDragDrop;
property OnDragOver;
property OnEndDrag;
property OnMouseMove;
property OnMouseDown;
property OnMouseUp;
property OnMouseEnter: TNotifyEvent
read FOnMouseEnter write FOnMouseEnter;
property OnMouseLeave: TNotifyEvent
read FOnMouseLeave write FOnMouseLeave;
property OnKeyDown;
property OnKeyUp;
property OnKeyPress;
property OnMouseMoveInChart: TMouseMoveInChartEvent
read FOnMMvInChart write FOnMMvInChart;
property OnZoomPan: TZoomPanEvent
read FOnZoomPan write FOnZoomPan;
property OnScaleTickDrawn: TScaleTickDrawnEvent
read FOnScaleTickDrawn write FOnScaleTickDrawn;
property OnBeforeRenderData: TRenderEvent
read FOnBefRenderData write FOnBefRenderData;
property OnDataRendered: TRenderEvent
read FOnDataRendered write FOnDataRendered;
property OnScalesRendered: TRenderEvent
read FOnScalesRendered write FOnScalesRendered;
property OnStartDrag;
property OnCrossHairMove: TCrossHairMoveEvent
read FOnCrossHMove write FOnCrossHMove;
property OnTextLabelMove: TTextLabelMoveEvent
read FOnTxtLblMove write FOnTxtLblMove;
{$IFNDEF ISCLX} // Kylix does not know OnCanResize
property OnCanResize;
property OnResize;
{$ENDIF}
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure SetBounds (ALeft, ATop, AWidth, AHeight: Integer); override;
end;
TRChart = class (TCustomRChart)
protected
procedure CreateWnd; override;
public
procedure M2R (Layer: integer; xin,yin: longint;
var xout,yout: double);
procedure R2M (Layer: integer; xin,yin: double;
var xout,yout: longint);
procedure ClearGraf;
procedure ConfineZoomRange (xLo, yLo, xHi, yHi: double);
procedure ShowGraf;
procedure ShowGrafNewOnly;
procedure SetBounds (ALeft, ATop, AWidth,
AHeight: Integer); override;
function MouseBox (var xLo, yLo, xHi, yHi: double): boolean;
procedure MouseBoxAbort;
property ActiveLayer;
function AddTextLabel (PosX, PosY: double; TxtColor: TColor;
Txt: string; PropertyTemplate: integer): integer;
procedure AllTextLabelsOff;
procedure Arrow (x1,y1, x2,y2: double; HeadSize: integer);
procedure Bar3D (llx, lly, urx, ury: double;
Depth: integer; Angle: integer);
procedure ClearZoomHistory;
procedure CopyToBitmap (ABitmap: TBitmap; BlkWhite: boolean);
procedure CopyToBMP (FName: string; BlkWhite: boolean);
procedure CopyToClipboard (BlkWhite: boolean);
{$IFNDEF ISCLX}
procedure CopyToClipboardWMF (BlkWhite: boolean);
procedure CopyToWMF (FName: string; BlkWhite: boolean);
procedure CopyToOpenPrinter (var x,y: integer; ScaleF: double;
BlkWhite: boolean);
procedure PrintIt (ScaleF: double; BlkWhite: boolean);
{$ENDIF}
property DataContainer;
property CrossHairPosX;
property CrossHairPosY;
procedure CrossHairSetPos (chnum: integer; x,y: double);
procedure CrossHairSetup (ch: integer; chColor: TColor;
Mode: TCrossHMode; LineType: TPenStyle;
LineWidth: integer);
property DataTag;
procedure DrawTo (x,y: double);
procedure DrawToRelPix (dx,dy: integer);
procedure Ellipse (cx, cy, HorizAxLeng, VertAxLeng: double);
procedure Line (x1,y1, x2, y2: double);
procedure MoveTo (x,y: double);
procedure MoveToRelPix (dx,dy: integer);
procedure MarkAt (x,y: double; mk: byte);
procedure Rectangle (x1,y1, x2, y2: double);
procedure RectFrame (x1,y1, x2, y2: double;
FrameStyle: TFrameStyle;
ShadowColor, HiLightColor: TColor);
procedure SaveDataASC (FName: string);
{$IFNDEF DOTNET}
procedure SaveData (FName: string);
procedure LoadData (FName: string; AppendIt: boolean);
{$ENDIF}
procedure SetRange (Layer: integer; xLo, yLo, xHi, yHi: extended);
procedure AutoRange (Layer: integer; Margin: double); overload;
procedure AutoRange (Layer: integer;
Margin, MinRange: double); overload;
procedure AutoRangeXOnly (Layer: integer;
Margin: double); overload;
procedure AutoRangeXOnly (Layer: integer;
Margin, MinRange: double); overload;
procedure AutoRangeYOnly (Layer: integer;
Margin: double); overload;
procedure AutoRangeYOnly (Layer: integer;
Margin, MinRange: double); overload;
procedure SetEqualRange (Layers: TLayerSet);
procedure SetEqualRangeXOnly (Layers: TLayerSet);
procedure SetEqualRangeYOnly (Layers: TLayerSet);
procedure Text (x,y: double; size: integer; txt: string);
{ process single item }
procedure RemoveLastItem;
procedure RemoveFirstItem;
procedure RemoveItem (Index: longint);
function RemoveItemsByClass (ClassNumber: byte): longint;
procedure FindMinMax (Layer: integer; RangeLoX, RangeLoY,
RangeHiX, RangeHiY: double;
var MinX, MinY, MaxX, MaxY: double);
function FindNearestItemReal (mx, my: double; ItemID: TrcItem;
ClassNumber: byte; var Dist: double): longint;
function FindNearestItemScreen (mx, my: double; ItemID: TrcItem;
ClassNumber: byte; var Dist: double): longint;
function FindUsedLayers: TLayerSet;
function GetItemParams (Item: longint): TrcChartItem;
property ItemCount;
procedure SetItemParams (Item: longint; ItParams: TrcChartItem);
procedure ScaleItem (Item: longint; kx, dx, ky, dy: double);
{ process more items }
function MarkItemsInWindow (xLo, YLo, XHi, YHi: double;
ItemID: TrcItem; ClassNumber: byte): longint;
procedure MarkAllItems (ItemID: TrcItem; ClassNumber: byte);
property MouseAffectsLayer;
property MousePosX;
property MousePosY;
property NumItems;
property ClassVisible;
property LayerVisible;
procedure ScaleAllItems (kx, dx, ky, dy: double);
property ScalePropsX;
property ScalePropsY;
procedure ScaleSelectedItems (kx, dx, ky, dy: double;
ClassNumber: byte);
procedure SetTextLabel (Idx: integer; PosX, PosY: double;
TxtColor: TColor; Txt: string;
PropertyTemplate: integer);
property SuppressPaint;
property TransparentItems;
property TypeOfLastItem;
property TypeOfFirstItem;
procedure NewColorOfClassItems (Newcol: TColor;
ClassNumber: byte);
property TextLabels;
property TickPosX;
property TickPosY;
property TickNumX;
property TickNumY;
property ZoomState;
procedure ZoomHistory (Index: integer);
property ZoomStack;
published
property Font;
property Align;
property Visible;
property ShowHint;
property PopupMenu;
property Anchors;
property Constraints;
{$IFNDEF ISCLX}
property DragKind;
property DragCursor;
property DragMode;
{$ENDIF}
property AllocSize;
property AutoRedraw;
property MarginLeft;
property MarginRight;
property MarginTop;
property MarginBottom;
property LRim;
property RRim;
property TRim;
property BRim;
property BackGroundImg;
property ClassDefault;
property GridStyle;
property GridDx;
property GridDy;
property Isometric;
property DataColor;
property PenStyle;
property ChartFrameColor;
property FillColor;
property ChartColor;
property WindColor;
property GridColor;
property JointLayers;
property LineWidth;
property Caption;
property CaptionPosX;
property CaptionPosY;
property CaptionAlignment;
property CaptionAnchorHoriz;
property CaptionAnchorVert;
property CrossHair1;
property CrossHair2;
property CrossHair3;
property CrossHair4;
property MouseAction;
property MouseCursorFixed;
property Scale1X;
property Scale1Y;
property Scale2X;
property Scale2Y;
{$IFDEF PAIDVERS}
property Scale3X;
property Scale3Y;
property Scale4X;
property Scale4Y;
{$ENDIF}
property StandardLayout;
property ShadowWidth;
property ShadowStyle;
property ShadowColor;
property ShadowBakColor;
property UseDataOf;
property TextFontStyle;
property TextBkStyle;
property TextBkColor;
property TextAlignment;
property OnClick;
property OnDblClick;
property OnDragDrop;
property OnDragOver;
property OnEndDrag;
property OnMouseMove;
property OnMouseDown;
property OnMouseUp;
property OnKeyDown;
property OnKeyUp;
property OnKeyPress;
property OnMouseMoveInChart;
property OnMouseEnter;
property OnMouseLeave;
property OnMouseWheel;
property OnMouseWheelUp;
property OnMouseWheelDown;
property OnZoomPan;
property OnScaleTickDrawn;
property OnBeforeRenderData;
property OnDataRendered;
property OnScalesRendered;
property OnStartDrag;
property OnCrossHairMove;
property OnTextLabelMove;
{$IFNDEF ISCLX} // Kylix does not know OnCanResize
property OnCanResize;
property OnResize;
{$ENDIF}
end;
TSmithChart = class(TCustomRChart)
private
FGridColLight : TColor;
FGridColDark : TColor;
FDiagramColor : TColor;
procedure SetGridColLight (value: TColor);
procedure SetGridColDark (value: TColor);
function GetCrossHair: TCrossHair;
function GetCrossHairPosX: double;
procedure SetCrossHairPosX (value: double);
function GetCrossHairPosY: double;
procedure SetCrossHairPosY (value: double);
procedure SetCrossHair (x: TCrossHair);
procedure SetDiagramColor (value: TColor);
function GetRangeLowX: double;
function GetRangeLowY: double;
function GetRangeHighX: double;
function GetRangeHighY: double;
procedure SetRangeLowX (value: double);
procedure SetRangeHighX (value: double);
procedure SetRangeLowY (value: double);
protected
procedure CreateWnd; override;
procedure Paint; override;
procedure InitGraf (cv: TCanvas; PosX, PosY: integer); override;
public
procedure M2R (xin,yin: longint; var ReflReal,ReflImag: double);
procedure R2M (ReflReal,ReflImag: double; var xout,yout: longint);
constructor Create(AOwner: TComponent); override;
function CalcReflectionReal (Resistance, Reactance: double): double;
function CalcReflectionImag (Resistance, Reactance: double): double;
function CalcResistance (ReflectionReal, ReflectionImag: double): double;
function CalcReactance (ReflectionReal, ReflectionImag: double): double;
procedure ClearGraf;
procedure ShowGraf;
procedure ShowGrafNewOnly;
procedure MarkAt (x,y: double; mk: byte);
procedure DrawTo (x,y: double);
procedure MoveTo (x,y: double);
property SuppressPaint;
procedure SetRange (xLo, yLo, xHi, yHi: extended);
procedure AutoRange (Margin: double); overload;
procedure AutoRange (Margin, MinRange: double); overload;
function AddTextLabel (PosX, PosY: double; TxtColor: TColor;
Txt: string; PropertyTemplate: integer): integer;
procedure AllTextLabelsOff;
procedure CopyToBitmap (ABitmap: TBitmap; BlkWhite: boolean);
procedure CopyToBMP (FName: string; BlkWhite: boolean);
procedure CenterChart;
procedure CopyToClipboard (BlkWhite: boolean);
property DataContainer;
procedure CopyToOpenPrinter (var x,y: integer; ScaleF: double;
BlkWhite: boolean);
procedure PrintIt (ScaleF: double; BlkWhite: boolean);
property CrossHairPosX: double read GetCrossHairPosX write SetCrossHairPosX;
property CrossHairPosY: double read GetCrossHairPosY write SetCrossHairPosY;
procedure CrossHairSetPos (x,y: double);
procedure CrossHairSetup (chColor: TColor;
Mode: TCrossHMode; LineType: TPenStyle;
LineWidth: integer);
property DataTag;
property NumItems;
procedure Line (x1,y1, x2, y2: double);
procedure Rectangle (x1,y1, x2, y2: double);
procedure Ellipse (cx, cy, HorizAxLeng, VertAxLeng: double);
procedure Text (refreal, refimag: double; size: integer; txt: string);
{$IFNDEF DOTNET}
procedure SaveData (FName: string);
procedure LoadData (FName: string; AppendIt: boolean);
{$ENDIF}
procedure RemoveLastItem;
procedure RemoveFirstItem;
procedure RemoveItem (Index: longint);
function RemoveItemsByClass (ClassNumber: byte): longint;
procedure FindMinMax (RangeLoX, RangeLoY, RangeHiX, RangeHiY: double;
var MinX, MinY, MaxX, MaxY: double);
property ItemCount;
procedure SetTextLabel (Idx: integer; PosX, PosY: double;
TxtColor: TColor; Txt: string;
PropertyTemplate: integer);
property TextLabels;
function MarkItemsInWindow (ReflRealLow, ReflImagLow, ReflRealHigh,
ReflImagHigh: double; ItemID: TrcItem;
ClassNumber: byte): longint;
procedure MarkAllItems (ItemID: TrcItem; ClassNumber: byte);
property ClassVisible;
procedure NewColorOfClassItems (Newcol: TColor; ClassNumber: byte);
property MousePosX: double read FMousePosX;
property MousePosY: double read FMousePosY;
published
property Font;
property Align;
property Visible;
property ShowHint;
property PopupMenu;
{$IFNDEF VER110} // CBuilder 3.0 does not know about Anchors and Constraints
{$IFNDEF VER100} // Delphi 3.0 does not know about Anchors and Constraints
property Anchors;
property Constraints;
{$ENDIF}
{$ENDIF}
property MarginLeft;
property MarginRight;
property MarginTop;
property MarginBottom;
property AllocSize;
property AutoRedraw;
property ClassDefault;
property GridColorLight: TColor read FGridColLight write SetGridColLight;
property GridColorDark: TColor read FGridColDark write SetGridColDark;
property DataColor;
property PenStyle;
property FillColor;
property ChartColor;
property ChartFrameColor;
property WindColor;
property DiagramColor: TColor read FDiagramColor write SetDiagramColor;
property LineWidth;
property CrossHair: TCrossHair
read GetCrossHair write SetCrossHair;
property Caption;
property CaptionPosX;
property CaptionPosY;
property CaptionAlignment;
property CaptionAnchorHoriz;
property CaptionAnchorVert;
property RangeXLow: double read GetRangeLowX write SetRangeLowX;
property RangeXHigh: double read GetRangeHighX write SetRangeHighX;
property RangeYLow: double read GetRangeLowY write SetRangeLowY;
property RangeYHigh: double read GetRangeHighY;
property MouseAction;
property MouseCursorFixed;
property ShadowWidth;
property ShadowStyle;
property ShadowColor;
property ShadowBakColor;
property TextFontStyle;
property TextBkStyle;
property TextBkColor;
property TextAlignment;
property TransparentItems;
property OnClick;
property OnDblClick;
property OnMouseMove;
property OnMouseDown;
property OnMouseUp;
property OnMouseMoveInChart;
property OnKeyDown;
property OnKeyUp;
property OnKeyPress;
property OnMouseEnter;
property OnMouseLeave;
property OnMouseWheel;
property OnMouseWheelUp;
property OnMouseWheelDown;
property OnZoomPan;
property OnDataRendered;
property OnCrossHairMove;
property OnTextLabelMove;
{$IFNDEF VER110} // CBuilder 3.0 does not know OnCanResize
{$IFNDEF VER100} // Delphi 3.0 does not know OnCanResize
{$IFNDEF ISCLX} // Kylix does not know either
property OnCanResize;
property OnResize;
{$ENDIF}
{$ENDIF}
{$ENDIF}
end;
{$IFDEF DEVELOPVERS}
{$I cxintf_contourplot.pas}
{$I cxintf_quickchart.pas}
{$ENDIF}
function RCSpecStrf (r: double; FieldWidth, DecP: integer): string;
|