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 60 61 62 63 64 65 66 67
| //---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "PatientezUnit.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "AdvProgressBar"
#pragma link "AdvProgr"
#pragma link "AdvCircularProgress"
#pragma resource "*.dfm"
TPatientezFrm *PatientezFrm;
//ThreadClass1 *MyThread1;
//---------------------------------------------------------------------------
__fastcall TPatientezFrm::TPatientezFrm(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TPatientezFrm::FormActivate(TObject *Sender)
{
//Synchronize(UpdateCaption);
PatientezFrm->AdvCircularProgress1->Enabled=true;
PatientezFrm->AdvCircularProgress1->Refresh();
}
//---------------------------------------------------------------------------
void __fastcall TPatientezFrm::FormClose(TObject *Sender,
TCloseAction &Action)
{
/* PatientezFrm->AdvCircularProgress1->Enabled=false;
MyThread1 = new ThreadClass1(false);
MyThread1->Suspend();*/
if(MonThread) Action = caNone;
PatientezFrm->AdvCircularProgress1->Enabled=false;
}
//---------------------------------------------------------------------------
void __fastcall TPatientezFrm::FormCreate(TObject *Sender)
{
MyThread1 = new ThreadClass1(true);
MyThread1->Resume();
}
//---------------------------------------------------------------------------
void __fastcall TPatientezFrm::FormPaint(TObject *Sender)
{
MonThread = new TMonThread(false);
MonThread->OnTerminate = FinDeMonThread;
EnableWindow(Handle, false);
}
//---------------------------------------------------------------------------
void __fastcall TPatientezFrm::FinDeMonThread(TObject *Sender)
{
EnableWindow(Handle, true);
msg->Caption = "Thread terminé";
delete MonThread;
MonThread = NULL;
}
//--------------------------------------------------------------------------- |
Partager