ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/acismesh/fenetre.cpp
Revision: 1
Committed: Mon Jun 11 22:53:07 2007 UTC (17 years, 11 months ago)
File size: 3264 byte(s)
Log Message:

File Contents

# User Rev Content
1 1 //---------------------------------------------------------------------------
2     #include <vcl\vcl.h>
3     #include <string.h>
4     #include <stdlib.h>
5     #include <stdio.h>
6     #pragma hdrstop
7    
8     #include "fenetre.h"
9     #include "const.h"
10     #include "prototype.h"
11    
12     extern int acismesh(int argc,char argv[][100]);
13     //---------------------------------------------------------------------------
14     #pragma resource "*.dfm"
15     TFenp *Fenp;
16     //---------------------------------------------------------------------------
17     __fastcall TFenp::TFenp(TComponent* Owner)
18     : TForm(Owner)
19     {
20     }
21    
22     //---------------------------------------------------------------------------
23     void __fastcall TFenp::Iniarg(char *mess)
24     {
25     char *p,*pp,*test;
26     char arg[255];
27     char arg_tmp[255];
28    
29     strcpy(arg,mess);
30     p=arg;
31     argc=0;
32    
33    
34     while (p!=NULL)
35     {
36     sscanf(p,"%s",argv[argc]);
37     argc++;
38     p=strchr(p,' ');
39     if (p!=NULL) p++;
40     }
41    
42    
43     /*
44     p=strchr(p,'-');
45     pp=strchr(p+1,'-');
46     if (pp!=NULL)
47     {
48     strncpy(arg_tmp,p,pp-p);
49     arg_tmp[pp-p]=0;
50     }
51     else strcpy(arg_tmp,p);
52     while (p!=NULL)
53     {
54     test=strchr(p,' ');
55     sscanf(arg_tmp,"%s",argv[argc]);
56     argc++;
57     if (test!=NULL) strncpy(argv[argc++],test+1,pp-test-2);
58     p=pp;
59     if (p==NULL) continue;
60     pp=strchr(p+1,'-');
61     if (pp!=NULL)
62     {
63     strncpy(arg_tmp,p,pp-p);
64     arg_tmp[pp-p]=0;
65     }
66     else strcpy(arg_tmp,p);
67     }
68    
69     */
70     }
71     //---------------------------------------------------------------------------
72     void __fastcall TFenp::FormActivate(TObject *Sender)
73     {
74     int batch;
75     Fenp->Font->Color=clWindowText;
76     batch=acismesh(argc,argv);
77     if (batch==1) Fenp->Close();
78     Fenp->Button1->Caption=FENETRE_FIN ;
79     }
80     //---------------------------------------------------------------------------
81     void __fastcall TFenp::FormCreate(TObject *Sender)
82     {
83     Fenp->Left=Screen->Width-Fenp->Width;
84     Fenp->Top=Screen->Height-Fenp->Height;
85     Fenp->Button1->Caption=FENETRE_ANNULER ;
86     Fenp->Memo1->ReadOnly=True;
87     Button1->Top=5;
88     Button1->Left=(int)(0.05*Fenp->ClientWidth);
89     Button1->Height=25;
90     Button1->Width=(int)(0.9*Fenp->ClientWidth);
91     Memo1->Top=(int)(30+0.05*Fenp->ClientHeight);
92     Memo1->Left=(int)(0.05*Fenp->ClientWidth);
93     Memo1->Height=(int)(0.95*Fenp->ClientHeight-Memo1->Top);
94     Memo1->Width=(int)(0.9*Fenp->ClientWidth);
95     }
96     //---------------------------------------------------------------------------
97     void __fastcall TFenp::Button1Click(TObject *Sender)
98     {
99     int rep;
100    
101     if (Button1->Caption==FENETRE_ANNULER)
102     {
103     rep=MessageBox(Handle,FENETRE_MESSAGE,FENETRE_ANNULER,MB_YESNO|MB_ICONEXCLAMATION);
104     if (rep==IDYES) _exit(3);
105     }
106     else Fenp->Close();
107     }
108     //---------------------------------------------------------------------------
109     void __fastcall TFenp::FormResize(TObject *Sender)
110     {
111     Button1->Top=5;
112     Button1->Left=(int)(0.05*Fenp->ClientWidth);
113     Button1->Height=25;
114     Button1->Width=(int)(0.9*Fenp->ClientWidth);
115     Memo1->Top=(int)(30+0.05*Fenp->ClientHeight);
116     Memo1->Left=(int)(0.05*Fenp->ClientWidth);
117     Memo1->Height=(int)(0.95*Fenp->ClientHeight-Memo1->Top);
118     Memo1->Width=(int)(0.9*Fenp->ClientWidth);
119    
120    
121     }
122     //---------------------------------------------------------------------------