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

📄 chartfx3.pas

📁 石油行业油井损害软件,有详细的油井损害模型,对石油建模有重要帮助
💻 PAS
📖 第 1 页 / 共 3 页
字号:
    function ReadTemplate(const lpszNewValue: WideString): Integer; dispid 79;
    function CopyData: Integer; dispid 80;
    function CopyBitmap: Integer; dispid 81;
    procedure Refresh; dispid -550;
    procedure AboutBox; dispid -552;
  end;

{ Event interface for ChartFX Control }

  _DChartfxEvents = dispinterface
    ['{2DC488B1-D891-101B-8652-00AA003A5593}']
    procedure LButtonDblClk(x, y, nSerie: Smallint; nPoint: Integer; var nRes: Smallint); dispid 1;
    procedure RButtonDown(x, y, nSerie: Smallint; nPoint: Integer; var nRes: Smallint); dispid 2;
    procedure ChangeValue(dValue: Double; nSerie: Smallint; nPoint: Integer; var nRes: Smallint); dispid 3;
    procedure ChangeString(nType: Smallint; nIndex: Integer; var nRes: Smallint); dispid 4;
    procedure ChangeColor(nType, nIndex: Smallint; var nRes: Smallint); dispid 5;
    procedure Destroy; dispid 6;
    procedure ReadFile; dispid 7;
    procedure ChangePalette(nIndex: Smallint; var nRes: Smallint); dispid 8;
    procedure ChangeFont(nIndex: Smallint; var nRes: Smallint); dispid 9;
    procedure ReadTemplate; dispid 10;
    procedure ChangePattern(nType, nIndex: Smallint; var nRes: Smallint); dispid 11;
    procedure ChangePattPal(nIndex: Smallint; var nRes: Smallint); dispid 12;
    procedure Menu(wParam: Integer; nSerie: Smallint; nPoint: Integer; var nRes: Smallint); dispid 13;
    procedure ChangeType(nType: Smallint; var nRes: Smallint); dispid 14;
    procedure UserScroll(wScrollMsg, wScrollParam: Integer; var nRes: Smallint); dispid 15;
    procedure GetLegend(nType: Smallint; var nRes: Smallint); dispid 16;
  end;

{ ChartFX Control }

  TChartfxLButtonDblClk = procedure(Sender: TObject; x, y, nSerie: Smallint; nPoint: Integer; var nRes: Smallint) of object;
  TChartfxRButtonDown = procedure(Sender: TObject; x, y, nSerie: Smallint; nPoint: Integer; var nRes: Smallint) of object;
  TChartfxChangeValue = procedure(Sender: TObject; dValue: Double; nSerie: Smallint; nPoint: Integer; var nRes: Smallint) of object;
  TChartfxChangeString = procedure(Sender: TObject; nType: Smallint; nIndex: Integer; var nRes: Smallint) of object;
  TChartfxChangeColor = procedure(Sender: TObject; nType, nIndex: Smallint; var nRes: Smallint) of object;
  TChartfxChangePalette = procedure(Sender: TObject; nIndex: Smallint; var nRes: Smallint) of object;
  TChartfxChangeFont = procedure(Sender: TObject; nIndex: Smallint; var nRes: Smallint) of object;
  TChartfxChangePattern = procedure(Sender: TObject; nType, nIndex: Smallint; var nRes: Smallint) of object;
  TChartfxChangePattPal = procedure(Sender: TObject; nIndex: Smallint; var nRes: Smallint) of object;
  TChartfxMenu = procedure(Sender: TObject; wParam: Integer; nSerie: Smallint; nPoint: Integer; var nRes: Smallint) of object;
  TChartfxChangeType = procedure(Sender: TObject; nType: Smallint; var nRes: Smallint) of object;
  TChartfxUserScroll = procedure(Sender: TObject; wScrollMsg, wScrollParam: Integer; var nRes: Smallint) of object;
  TChartfxGetLegend = procedure(Sender: TObject; nType: Smallint; var nRes: Smallint) of object;

  TChartfx = class(TOleControl)
  private
    FOnLButtonDblClk: TChartfxLButtonDblClk;
    FOnRButtonDown: TChartfxRButtonDown;
    FOnChangeValue: TChartfxChangeValue;
    FOnChangeString: TChartfxChangeString;
    FOnChangeColor: TChartfxChangeColor;
    FOnDestroy: TNotifyEvent;
    FOnReadFile: TNotifyEvent;
    FOnChangePalette: TChartfxChangePalette;
    FOnChangeFont: TChartfxChangeFont;
    FOnReadTemplate: TNotifyEvent;
    FOnChangePattern: TChartfxChangePattern;
    FOnChangePattPal: TChartfxChangePattPal;
    FOnMenu: TChartfxMenu;
    FOnChangeType: TChartfxChangeType;
    FOnUserScroll: TChartfxUserScroll;
    FOnGetLegend: TChartfxGetLegend;
    FIntf: _DChartfx;
    function Get_hWnd: OLE_HANDLE;
    procedure Set_hWnd(var Value: OLE_HANDLE);
    function Get_Value(index: Smallint): Double;
    procedure Set_Value(index: Smallint; Value: Double);
    function Get_XValue(index: Smallint): Double;
    procedure Set_XValue(index: Smallint; Value: Double);
    function Get_IniValue(index: Smallint): Double;
    procedure Set_IniValue(index: Smallint; Value: Double);
    function Get_Const_(index: Smallint): Double;
    procedure Set_Const_(index: Smallint; Value: Double);
    function Get_Color(index: Smallint): TColor;
    procedure Set_Color(index: Smallint; Value: TColor);
    function Get_BkColor(index: Smallint): TColor;
    procedure Set_BkColor(index: Smallint; Value: TColor);
    function Get_Adm(index: Smallint): Double;
    procedure Set_Adm(index: Smallint; Value: Double);
    function Get_Pattern(index: Smallint): Smallint;
    procedure Set_Pattern(index: Smallint; Value: Smallint);
    function Get_Fonts(index: Smallint): Integer;
    procedure Set_Fonts(index: Smallint; Value: Integer);
    function Get_Title(index: Smallint): WideString;
    procedure Set_Title(index: Smallint; const Value: WideString);
    function Get_Legend(index: Smallint): WideString;
    procedure Set_Legend(index: Smallint; const Value: WideString);
    function Get_SerLeg(index: Smallint): WideString;
    procedure Set_SerLeg(index: Smallint; const Value: WideString);
    function Get_KeyLeg(index: Smallint): WideString;
    procedure Set_KeyLeg(index: Smallint; const Value: WideString);
    function Get_FixLeg(index: Smallint): WideString;
    procedure Set_FixLeg(index: Smallint; const Value: WideString);
    function Get_YLeg(index: Smallint): WideString;
    procedure Set_YLeg(index: Smallint; const Value: WideString);
    function Get_KeySer(index: Smallint): WideString;
    procedure Set_KeySer(index: Smallint; const Value: WideString);
    function Get_StatusText(index: Smallint): WideString;
    procedure Set_StatusText(index: Smallint; const Value: WideString);
    function Get_RGBFont(index: Smallint): TColor;
    procedure Set_RGBFont(index: Smallint; Value: TColor);
    function Get_HFont(index: Smallint): Smallint;
    procedure Set_HFont(index: Smallint; Value: Smallint);
    function Get_ItemWidth(index: Smallint): Smallint;
    procedure Set_ItemWidth(index: Smallint; Value: Smallint);
    function Get_ItemStyle(index: Smallint): Smallint;
    procedure Set_ItemStyle(index: Smallint; Value: Smallint);
    function Get_ItemColor(index: Smallint): TColor;
    procedure Set_ItemColor(index: Smallint; Value: TColor);
    function Get_DecimalsNum(index: Smallint): Smallint;
    procedure Set_DecimalsNum(index: Smallint; Value: Smallint);
  protected
    procedure InitControlData; override;
    procedure InitControlInterface(const Obj: IUnknown); override;
  public
    function OpenDataEx(nType: Smallint; n1, n2: Integer): Integer;
    function CloseData(nType: Smallint): WordBool;
    function DblClk(nType: Smallint; lExtra: Integer): Integer;
    function RigClk(nType: Smallint; lExtra: Integer): Integer;
    function Status(nItems: Smallint; lpStatus: Integer): Integer;
    function ShowDialog(nDialog: Smallint; lExtra: Integer): Integer;
    function PrintIt: Integer;
    function Scroll(wParam, lParam: Integer): Integer;
    function SetStatusItem(index: Smallint; bText: WordBool; nID: Smallint; bFrame: WordBool; nWidth, nMin, nDesp: Smallint; dwStyle: Integer): Integer;
    function Paint(hDC: Integer; nLeft, nTop, nRight, nBottom, wAction: Smallint; lps: Integer): Integer;
    function SetStripe(index: Smallint; dMin, dMax: Double; rgb: TColor): Integer;
    function Language(const sResource: WideString): Integer;
    function ExportFile(const lpszNewValue: WideString): Integer;
    function ImportFile(const lpszNewValue: WideString): Integer;
    function WriteTemplate(const lpszNewValue: WideString): Integer;
    function ReadTemplate(const lpszNewValue: WideString): Integer;
    function CopyData: Integer;
    function CopyBitmap: Integer;
    procedure Refresh;
    procedure AboutBox;
    property ControlInterface: _DChartfx read FIntf;
    property Value[index: Smallint]: Double read Get_Value write Set_Value;
    property XValue[index: Smallint]: Double read Get_XValue write Set_XValue;
    property IniValue[index: Smallint]: Double read Get_IniValue write Set_IniValue;
    property Const_[index: Smallint]: Double read Get_Const_ write Set_Const_;
    property Color[index: Smallint]: TColor read Get_Color write Set_Color;
    property BkColor[index: Smallint]: TColor read Get_BkColor write Set_BkColor;
    property Adm[index: Smallint]: Double read Get_Adm write Set_Adm;
    property Pattern[index: Smallint]: Smallint read Get_Pattern write Set_Pattern;
    property Fonts[index: Smallint]: Integer read Get_Fonts write Set_Fonts;
    property Title[index: Smallint]: WideString read Get_Title write Set_Title;
    property Legend[index: Smallint]: WideString read Get_Legend write Set_Legend;
    property SerLeg[index: Smallint]: WideString read Get_SerLeg write Set_SerLeg;
    property KeyLeg[index: Smallint]: WideString read Get_KeyLeg write Set_KeyLeg;
    property FixLeg[index: Smallint]: WideString read Get_FixLeg write Set_FixLeg;
    property YLeg[index: Smallint]: WideString read Get_YLeg write Set_YLeg;
    property KeySer[index: Smallint]: WideString read Get_KeySer write Set_KeySer;
    property StatusText[index: Smallint]: WideString read Get_StatusText write Set_StatusText;
    property RGBFont[index: Smallint]: TColor read Get_RGBFont write Set_RGBFont;
    property HFont[index: Smallint]: Smallint read Get_HFont write Set_HFont;
    property ItemWidth[index: Smallint]: Smallint read Get_ItemWidth write Set_ItemWidth;
    property ItemStyle[index: Smallint]: Smallint read Get_ItemStyle write Set_ItemStyle;
    property ItemColor[index: Smallint]: TColor read Get_ItemColor write Set_ItemColor;
    property DecimalsNum[index: Smallint]: Smallint read Get_DecimalsNum write Set_DecimalsNum;
  published
    property TabStop;
    property Align;
    property DragCursor;
    property DragMode;
    property ParentShowHint;
    property PopupMenu;
    property ShowHint;
    property TabOrder;
    property Visible;
    property OnDragDrop;
    property OnDragOver;
    property OnEndDrag;
    property OnEnter;
    property OnExit;
    property OnStartDrag;
    property DesignDraw: Smallint index 4 read GetSmallintProp write SetSmallintProp stored False;
    property ThisSerie: Smallint index 1 read GetSmallintProp write SetSmallintProp stored False;
    property ThisPoint: Smallint index 2 read GetSmallintProp write SetSmallintProp stored False;
    property AutoInvalidate: WordBool index 3 read GetWordBoolProp write SetWordBoolProp stored False;
    property Type_: Integer index 5 read GetIntegerProp write SetIntegerProp stored False;
    property Style: Integer index 6 read GetIntegerProp write SetIntegerProp stored False;
    property NSeries: Smallint index 7 read GetSmallintProp write SetSmallintProp stored False;
    property NValues: Smallint index 8 read GetSmallintProp write SetSmallintProp stored False;
    property ThisColor: TColor index 9 read GetTColorProp write SetTColorProp stored False;
    property ThisBkColor: TColor index 10 read GetTColorProp write SetTColorProp stored False;
    property LeftGap: Smallint index 11 read GetSmallintProp write SetSmallintProp stored False;
    property RightGap: Smallint index 12 read GetSmallintProp write SetSmallintProp stored False;
    property TopGap: Smallint index 13 read GetSmallintProp write SetSmallintProp stored False;
    property BottomGap: Smallint index 14 read GetSmallintProp write SetSmallintProp stored False;
    property Decimals: Smallint index 15 read GetSmallintProp write SetSmallintProp stored False;
    property PointType: Smallint index 16 read GetSmallintProp write SetSmallintProp stored False;
    property Scheme: Smallint index 17 read GetSmallintProp write SetSmallintProp stored False;
    property Stacked: Smallint index 18 read GetSmallintProp write SetSmallintProp stored False;
    property Grid: Smallint index 19 read GetSmallintProp write SetSmallintProp stored False;
    property WallWidth: Smallint index 20 read GetSmallintProp write SetSmallintProp stored False;
    property BarHorzGap: Smallint index 21 read GetSmallintProp write SetSmallintProp stored False;
    property View3D: WordBool index 22 read GetWordBoolProp write SetWordBoolProp stored False;
    property Angles3D: Integer index 23 read GetIntegerProp write SetIntegerProp stored False;
    property PixFactor: Smallint index 24 read GetSmallintProp write SetSmallintProp stored False;
    property LineWidth: Smallint index 25 read GetSmallintProp write SetSmallintProp stored False;
    property LineStyle: Smallint index 26 read GetSmallintProp write SetSmallintProp stored False;
    property LineColor: TColor index 27 read GetTColorProp write SetTColorProp stored False;
    property LineBkColor: TColor index 28 read GetTColorProp write SetTColorProp stored False;
    property FixedWidth: Smallint index 29 read GetSmallintProp write SetSmallintProp stored False;
    property FixedStyle: Smallint index 30 read GetSmallintProp write SetSmallintProp stored False;
    property FixedColor: TColor index 31 read GetTColorProp write SetTColorProp stored False;
    property FixedBkColor: TColor index 32 read GetTColorProp write SetTColorProp stored False;
    property FixedGap: Smallint index 33 read GetSmallintProp write SetSmallintProp stored False;
    property RGBBarHorz: TColor index 34 read GetTColorProp write SetTColorProp stored False;
    property RGBBk: TColor index 35 read GetTColorProp write SetTColorProp stored False;
    property RGB2DBk: TColor index 36 read GetTColorProp write SetTColorProp stored False;
    property RGB3DBk: TColor index 37 read GetTColorProp write SetTColorProp stored False;
    property ShowStatus: WordBool index 38 read GetWordBoolProp write SetWordBoolProp stored False;
    property HText: WideString index 39 read GetWideStringProp write SetWideStringProp stored False;
    property ChartStatus: Smallint index 40 read GetSmallintProp write SetSmallintProp stored False;
    property Edit: Smallint index 41 read GetSmallintProp write SetSmallintProp stored False;
    property ChartType: Smallint index 42 read GetSmallintProp write SetSmallintProp stored False;
    property Chart3D: WordBool index 43 read GetWordBoolProp write SetWordBoolProp stored False;
    property ToolBar: WordBool index 44 read GetWordBoolProp write SetWordBoolProp stored False;
    property PaletteBar: WordBool index 45 read GetWordBoolProp write SetWordBoolProp stored False;
    property PatternBar: WordBool index 46 read GetWordBoolProp write SetWordBoolProp stored False;
    property CustTool: Integer index 47 read GetIntegerProp write SetIntegerProp stored False;
    property ReturnValue: Integer index 48 read GetIntegerProp write SetIntegerProp stored False;
    property AutoIncrement: WordBool index 49 read GetWordBoolProp write SetWordBoolProp stored False;
    property ThisValue: Double index 50 read GetDoubleProp write SetDoubleProp stored False;
    property VertGridGap: Smallint index 51 read GetSmallintProp write SetSmallintProp stored False;
    property XLegType: Smallint index 52 read GetSmallintProp write SetSmallintProp stored False;
    property ConstType: Smallint index 53 read GetSmallintProp write SetSmallintProp stored False;
    property LeftFont: TFont index 54 read GetTFontProp write SetTFontProp stored False;
    property RightFont: TFont index 55 read GetTFontProp write SetTFontProp stored False;
    property TopFont: TFont index 56 read GetTFontProp write SetTFontProp stored False;
    property BottomFont: TFont index 57 read GetTFontProp write SetTFontProp stored False;
    property XLegFont: TFont index 58 read GetTFontProp write SetTFontProp stored False;
    property YLegFont: TFont index 59 read GetTFontProp write SetTFontProp stored False;
    property FixedFont: TFont index 60 read GetTFontProp write SetTFontProp stored False;
    property LegendFont: TFont index 61 read GetTFontProp write SetTFontProp stored False;
    property LegendWidth: Smallint index 62 read GetSmallintProp write SetSmallintProp stored False;
    property Enabled: WordBool index -514 read GetWordBoolProp write SetWordBoolProp stored False;
    property hWnd: OLE_HANDLE read Get_hWnd write Set_hWnd stored False;
    property BorderStyle: Smallint index -504 read GetSmallintProp write SetSmallintProp stored False;
    property hCtlWnd: Integer index 63 read GetIntegerProp write SetIntegerProp stored False;
    property OnLButtonDblClk: TChartfxLButtonDblClk read FOnLButtonDblClk write FOnLButtonDblClk;
    property OnRButtonDown: TChartfxRButtonDown read FOnRButtonDown write FOnRButtonDown;
    property OnChangeValue: TChartfxChangeValue read FOnChangeValue write FOnChangeValue;
    property OnChangeString: TChartfxChangeString read FOnChangeString write FOnChangeString;
    property OnChangeColor: TChartfxChangeColor read FOnChangeColor write FOnChangeColor;
    property OnDestroy: TNotifyEvent read FOnDestroy write FOnDestroy;
    property OnReadFile: TNotifyEvent read FOnReadFile write FOnReadFile;
    property OnChangePalette: TChartfxChangePalette read FOnChangePalette write FOnChangePalette;
    property OnChangeFont: TChartfxChangeFont read FOnChangeFont write FOnChangeFont;
    property OnReadTemplate: TNotifyEvent read FOnReadTemplate write FOnReadTemplate;
    property OnChangePattern: TChartfxChangePattern read FOnChangePattern write FOnChangePattern;
    property OnChangePattPal: TChartfxChangePattPal read FOnChangePattPal write FOnChangePattPal;
    property OnMenu: TChartfxMenu read FOnMenu write FOnMenu;
    property OnChangeType: TChartfxChangeType read FOnChangeType write FOnChangeType;
    property OnUserScroll: TChartfxUserScroll read FOnUserScroll write FOnUserScroll;
    property OnGetLegend: TChartfxGetLegend read FOnGetLegend write FOnGetLegend;
  end;

procedure Register;

implementation

uses ComObj;

procedure TChartfx.InitControlData;
const
  CEventDispIDs: array[0..15] of Integer = (
    $00000001, $00000002, $00000003, $00000004, $00000005, $00000006,
    $00000007, $00000008, $00000009, $0000000A, $0000000B, $0000000C,
    $0000000D, $0000000E, $0000000F, $00000010);
  CLicenseKey: array[0..71] of Word = (
    $0043, $0068, $0061, $0072, $0074, $0020, $0046, $0058, $0020, $0032,
    $002E, $0030, $0020, $004F, $0043, $0058, $0033, $0032, $0020, $0028,
    $0033, $0032, $0020, $0042, $0069, $0074, $0073, $0029, $002E, $0020,
    $0043, $006F, $0070, $0079, $0072, $0069, $0067, $0068, $0074, $0020,
    $0028, $0063, $0029, $0020, $0031, $0039, $0039, $0034, $0020, $0053,
    $006F, $0066, $0074, $0077, $0061, $0072, $0065, $0020, $0046, $0058,
    $002C, $0020, $0049, $006E, $0063, $002E, $002D, $0031, $0039, $0039,
    $0035, $0000);
  CTFontIDs: array [0..7] of Integer = (
    $00000036, $00000037, $00000038, $00000039, $0000003A, $0000003B,
    $0000003C, $0000003D);
  CControlData: TControlData = (
    ClassID: '{8996B0A1-D7BE-101B-8650-00AA003A5593}';
    EventIID: '{2DC488B1-D891-101B-8652-00AA003A5593}';
    EventCount: 16;
    EventDispIDs: @CEventDispIDs;
    LicenseKey: @CLicenseKey;
    Flags: $00000008;
    Version: 300;
    FontCount: 8;
    FontIDs: @CTFontIDs);
begin
  ControlData := @CControlData;
end;

procedure TChartfx.InitControlInterface(const Obj: IUnknown);
begin
  FIntf := Obj as _DChartfx;
end;

function TChartfx.OpenDataEx(nType: Smallint; n1, n2: Integer): Integer;
begin
  Result := ControlInterface.OpenDataEx(nType, n1, n2);
end;

function TChartfx.CloseData(nType: Smallint): WordBool;
begin
  Result := ControlInterface.CloseData(nType);
end;

function TChartfx.DblClk(nType: Smallint; lExtra: Integer): Integer;
begin
  Result := ControlInterface.DblClk(nType, lExtra);
end;

function TChartfx.RigClk(nType: Smallint; lExtra: Integer): Integer;
begin
  Result := ControlInterface.RigClk(nType, lExtra);
end;

function TChartfx.Status(nItems: Smallint; lpStatus: Integer): Integer;
begin
  Result := ControlInterface.Status(nItems, lpStatus);

⌨️ 快捷键说明

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