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

📄 teecursoredit.pas

📁 第三方控件:PaintGrid.pas 网格型仪表控件源文件 Mymeter.pas 圆型仪表控件源文件 Project1是这两个控件的使用范例。 该
💻 PAS
字号:
{******************************************}
{ TCursorTool Editor Dialog                }
{ Copyright (c) 1999-2005 by David Berneda }
{******************************************}
unit TeeCursorEdit;
{$I TeeDefs.inc}

interface

uses SysUtils, Classes,
     {$IFDEF CLX}
     QGraphics, QControls, QForms, QDialogs, QStdCtrls, QExtCtrls, QComCtrls,
     QButtons,
     {$ELSE}
     Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, ComCtrls,
     Buttons,
     {$ENDIF}
     Chart, TeeTools, TeCanvas, TeePenDlg, TeeToolSeriesEdit;

type
  TCursorToolEditor = class(TSeriesToolEditor)
    BPen: TButtonPen;
    Label2: TLabel;
    CBStyle: TComboFlat;
    CBSnap: TCheckBox;
    CBFollow: TCheckBox;
    CBZ: TCheckBox;
    Label3: TLabel;
    EPixels: TEdit;
    UDClick: TUpDown;
    Label4: TLabel;
    procedure FormShow(Sender: TObject);
    procedure CBSeriesChange(Sender: TObject);
    procedure CBStyleChange(Sender: TObject);
    procedure CBSnapClick(Sender: TObject);
    procedure CBFollowClick(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure CBZClick(Sender: TObject);
    procedure EPixelsChange(Sender: TObject);
  private
    { Private declarations }
    CursorTool : TCursorTool;
  public
    { Public declarations }
  end;

implementation

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

Uses TeEngine, TeeConst, TeeProCo;

procedure TCursorToolEditor.FormShow(Sender: TObject);
begin
  inherited;
  CursorTool:=TCursorTool(Tag);

  if Assigned(CursorTool) then
  With CursorTool do
  begin
    CBStyle.ItemIndex:=Ord(Style);
    CBSnap.Checked:=Snap;
    CBSnap.Enabled:=Assigned(Series);
    CBZ.Checked:=UseSeriesZ;
    CBZ.Enabled:=CBSnap.Enabled;
    CBFollow.Checked:=FollowMouse;
    BPen.LinkPen(Pen);
    UDClick.Position:=ClickTolerance;
  end;
end;

procedure TCursorToolEditor.CBSeriesChange(Sender: TObject);
begin
  inherited;
  CBSnap.Enabled:=Assigned(CursorTool.Series);
  CBZ.Enabled:=CBSnap.Enabled;
end;

procedure TCursorToolEditor.CBStyleChange(Sender: TObject);
begin
  CursorTool.Style:=TCursorToolStyle(CBStyle.ItemIndex);
end;

procedure TCursorToolEditor.CBSnapClick(Sender: TObject);
begin
  CursorTool.Snap:=CBSnap.Checked
end;

procedure TCursorToolEditor.CBFollowClick(Sender: TObject);
begin
  CursorTool.FollowMouse:=CBFollow.Checked
end;

procedure TCursorToolEditor.FormCreate(Sender: TObject);
begin
  inherited;
  Align:=alClient;
end;

procedure TCursorToolEditor.CBZClick(Sender: TObject);
begin
  CursorTool.UseSeriesZ:=CBZ.Checked
end;

procedure TCursorToolEditor.EPixelsChange(Sender: TObject);
begin
  if Assigned(CursorTool) then
     CursorTool.ClickTolerance:=UDClick.Position;
end;

initialization
  RegisterClass(TCursorToolEditor);
end.

⌨️ 快捷键说明

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