⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qiplotcomponent.pas

📁 iocopm3.04源码,一套很好的工控开发工具
💻 PAS
📖 第 1 页 / 共 5 页
字号:
{*******************************************************}
{                                                       }
{       TiPlotComponent                                 }
{                                                       }
{       Copyright (c) 1997,2003 Iocomp Software         }
{                                                       }
{*******************************************************}
{$I iInclude.inc}

{$ifdef iVCL}unit  iPlotComponent;{$endif}
{$ifdef iCLX}unit QiPlotComponent;{$endif}

interface

uses
  {$I iIncludeUses.inc}
  {$IFDEF iVCL} Menus,  Printers,  iTypes,  iGPFunctions,  iMath, iCustomComponent,  iEditorBasicComponents,  ImgList, CommCtrl, JPeg,{$ENDIF}
  {$IFDEF iCLX}QMenus, QPrinters, QiTypes, QiGPFunctions, qiMath, QiCustomComponent, QiEditorBasicComponents, QImgList,                {$ENDIF}

  {$IFDEF iVCL} iPlotMasterManager,  iPlotManagers,  iPlotLayoutManager,  iPlotObjects,{$ENDIF}
  {$IFDEF iCLX}QiPlotMasterManager, QiPlotManagers, QiPlotLayoutManager, QiPlotObjects,{$ENDIF}

  {$IFDEF iVCL} iPlotChannelCustom,  iPlotChannel,  iXYPlotChannel,  iPlotTranslation,  iPlotAnnotation, iPlotPreview, {$ENDIF}
  {$IFDEF iCLX}QiPlotChannelCustom, QiPlotChannel, QiXYPlotChannel, QiPlotTranslation, QiPlotAnnotation, QiPlotPreview,{$ENDIF}

  {$IFDEF iVCL} iPlotDataCursor,  iPlotAxis,  iPlotLegend,  iPlotToolBar,  iPlotLimit,  iPlotLabel,  iPlotDataView,  iPlotTable;{$ENDIF}
  {$IFDEF iCLX}QiPlotDataCursor, QiPlotAxis, QiPlotLegend, QiPlotToolBar, QiPlotLimit, QiPlotLabel, QiPlotDataView, QiPlotTable;{$ENDIF}

type
  TiPlotFormStyle                    = (ipfsModal, ipfsStayOnTop);
  TiPlotDataFileColumnSeparator      = (ipdfcsTab, ipdfcsComma);
  TiPlotDataFileFormat               = (ipdffText, ipdffCompactInterval);

  TiPlotAxesMinSpanChangeEvent       = procedure(Index: Integer; OldMin, OldSpan, NewMin, NewSpan : Double)               of object;
  TiPlotObjectDoubleValueChangeEvent = procedure(Index: Integer; OldValue, NewValue : Double)                             of object;
  TiPlotAxesCustomizeLabelEvent      = procedure(Index: Integer; Value: Double; var ALabel: String)                       of object;
  TiPlotObjectMouseEvent             = procedure(Index: Integer; Button: TMouseButton; Shift: TShiftState; X, Y: Integer) of object;
  TiPlotObjectMouseMoveEvent         = procedure(Index: Integer;                       Shift: TShiftState; X, Y: Integer) of object;
  TiPlotObjectEvent                  = procedure(Index: Integer)                                                          of object;
  TiPlotPopupMenuEvent               = procedure(Index: Integer; var Cancel: Boolean; ScreenX, ScreenY: Integer)          of object;
  TiPlotClickDataPointEvent          = procedure(ChannelIndex, DataIndex: Integer)                                        of object;
  TiPlotZoomBoxEvent                 = procedure(var ZoomRect: TRect; var Cancel: Boolean)                                of object;
  TiPlotObjectCustomizeTextEvent     = procedure(Index: Integer; var AText: String)                                       of object;
  TiPlotToolBarButtonEvent           = procedure(Index: Integer; ButtonType: TiPlotToolBarButtonType)                     of object;

  TiPlotComponent = class(TiCustomComponent)
  private
    FMaster                                : TiPlotMasterManager;
    FLayerList                             : TStringList;
    FHintData                              : TiHintData;
    FHintShowing                           : Boolean;
    FHintsFont                             : TFont;

    FAxesCollisionList                     : TStringList;

    FStringCurrentPos                      : PChar;
    FStringScanPos                         : PChar;

    FShiftState                            : TShiftState;

    FPopupMenu                             : TPopupMenu;

    FImageList0                            : TImageList;
    FImageList1                            : TImageList;
    FImageList2                            : TImageList;

    FSaveDialog                            : TiComponentEditorSavePicker;

    FMasterAxisBlock                       : Boolean;

    FUserCanAddRemoveChannels              : Boolean;

    FPrintShowDialog                       : Boolean;
    FPrintOrientation                      : TPrinterOrientation;
    FPrintMarginTop                        : Double;
    FPrintMarginLeft                       : Double;
    FPrintMarginRight                      : Double;
    FPrintMarginBottom                     : Double;
    FPrintDocumentName                     : String;
    FPrinterName                           : String;

    FMouseDown                             : Boolean;
    FMouseDownObject                       : TiPlotObject;
    FLastMouseOverObject                   : TiPlotObject;
    FLastMouseClickObject                  : TiPlotObject;
    FLastMouseClickButton                  : TMouseButton;
    FLastMouseClickShift                   : TShiftState;
    FLastMouseClickX                       : Integer;
    FLastMouseClickY                       : Integer;
    FLastMouseClickScreenX                 : Integer;
    FLastMouseClickScreenY                 : Integer;

    FVisibleListLeft                       : TStringList;
    FVisibleListRight                      : TStringList;
    FVisibleListTop                        : TStringList;
    FVisibleListBottom                     : TStringList;

    {$ifdef iVCL}FMetaFile            : TMetafile;{$endif}
    {$ifdef iVCL}FCaptureWindowHandle : HWnd;    {$endif}
    {$ifdef iVCL}FSnapShotPicture     : TPicture; {$endif}

    FOuterMarginTop                        : Integer;
    FOuterMarginLeft                       : Integer;
    FOuterMarginRight                      : Integer;
    FOuterMarginBottom                     : Integer;

    FSelectingActive                       : Boolean;
    FJustReleasedCapture                   : Boolean;

    FEditorFormStyle                       : TiPlotFormStyle;
    FCopyToClipBoardFormat                 : TiPlotExportFormat;
    FClipAnnotationsToAxes                 : Boolean;

    FHintsShow                             : Boolean;
    FHintsPause                            : Integer;
    FHintsHidePause                        : Integer;

    FLoggingActive                         : Boolean;
    FLogBufferSize                         : Integer;
    FLogFileName                           : String;
    FLogBufferCount                        : Integer;

    FAnnotationDefaultPenWidth             : Integer;
    FAnnotationDefaultBrushStlye           : TBrushStyle;
    FAnnotationDefaultBrushColor           : TColor;
    FAnnotationDefaultPenColor             : TColor;
    FAnnotationDefaultFont                 : TFont;
    FAnnotationDefaultPenStlye             : TPenStyle;

    FOnMouseDownLimit                      : TiPlotObjectMouseEvent;
    FOnMouseDownYAxis                      : TiPlotObjectMouseEvent;
    FOnMouseDownDataCursor                 : TiPlotObjectMouseEvent;
    FOnMouseDownChannel                    : TiPlotObjectMouseEvent;
    FOnMouseDownAnnotation                 : TiPlotObjectMouseEvent;
    FOnMouseDownLegend                     : TiPlotObjectMouseEvent;
    FOnMouseDownXAxis                      : TiPlotObjectMouseEvent;
    FOnMouseDownDataView                   : TiPlotObjectMouseEvent;

    FOnMouseMoveLimit                      : TiPlotObjectMouseMoveEvent;
    FOnMouseMoveYAxis                      : TiPlotObjectMouseMoveEvent;
    FOnMouseMoveDataCursor                 : TiPlotObjectMouseMoveEvent;
    FOnMouseMoveChannel                    : TiPlotObjectMouseMoveEvent;
    FOnMouseMoveAnnotation                 : TiPlotObjectMouseMoveEvent;
    FOnMouseMoveLegend                     : TiPlotObjectMouseMoveEvent;
    FOnMouseMoveXAxis                      : TiPlotObjectMouseMoveEvent;
    FOnMouseMoveDataView                   : TiPlotObjectMouseMoveEvent;

    FOnMouseUpLimit                        : TiPlotObjectMouseEvent;
    FOnMouseUpYAxis                        : TiPlotObjectMouseEvent;
    FOnMouseUpDataCursor                   : TiPlotObjectMouseEvent;
    FOnMouseUpChannel                      : TiPlotObjectMouseEvent;
    FOnMouseUpAnnotation                   : TiPlotObjectMouseEvent;
    FOnMouseUpLegend                       : TiPlotObjectMouseEvent;
    FOnMouseUpXAxis                        : TiPlotObjectMouseEvent;
    FOnMouseUpDataView                     : TiPlotObjectMouseEvent;

    FOnClickXAxis                          : TiPlotObjectEvent;
    FOnClickYAxis                          : TiPlotObjectEvent;
    FOnClickDataPoint                      : TiPlotClickDataPointEvent;
    FOnClickAnnotation                     : TiPlotObjectEvent;
    FOnClickDataCursor                     : TiPlotObjectEvent;
    FOnClickLegend                         : TiPlotObjectEvent;
    FOnClickChannel                        : TiPlotObjectEvent;
    FOnClickDataView                       : TiPlotObjectEvent;
    FOnClickLimit                          : TiPlotObjectEvent;

    FOnDblClickAnnotation                  : TiPlotObjectEvent;
    FOnDblClickDataView                    : TiPlotObjectEvent;
    FOnDblClickYAxis                       : TiPlotObjectEvent;
    FOnDblClickXAxis                       : TiPlotObjectEvent;
    FOnDblClickChannel                     : TiPlotObjectEvent;
    FOnDblClickLimit                       : TiPlotObjectEvent;
    FOnDblClickLegend                      : TiPlotObjectEvent;
    FOnDblClickDataCursor                  : TiPlotObjectEvent;

    FOnDataCursorChange                    : TiPlotObjectEvent;

    FOnXAxisMinChange                      : TiPlotObjectDoubleValueChangeEvent;
    FOnXAxisSpanChange                     : TiPlotObjectDoubleValueChangeEvent;
    FOnXAxisMinSpanChange                  : TiPlotAxesMinSpanChangeEvent;
    FOnXAxisCustomizeLabel                 : TiPlotAxesCustomizeLabelEvent;

    FOnYAxisMinChange                      : TiPlotObjectDoubleValueChangeEvent;
    FOnYAxisSpanChange                     : TiPlotObjectDoubleValueChangeEvent;
    FOnYAxisMinSpanChange                  : TiPlotAxesMinSpanChangeEvent;
    FOnYAxisCustomizeLabel                 : TiPlotAxesCustomizeLabelEvent;

    FOnDataCursorCustomizeHint             : TiPlotObjectCustomizeTextEvent;
    FOnYAxisCustomizeHint                  : TiPlotObjectCustomizeTextEvent;
    FOnXAxisCustomizeHint                  : TiPlotObjectCustomizeTextEvent;
    FOnToolBarCustomizeHint                : TiPlotObjectCustomizeTextEvent;
    FOnToolBarButtonClick                  : TiPlotToolBarButtonEvent;

    FOnLimitLine1PositionChange            : TiPlotObjectDoubleValueChangeEvent;
    FOnLimitLine2PositionChange            : TiPlotObjectDoubleValueChangeEvent;
    FOnBeforePrint                         : TNotifyEvent;
    FOnAfterPrint                          : TNotifyEvent;

    FOnAfterLoadProperties                 : TNotifyEvent;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -