home *** CD-ROM | disk | FTP | other *** search
- //---------------------------------------------------------------------------
- #include <vcl\vcl.h>
- #pragma hdrstop
-
- #include "timser.h"
- #include "math.h"
- //---------------------------------------------------------------------------
- #pragma link "RChart"
- #pragma link "NumLab"
- #pragma resource "*.dfm"
- TForm1 *Form1;
- //---------------------------------------------------------------------------
- __fastcall TForm1::TForm1(TComponent* Owner)
- : TForm(Owner)
- {
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::ButDoneClick(TObject *Sender)
- {
- Close();
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::CBMYClick(TObject *Sender)
- {
- NumLab2->Visible = CBMY->Checked;
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::CBMXClick(TObject *Sender)
- {
- NumLab1->Visible = CBMX->Checked;
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::FormActivate(TObject *Sender)
- {
- const int NumVal = 800;
- int i;
-
- RChart1->RangeHiX = NumVal;
- RChart1->RangeLoX = 0;
- RChart1->RangeHiY = 150;
- RChart1->RangeLoY = -30;
- RChart1->DataColor = clBlue;
- RChart1->MoveTo (0,0);
- for (i=1; i<=NumVal; i++)
- RChart1->DrawTo (i,0.1*i+0.03*i*sin(i*0.04)+0.04*(random(1000)));
- RChart1->DataColor = clRed;
- RChart1->MoveTo (0,40);
- for (i=1; i<=NumVal; i++)
- RChart1->DrawTo (i,40+0.05*i*sin(i*0.05));
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::RChart1MouseMoveInChart(TObject *Sender, bool InChart,
- TShiftState Shift, double rMousePosX, double rMousePosY)
- {
- NumLab1->Empty = ! InChart;
- NumLab2->Empty = ! InChart;
- NumLab1->Value = rMousePosX;
- NumLab2->Value = rMousePosY;
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::FormMouseMove(TObject *Sender, TShiftState Shift, int X,
- int Y)
- {
- Screen->Cursor = crDefault;
- }
- //---------------------------------------------------------------------------