1 |
|
5 |
//------------------------------------------------------------
|
2 |
|
|
//------------------------------------------------------------
|
3 |
|
|
// MAGiC
|
4 |
|
|
// Jean Christophe Cuillière et Vincent FRANCOIS
|
5 |
|
|
// Département de Génie Mécanique - UQTR
|
6 |
|
|
//------------------------------------------------------------
|
7 |
|
|
// Le projet MAGIC est un projet de recherche du département
|
8 |
|
|
// de génie mécanique de l'Université du Québec à
|
9 |
|
|
// Trois Rivières
|
10 |
|
|
// Les librairies ne peuvent être utilisées sans l'accord
|
11 |
|
|
// des auteurs (contact : francois@uqtr.ca)
|
12 |
|
|
//------------------------------------------------------------
|
13 |
|
|
//------------------------------------------------------------
|
14 |
|
|
//
|
15 |
|
|
// editwin.cpp
|
16 |
|
|
//
|
17 |
|
|
//------------------------------------------------------------
|
18 |
|
|
//------------------------------------------------------------
|
19 |
|
|
// COPYRIGHT 2000
|
20 |
|
|
// Version du 02/03/2006 à 11H26
|
21 |
|
|
//------------------------------------------------------------
|
22 |
|
|
//------------------------------------------------------------
|
23 |
|
|
|
24 |
|
|
|
25 |
|
|
#include "gestionversion.h"
|
26 |
|
|
#include <vcl.h>
|
27 |
|
|
#include <io.h>
|
28 |
|
|
#pragma hdrstop
|
29 |
|
|
|
30 |
|
|
#include "editwin.h"
|
31 |
|
|
#include "main.h"
|
32 |
|
|
//---------------------------------------------------------------------
|
33 |
|
|
#pragma resource "*.dfm"
|
34 |
|
|
//---------------------------------------------------------------------
|
35 |
|
|
__fastcall TEditeurWinform::TEditeurWinform(TComponent *Owner)
|
36 |
|
|
: TForm(Owner)
|
37 |
|
|
{
|
38 |
|
|
}
|
39 |
|
|
//---------------------------------------------------------------------
|
40 |
|
|
void __fastcall TEditeurWinform::FormClose(TObject *Sender, TCloseAction &Action)
|
41 |
|
|
{
|
42 |
|
|
MainForm->StatusBar->Panels->Items[3]->Text="";
|
43 |
|
|
MainForm->StatusBar->Panels->Items[4]->Text="";
|
44 |
|
|
Action=caFree;
|
45 |
|
|
}
|
46 |
|
|
//---------------------------------------------------------------------
|
47 |
|
|
void __fastcall TEditeurWinform::Fermer1Click(TObject *Sender)
|
48 |
|
|
{
|
49 |
|
|
Close();
|
50 |
|
|
}
|
51 |
|
|
//---------------------------------------------------------------------------
|
52 |
|
|
|
53 |
|
|
void __fastcall TEditeurWinform::FileExitItemClick(TObject *Sender)
|
54 |
|
|
{
|
55 |
|
|
MainForm->StatusBar->Panels->Items[3]->Text="";
|
56 |
|
|
MainForm->StatusBar->Panels->Items[4]->Text="";
|
57 |
|
|
TerminateProcess(GetCurrentProcess(),0);
|
58 |
|
|
}
|
59 |
|
|
//---------------------------------------------------------------------------
|
60 |
|
|
|
61 |
|
|
|
62 |
|
|
void __fastcall TEditeurWinform::FormActivate(TObject *Sender)
|
63 |
|
|
{
|
64 |
|
|
FILE* in=fopen(Caption.c_str(),"rt");
|
65 |
|
|
if (in!=NULL)
|
66 |
|
|
{
|
67 |
|
|
std::ftime ft;
|
68 |
|
|
getftime(fileno(in), &ft);
|
69 |
|
|
char mess[1000];
|
70 |
|
|
sprintf(mess,"Heure fichier: %02u:%02u:%02u\n",ft.ft_hour, ft.ft_min,ft.ft_tsec * 2);
|
71 |
|
|
MainForm->StatusBar->Panels->Items[3]->Text=mess;
|
72 |
|
|
sprintf(mess,"Jour fichier: %02u/%02u/%02u\n",ft.ft_day, ft.ft_month,ft.ft_year+1980);
|
73 |
|
|
MainForm->StatusBar->Panels->Items[4]->Text=mess;
|
74 |
|
|
fclose(in);
|
75 |
|
|
}
|
76 |
|
|
|
77 |
|
|
}
|
78 |
|
|
//---------------------------------------------------------------------------
|
79 |
|
|
|
80 |
|
|
void __fastcall TEditeurWinform::FormDeactivate(TObject *Sender)
|
81 |
|
|
{
|
82 |
|
|
MainForm->StatusBar->Panels->Items[3]->Text="";
|
83 |
|
|
MainForm->StatusBar->Panels->Items[4]->Text="";
|
84 |
|
|
|
85 |
|
|
}
|
86 |
|
|
//---------------------------------------------------------------------------
|
87 |
|
|
|