📄 unit3.cpp
字号:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
#include "Unit2.h"
#include "Unit3.h"
#include "Unit18.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm3 *Form3;
extern TForm2** fForm2Array;
extern TColor tGraphColor;
extern int iActForm2;
extern int iGraphThick;
extern int iGraphStyle;
extern int iForm2Sum;
enum EMyCursor{myPenCursor=10,mySuckCursor,myUpZoomCursor,myDownZoomCursor,myUnZoomCursor,myRecCursor}; //光标
//---------------------------------------------------------------------------
__fastcall TForm3::TForm3(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
bool TForm3::f_judge(int GS)
{
if(iGraphStyle>=100)
Form1->Panel3->Visible=false;
if(iGraphStyle==6||iGraphStyle==7)
{
Form1->Panel4->Visible=false;
Form1->Panel3->Visible=false;
}
if(iForm2Sum<1)
{
SpeedButton4->Down=true;
return false;
}
else if(iGraphStyle==1)
{
Form1->f_SetForm2ChooseFalse();
iGraphStyle=GS;
}
else
iGraphStyle=GS;
SendMessage(Form1->Handle,WM_SIZE,0,0);
return true;
}
//---------------------------------------------------------------------------
void __fastcall TForm3::SpeedButton1Click(TObject *Sender)
{
if(f_judge(2))
Form1->setcur(myPenCursor);
}
//---------------------------------------------------------------------------
void __fastcall TForm3::SpeedButton2Click(TObject *Sender)
{
if(f_judge(3))
Form1->setcur(myPenCursor);
}
//---------------------------------------------------------------------------
void __fastcall TForm3::SpeedButton3Click(TObject *Sender)
{
if(f_judge(5))
Form1->setcur(crCross);
}
//---------------------------------------------------------------------------
void __fastcall TForm3::SpeedButton5Click(TObject *Sender)
{
if(f_judge(4))
Form1->setcur(crCross);
}
//---------------------------------------------------------------------------
void __fastcall TForm3::SpeedButton4Click(TObject *Sender)
{
if(iGraphStyle>=100)
Form1->Panel3->Visible=false;
Form1->Panel3->Visible=false;
Form1->Panel4->Visible=false;
iGraphStyle=0;
Form1->setcur(crArrow);
Form1->f_SetForm2ChooseFalse();
SendMessage(Form1->Handle,WM_SIZE,0,0);
}
//---------------------------------------------------------------------------
void __fastcall TForm3::ListBox1DblClick(TObject *Sender)
{
// if(ListBox1->Items[Sender-> ]
Form1->f_Form2DoHistroy(ListBox1->ItemIndex);
}
//---------------------------------------------------------------------------
void __fastcall TForm3::SpeedButton6Click(TObject *Sender)
{
if(iGraphStyle==1)
return;
if(f_judge(1))
Form1->setcur(crCross);
}
//---------------------------------------------------------------------------
void __fastcall TForm3::SpeedButton7Click(TObject *Sender)
{
if(iGraphStyle>=100)
Form1->Panel3->Visible=false;
if(iForm2Sum<1)
SpeedButton4->Down=true;
else if(iGraphStyle==1)
{
Form1->f_SetForm2ChooseFalse();
iGraphStyle=6;
Form1->Panel4->Visible=true;
Form1->setcur(crCross);
}
else
{
Form1->Panel4->Visible=true;
iGraphStyle=6;
Form1->setcur(crCross);
}
SendMessage(Form1->Handle,WM_SIZE,0,0);
}
//---------------------------------------------------------------------------
void __fastcall TForm3::SpeedButton8Click(TObject *Sender)
{
if(iGraphStyle>=100)
{
Form1->Panel3->Visible=false;
}
if(iForm2Sum<1)
SpeedButton4->Down=true;
else if(iGraphStyle==1)
{
Form1->f_SetForm2ChooseFalse();
iGraphStyle=7;
Form1->Panel4->Visible=true;
Form1->setcur(crCross);
}
else
{
Form1->Panel4->Visible=true;
iGraphStyle=7;
Form1->setcur(crCross);
}
SendMessage(Form1->Handle,WM_SIZE,0,0);
}
//---------------------------------------------------------------------------
void __fastcall TForm3::SpeedButton9Click(TObject *Sender)
{
if(f_judge(8))
Form1->setcur(mySuckCursor);
}
//---------------------------------------------------------------------------
void __fastcall TForm3::SpeedButton10Click(TObject *Sender)
{
f_judge(9);
}
//---------------------------------------------------------------------------
void __fastcall TForm3::SpeedButton11Click(TObject *Sender)
{
if(iGraphStyle>99)
return;
Form1->Panel4->Visible=false;
Form1->Panel3->Visible=false;
if(iGraphStyle==1)
Form1->f_SetForm2ChooseFalse();
if(iForm2Sum<1)
{
SpeedButton4->Down=true;
if(iGraphStyle>=100)
Form1->Panel3->Visible=false;
iGraphStyle=0;
}
else
{
Form1->setcur(myUpZoomCursor) ;
Form1->Panel3->Visible=true;
if(Form1->RadioButton1->Checked)
iGraphStyle=100;
else
iGraphStyle=101;
}
SendMessage(Form1->Handle,WM_SIZE,0,0);
}
//---------------------------------------------------------------------------
void __fastcall TForm3::Shape1MouseDown(TObject *Sender,
TMouseButton Button, TShiftState Shift, int X, int Y)
{
Form18 = new TForm18(this);
Form18->ShowModal();
}
//---------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -