-
Notifications
You must be signed in to change notification settings - Fork 2
/
SplashForm.cpp
60 lines (57 loc) · 2.16 KB
/
SplashForm.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//$$---- Form CPP ----
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "MainForm.h"
#include "SplashForm.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "RzStatus"
#pragma resource "*.dfm"
TSplashFormClass *SplashFormClass;
//---------------------------------------------------------------------------
__fastcall TSplashFormClass::TSplashFormClass(TComponent* Owner) : TForm(Owner)
{
SplashClose = false;
}
//---------------------------------------------------------------------------
void __fastcall TSplashFormClass::Timer1Timer(TObject *Sender)
{
int counter = 5;
ProgressStatus->Percent += counter;
}
//---------------------------------------------------------------------------
__fastcall TThreadClass::TThreadClass(bool CreateSuspended) : TThread(CreateSuspended){}
//---------------------------------------------------------------------------
void __fastcall TThreadClass::Execute()
{
MainFormClass->loadBase("Dic\\KR.tdb");
int temp = SplashFormClass->ProgressStatus->Percent;
if (temp < 50)
SplashFormClass->Timer1->Interval /= 3;
else if (temp > 50)
SplashFormClass->Timer1->Interval *= 3;
MainFormClass->loadBase("Dic\\RK.tdb");
SplashFormClass->ProgressStatus->Percent = 100;
SplashFormClass->SplashClose = true;
SplashFormClass->Close();
}
//---------------------------------------------------------------------------
void __fastcall TSplashFormClass::FormShow(TObject *Sender)
{
ThreadClass = new TThreadClass(true);
ThreadClass->Resume();
}
//---------------------------------------------------------------------------
void __fastcall TSplashFormClass::FormDestroy(TObject *Sender)
{
delete ThreadClass;
}
//---------------------------------------------------------------------------
void __fastcall TSplashFormClass::OnTerminate(TObject *) { } // Do not close!
//---------------------------------------------------------------------------
void __fastcall TSplashFormClass::FormCloseQuery(TObject *Sender, bool &CanClose)
{
CanClose = SplashClose;
}
//---------------------------------------------------------------------------