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

📄 unit4.cpp

📁 光学仪器的控制系统 用于教学和科研的仪器
💻 CPP
字号:
//---------------------------------------------------------------------------
#pragma hdrstop
#include <vcl.h>


#include "Unit4.h"
#include "Unit1.h"
#include "delaytest.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TAbout *About;
//---------------------------------------------------------------------------
__fastcall TAbout::TAbout(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TAbout::FormCreate(TObject *Sender)
{
    num=0;
    if(Form1->MC == 1){
        RadioButton1->Checked = true;
        ListBox1->Enabled = true;
        ListBox2->Enabled = false;
    }
    else if(Form1->MC == 2){
        RadioButton2->Checked = true;
        ListBox1->Enabled = false;
        ListBox2->Enabled = true;
    }
    else if(Form1->MC == 0)
        RadioButton3->Checked = true;
}
//---------------------------------------------------------------------------
void __fastcall TAbout::Panel1Click(TObject *Sender)
{
	num++;
//Label5->Caption=num;
	if(num>4)
	{
   		char sdelay[20]="";
   		int iFileHandle;
   		if(FileExists("delay.ini"))
   		{
       		iFileHandle=FileOpen("delay.ini",fmOpenRead);
       		FileRead(iFileHandle,sdelay,sizeof(sdelay));
       		FileClose(iFileHandle);
       		Form1->delaypara=StrToInt(sdelay);
//Edit1->Text=sdelay;
//Label1->Caption=StrToInt(sdelay)+100;
//Label5->Caption=StrToInt(sdelay);
			num=0;
   			Close();
   		}
   		else
   		{
      		String str;
      		str=IntToStr(Form1->delaypara);
      		strcpy(sdelay,str.c_str());
      		iFileHandle=FileCreate("delay.ini");
      		FileWrite(iFileHandle,sdelay,sizeof(str));
      		FileClose(iFileHandle);
      		num=0;
//Form1->delaypara=165;
//leCreate()
   		}
	}
}
//---------------------------------------------------------------------------
void __fastcall TAbout::FormShow(TObject *Sender)
{
	num=0;
}
//---------------------------------------------------------------------------
void __fastcall TAbout::Panel2Click(TObject *Sender)
{
	num++;
	if(num>4)
	{
    	fmDtest->ShowModal();
    	num=0;
	}
}
//---------------------------------------------------------------------------
void __fastcall TAbout::RadioButton1Click(TObject *Sender)
{
    Form1->MC = 1;
    ListBox1->Enabled = true;
    ListBox2->Enabled = false;
}
//---------------------------------------------------------------------------

void __fastcall TAbout::RadioButton2Click(TObject *Sender)
{
    Form1->MC = 2;
    ListBox1->Enabled = false;
    ListBox2->Enabled = true;
}
//---------------------------------------------------------------------------

void __fastcall TAbout::RadioButton3Click(TObject *Sender)
{
    Form1->MC = 0;
}
//---------------------------------------------------------------------------

void __fastcall TAbout::FormClose(TObject *Sender, TCloseAction &Action)
{
    Form1->ONE = ListBox1->TopIndex+1;
    Form1->TWO = ListBox2->TopIndex+1;
}
//---------------------------------------------------------------------------

⌨️ 快捷键说明

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