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

📄 teebollingereditor.pas

📁 Delphi TeeChartPro.6.01的源代码
💻 PAS
字号:
{********************************************}
{     TeeChart Pro Charting Library          }
{ Copyright (c) 1995-2003 by David Berneda   }
{         All Rights Reserved                }
{********************************************}
unit TeeBollingerEditor;
{$I TeeDefs.inc}

interface

uses
  {$IFNDEF LINUX}
  Windows, Messages,
  {$ENDIF}
  SysUtils, Classes,
  {$IFDEF CLX}
  QGraphics, QControls, QForms, QDialogs, QStdCtrls, QComCtrls,
  {$ELSE}
  Graphics, Controls, Forms, Dialogs, StdCtrls, ComCtrls,
  {$ENDIF}
  TeCanvas, TeePenDlg, StatChar, TeeBaseFuncEdit;

type
  TBollingerFuncEditor = class(TBaseFunctionEditor)
    Label3: TLabel;
    ENum: TEdit;
    UpDown1: TUpDown;
    CheckBox1: TCheckBox;
    Label1: TLabel;
    Edit1: TEdit;
    ButtonPen1: TButtonPen;
    ButtonPen2: TButtonPen;
    procedure ENumChange(Sender: TObject);
  private
    { Private declarations }
  protected
    procedure ApplyFormChanges; override;
    Procedure SetFunction; override;
  public
    { Public declarations }
  end;

implementation

{$IFNDEF CLX}
{$R *.DFM}
{$ELSE}
{$R *.xfm}
{$ENDIF}

procedure TBollingerFuncEditor.ApplyFormChanges;
begin
  inherited;
  with TBollingerFunction(IFunction) do
  begin
    Period:=UpDown1.Position;
    Exponential:=CheckBox1.Checked;
    Deviation:=StrToFloat(Edit1.Text);
  end;
end;

procedure TBollingerFuncEditor.ENumChange(Sender: TObject);
begin
  EnableApply;
end;

Procedure TBollingerFuncEditor.SetFunction;
begin
  inherited;
  with TBollingerFunction(IFunction) do
  begin
    UpDown1.Position:=Round(Period);
    CheckBox1.Checked:=Exponential;
    Edit1.Text:=FloatToStr(Deviation);
    ButtonPen1.LinkPen(UpperBandPen);
    ButtonPen2.LinkPen(LowBandPen);
  end;
end;

initialization
  RegisterClass(TBollingerFuncEditor);
end.

⌨️ 快捷键说明

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