📄 qiplotcomponent.pas
字号:
TiPlotAxisAccess = class(TiPlotAxis ) end;
TiPlotLabelAccess = class(TiPlotLabel ) end;
TiPlotDataViewAccess = class(TiPlotDataView ) end;
TiPlotLegendAccess = class(TiPlotLegend ) end;
TiPlotTableAccess = class(TiPlotTable ) end;
TiPlotLimitAccess = class(TiPlotLimit ) end;
TiPlotToolBarAccess = class(TiPlotToolBar ) end;
TiPlotDataCursorAccess = class(TiPlotDataCursor ) end;
TiPlotAnnotationAccess = class(TiPlotAnnotation ) end;
TStringListAccess = class(TStringList ) end;
//****************************************************************************************************************************************************
constructor TiPlotComponent.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
Width := 500;
Height := 200;
BackGroundColor := clBlack;
BorderStyle := ibsLowered;
UpdateFrameRate := 60;
AutoFrameRate := True;
FBackGroundGradientStartColor := clBlue;
FOuterMarginLeft := 5;
FOuterMarginTop := 5;
FOuterMarginRight := 5;
FOuterMarginBottom := 5;
FHintsShow := True;
FHintsPause := 500;
FHintsHidePause := 2500;
FPrintShowDialog := True;
FPrintOrientation := poLandscape;
FPrintMarginTop := 1;
FPrintMarginLeft := 1;
FPrintMarginRight := 1;
FPrintMarginBottom := 1;
FPrintDocumentName := 'Untitled';
FMaster := TiPlotMasterManager.Create(Self);
FMaster.OnChange := MasterChange;
FMaster.OnRemove := MasterRemove;
FMaster.OnInvalidateNow := InvalidateNowEvent;
FPopupMenu := TPopupMenu.Create(Self);
FHintsFont := TFont.Create;
FImageList0 := TImageList.CreateSize(24, 24);
FImageList1 := TImageList.CreateSize(24, 24);
FImageList2 := TImageList.CreateSize(24, 24);
FAnnotationDefaultFont := TFont.Create;
FAnnotationDefaultFont.Color := clWhite;
FAnnotationDefaultBrushStlye := bsSolid;
FAnnotationDefaultBrushColor := clWhite;
FAnnotationDefaultPenStlye := pssolid;
FAnnotationDefaultPenColor := clWhite;
FAnnotationDefaultPenwidth := 1;
FAxesCollisionList := TStringList.Create;
FAxesCollisionList.Sorted := False;
FVisibleListLeft := TStringList.Create;
FVisibleListRight := TStringList.Create;
FVisibleListTop := TStringList.Create;
FVisibleListBottom := TStringList.Create;
FLayerList := TStringList.Create;
FLayerList.Sorted := True;
FLayerList.Duplicates := dupAccept;
FClipAnnotationsToAxes := True;
UserCanEditObjects := True;
OnInternalTimer := HintTimer;
end;
//****************************************************************************************************************************************************
destructor TiPlotComponent.Destroy;
begin
FMouseDownObject := nil;
ClearAxesCollisionList;
FMaster.ObjectManager.ShutDownSetup;
if Assigned(FMaster) then
begin
FMaster.Free;
FMaster := nil;
end;
{$ifdef iVCL}if Assigned(FSnapShotPicture) then FSnapShotPicture.Free;{$endif}
{$ifdef iVCL}if Assigned(FMetaFile) then FMetaFile.Free; {$endif}
if Assigned(FSaveDialog) then FSaveDialog.Free;
FHintsFont.Free;
FAnnotationDefaultFont.Free;
FImageList0.Free;
FImageList1.Free;
FImageList2.Free;
FAxesCollisionList.Free;
FLayerList.Free;
FVisibleListBottom.Free;
FVisibleListTop.Free;
FVisibleListRight.Free;
FVisibleListLeft.Free;
inherited;
end;
//****************************************************************************************************************************************************
procedure TiPlotComponent.Loaded;
begin
inherited;
FMaster.LayoutManager.Enabled := True;
EndUpdate;
end;
//****************************************************************************************************************************************************
procedure TiPlotComponent.ClearAxesCollisionList;
begin
while FAxesCollisionList.Count <> 0 do
begin
FAxesCollisionList.Objects[0].Free;
FAxesCollisionList.Delete(0);
end;
end;
//****************************************************************************************************************************************************
procedure TiPlotComponent.ClearLayerList;
begin
FLayerList.Clear;
end;
//****************************************************************************************************************************************************
procedure TiPlotComponent.AddLayerObject(LayerString: String; PlotObject: TiPlotObject);
begin
FLayerList.AddObject(LayerString, PlotObject);
end;
//****************************************************************************************************************************************************
procedure TiPlotComponent.AddAxesCollisionItem(ARect: TRect);
var
iPlotRectObject : TiPlotRectObject;
begin
iPlotRectObject := TiPlotRectObject.Create;
iPlotRectObject.ARect := ARect;
FAxesCollisionList.AddObject('', iPlotRectObject);
end;
//****************************************************************************************************************************************************
function TiPlotComponent.AddAxesCollisionDetectionItem(ARect: TRect): Boolean;
var
x : Integer;
CurrentRect : TRect;
DummyRect : TRect;
begin
Result := False;
for x := 0 to FAxesCollisionList.Count - 1 do
begin
CurrentRect := (FAxesCollisionList.Objects[x] as TiPlotRectObject).ARect;
if IntersectRect(DummyRect, CurrentRect, ARect) then Exit;
UnionRect(DummyRect, Master.DataViewManager.Items[0].DrawRect, ARect);
if not EqualRect(DummyRect, Master.DataViewManager.Items[0].DrawRect) then Exit;
end;
AddAxesCollisionItem(ARect);
Result := True;
end;
//****************************************************************************************************************************************************
function TiPlotComponent.GetChannelManager : TiPlotChannelManager; begin Result := FMaster.ChannelManager; end;
function TiPlotComponent.GetDataCursorManager : TiPlotDataCursorManager; begin Result := FMaster.DataCursorManager; end;
function TiPlotComponent.GetDataViewManager : TiPlotDataViewManager; begin Result := FMaster.DataViewManager; end;
function TiPlotComponent.GetLabelManager : TiPlotLabelManager; begin Result := FMaster.LabelManager; end;
function TiPlotComponent.GetLayoutManager : TiPlotLayoutManager; begin Result := FMaster.LayoutManager; end;
function TiPlotComponent.GetLegendManager : TiPlotLegendManager; begin Result := FMaster.LegendManager; end;
function TiPlotComponent.GetTableManager : TiPlotTableManager; begin Result := FMaster.TableManager; end;
function TiPlotComponent.GetLimitManager : TiPlotLimitManager; begin Result := FMaster.LimitManager; end;
function TiPlotComponent.GetPlotObjectManager : TiPlotObjectManager; begin Result := FMaster.ObjectManager; end;
function TiPlotComponent.GetToolBarManager : TiPlotToolBarManager; begin Result := FMaster.ToolBarManager; end;
function TiPlotComponent.GetTranslationManager: TiPlotTranslationManager; begin Result := FMaster.TranslationManager; end;
function TiPlotComponent.GetXAxisManager : TiPlotXAxisManager; begin Result := FMaster.XAxisManager; end;
function TiPlotComponent.GetYAxisManager : TiPlotYAxisManager; begin Result := FMaster.YAxisManager; end;
//****************************************************************************************************************************************************
procedure TiPlotComponent.SetOuterMarginBottom (const Value:Integer);begin SetIntegerProperty(Value,FOuterMarginBottom, irtInvalidate);end;
procedure TiPlotComponent.SetOuterMarginLeft (const Value:Integer);begin SetIntegerProperty(Value,FOuterMarginLeft, irtInvalidate);end;
procedure TiPlotComponent.SetOuterMarginRight (const Value:Integer);begin SetIntegerProperty(Value,FOuterMarginRight, irtInvalidate);end;
procedure TiPlotComponent.SetOuterMarginTop (const Value:Integer);begin SetIntegerProperty(Value,FOuterMarginTop, irtInvalidate);end;
procedure TiPlotComponent.SetHintsHidePause (const Value:Integer);begin SetIntegerProperty(Value,FHintsHidePause, irtNone );end;
procedure TiPlotComponent.SetHintsPause (const Value:Integer);begin SetIntegerProperty(Value,FHintsPause, irtNone );end;
procedure TiPlotComponent.SetHintsShow (const Value:Boolean);begin SetBooleanProperty(Value,FHintsShow, irtNone );end;
procedure TiPlotComponent.SetLogBufferSize (const Value:Integer);begin SetIntegerProperty(Value,FLogBufferSize, irtNone );end;
procedure TiPlotComponent.SetClipAnnotationsToAxes (const Value:Boolean);begin SetBooleanProperty(Value,FClipAnnotationsToAxes, irtInvalidate);end;
procedure TiPlotComponent.SetBackGroundGradientEnabled (const Value:Boolean);begin SetBoolean
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -