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

📄 uanizoom.cpp

📁 TeeChart Pro ActiveX是西班牙Steema SL公司开发的图表类控件
💻 CPP
字号:
/*********************************************/
/* TeeChart Delphi Component Library 4.0     */
/* Demo                                      */
/* Copyright (c) 1995-1998 by David Berneda  */
/* All rights reserved                       */
/*********************************************/
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop

#include "UAniZoom.h"
#include <stdlib.h>
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TFormAnimatedZoom *FormAnimatedZoom;
//---------------------------------------------------------------------------
__fastcall TFormAnimatedZoom::TFormAnimatedZoom(TComponent* Owner)
  : TForm(Owner)
{
}
//---------------------------------------------------------------------------

void TFormAnimatedZoom::RandomValues(TChartSeries* ASeries)
{
  int tmp=0;
  ASeries->Clear();
  for (int t=1;t<51;t++) {
    tmp=tmp+random(10000)-5000;
    ASeries->Add(tmp, "", clTeeColor);
  }
}

void __fastcall TFormAnimatedZoom::FormCreate(TObject *Sender)
{
  ScrollBar1->Position=Chart1->AnimatedZoomSteps;
  RandomValues(LineSeries1);
  RandomValues(LineSeries2);
  RandomValues(LineSeries3);
  RandomValues(LineSeries4);
  RandomValues(LineSeries5);
  RandomValues(PointSeries1);
  Chart1->AnimatedZoom=false;
  Chart1->ZoomPercent(5);
  Chart1->AnimatedZoom=true;

}
//---------------------------------------------------------------------------
void __fastcall TFormAnimatedZoom::CheckBox1Click(TObject *Sender)
{
  Chart1->AnimatedZoom=CheckBox1->Checked;
}
//---------------------------------------------------------------------------
void __fastcall TFormAnimatedZoom::CheckBox2Click(TObject *Sender)
{
  Chart1->View3D=CheckBox2->Checked;
}
//---------------------------------------------------------------------------
void __fastcall TFormAnimatedZoom::BitBtn1Click(TObject *Sender)
{
  BitBtn1->Enabled=false;
  BitBtn2->Enabled=false;
  Chart1->ZoomPercent(115);
  BitBtn1->Enabled=true;
  BitBtn2->Enabled=true;
}
//---------------------------------------------------------------------------
void __fastcall TFormAnimatedZoom::BitBtn2Click(TObject *Sender)
{
  BitBtn1->Enabled=false;
  BitBtn2->Enabled=false;
  Chart1->ZoomPercent(85);
  BitBtn1->Enabled=true;
  BitBtn2->Enabled=true;
}
//---------------------------------------------------------------------------
void __fastcall TFormAnimatedZoom::ScrollBar1Change(TObject *Sender)
{
  Chart1->AnimatedZoomSteps=ScrollBar1->Position;
}
//---------------------------------------------------------------------------

⌨️ 快捷键说明

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