#include "ProjetzzFrm.h"
#include "mod_code.h"
#include "Dlg1.h"
#include "Dlg2.h"
#include "Dlga.h"
#include "Images/Self_ProjetzzFrm_XPM.xpm"
#include "Images/ProjetzzFrm_WxToolButton4_XPM.xpm"
#include "Images/ProjetzzFrm_WxToolButton3_XPM.xpm"
#include "Images/ProjetzzFrm_WxToolButton2_XPM.xpm"
#include "Images/ProjetzzFrm_WxToolButton1_XPM.xpm"
BEGIN_EVENT_TABLE(ProjetzzFrm,wxFrame)
EVT_CLOSE(ProjetzzFrm::OnClose)
EVT_MENU(ID_MNU_NOUVEAU_1027, ProjetzzFrm::Mnunouveau1027Click)
EVT_MENU(ID_MNU_OUVRIR_1021, ProjetzzFrm::Mnuouvrir1021Click)
EVT_MENU(ID_MNU_SAUVER_1022, ProjetzzFrm::Mnusauver1022Click)
EVT_MENU(ID_MNU_QUITTER_1024, ProjetzzFrm::Mnuquitter1024Click)
EVT_MENU(ID_MNU_AIDEDESOPTIONS_1037, ProjetzzFrm::Mnuaidedesoptions1037Click)
EVT_MENU(ID_MNU_MODIFIERLECODE_1039, ProjetzzFrm::Mnumodifierlecode1039Click)
EVT_MENU(ID_MNU_SUBMENUITEM18_1041, ProjetzzFrm::Mnusubmenuitem181041Click)
EVT_MENU(ID_MNU_SUBMENUITEM12_1029, ProjetzzFrm::Mnusubmenuitem121029Click)
EVT_MENU(ID_MNU_COMMANDES_1030, ProjetzzFrm::Mnucommandes1030Click)
EVT_MENU(ID_WXTOOLBUTTON4,ProjetzzFrm::WxToolButton4Click)
EVT_MENU(ID_WXTOOLBUTTON3,ProjetzzFrm::Mnusauver1022Click)
EVT_MENU(ID_WXTOOLBUTTON2,ProjetzzFrm::Mnuouvrir1021Click)
EVT_MENU(ID_WXTOOLBUTTON1,ProjetzzFrm::Mnunouveau1027Click)
EVT_GRID_CELL_CHANGE(ProjetzzFrm::WxGrid1CellChange1)
EVT_BUTTON(ID_WXBUTTON5,ProjetzzFrm::WxButton5Click)
EVT_BUTTON(ID_WXBUTTON4,ProjetzzFrm::WxButton4Click)
EVT_LISTBOX(ID_WXLISTBOX1,ProjetzzFrm::WxListBox1Selected)
EVT_LISTBOX_DCLICK(ID_WXLISTBOX1,ProjetzzFrm::WxButton3Click)
EVT_BUTTON(ID_WXBUTTON3,ProjetzzFrm::WxButton3Click)
EVT_BUTTON(ID_WXBUTTON2,ProjetzzFrm::WxButton2Click)
EVT_BUTTON(ID_WXBUTTON1,ProjetzzFrm::WxButton1Click)
EVT_UPDATE_UI(ID_WXPANEL1,ProjetzzFrm::WxPanel1UpdateUI)
END_EVENT_TABLE()
int jx=0,jx2=0,ix=0,n_liste=0,n_instr=0,maximum,nbre_texte;
int posG;
wxString phrase,phrase2,liste[300],code[300],objet[200],param1[200],param2[200],rien=wxT("");
wxString param1i,param2i,phrasex,intermede;
wxString texte1,texte2,texte3,texte4,texte5;
int n=0,n2=0,i=0,j=0,k=0,fr=0,nx[8];int nb,i9,signe_nb,resultat,valeur,total1x;
char nomfichier[50],phra[50],phr,phr2[510],phr3[250],phr4[150],phr5[90];
char phr6[90],phr7[90],phrn[300],suf[5]=".cel",ent[]="\n",nom_obj[50]="";
char encod[40],encx[40],ency[40],encz[40],obj[250],obj2[250],obj3[250],obj4[250];
static unsigned char alphabet[65] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
double ax,ay,az,a9,bx,by,bz,b9;
float ang,cx,cy,cz,ow,ox,oy,oz,fov1,fov2,k0;
const float coef_a=1.015; wxString att1x,att2x,att3x,att4x,att5x,duree1x,duree2x,duree3x,duree4x;
wxString duree1,duree2,duree3,duree4,ph_orb;
bool valid1x,valid2x,block;
char const sel[]="select { object \"",got[]="goto { time ",wai[]="wait { duration ";
char const dis[]=" distance ",orb[]="orbit { axis [ 0 1 0 ] rate ",orb2[]=" duration ";
char const deb[]="{",fin[]=" }",rot[]="rotate { duration",fol[]="follow{}",motz[]="z ",moto[]="o";
char const tim[]="timerate { rate ",cha[]="changedistance { duration ",motx[]="x ",moty[]="y ";
char const rat[]=" rate ",rajt[]="wait { duration 2 }",dur5[]="5",gui[]="\"";
char const syn[]="synchronous {}",dur8[]="8",dur9[]="10",dur13[]="13",dur14[]="14";
char const sol[]="Soleil",sla[]="/",lab[]="labels {",ren[]="renderflags {",ou[]="|";
char const pol[]="orbit { axis [ 1 0 0 ] rate 15 duration 6 }",tim0[]="timerate { rate 0}";
char const cen[]="center {}",set[]="set { name \"FOV\" value ",dies[]="# ",timex[]="time ",jd[]="{ jd ";
char const pri[]="print { text \"",row[]="\" row -4 column 3 }",sel2[]="select { object ";
char const setfr[]="setframe { ",gotl[]="gotoloc {",motw[]="w ";
char const wait_fov[]="wait { duration 0.05 }";
char wai2[40]="wait { duration ";
int c,cc,rep=0,rep2=0,rep3=0,rep4=0,m=0,n0,sortie=0,j01;
char recapil[300][250],recap[300],instrm[10000]; char lect[3],durees[50],lettre[2]; FILE *fic;
ProjetzzFrm::ProjetzzFrm(wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &position, const wxSize& size, long style)
: wxFrame(parent, id, title, position, size, style)
{
CreateGUIControls();
}
ProjetzzFrm::~ProjetzzFrm()
{
}
void mod_nom(void)
{
if (strcmp(obj,"Vénus")==0) strcpy(obj,"Venus");if (strcmp(obj,"vénus")==0) strcpy(obj,"Venus");
if (strcmp(obj,"VENUS")==0) strcpy(obj,"Venus");
if (strcmp(obj2,"Vénus")==0) strcpy(obj2,"Venus");if (strcmp(obj2,"vénus")==0) strcpy(obj2,"Venus");
if (strcmp(obj2,"VENUS")==0) strcpy(obj2,"Venus");
if (strcmp(obj3,"Vénus")==0) strcpy(obj3,"Venus");if (strcmp(obj3,"vénus")==0) strcpy(obj3,"Venus");
if (strcmp(obj3,"VENUS")==0) strcpy(obj3,"Venus");
if (strcmp(obj4,"Vénus")==0) strcpy(obj4,"Venus");if (strcmp(obj4,"vénus")==0) strcpy(obj4,"Venus");
if (strcmp(obj4,"VENUS")==0) strcpy(obj4,"Venus");
if (block==false) return;if (strcmp(obj,"soleil")==0) strcpy(obj,"Sol");
if (strcmp(obj,"Soleil")==0) strcpy(obj,"Sol");
if (strcmp(obj,"SOLEIL")==0) strcpy(obj,"Sol");
if (strcmp(obj,"terre")==0) strcpy(obj,"Earth");
if (strcmp(obj,"Terre")==0) strcpy(obj,"Earth");
if (strcmp(obj,"TERRE")==0) strcpy(obj,"Earth");
if (strcmp(obj,"saturne")==0) strcpy(obj,"Saturn");
if (strcmp(obj,"Saturne")==0) strcpy(obj,"Saturn");
if (strcmp(obj,"SATURNE")==0) strcpy(obj,"Saturn");
if (strcmp(obj,"Mercure")==0) strcpy(obj,"Mercury");
if (strcmp(obj,"mercure")==0) strcpy(obj,"Mercury");
if (strcmp(obj,"MERCURE")==0) strcpy(obj,"Mercury");
if (strcmp(obj,"Europe")==0) strcpy(obj,"Europa");
if (strcmp(obj,"europe")==0) strcpy(obj,"Europa");
if (strcmp(obj,"EUROPE")==0) strcpy(obj,"Europa");
if (strcmp(obj,"Lune")==0) strcpy(obj,"Moon");
if (strcmp(obj,"lune")==0) strcpy(obj,"Moon");
if (strcmp(obj,"LUNE")==0) strcpy(obj,"Moon");
if (strcmp(obj,"Pluton")==0) strcpy(obj,"Pluto");
if (strcmp(obj,"pluton")==0) strcpy(obj,"Pluto");
if (strcmp(obj,"PLUTON")==0) strcpy(obj,"Pluto");
if (strcmp(obj2,"soleil")==0) strcpy(obj2,"Sol");
if (strcmp(obj2,"Soleil")==0) strcpy(obj2,"Sol");
if (strcmp(obj2,"SOLEIL")==0) strcpy(obj2,"Sol");
if (strcmp(obj2,"terre")==0) strcpy(obj2,"Earth");
if (strcmp(obj2,"Terre")==0) strcpy(obj2,"Earth");
if (strcmp(obj2,"TERRE")==0) strcpy(obj2,"Earth");
if (strcmp(obj2,"saturne")==0) strcpy(obj2,"Saturn");
if (strcmp(obj2,"Saturne")==0) strcpy(obj2,"Saturn");
if (strcmp(obj2,"SATURNE")==0) strcpy(obj2,"Saturn");
if (strcmp(obj2,"Mercure")==0) strcpy(obj2,"Mercury");
if (strcmp(obj2,"mercure")==0) strcpy(obj2,"Mercury");
if (strcmp(obj2,"MERCURE")==0) strcpy(obj2,"Mercury");
if (strcmp(obj2,"Europe")==0) strcpy(obj2,"Europa");
if (strcmp(obj2,"europe")==0) strcpy(obj2,"Europa");
if (strcmp(obj2,"EUROPE")==0) strcpy(obj2,"Europa");
if (strcmp(obj2,"Lune")==0) strcpy(obj2,"Moon");
if (strcmp(obj2,"lune")==0) strcpy(obj2,"Moon");
if (strcmp(obj2,"LUNE")==0) strcpy(obj2,"Moon");
if (strcmp(obj2,"Pluton")==0) strcpy(obj2,"Pluto");
if (strcmp(obj2,"pluton")==0) strcpy(obj2,"Pluto");
if (strcmp(obj2,"PLUTON")==0) strcpy(obj2,"Pluto");
if (strcmp(obj3,"soleil")==0) strcpy(obj3,"Sol");
if (strcmp(obj3,"Soleil")==0) strcpy(obj3,"Sol");
if (strcmp(obj3,"SOLEIL")==0) strcpy(obj3,"Sol");
if (strcmp(obj3,"terre")==0) strcpy(obj3,"Earth");
if (strcmp(obj3,"Terre")==0) strcpy(obj3,"Earth");
if (strcmp(obj3,"TERRE")==0) strcpy(obj3,"Earth");
if (strcmp(obj3,"saturne")==0) strcpy(obj3,"Saturn");
if (strcmp(obj3,"Saturne")==0) strcpy(obj3,"Saturn");
if (strcmp(obj3,"SATURNE")==0) strcpy(obj3,"Saturn");
if (strcmp(obj3,"Mercure")==0) strcpy(obj3,"Mercury");
if (strcmp(obj3,"mercure")==0) strcpy(obj3,"Mercury");
if (strcmp(obj3,"MERCURE")==0) strcpy(obj3,"Mercury");
if (strcmp(obj3,"Europe")==0) strcpy(obj3,"Europa");
if (strcmp(obj3,"europe")==0) strcpy(obj3,"Europa");
if (strcmp(obj3,"EUROPE")==0) strcpy(obj3,"Europa");
if (strcmp(obj3,"Lune")==0) strcpy(obj3,"Moon");
if (strcmp(obj3,"lune")==0) strcpy(obj3,"Moon");
if (strcmp(obj3,"LUNE")==0) strcpy(obj3,"Moon");
if (strcmp(obj3,"Pluton")==0) strcpy(obj3,"Pluto");
if (strcmp(obj3,"pluton")==0) strcpy(obj3,"Pluto");
if (strcmp(obj3,"PLUTON")==0) strcpy(obj3,"Pluto");
if (strcmp(obj4,"soleil")==0) strcpy(obj4,"Sol");
if (strcmp(obj4,"Soleil")==0) strcpy(obj4,"Sol");
if (strcmp(obj4,"SOLEIL")==0) strcpy(obj4,"Sol");
if (strcmp(obj4,"terre")==0) strcpy(obj4,"Earth");
if (strcmp(obj4,"Terre")==0) strcpy(obj4,"Earth");
if (strcmp(obj4,"TERRE")==0) strcpy(obj4,"Earth");
if (strcmp(obj4,"saturne")==0) strcpy(obj4,"Saturn");
if (strcmp(obj4,"Saturne")==0) strcpy(obj4,"Saturn");
if (strcmp(obj4,"SATURNE")==0) strcpy(obj4,"Saturn");
if (strcmp(obj4,"Mercure")==0) strcpy(obj4,"Mercury");
if (strcmp(obj4,"mercure")==0) strcpy(obj4,"Mercury");
if (strcmp(obj4,"MERCURE")==0) strcpy(obj4,"Mercury");
if (strcmp(obj4,"Europe")==0) strcpy(obj4,"Europa");
if (strcmp(obj4,"europe")==0) strcpy(obj4,"Europa");
if (strcmp(obj4,"EUROPE")==0) strcpy(obj4,"Europa");
if (strcmp(obj4,"Lune")==0) strcpy(obj4,"Moon");
if (strcmp(obj4,"lune")==0) strcpy(obj4,"Moon");
if (strcmp(obj4,"LUNE")==0) strcpy(obj4,"Moon");
if (strcmp(obj4,"Pluton")==0) strcpy(obj4,"Pluto");
if (strcmp(obj4,"pluton")==0) strcpy(obj4,"Pluto");
if (strcmp(obj4,"PLUTON")==0) strcpy(obj4,"Pluto");
}
void enleveraccent(void){
for(unsigned int tail=0;tail<strlen(obj);tail++)
{
if ((obj[tail]=='é')|(obj[tail]=='è')|(obj[tail]=='ê')|(obj[tail]=='ë'))
obj[tail]='e';
if (obj[tail]=='à')
obj[tail]='a';
if ((obj[tail]=='î')|(obj[tail]=='ï'))
obj[tail]='i';
if (obj[tail]=='ù')
obj[tail]='u';
if (obj[tail]=='ô')
obj[tail]='o';
if (obj[tail]=='ç')
obj[tail]='c';
}
for(unsigned int tail=0;tail<strlen(obj2);tail++)
{
if ((obj2[tail]=='é')|(obj2[tail]=='è')|(obj2[tail]=='ê')|(obj2[tail]=='ë'))
obj2[tail]='e';
if (obj2[tail]=='à')
obj2[tail]='a';
if ((obj2[tail]=='î')|(obj2[tail]=='ï'))
obj2[tail]='i';
if (obj2[tail]=='ù')
obj2[tail]='u';
if (obj2[tail]=='ô')
obj2[tail]='o';
if (obj2[tail]=='ç')
obj2[tail]='c';
}
for(unsigned int tail=0;tail<strlen(obj3);tail++)
{
if ((obj3[tail]=='é')|(obj3[tail]=='è')|(obj3[tail]=='ê')|(obj3[tail]=='ë'))
obj3[tail]='e';
if (obj3[tail]=='à')
obj3[tail]='a';
if ((obj3[tail]=='î')|(obj3[tail]=='ï'))
obj3[tail]='i';
if (obj3[tail]=='ù')
obj3[tail]='u';
if (obj3[tail]=='ô')
obj3[tail]='o';
if (obj3[tail]=='ç')
obj3[tail]='c';
}
for(unsigned int tail=0;tail<strlen(obj4);tail++)
{
if ((obj4[tail]=='é')|(obj4[tail]=='è')|(obj4[tail]=='ê')|(obj4[tail]=='ë'))
obj4[tail]='e';
if (obj4[tail]=='à')
obj4[tail]='a';
if ((obj4[tail]=='î')|(obj4[tail]=='ï'))
obj4[tail]='i';
if (obj4[tail]=='ù')
obj4[tail]='u';
if (obj4[tail]=='ô')
obj4[tail]='o';
if (obj4[tail]=='ç')
obj4[tail]='c';
}
}
void accent(unsigned int i7,unsigned int i8)
{
unsigned int z0;
char obi[150]="",obf[150]="";
for (z0=0;z0<i7;z0++)
{
obi[z0]=obj[z0];
}
for (z0=i7+1;z0<=strlen(obj);z0++)
{
obf[z0-i7-1]=obj[z0];
}
if (i8==233) strcat(obi,"\\u00e9"); if (i8==232) strcat(obi,"\\u00e8"); if (i8==234) strcat(obi,"\\u00ea"); if (i8==235) strcat(obi,"\\u00eb"); if (i8==224) strcat(obi,"\\u00e0"); if (i8==238) strcat(obi,"\\u00ee"); if (i8==239) strcat(obi,"\\u00ef"); if (i8==249) strcat(obi,"\\u00f9"); if (i8==244) strcat(obi,"\\u00f4"); if (i8==231) strcat(obi,"\\u00e7"); strcat(obi,obf);
strcpy(obj,obi);
}
void codage(double d,double d2)
{
double d3;
for (int i = 0; i < 8; i++)
nx[i] = 0;
int sign = 1;
if (d < 0)
{
sign = -1;
d = -d;
d2 = -d2;
if(d2<0) d3=-d2;
else d3=d2;
}
double e = floor(d / (65536.0 * 65536.0 * 65536.0));
if (e < 32767)
{
nx[7] = (unsigned short) e;
d -= nx[7] * 65536.0 * 65536.0 * 65536.0;
nx[6] = (unsigned short) (d / (65536.0 * 65536.0));
d -= nx[6] * 65536.0 * 65536.0;
nx[5] = (unsigned short) (d / 65536.0);
d -= nx[5] * 65536.0;
nx[4] = (unsigned short) d;
d -= nx[4];
if (d3>0.0001) d+=d2;
nx[3] = (unsigned short) (d * 65536.0);
d -= nx[3] / 65536.0;
if ((d3>0.0000001)&&(d3<0.0001)) d+=d2;
nx[2] = (unsigned short) (d * 65536.0 * 65536.0);
d -= nx[2] / (65536.0 * 65536.0);
if ((d3>0.00000000001)&&(d3<0.0000001)) d+=d2;
nx[1] = (unsigned short) (d * 65536.0 * 65536.0 * 65536.0);
d -= nx[1] / (65536.0 * 65536.0 * 65536.0);
if (d3<0.00000000001) d+=d2;
nx[0] = (unsigned short) (d * 65536.0 * 65536.0 * 65536.0 * 65536.0);
}
if (sign==-1)
{for (int i7=0;i7<8;i7++)
{
nx[i7]^=0xffff;
}
}
}
void encodage(void)
{
strcpy(encod,"");
int bits, c, char_count, started, i, j, k=0;
char_count = 0;
bits = 0;
started = 0;
i = 16;
do {
i--;
c = nx[i/2];
if (i & 1) c >>= 8;
c &= 0xff;
} while ((c == 0) && (i != 0));
if (i == 0)
{
encod[k]=0;
return; }
j = 0;
while (j <= i)
{
c = nx[j/2];
if ( j & 1 ) c >>= 8;
c &= 0xff;
j++;
bits += c;
char_count++;
if (char_count == 3)
{
encod[k++]=alphabet[bits >> 18];
encod[k++]=alphabet[(bits >> 12) & 0x3f];
encod[k++]=alphabet[(bits >> 6) & 0x3f];
encod[k++]=alphabet[bits & 0x3f];
bits = 0;
char_count = 0;
}
else
{
bits <<= 8;
}
}
if (char_count != 0)
{
bits <<= 16 - (8 * char_count);
encod[k++]=alphabet[bits >> 18];
encod[k++]=alphabet[(bits >> 12) & 0x3f];
if (char_count != 1)
encod[k++]=alphabet[(bits >> 6) & 0x3f];
}
encod[k]=0;
return;
}void modif_texte_suppl(int numero_ph)
{
if (n_instr!=3)
strcpy(wai2,wai);
strcpy(obj2,obj);
unsigned int longueur=strlen(obj);
if (longueur>61)
{
for(j=60;j>32;j--)
if (obj[j]==32)
{
strcat(obj,"+");
for(i=longueur-1;i>j;i--)
obj[i+1]=obj[i];
obj[j]=92;
obj[j+1]=110;
break;
}
}
longueur=strlen(obj);
if (longueur>126)
{
for(j=125;j>100;j--)
if (obj[j]==32)
{
strcat(obj,"+");
for(i=longueur-1;i>j;i--)
obj[i+1]=obj[i];
obj[j]=92;
obj[j+1]=110;
break;
}
}
i=0;
while(i<strlen(obj))
{
j=obj[i];
if (j<0) j=256+j;
if ((j==233)|(j==232)|(j==234)|(j==235)|(j==224)|(j==238)|(j==239)|(j==249)|(j==244)|(j==231))
accent(i,j);
i++;
}
strcpy(durees,"3");
if(numero_ph==1)
if(att1x!=wxT("0"))
{
strcat(instrm,wai2); strcat(instrm,att1x.c_str());
strcat(instrm,fin); strcat(instrm,ent); }
if(numero_ph==2)
if(att2x!=wxT("0"))
{
strcat(instrm,wai2); strcat(instrm,att2x.c_str());
strcat(instrm,fin); strcat(instrm,ent); }
if(numero_ph==3)
if(att3x!=wxT("0"))
{
strcat(instrm,wai2); strcat(instrm,att3x.c_str());
strcat(instrm,fin); strcat(instrm,ent); }
if(numero_ph==4)
if(att4x!=wxT("0"))
{
strcat(instrm,wai2); strcat(instrm,att4x.c_str());
strcat(instrm,fin); strcat(instrm,ent); }
if (strlen(obj)>0)
{
strcat(instrm,pri); strcat(instrm,obj); strcat(instrm,gui);
strcat(instrm," row -3 column 3 duration ");
if(numero_ph==0)
strcat(instrm,durees); else
{
if(numero_ph==1)
strcat(instrm,duree1x.c_str());
if(numero_ph==2)
strcat(instrm,duree2x.c_str());
if(numero_ph==3)
strcat(instrm,duree3x.c_str());
if(numero_ph==4)
strcat(instrm,duree4x.c_str());
}
strcat(instrm,fin); strcat(instrm,ent); }
if(numero_ph==0)
{
strcat(instrm,wai2); strcat(instrm,durees); strcat(instrm,fin); strcat(instrm,ent); }
if(numero_ph==1)
if(duree1x!=wxT("0"))
{
strcat(instrm,wai2); strcat(instrm,duree1x.c_str());
strcat(instrm,fin); strcat(instrm,ent); }
if(numero_ph==2)
if(duree2x!=wxT("0"))
{
strcat(instrm,wai2); strcat(instrm,duree2x.c_str());
strcat(instrm,fin); strcat(instrm,ent); }
if(numero_ph==3)
if(duree3x!=wxT("0"))
{
strcat(instrm,wai2); strcat(instrm,duree3x.c_str());
strcat(instrm,fin); strcat(instrm,ent); }
if(numero_ph==4)
if(duree4x!=wxT("0"))
{
strcat(instrm,wai2); strcat(instrm,duree4x.c_str());
strcat(instrm,fin); strcat(instrm,ent); }
}
wxString mod_phrase(wxString wxph)
{
char obj_int[250],obj_fin[250];
strcpy(obj_int,obj);
strcpy(obj,wxph.c_str());
unsigned int longueur=strlen(obj);
if (longueur>61)
{
for(j=60;j>32;j--)
if (obj[j]==32)
{
strcat(obj,"+");
for(i=longueur-1;i>j;i--)
obj[i+1]=obj[i];
obj[j]=92;
obj[j+1]=110;
break;
}
}
longueur=strlen(obj);
if (longueur>126)
{
for(j=125;j>100;j--)
if (obj[j]==32)
{
strcat(obj,"+");
for(i=longueur-1;i>j;i--)
obj[i+1]=obj[i];
obj[j]=92;
obj[j+1]=110;
break;
}
}
i=0;
while(i<strlen(obj))
{
j=obj[i];
if (j<0) j=256+j;
if ((j==233)|(j==232)|(j==234)|(j==235)|(j==224)|(j==238)|(j==239)|(j==249)|(j==244)|(j==231))
accent(i,j);
i++;
}
strcpy(obj_fin,obj);
strcpy(obj,obj_int);
return wxT(obj_fin);
}
void ProjetzzFrm::CreateGUIControls()
{
WxPanel1 = new wxPanel(this, ID_WXPANEL1, wxPoint(2,6), wxSize(619,378));
WxPanel1->SetForegroundColour(wxColour(128,0,0));
WxPanel1->SetFont(wxFont(8, wxSWISS, wxNORMAL,wxBOLD, false));
WxButton1 = new wxButton(WxPanel1, ID_WXBUTTON1, wxT("Supprimer"), wxPoint(271,272), wxSize(65,25), 0, wxDefaultValidator, wxT("WxButton1"));
WxButton1->SetToolTip(wxT("Supprimer une instruction"));
WxButton1->SetFont(wxFont(8, wxSWISS, wxNORMAL,wxBOLD, false));
WxButton2 = new wxButton(WxPanel1, ID_WXBUTTON2, wxT("Remonter"), wxPoint(361,272), wxSize(65,25), 0, wxDefaultValidator, wxT("WxButton2"));
WxButton2->SetToolTip(wxT("Remonter d'un rang une instruction"));
WxButton2->SetFont(wxFont(8, wxSWISS, wxNORMAL,wxBOLD, false));
WxButton3 = new wxButton(WxPanel1, ID_WXBUTTON3, wxT("Valider"), wxPoint(88,285), wxSize(60,25), 0, wxDefaultValidator, wxT("WxButton3"));
WxButton3->SetToolTip(wxT("Valider une instruction"));
WxButton3->SetFont(wxFont(8, wxSWISS, wxNORMAL,wxBOLD, false));
wxArrayString arrayStringFor_WxListBox1;
WxListBox1 = new wxListBox(WxPanel1, ID_WXLISTBOX1, wxPoint(9,33), wxSize(235,246), arrayStringFor_WxListBox1, wxLB_SINGLE);
WxListBox1->SetToolTip(wxT("Choisir une instruction"));
WxListBox1->Append(wxT("Aller vers un objet"));
WxListBox1->Append(wxT("Attendre quelques secondes"));
WxListBox1->Append(wxT("Aller vers un signet"));
WxListBox1->Append(wxT("Tourner autour"));
WxListBox1->Append(wxT("Changer la vitesse du temps"));
WxListBox1->Append(wxT("S'approcher ou s'éloigner"));
WxListBox1->Append(wxT("Suivre"));
WxListBox1->Append(wxT("Se synchroniser avec"));
WxListBox1->Append(wxT("Modifier l'affichage"));
WxListBox1->Append(wxT("Se placer au-dessus d'un pôle"));
WxListBox1->Append(wxT("Regarder vers un objet"));
WxListBox1->Append(wxT("Changer le champ de vision"));
WxListBox1->Append(wxT("Faire un travelling arrière / avant"));
WxListBox1->Append(wxT("Ajouter du texte"));
WxListBox1->Append(wxT("Aller à une longitude/lattitude"));
WxListBox1->SetBackgroundColour(wxColour(255,255,128));
WxListBox1->SetFont(wxFont(10, wxSWISS, wxNORMAL,wxBOLD, false));
WxStaticText1 = new wxStaticText(WxPanel1, ID_WXSTATICTEXT1, wxT("instructions à choisir"), wxPoint(50,10), wxDefaultSize, 0, wxT("WxStaticText1"));
WxStaticText1->SetFont(wxFont(10, wxSWISS, wxNORMAL,wxBOLD, false));
WxStaticText2 = new wxStaticText(WxPanel1, ID_WXSTATICTEXT2, wxT("Liste du script"), wxPoint(363,10), wxDefaultSize, 0, wxT("WxStaticText2"));
WxStaticText2->SetFont(wxFont(10, wxSWISS, wxNORMAL,wxBOLD, false));
WxButton4 = new wxButton(WxPanel1, ID_WXBUTTON4, wxT("Descendre"), wxPoint(452,272), wxSize(70,25), 0, wxDefaultValidator, wxT("WxButton4"));
WxButton4->SetToolTip(wxT("Descendre d'un rang une instruction"));
WxButton4->SetFont(wxFont(8, wxSWISS, wxNORMAL,wxBOLD, false));
WxButton5 = new wxButton(WxPanel1, ID_WXBUTTON5, wxT("Insérer"), wxPoint(547,272), wxSize(62,25), 0, wxDefaultValidator, wxT("WxButton5"));
WxButton5->SetToolTip(wxT("Insérer une instruction à l'emplacement souhaité"));
WxButton5->SetFont(wxFont(8, wxSWISS, wxNORMAL,wxBOLD, false));
WxGrid1 = new wxGrid(WxPanel1, ID_WXGRID1, wxPoint(267,34), wxSize(348,229), wxDOUBLE_BORDER);
WxGrid1->SetToolTip(wxT("Liste des instructions du script"));
WxGrid1->SetHelpText(wxT("liste des instructions"));
WxGrid1->SetFont(wxFont(8, wxSWISS, wxNORMAL,wxBOLD, false));
WxGrid1->SetDefaultColSize(450);
WxGrid1->SetDefaultRowSize(20);
WxGrid1->SetRowLabelSize(25);
WxGrid1->SetColLabelSize(0);
WxGrid1->CreateGrid(1,1,wxGrid::wxGridSelectCells);
WxToolBar1 = new wxToolBar(this, ID_WXTOOLBAR1, wxPoint(0,0), wxSize(627,29));
wxBitmap WxToolButton1_BITMAP (ProjetzzFrm_WxToolButton1_XPM);
wxBitmap WxToolButton1_DISABLE_BITMAP (wxNullBitmap);
WxToolBar1->AddTool(ID_WXTOOLBUTTON1, wxT("nouveau script"), WxToolButton1_BITMAP, WxToolButton1_DISABLE_BITMAP, wxITEM_NORMAL, wxT("Nouveau script"), wxT("nouveau script ?"));
wxBitmap WxToolButton2_BITMAP (ProjetzzFrm_WxToolButton2_XPM);
wxBitmap WxToolButton2_DISABLE_BITMAP (wxNullBitmap);
WxToolBar1->AddTool(ID_WXTOOLBUTTON2, wxT("ouvrir"), WxToolButton2_BITMAP, WxToolButton2_DISABLE_BITMAP, wxITEM_NORMAL, wxT("Ouvrir un script"), wxT("ouvrir un script ?"));
wxBitmap WxToolButton3_BITMAP (ProjetzzFrm_WxToolButton3_XPM);
wxBitmap WxToolButton3_DISABLE_BITMAP (wxNullBitmap);
WxToolBar1->AddTool(ID_WXTOOLBUTTON3, wxT("Sauver"), WxToolButton3_BITMAP, WxToolButton3_DISABLE_BITMAP, wxITEM_NORMAL, wxT("Sauver un script"), wxT("Sauver le scipt ?"));
wxBitmap WxToolButton4_BITMAP (ProjetzzFrm_WxToolButton4_XPM);
wxBitmap WxToolButton4_DISABLE_BITMAP (wxNullBitmap);
WxToolBar1->AddTool(ID_WXTOOLBUTTON4, wxT("celestia"), WxToolButton4_BITMAP, WxToolButton4_DISABLE_BITMAP, wxITEM_NORMAL, wxT("Lancer CELESTIA"), wxT("Lancer Celestia"));
WxSaveFileDialog1 = new wxFileDialog(this, wxT("Sauver un fichier"), wxT(""), wxT(""), wxT("*.cel"), wxSAVE | wxOVERWRITE_PROMPT);
WxTextEntryDialog3 = new wxTextEntryDialog( this,wxT("Donnez le nom de la lune ou du satellite"), wxT("Choisir..."), wxT("") ,wxOK | wxCANCEL | wxCENTRE);
WxTextEntryDialog19 = new wxTextEntryDialog( this,wxT("Donner la vitesse angulaire (degré par seconde) :"), wxT("Valeur supplémentaire"), wxT("") ,wxOK | wxCANCEL | wxCENTRE);
signetDialog1 = new wxTextEntryDialog( this,wxT("Aller vers quel signet ? (attention aux majuscules)"), wxT("Aller vers un signet"), wxT("") ,wxOK | wxCANCEL | wxCENTRE);
WxTextEntryDialog9 = new wxTextEntryDialog( this,wxT("Donnez le nom du satellite ou de la lune :"), wxT("Un satellite ou une lune d'une planète"), wxT("") ,wxOK | wxCANCEL | wxCENTRE);
WxTextEntryDialog5 = new wxTextEntryDialog( this,wxT("Donner le coefficient multiplicateur du temps : (1=temps réel)"), wxT("Changer la vitesse du temps"), wxT("") ,wxOK | wxCANCEL | wxCENTRE);
AttendreDialog1 = new wxTextEntryDialog( this,wxT("Attendre combien de secondes ?"), wxT("Attendre quelques secondes"), wxT("") ,wxOK | wxCANCEL | wxCENTRE);
WxTextEntryDialog15 = new wxTextEntryDialog( this,wxT("Donner le champ de vision (FOV) initial (annulez s'il est inconnu) :"), wxT("Changer le champ de vision"), wxT("") ,wxOK | wxCANCEL | wxCENTRE);
WxTextEntryDialog2 = new wxTextEntryDialog( this,wxT("Donnez le nom de l'étoile ou de la galaxie"), wxT("Choisir..."), wxT("") ,wxOK | wxCANCEL | wxCENTRE);
WxMessageDialog1 = new wxMessageDialog(this, wxT("Voulez-vous supprimer cette instruction ?"), wxT("Supprimer"), wxYES_NO | wxICON_EXCLAMATION);
wxArrayString arrayStringFor_WxSingleChoiceDialog4;
arrayStringFor_WxSingleChoiceDialog4.Add(wxT("notre soleil"));
arrayStringFor_WxSingleChoiceDialog4.Add(wxT("une autre étoile ou une galaxie"));
arrayStringFor_WxSingleChoiceDialog4.Add(wxT("une planète du système solaire"));
arrayStringFor_WxSingleChoiceDialog4.Add(wxT("une planète d'un autre système"));
arrayStringFor_WxSingleChoiceDialog4.Add(wxT("une comète, un astéroïde ou une sonde"));
arrayStringFor_WxSingleChoiceDialog4.Add(wxT("un satellite ou une lune d'une planète"));
arrayStringFor_WxSingleChoiceDialog4.Add(wxT("un satellite d'une lune"));
arrayStringFor_WxSingleChoiceDialog4.Add(wxT("un autre cas"));
WxSingleChoiceDialog4 = new wxSingleChoiceDialog(this, wxT("Choisir le bon cas :"), wxT("Aller vers :"), arrayStringFor_WxSingleChoiceDialog4,NULL, wxOK | wxCANCEL);
WxOpenFileDialog1 = new wxFileDialog(this, wxT("Ouvrir un fichier"), wxT(""), wxT(""), wxT("*.cel"), wxOPEN);
WxMessageDialog6 = new wxMessageDialog(this, wxT("Valider ?"), wxT("Synchronisation avec l'objet"), wxYES_NO);
WxTextEntryDialog11 = new wxTextEntryDialog( this,wxT("Donnez le nom de la lune :"), wxT("Un satellite d'une lune"), wxT("") ,wxOK | wxCANCEL | wxCENTRE);
WxTextEntryDialog24 = new wxTextEntryDialog( this,wxT("Combien de temps rajoutez-vous à ces textes ? (en secondes)"), wxT("Durée supplementaire"), wxT("") ,wxOK | wxCANCEL | wxCENTRE);
wxcommandesDialog = new wxMessageDialog(this, wxT("1 - choisir une instruction dans le rectangle jaune\n2 - Cliquer sur \"valider\"\n3 - répondre aux messages affichés\n4 - La nouvelle instruction s'affiche à droite\n\nPour tester le script : \n1 - l'enregistrer (Sauver)\n2 - Lancer CELESTIA en cliquant sur l'icône \"planète\"\n3 - Dans CELESTIA, faire Fichier/ouvrir un script et choisir votre script"), wxT("Liste des commandes"));
WxTextEntryDialog1 = new wxTextEntryDialog( this,wxT("Donnez le nom de la planète"), wxT("Aller vers ..."), wxT("") ,wxOK | wxCANCEL | wxCENTRE);
WxTextEntryDialog18 = new wxTextEntryDialog( this,wxT("Durée en seconde :"), wxT("Valeur supplémentaire"), wxT("") ,wxOK | wxCANCEL | wxCENTRE);
WxMenuBar1 = new wxMenuBar();
wxMenu *ID_MNU_MENUITEM1_1014_Mnu_Obj = new wxMenu(0);
ID_MNU_MENUITEM1_1014_Mnu_Obj->Append(ID_MNU_NOUVEAU_1027, wxT("&Nouveau"), wxT(""), wxITEM_NORMAL);
ID_MNU_MENUITEM1_1014_Mnu_Obj->Append(ID_MNU_OUVRIR_1021, wxT("&Ouvrir"), wxT(""), wxITEM_NORMAL);
ID_MNU_MENUITEM1_1014_Mnu_Obj->Append(ID_MNU_SAUVER_1022, wxT("&Sauver"), wxT(""), wxITEM_NORMAL);
ID_MNU_MENUITEM1_1014_Mnu_Obj->AppendSeparator();
ID_MNU_MENUITEM1_1014_Mnu_Obj->Append(ID_MNU_QUITTER_1024, wxT("&Quitter"), wxT(""), wxITEM_NORMAL);
m_fileHistory = new wxFileHistory(9,wxID_FILE1);
m_fileHistory->UseMenu( ID_MNU_MENUITEM1_1014_Mnu_Obj );
m_fileConfig = new wxConfig("Projetzz2");
wxConfigBase::Set( m_fileConfig );
m_fileConfig->SetPath(wxT("/RecentFiles"));
m_fileHistory->Load(*m_fileConfig);
m_fileConfig->SetPath(wxT(".."));
WxMenuBar1->Append(ID_MNU_MENUITEM1_1014_Mnu_Obj, wxT("&Fichier"));
wxMenu *ID_MNU_MENUITEM2_1015_Mnu_Obj = new wxMenu(0);
ID_MNU_MENUITEM2_1015_Mnu_Obj->Append(ID_MNU_SUBMENUITEM3_1016, wxT("Pl&us de paramètres"), wxT(""), wxITEM_CHECK);
ID_MNU_MENUITEM2_1015_Mnu_Obj->Check(ID_MNU_SUBMENUITEM3_1016,false);
ID_MNU_MENUITEM2_1015_Mnu_Obj->Append(ID_MNU_TEXTEDURANTVOYAGE_1038, wxT("&Texte durant le voyage"), wxT(""), wxITEM_CHECK);
ID_MNU_MENUITEM2_1015_Mnu_Obj->Check(ID_MNU_TEXTEDURANTVOYAGE_1038,false);
ID_MNU_MENUITEM2_1015_Mnu_Obj->Append(ID_MNU_NOMSENFRAN_AIS_1026, wxT("&Noms en français"), wxT(""), wxITEM_CHECK);
ID_MNU_MENUITEM2_1015_Mnu_Obj->Check(ID_MNU_NOMSENFRAN_AIS_1026,false);
ID_MNU_MENUITEM2_1015_Mnu_Obj->AppendSeparator();
ID_MNU_MENUITEM2_1015_Mnu_Obj->Append(ID_MNU_AIDEDESOPTIONS_1037, wxT("Aide des options"), wxT(""), wxITEM_NORMAL);
ID_MNU_MENUITEM2_1015_Mnu_Obj->Append(ID_MNU_MODIFIERLECODE_1039, wxT("&Modifier le code"), wxT(""), wxITEM_NORMAL);
ID_MNU_MENUITEM2_1015_Mnu_Obj->Append(ID_MNU_SUBMENUITEM18_1041, wxT("Enregistrer les configurations"), wxT(""), wxITEM_NORMAL);
WxMenuBar1->Append(ID_MNU_MENUITEM2_1015_Mnu_Obj, wxT("O&ptions"));
wxMenu *ID_MNU_APROPOS_1025_Mnu_Obj = new wxMenu(0);
ID_MNU_APROPOS_1025_Mnu_Obj->Append(ID_MNU_SUBMENUITEM12_1029, wxT("A propos"), wxT(""), wxITEM_NORMAL);
ID_MNU_APROPOS_1025_Mnu_Obj->Append(ID_MNU_COMMANDES_1030, wxT("Commandes"), wxT(""), wxITEM_NORMAL);
WxMenuBar1->Append(ID_MNU_APROPOS_1025_Mnu_Obj, wxT("Aide"));
SetMenuBar(WxMenuBar1);
wxArrayString arrayStringFor_WxSingleChoiceDialog2;
arrayStringFor_WxSingleChoiceDialog2.Add(wxT("apparaître des noms"));
arrayStringFor_WxSingleChoiceDialog2.Add(wxT("disparaître des noms"));
arrayStringFor_WxSingleChoiceDialog2.Add(wxT("apparaître les orbites"));
arrayStringFor_WxSingleChoiceDialog2.Add(wxT("disparaître les orbites"));
arrayStringFor_WxSingleChoiceDialog2.Add(wxT("apparaître les limites des constellations"));
arrayStringFor_WxSingleChoiceDialog2.Add(wxT("disparaître les limites des constellations"));
arrayStringFor_WxSingleChoiceDialog2.Add(wxT("apparaître le dessin des constellations"));
arrayStringFor_WxSingleChoiceDialog2.Add(wxT("disparaître le dessin des constellations"));
WxSingleChoiceDialog2 = new wxSingleChoiceDialog(this, wxT("Que voulez-vous faire ?"), wxT("Modifier l'affichage"), arrayStringFor_WxSingleChoiceDialog2,NULL, wxOK | wxCANCEL);
wxArrayString arrayStringFor_WxSingleChoiceDialog6;
arrayStringFor_WxSingleChoiceDialog6.Add(wxT("Faire un travelling avant (touche HOME)"));
arrayStringFor_WxSingleChoiceDialog6.Add(wxT("Faire un travelling arrière (touche FIN)"));
WxSingleChoiceDialog6 = new wxSingleChoiceDialog(this, wxT("Choisir le type de travelling :"), wxT("Faire un travelling avant/arrière"), arrayStringFor_WxSingleChoiceDialog6,NULL);
wxArrayString arrayStringFor_WxSingleChoiceDialog3;
arrayStringFor_WxSingleChoiceDialog3.Add(wxT("Les noms des vaisseaux, satellites artificiels et sondes"));
arrayStringFor_WxSingleChoiceDialog3.Add(wxT("Les noms des planètes"));
arrayStringFor_WxSingleChoiceDialog3.Add(wxT("Les noms des astéroïdes"));
arrayStringFor_WxSingleChoiceDialog3.Add(wxT("Les noms des lunes"));
arrayStringFor_WxSingleChoiceDialog3.Add(wxT("Les noms des comètes"));
arrayStringFor_WxSingleChoiceDialog3.Add(wxT("Les noms des étoiles"));
arrayStringFor_WxSingleChoiceDialog3.Add(wxT("Les noms des constellations"));
arrayStringFor_WxSingleChoiceDialog3.Add(wxT("Les noms des galaxies"));
arrayStringFor_WxSingleChoiceDialog3.Add(wxT("Tous les noms"));
WxSingleChoiceDialog3 = new wxSingleChoiceDialog(this, wxT("ela concerne :"), wxT("Modifier l'affichage (suite)"), arrayStringFor_WxSingleChoiceDialog3,NULL, wxOK | wxCANCEL);
WxTextEntryDialog17 = new wxTextEntryDialog( this,wxT("Ecrire le texte à faire apparaitre :"), wxT("Ajouter du texte"), wxT("") ,wxOK | wxCANCEL | wxCENTRE);
WxTextEntryDialog14 = new wxTextEntryDialog( this,wxT("Pendant combien de secondes ?"), wxT("Faire un travelling avant/arrière"), wxT("") ,wxOK | wxCANCEL | wxCENTRE);
WxMessageDialog3 = new wxMessageDialog(this, wxT("Voulez-vous remplacer cette instruction ?"), wxT("Remplacement"), wxYES_NO | wxICON_QUESTION);
WxTextEntryDialog20 = new wxTextEntryDialog( this,wxT("Phrase : ( Annuler pour ne rien écrire)"), wxT("Texte supplémentaire"), wxT("") ,wxOK | wxCANCEL | wxCENTRE);
WxTextEntryDialog10 = new wxTextEntryDialog( this,wxT("Donnez le nom du satellite :"), wxT("Un satellite d'une lune"), wxT("") ,wxOK | wxCANCEL | wxCENTRE);
WxMessageDialog7 = new wxMessageDialog(this, wxT("Voulez-vous effacer l'ancien script ?"), wxT("Nouveau script"), wxOK | wxCANCEL | wxICON_QUESTION);
WxMessageDialog4 = new wxMessageDialog(this, wxT("Suivre l'objet ?"), wxT("Suivre"), wxYES_NO);
wxArrayString arrayStringFor_WxSingleChoiceDialog1;
arrayStringFor_WxSingleChoiceDialog1.Add(wxT("notre soleil"));
arrayStringFor_WxSingleChoiceDialog1.Add(wxT("une autre étoile ou une galaxie"));
arrayStringFor_WxSingleChoiceDialog1.Add(wxT("une planète du système solaire"));
arrayStringFor_WxSingleChoiceDialog1.Add(wxT("une planète d'un autre système"));
arrayStringFor_WxSingleChoiceDialog1.Add(wxT("une comète, un astéroïde ou une sonde"));
arrayStringFor_WxSingleChoiceDialog1.Add(wxT("un satellite ou une lune d'une planète"));
arrayStringFor_WxSingleChoiceDialog1.Add(wxT("un satellite d'une lune"));
arrayStringFor_WxSingleChoiceDialog1.Add(wxT("un autre cas"));
WxSingleChoiceDialog1 = new wxSingleChoiceDialog(this, wxT("Choisir le bon cas :"), wxT("Aller vers :"), arrayStringFor_WxSingleChoiceDialog1,NULL, wxOK | wxCANCEL);
WxTextEntryDialog8 = new wxTextEntryDialog( this,wxT("Donnez le nom de la comète, de l'astéroïde ou de la sonde :"), wxT("Une comète, un astéroïde ou une sonde"), wxT("") ,wxOK | wxCANCEL | wxCENTRE);
wxArrayString arrayStringFor_WxSingleChoiceDialog5;
arrayStringFor_WxSingleChoiceDialog5.Add(wxT("notre soleil"));
arrayStringFor_WxSingleChoiceDialog5.Add(wxT("une autre étoile ou une galaxie"));
arrayStringFor_WxSingleChoiceDialog5.Add(wxT("une planète du système solaire"));
arrayStringFor_WxSingleChoiceDialog5.Add(wxT("une planète d'un autre système"));
arrayStringFor_WxSingleChoiceDialog5.Add(wxT("une comète, un astéroïde ou une sonde"));
arrayStringFor_WxSingleChoiceDialog5.Add(wxT("un satellite ou une lune d'une planète"));
arrayStringFor_WxSingleChoiceDialog5.Add(wxT("un satellite d'une lune"));
arrayStringFor_WxSingleChoiceDialog5.Add(wxT("un autre cas"));
WxSingleChoiceDialog5 = new wxSingleChoiceDialog(this, wxT("Choisir le bon cas :"), wxT("Regarder vers (centrer) :"), arrayStringFor_WxSingleChoiceDialog5,NULL);
WxTextEntryDialog6 = new wxTextEntryDialog( this,wxT("Donnez le nom de l'étoile ou de la galaxie"), wxT("une autre étoile ou une galaxie"), wxT("") ,wxOK | wxCANCEL | wxCENTRE);
WxMessageDialog8 = new wxMessageDialog(this, wxT("Ce fichier existe déjà : continuer ou abandonner ?"), wxT("Sauver un fichier"), wxYES_NO | wxICON_QUESTION);
WxMessageDialog2 = new wxMessageDialog(this, wxT("Voulez-vous vraiment quitter ?"), wxT("Quitter Miniscript"), wxYES_NO | wxICON_EXCLAMATION);
aproposDialog = new wxMessageDialog(this, wxT("Miniscript - Licence libre GPL\n B. JUBIN\n avril 2007"), wxT("A propos"), wxICON_INFORMATION);
WxMessageDialog5 = new wxMessageDialog(this, wxT("Valider ?"), wxT("mise au niveau d'un pole"), wxYES_NO);
WxTextEntryDialog13 = new wxTextEntryDialog( this,wxT("Tourner pendant combien de secondes ?\n(1 tour en 18 s à 30°/s)"), wxT("Tourner autour d'un objet"), wxT("") ,wxOK | wxCANCEL | wxCENTRE);
WxTextEntryDialog7 = new wxTextEntryDialog( this,wxT("Donnez le nom de son étoile :"), wxT("Une planète d'un autre système"), wxT("") ,wxOK | wxCANCEL | wxCENTRE);
WxTextEntryDialog4 = new wxTextEntryDialog( this,wxT("Donner le rapport entre la distance et le rayon de l'objet : ( 5 initial)"), wxT("S'approcher ou s'éloigne"), wxT("") ,wxOK | wxCANCEL | wxCENTRE);
WxTextEntryDialog12 = new wxTextEntryDialog( this,wxT("Donnez le nom de l'objet :"), wxT("Un autre cas"), wxT("") ,wxOK | wxCANCEL | wxCENTRE);
WxTextEntryDialog16 = new wxTextEntryDialog( this,wxT("Donner le champ de vision (FOV) voulu :"), wxT("Changer le champ de vision"), wxT("") ,wxOK | wxCANCEL | wxCENTRE);
WxTextEntryDialog21 = new wxTextEntryDialog( this,wxT("Lattitude (entre - 180 et 180, pas d'espace après le -)"), wxT("Aller à une longidute/lattitude"), wxT("") ,wxOK | wxCANCEL | wxCENTRE);
WxTextEntryDialog22 = new wxTextEntryDialog( this,wxT("Longitude (entre - 90 et 90,pas d'espace après le - )"), wxT("Aller à une longidute/lattitude"), wxT("") ,wxOK | wxCANCEL | wxCENTRE);
WxTextEntryDialog23 = new wxTextEntryDialog( this,wxT("Durée du voyage ? (en secondes)"), wxT("Aller à une longidute/lattitude"), wxT("") ,wxOK | wxCANCEL | wxCENTRE);
WxToolBar1->SetToolBitmapSize(wxSize(32,32));
WxToolBar1->Realize();
SetToolBar(WxToolBar1);
SetTitle(wxT("Miniscript pour CELESTIA"));
SetIcon(Self_ProjetzzFrm_XPM);
SetSize(8,8,635,417);
Center();
WxGrid1->EnableCellEditControl(false);
WxGrid1->DisableDragRowSize();
fic=fopen("miniscript.cfg","r"); if( fic!=NULL )
{
fread(&lettre,1,1,fic);
if (lettre[0]==48)
WxMenuBar1->Check(1016,false);
else
WxMenuBar1->Check(1016,true);
fread(&lettre,1,1,fic);
if (lettre[0]==48)
WxMenuBar1->Check(1038,false);
else
WxMenuBar1->Check(1038,true);
fread(&lettre,1,1,fic);
if (lettre[0]==48)
WxMenuBar1->Check(1026,false);
else
WxMenuBar1->Check(1026,true);
if (feof(fic)==0)
{
fread(&lettre,1,1,fic);
if (lettre[0]=='B')
block=false; else
block=true;
}
fclose(fic);
}
}
void ProjetzzFrm::OnClose(wxCloseEvent& event)
{
if(WxMessageDialog2->ShowModal()==wxID_YES)
Destroy();
}
void ProjetzzFrm::WxEdit1Updated(wxCommandEvent& event)
{
}
void ProjetzzFrm::WxButton3Click(wxCommandEvent& event)
{
if (jx==1) {
int pos1=WxGrid1->GetGridCursorRow();
switch (n_instr)
{
case 0: {
if(WxSingleChoiceDialog1->ShowModal()==wxID_OK)
{
rep2=WxSingleChoiceDialog1->GetSelection()+1;
switch (rep2)
{
case 1: { strcpy(obj,sol);
strcpy(nom_obj,"soleil"); break;
}
case 2: { if(WxTextEntryDialog6->ShowModal()==wxID_OK)
{
phrasex=WxTextEntryDialog6->GetValue();
strcpy(obj,phrasex.c_str());
strcpy(nom_obj,obj); }
else
rep2=0;
break;
}
case 3: { if(WxTextEntryDialog1->ShowModal()==wxID_OK)
{
strcpy(obj2,WxTextEntryDialog1->GetValue().c_str());
strcpy(nom_obj,obj2); strcpy(obj,sol);
}
else
rep2=0;
break;
}
case 4: { if(WxTextEntryDialog1->ShowModal()==wxID_OK)
{
strcpy(obj2,WxTextEntryDialog1->GetValue().c_str());
if(WxTextEntryDialog7->ShowModal()==wxID_OK)
{
strcpy(obj,WxTextEntryDialog7->GetValue().c_str());
strcpy(nom_obj,obj2); }
else
rep2=0;
}
else
rep2=0;
break;
}
case 5: { if(WxTextEntryDialog8->ShowModal()==wxID_OK)
{
strcpy(obj2,WxTextEntryDialog8->GetValue().c_str());
strcpy(nom_obj,obj2); strcpy(obj,sol);
}
else
rep2=0;
break;
}
case 6: { if(WxTextEntryDialog9->ShowModal()==wxID_OK)
{
strcpy(obj3,WxTextEntryDialog9->GetValue().c_str());
if(WxTextEntryDialog1->ShowModal()==wxID_OK)
{
strcpy(obj2,WxTextEntryDialog1->GetValue().c_str()); strcpy(nom_obj,obj3); strcpy(obj,sol);
}
else
rep2=0;
}
else
rep2=0;
break;
}
case 7: { if(WxTextEntryDialog10->ShowModal()==wxID_OK)
{
strcpy(obj4,WxTextEntryDialog10->GetValue().c_str()); if(WxTextEntryDialog11->ShowModal()==wxID_OK)
{
strcpy(obj3,WxTextEntryDialog11->GetValue().c_str()); if(WxTextEntryDialog1->ShowModal()==wxID_OK)
{
strcpy(obj2,WxTextEntryDialog1->GetValue().c_str());
strcpy(nom_obj,obj4); strcpy(obj,sol);
}
else
rep2=0;
}
else
rep2=0;
}
else
rep2=0;
break;
}
case 8: { if(WxTextEntryDialog12->ShowModal()==wxID_OK)
{
strcpy(obj,WxTextEntryDialog12->GetValue().c_str());
strcpy(nom_obj,obj); }
else
rep2=0;
break;
}
}
if (rep2==0) break;
if (!WxMenuBar1->IsChecked(1026)) mod_nom();
strcpy(durees,dur13); if(WxMenuBar1->IsChecked(1038)) {
if (WxMenuBar1->IsChecked(1016))
{
Dlg1* Wxdlg1 = new Dlg1(this);
Wxdlg1->ShowModal();
att1x=Wxdlg1->att1;
att2x=Wxdlg1->att2;
att3x=Wxdlg1->att3;
att4x=Wxdlg1->att4;
att5x=Wxdlg1->att5;
duree1x=Wxdlg1->duree1;
duree2x=Wxdlg1->duree2;
duree3x=Wxdlg1->duree3;
duree4x=Wxdlg1->duree4;
total1x=Wxdlg1->total1;
texte1=Wxdlg1->text1;
texte2=Wxdlg1->text2;
texte3=Wxdlg1->text3;
texte4=Wxdlg1->text4;
valid1x=Wxdlg1->valid1;
}
else
{
Dlg2* Wxdlg2 = new Dlg2(this);
Wxdlg2->ShowModal();
texte1=Wxdlg2->text01;
texte2=Wxdlg2->text02;
texte3=Wxdlg2->text03;
texte4=Wxdlg2->text04;
valid2x=Wxdlg2->valid2;
}
}
else
{
if (WxMenuBar1->IsChecked(1016))
{
if(WxTextEntryDialog18->ShowModal()==wxID_OK)
{
intermede=WxTextEntryDialog18->GetValue();
if (intermede!=rien)
strcpy(durees,intermede.c_str());
}
}
}
enleveraccent();
strcpy(instrm,"");
strcat(instrm,sel); strcat(instrm,obj);
if ((rep2>2)&(rep2<8))
{
strcat(instrm,sla); strcat(instrm,obj2); if ((rep2>5)&(rep2<8))
{
strcat(instrm,sla); strcat(instrm,obj3); if (rep2==7)
{
strcat(instrm,sla); strcat(instrm,obj4); }
}
}
strcat(instrm,gui); strcat(instrm,fin); strcat(instrm,ent); strcat(instrm,fol); strcat(instrm,ent); strcat(instrm,got); if(WxMenuBar1->IsChecked(1038))
if (WxMenuBar1->IsChecked(1016))
if (valid1x)
sprintf(durees,"%d",total1x);
strcat(instrm,durees); if (WxMenuBar1->IsChecked(1016))
if(WxTextEntryDialog4->ShowModal()==wxID_OK)
{
strcat(instrm," distance ");
strcat(instrm,WxTextEntryDialog4->GetValue().c_str());
}
strcat(instrm,fin); strcat(instrm,ent);
if(WxMenuBar1->IsChecked(1038))
{
if (WxMenuBar1->IsChecked(1016))
{
if (valid1x)
{
strcpy(obj,texte1.c_str());
modif_texte_suppl(1);
strcpy(obj,texte2.c_str());
modif_texte_suppl(2);
strcpy(obj,texte3.c_str());
modif_texte_suppl(3);
strcpy(obj,texte4.c_str());
modif_texte_suppl(4);
strcpy(durees,att5x.c_str());
}
}
else
{
if (valid2x)
{
strcpy(obj,texte1.c_str());
modif_texte_suppl(0);
strcpy(obj,texte2.c_str());
modif_texte_suppl(0);
strcpy(obj,texte3.c_str());
modif_texte_suppl(0);
strcpy(obj,texte4.c_str());
modif_texte_suppl(0);
strcpy(durees,"1");
}
}
}
if (strcmp(durees,"0"))
{
strcat(instrm,wai2); strcat(instrm,durees); strcat(instrm,fin); strcat(instrm,ent); }
strcpy(recap,"");
strcat(recap,"Aller vers : ");
strcat(recap,nom_obj);
if(WxMenuBar1->IsChecked(1038))
{
if (WxMenuBar1->IsChecked(1016))
{
if (valid1x)
sprintf(durees,"%d",total1x);
}
else
{
if (valid2x)
strcpy(durees,"13");
}
}
strcat(recap," (en ");
strcat(recap,durees);
strcat(recap," s)");
phrase2=wxT(instrm);
phrase=wxT(recap);
sortie=1;
}
break;
}
case 1: {
if(AttendreDialog1->ShowModal()==wxID_OK)
{
strcpy(obj,AttendreDialog1->GetValue().c_str());
strcpy(instrm,"");
strcat(instrm,wai); strcat(instrm,obj); strcat(instrm,fin); strcat(instrm,ent); strcpy(recap,"");
strcat(recap,"Attendre ");
strcat(recap,obj);
strcat(recap," secondes");
phrase2=wxT(instrm);
phrase=wxT(recap);
sortie=1;
}
break;
}
case 2: {
if(signetDialog1->ShowModal()==wxID_OK)
{
strcpy(obj,signetDialog1->GetValue().c_str());
strcpy(obj2,gui); strcat(obj2,obj); strcat(obj2,gui); strcat(obj2," {\n"); fic=fopen("favorites.cel","r"); if( fic==NULL )
{
wxMessageBox("fichier introuvable", _T("Aller vers un signet"),wxOK | wxICON_INFORMATION, this);
return;
}
cc=0;
while ((feof(fic)==0)&&(cc==0))
{
fgets(phr2,sizeof(phr2),fic);
if (strcmp(phr2,obj2)==0)
{
wxMessageBox("Signet trouvé", _T("Aller vers un signet"),wxOK | wxICON_INFORMATION, this);
fgets(phr3,sizeof(phr3),fic); fgets(phr3,sizeof(phr3),fic);
fscanf(fic,"%s",phrn);
fscanf(fic,"%s",phrn);
fscanf(fic,"%s",phrn);
sscanf(phrn,"%lf",&ax);
fscanf(fic,"%s",phrn);
sscanf(phrn,"%lf",&ay);
fscanf(fic,"%s",phrn);
sscanf(phrn,"%lf",&az);
fgets(phr2,sizeof(phr2),fic);
fscanf(fic,"%s",phrn);
fscanf(fic,"%s",phrn);
fscanf(fic,"%s",phrn);
sscanf(phrn,"%lf",&bx);
fscanf(fic,"%s",phrn);
sscanf(phrn,"%lf",&by);
fscanf(fic,"%s",phrn);
sscanf(phrn,"%lf",&bz);
fgets(phr2,sizeof(phr2),fic);
fscanf(fic,"%s",phrn);
fscanf(fic,"%s",phrn);
fscanf(fic,"%s",phrn);
sscanf(phrn,"%f",&cx);
fscanf(fic,"%s",phrn);
sscanf(phrn,"%f",&cy);
fscanf(fic,"%s",phrn);
sscanf(phrn,"%f",&cz);
fgets(phr2,sizeof(phr2),fic);
fscanf(fic,"%s",phrn);
fscanf(fic,"%s",phrn);
sscanf(phrn,"%f",&ang);
fgets(phr2,sizeof(phr2),fic);
for (cc=0; cc<8 ;++cc)
phr=fgetc(fic);
fscanf(fic,"%s",phr4);
fgets(phr2,sizeof(phr2),fic);
for (cc=0; cc<10 ;++cc)
phr=fgetc(fic);
fscanf(fic,"%s",phr5);
fgets(phr2,sizeof(phr2),fic);
phr=fgetc(fic);
fscanf(fic,"%s",phr6); fscanf(fic,"%s",phr2);
strcat(phr6," ");
strcat(phr6,phr2);
cc=1; } } if (cc==0)
{
wxMessageBox("Signet non trouvés", _T("Aller vers un signet"),wxOK | wxICON_INFORMATION, this);
return; }
ow=cos(ang/2);
ox=cx*sin(ang/2);
oy=cy*sin(ang/2);
oz=cz*sin(ang/2);
ax*=1000000;
ay*=1000000;
az*=1000000; codage(ax,bx);
encodage();
strcpy(encx,encod);
codage(ay,by); encodage();
strcpy(ency,encod);
codage(az,bz); encodage();
strcpy(encz,encod);
strcpy(durees,dur13); if(WxMenuBar1->IsChecked(1038)) {
if (WxMenuBar1->IsChecked(1016))
{
Dlg1* Wxdlg1 = new Dlg1(this);
Wxdlg1->ShowModal();
att1x=Wxdlg1->att1;
att2x=Wxdlg1->att2;
att3x=Wxdlg1->att3;
att4x=Wxdlg1->att4;
att5x=Wxdlg1->att5;
duree1x=Wxdlg1->duree1;
duree2x=Wxdlg1->duree2;
duree3x=Wxdlg1->duree3;
duree4x=Wxdlg1->duree4;
total1x=Wxdlg1->total1;
texte1=Wxdlg1->text1;
texte2=Wxdlg1->text2;
texte3=Wxdlg1->text3;
texte4=Wxdlg1->text4;
valid1x=Wxdlg1->valid1;
}
else
{
Dlg2* Wxdlg2 = new Dlg2(this);
Wxdlg2->ShowModal();
texte1=Wxdlg2->text01;
texte2=Wxdlg2->text02;
texte3=Wxdlg2->text03;
texte4=Wxdlg2->text04;
valid2x=Wxdlg2->valid2;
}
}
else
{
if (WxMenuBar1->IsChecked(1016))
{
if(WxTextEntryDialog18->ShowModal()==wxID_OK)
{
intermede=WxTextEntryDialog18->GetValue();
if (intermede!=rien)
strcpy(durees,intermede.c_str());
}
}
}
strcpy(instrm,"");
strcat(instrm,sel2); strcat(instrm,phr5); strcat(instrm,fin); strcat(instrm,ent); strcat(instrm,cen); strcat(instrm,ent); strcat(instrm,fol); strcat(instrm,ent); strcat(instrm,timex); strcat(instrm,jd); strcat(instrm,phr4); strcat(instrm,fin); strcat(instrm,ent); strcat(instrm,setfr); strcat(instrm,phr6); strcat(instrm,fin); strcat(instrm,ent);
strcat(instrm,gotl); strcat(instrm,ent); strcat(instrm,timex); if(WxMenuBar1->IsChecked(1038))
if (WxMenuBar1->IsChecked(1016))
if (valid1x)
sprintf(durees,"%d",total1x);
strcat(instrm,durees); strcat(instrm,ent);
strcat(instrm,motx); strcat(instrm,gui); strcat(instrm,encx); strcat(instrm,gui); strcat(instrm,ent); strcat(instrm,moty); strcat(instrm,gui); strcat(instrm,ency); strcat(instrm,gui); strcat(instrm,ent); strcat(instrm,motz); strcat(instrm,gui); strcat(instrm,encz); strcat(instrm,gui); strcat(instrm,ent); strcat(instrm,moto); strcat(instrm,motw); sprintf(obj2,"%f",ow);
strcat(instrm,obj2); strcat(instrm,ent); strcat(instrm,moto); strcat(instrm,motx); sprintf(obj2,"%f",ox);
strcat(instrm,obj2); strcat(instrm,ent); strcat(instrm,moto); strcat(instrm,moty); sprintf(obj2,"%f",oy);
strcat(instrm,obj2); strcat(instrm,ent); strcat(instrm,moto); strcat(instrm,motz); sprintf(obj2,"%f",oz);
strcat(instrm,obj2); strcat(instrm," "); strcat(instrm,fin); strcat(instrm,ent);
strcpy(obj3,obj);
if(WxMenuBar1->IsChecked(1038))
{
if (WxMenuBar1->IsChecked(1016))
{
if (valid1x)
{
strcpy(obj,texte1.c_str());
modif_texte_suppl(1);
strcpy(obj,texte2.c_str());
modif_texte_suppl(2);
strcpy(obj,texte3.c_str());
modif_texte_suppl(3);
strcpy(obj,texte4.c_str());
modif_texte_suppl(4);
strcpy(durees,att5x.c_str());
}
}
else
{
if (valid2x)
{
strcpy(obj,texte1.c_str());
modif_texte_suppl(0);
strcpy(obj,texte2.c_str());
modif_texte_suppl(0);
strcpy(obj,texte3.c_str());
modif_texte_suppl(0);
strcpy(obj,texte4.c_str());
modif_texte_suppl(0);
strcpy(durees,"1");
}
}
}
if (strcmp(durees,"0"))
{
strcat(instrm,wai); strcat(instrm,durees); strcat(instrm,fin); strcat(instrm,ent); }
strcpy(obj,obj3);
strcpy(recap,"");
strcat(recap,"Aller au signet : ");
strcat(recap,obj);
if(WxMenuBar1->IsChecked(1038))
if (WxMenuBar1->IsChecked(1016))
{
if (valid1x)
sprintf(durees,"%d",total1x);
}
else
{
if (valid2x)
strcpy(durees,"13");
}
strcat(recap," (en ");
strcat(recap,durees);
strcat(recap," s)");
phrase2=wxT(instrm);
phrase=wxT(recap);
strcpy(nom_obj,phr5);
nom_obj[sizeof(phr5)-1]=0;
sortie=1;
}
break;
}
case 3: {
valid1x=false;
if (WxMenuBar1->IsChecked(1038))
{
if (WxMenuBar1->IsChecked(1016))
{
Dlg1* Wxdlg1 = new Dlg1(this);
Wxdlg1->ShowModal();
att1x=Wxdlg1->att1;
att2x=Wxdlg1->att2;
att3x=Wxdlg1->att3;
att4x=Wxdlg1->att4;
att5x=Wxdlg1->att5;
duree1x=Wxdlg1->duree1;
duree2x=Wxdlg1->duree2;
duree3x=Wxdlg1->duree3;
duree4x=Wxdlg1->duree4;
total1x=Wxdlg1->total1;
texte1=Wxdlg1->text1;
texte2=Wxdlg1->text2;
texte3=Wxdlg1->text3;
texte4=Wxdlg1->text4;
valid1x=Wxdlg1->valid1;
}
}
if (!valid1x) {
if(WxTextEntryDialog13->ShowModal()==wxID_CANCEL)
break;
strcpy(obj,WxTextEntryDialog13->GetValue().c_str()); }
else
sprintf(obj,"%d",total1x);
strcpy(durees,"30");
if (WxMenuBar1->IsChecked(1016))
{
if(WxTextEntryDialog19->ShowModal()==wxID_OK)
{
intermede=WxTextEntryDialog19->GetValue();
if (intermede!=rien)
strcpy(durees,intermede.c_str());
}
}
strcpy(instrm,"");
if (WxMenuBar1->IsChecked(1038))
if (!WxMenuBar1->IsChecked(1016))
if(WxTextEntryDialog20->ShowModal()==wxID_OK)
if (WxTextEntryDialog20->GetValue()!=rien)
{
strcat(instrm,pri); strcat(instrm,mod_phrase(WxTextEntryDialog20->GetValue()).c_str()); strcat(instrm,row); strcat(instrm,ent); }
if (!valid1x)
{
strcat(instrm,orb); strcat(instrm,durees); strcat(instrm,orb2); strcat(instrm,obj);
strcat(instrm,fin); strcat(instrm,ent); }
else
{
strcpy(wai2,orb);
strcat(wai2,durees);
strcat(wai2,orb2);
strcpy(obj3,durees); strcpy(obj,texte1.c_str());
modif_texte_suppl(1);
strcpy(obj,texte2.c_str());
modif_texte_suppl(2);
strcpy(obj,texte3.c_str());
modif_texte_suppl(3);
strcpy(obj,texte4.c_str());
modif_texte_suppl(4);
if (strcmp(att5x.c_str(),"0"))
{
strcat(instrm,wai2); strcat(instrm,att5x.c_str()); strcat(instrm,fin); strcat(instrm,ent); }
strcpy(durees,obj3);
}
strcpy(recap,"");
strcat(recap,"Tourner autour pendant ");
strcat(recap,obj);
strcat(recap," secondes");
if (strcmp("30",durees))
{
strcat(recap," (à ");
strcat(recap,durees);
strcat(recap,"° par sec)");
}
phrase2=wxT(instrm);
phrase=wxT(recap);
sortie=1;
break;
}
case 4 : {
if(WxTextEntryDialog5->ShowModal()==wxID_CANCEL)
break;
strcpy(obj,WxTextEntryDialog5->GetValue().c_str());
strcpy(instrm,"");
strcat(instrm,tim); strcat(instrm,obj); strcat(instrm,fin); strcat(instrm,ent); strcat(instrm,rajt); strcat(instrm,ent); strcpy(recap,"");
strcat(recap,"Le temps va ");
strcat(recap,obj);
strcat(recap," fois plus vite ");
phrase2=wxT(instrm);
phrase=wxT(recap);
sortie=1;
break;
}
case 5 : {
if(WxTextEntryDialog4->ShowModal()==wxID_CANCEL)
break;
strcpy(obj,WxTextEntryDialog4->GetValue().c_str());
strcpy(durees,dur5);
if (WxMenuBar1->IsChecked(1016))
{
if(WxTextEntryDialog18->ShowModal()==wxID_OK)
{
intermede=WxTextEntryDialog18->GetValue();
if (intermede!=rien)
strcpy(durees,intermede.c_str());
}
}
strcpy(instrm,"");
strcat(instrm,got); strcat(instrm,durees); strcat(instrm,dis); strcat(instrm,obj); strcat(instrm,fin); strcat(instrm,ent); if (WxMenuBar1->IsChecked(1038)) {
if(WxTextEntryDialog20->ShowModal()==wxID_OK)
{
if (WxTextEntryDialog20->GetValue()!=rien)
{
strcat(instrm,pri); strcat(instrm,mod_phrase(WxTextEntryDialog20->GetValue()).c_str()); strcat(instrm,row); strcat(instrm,ent); }
}
}
strcat(instrm,wai); strcat(instrm,durees); strcat(instrm,fin); strcat(instrm,ent); strcpy(recap,"");
strcat(recap,"La distance est de ");
strcat(recap,obj);
strcat(recap," fois le rayon de l\'objet");
if (strcmp(dur5,durees))
{
strcat(recap," (en ");
strcat(recap,durees);
strcat(recap," s)");
}
phrase2=wxT(instrm);
phrase=wxT(recap);
sortie=1;
break;
}
case 6 : {
if (WxMessageDialog4->ShowModal()==wxID_NO)
break;
strcpy(instrm,"");
strcat(instrm,fol); strcat(instrm,ent); strcpy(recap,"");
strcat(recap,"Suivre : ");
strcat(recap,nom_obj);
phrase2=wxT(instrm);
phrase=wxT(recap);
sortie=1;
break;
}
case 7 : { if (WxMessageDialog6->ShowModal()==wxID_NO)
break;
strcpy(instrm,"");
strcat(instrm,syn); strcat(instrm,ent); strcpy(recap,"");
strcat(recap,"Synchronisation avec : ");
strcat(recap,nom_obj);
phrase2=wxT(instrm);
phrase=wxT(recap);
sortie=1;
break;
}
case 8 : {
rep2=0;
if(WxSingleChoiceDialog2->ShowModal()==wxID_OK)
rep2=WxSingleChoiceDialog2->GetSelection()+1;
if (rep2==0)
break; if ((rep2==1)|(rep2==3)|(rep2==5)|(rep2==7)) strcpy(obj," set ");
if ((rep2==2)|(rep2==4)|(rep2==6)|(rep2==8)) strcpy(obj," clear ");
if ((rep2==1)|(rep2==2))
{
rep3=0;
if(WxSingleChoiceDialog3->ShowModal()==wxID_OK)
rep3=WxSingleChoiceDialog3->GetSelection()+1;
switch (rep3)
{
case 0 :
break; case 1 :
strcpy(obj2,"spacecraft");
break;
case 2 :
strcpy(obj2,"planets");
break;
case 3 :
strcpy(obj2,"asteroids");
break;
case 4 :
strcpy(obj2,"moons");
break;
case 5 :
strcpy(obj2,"comets");
break;
case 6 :
strcpy(obj2,"stars");
break;
case 7 :
strcpy(obj2,"constellations");
break;
case 8 :
strcpy(obj2,"galaxies");
break;
case 9 :
strcpy(obj2,"planets|spacecraft|asteroids|moons|comets|stars|contellations|galaxies");
break;
}
if (rep3!=0) {
strcpy(instrm,"");
strcat(instrm,lab); strcat(instrm,obj); strcat(instrm,gui); strcat(instrm,obj2); strcat(instrm,gui); strcat(instrm,fin); strcat(instrm,ent); strcpy(recap,"");
strcat(recap,"Faire ");
if ((rep2==1)|(rep2==3)|(rep2==5)|(rep2==7)) strcat(recap," apparaitre les noms ");
else strcat(recap," disparaitre les noms ");
switch (rep3)
{
case 1 :
strcat(recap,"des vaisseaux et des sondes");
break;
case 2 :
strcat(recap,"des planetes");
break;
case 3 :
strcat(recap,"des asteroides");
break;
case 4 :
strcat(recap,"des lunes");
break;
case 5 :
strcat(recap,"des cometes");
break;
case 6 :
strcat(recap,"des etoiles");
break;
case 7 :
strcat(recap,"des constellations");
break;
case 8 :
strcat(recap,"des galaxies");
break;
case 9 :
strcat(recap,"de tout");
break;
}
phrase2=wxT(instrm);
phrase=wxT(recap);
sortie=1;
}
} if ((rep2==3)|(rep2==4)) {
strcpy(obj2,"orbits");
strcpy(instrm,"");
strcat(instrm,ren); strcat(instrm,obj); strcat(instrm,gui); strcat(instrm,obj2); strcat(instrm,gui); strcat(instrm,fin); strcat(instrm,ent); strcpy(recap,"");
strcat(recap,"Faire ");
if ((rep2==1)|(rep2==3)|(rep2==5)|(rep2==7)) strcat(recap," apparaitre les orbites");
else strcat(recap," disparaitre les orbites");
phrase2=wxT(instrm);
phrase=wxT(recap);
sortie=1;
}
if ((rep2==5)|(rep2==6)) {
strcpy(obj2,"boundaries");
strcpy(instrm,"");
strcat(instrm,ren); strcat(instrm,obj); strcat(instrm,gui); strcat(instrm,obj2); strcat(instrm,gui); strcat(instrm,fin); strcat(instrm,ent); strcpy(recap,"");
strcat(recap,"Faire ");
if ((rep2==1)|(rep2==3)|(rep2==5)|(rep2==7)) strcat(recap," apparaitre les limites des constellations");
else strcat(recap," disparaitre les limites des constellations");
phrase2=wxT(instrm);
phrase=wxT(recap);
sortie=1;
}
if ((rep2==7)|(rep2==8)) {
strcpy(obj2,"constellations");
strcpy(instrm,"");
strcat(instrm,ren); strcat(instrm,obj); strcat(instrm,gui); strcat(instrm,obj2); strcat(instrm,gui); strcat(instrm,fin); strcat(instrm,ent); strcpy(recap,"");
strcat(recap,"Faire ");
if ((rep2==1)|(rep2==3)|(rep2==5)|(rep2==7)) strcat(recap," apparaitre les constellations");
else strcat(recap," disparaitre les constellations");
phrase2=wxT(instrm);
phrase=wxT(recap);
sortie=1;
}
break;
}
case 9 : {
if (WxMessageDialog5->ShowModal()==wxID_NO)
break;
strcpy(instrm,"");
if (WxMenuBar1->IsChecked(1038)) {
if(WxTextEntryDialog20->ShowModal()==wxID_OK)
{
if (WxTextEntryDialog20->GetValue()!=rien)
{
strcat(instrm,pri); strcat(instrm,mod_phrase(WxTextEntryDialog20->GetValue()).c_str()); strcat(instrm,row); strcat(instrm,ent); }
}
}
strcat(instrm,pol); strcat(instrm,ent); strcpy(recap,"");
strcat(recap,"mise au niveau d'un pole de : ");
strcat(recap,nom_obj);
phrase2=wxT(instrm);
phrase=wxT(recap);
sortie=1;
break;
}
case 10: {
if(WxSingleChoiceDialog5->ShowModal()==wxID_OK)
{
rep2=WxSingleChoiceDialog5->GetSelection()+1;
switch (rep2)
{
case 1: { strcpy(obj,sol);
strcpy(nom_obj,"soleil"); break;
}
case 2: { if(WxTextEntryDialog6->ShowModal()==wxID_OK)
{
phrasex=WxTextEntryDialog6->GetValue();
strcpy(obj,phrasex.c_str());
strcpy(nom_obj,obj); }
else
rep2=0;
break;
}
case 3: { if(WxTextEntryDialog1->ShowModal()==wxID_OK)
{
strcpy(obj2,WxTextEntryDialog1->GetValue().c_str());
strcpy(nom_obj,obj2); strcpy(obj,sol);
}
else
rep2=0;
break;
}
case 4: { if(WxTextEntryDialog1->ShowModal()==wxID_OK)
{
strcpy(obj2,WxTextEntryDialog1->GetValue().c_str());
if(WxTextEntryDialog7->ShowModal()==wxID_OK)
{
strcpy(obj,WxTextEntryDialog7->GetValue().c_str());
strcpy(nom_obj,obj2); }
else
rep2=0;
}
else
rep2=0;
break;
}
case 5: { if(WxTextEntryDialog8->ShowModal()==wxID_OK)
{
strcpy(obj2,WxTextEntryDialog8->GetValue().c_str());
strcpy(nom_obj,obj2); strcpy(obj,sol);
}
else
rep2=0;
break;
}
case 6: { if(WxTextEntryDialog9->ShowModal()==wxID_OK)
{
strcpy(obj3,WxTextEntryDialog9->GetValue().c_str());
if(WxTextEntryDialog1->ShowModal()==wxID_OK)
{
strcpy(obj2,WxTextEntryDialog1->GetValue().c_str()); strcpy(nom_obj,obj3); strcpy(obj,sol);
}
else
rep2=0;
}
else
rep2=0;
break;
}
case 7: { if(WxTextEntryDialog10->ShowModal()==wxID_OK)
{
strcpy(obj4,WxTextEntryDialog10->GetValue().c_str()); if(WxTextEntryDialog11->ShowModal()==wxID_OK)
{
strcpy(obj3,WxTextEntryDialog11->GetValue().c_str()); if(WxTextEntryDialog1->ShowModal()==wxID_OK)
{
strcpy(obj2,WxTextEntryDialog1->GetValue().c_str());
strcpy(nom_obj,obj4); strcpy(obj,sol);
}
else
rep2=0;
}
else
rep2=0;
}
else
rep2=0;
break;
}
case 8: { if(WxTextEntryDialog12->ShowModal()==wxID_OK)
{
strcpy(obj,WxTextEntryDialog12->GetValue().c_str());
strcpy(nom_obj,obj); }
else
rep2=0;
break;
}
}
if (rep2==0) break; if (!WxMenuBar1->IsChecked(1026)) mod_nom();
enleveraccent();
strcpy(instrm,"");
strcat(instrm,sel); strcat(instrm,obj); if ((rep2>2)&(rep2<8))
{
strcat(instrm,sla); strcat(instrm,obj2); if ((rep2>5)&(rep2<8))
{
strcat(instrm,sla); strcat(instrm,obj3); if (rep2==7)
{
strcat(instrm,sla); strcat(instrm,obj4); }
}
}
strcpy(durees,"3");
if (WxMenuBar1->IsChecked(1016))
{
if(WxTextEntryDialog18->ShowModal()==wxID_OK)
{
intermede=WxTextEntryDialog18->GetValue();
if (intermede!=rien)
strcpy(durees,intermede.c_str());
}
}
strcat(instrm,gui); strcat(instrm,fin); strcat(instrm,ent); strcat(instrm,cen); strcat(instrm,ent); if (WxMenuBar1->IsChecked(1038)) {
if(WxTextEntryDialog20->ShowModal()==wxID_OK)
{
if (WxTextEntryDialog20->GetValue()!=rien)
{
strcat(instrm,pri); strcat(instrm,mod_phrase(WxTextEntryDialog20->GetValue()).c_str()); strcat(instrm,row); strcat(instrm,ent); }
}
}
strcat(instrm,wai);
strcat(instrm,durees);
strcat(instrm,fin);
strcat(instrm,ent); strcpy(recap,"");
strcat(recap,"Centrer vers : ");
strcat(recap,nom_obj);
phrase2=wxT(instrm);
phrase=wxT(recap);
sortie=1;
}
break;
}
case 11 : {
rep2=0;
if(WxTextEntryDialog15->ShowModal()==wxID_OK)
rep2=1;
if(WxTextEntryDialog16->ShowModal()==wxID_OK)
{
phrasex=WxTextEntryDialog16->GetValue();
strcpy(obj,WxTextEntryDialog16->GetValue().c_str());
sscanf(obj,"%f",&fov2);
if (rep2==1)
{
phrasex=WxTextEntryDialog15->GetValue();
strcpy(obj2,WxTextEntryDialog15->GetValue().c_str());
sscanf(obj2,"%f",&fov1);
k0=fov2/fov1;
nb=(int)floor(log(k0)/log(coef_a));
signe_nb=1;
if (nb<0)
{
nb=-nb;
signe_nb=-1;
}
strcpy(instrm,"");
phrase2=wxT(instrm);
for (i9=0;i9<=nb;++i9)
{
strcat(instrm,set); a9=fov1*pow(coef_a,i9*signe_nb);
sprintf(obj2,"%f",a9);
strcat(instrm,obj2); strcat(instrm,fin); strcat(instrm,ent); strcat(instrm,wait_fov); strcat(instrm,ent); phrase2+=wxT(instrm);
strcpy(instrm,"");
}
strcpy(recap,"");
strcat(recap,"Nouvel angle du champ de vision (FOV) : ");
strcat(recap,obj);
phrase=wxT(recap);
sortie=1;
} else {
strcpy(instrm,"");
strcat(instrm,set); strcat(instrm,obj); strcat(instrm,fin); strcat(instrm,ent); strcpy(recap,"");
strcat(recap,"Nouvel angle du champ de vision (FOV) : ");
strcat(recap,obj);
phrase2=wxT(instrm);
phrase=wxT(recap);
sortie=1;
}
break;
}
}
case 12 : {
WxSingleChoiceDialog6->ShowModal();
{
if(WxTextEntryDialog14->ShowModal()==wxID_OK)
{
strcpy(obj2,WxTextEntryDialog14->GetValue().c_str());
strcpy(instrm,"");
if (WxMenuBar1->IsChecked(1038)) {
if(WxTextEntryDialog20->ShowModal()==wxID_OK)
{
if (WxTextEntryDialog20->GetValue()!=rien)
{
strcat(instrm,pri); strcat(instrm,mod_phrase(WxTextEntryDialog20->GetValue()).c_str()); strcat(instrm,row); strcat(instrm,ent); }
}
}
strcat(instrm,cha); strcat(instrm,obj2); strcat(instrm,rat); if (WxSingleChoiceDialog6->GetSelection()==1)
strcpy(obj,"0.8");
else
strcpy(obj,"-0.8");
strcat(instrm,obj); strcat(instrm,fin); strcat(instrm,ent); strcpy(recap,"");
strcat(recap,"Faire un travelling ");
if (WxSingleChoiceDialog5->GetSelection()==1)
strcat(recap,"arriere pendant ");
else
strcat(recap,"avant pendant ");
strcat(recap,obj2);
strcat(recap," secondes");
phrase2=wxT(instrm);
phrase=wxT(recap);
sortie=1;
}
}
break;
}
case 13 : {
if(WxTextEntryDialog17->ShowModal()==wxID_OK)
{
strcpy(obj,WxTextEntryDialog17->GetValue().c_str());
strcpy(obj2,obj);
unsigned int longueur=strlen(obj);
if (longueur>61)
{
for(j=60;j>32;j--)
if (obj[j]==32)
{
strcat(obj,"+");
for(i=longueur-1;i>j;i--)
obj[i+1]=obj[i];
obj[j]=92;
obj[j+1]=110;
break;
}
}
longueur=strlen(obj);
if (longueur>126)
{
for(j=125;j>100;j--)
if (obj[j]==32)
{
strcat(obj,"+");
for(i=longueur-1;i>j;i--)
obj[i+1]=obj[i];
obj[j]=92;
obj[j+1]=110;
break;
}
}
i=0;
while(i<strlen(obj))
{
j=obj[i];
if (j<0) j=256+j;
if ((j==233)|(j==232)|(j==234)|(j==235)|(j==224)|(j==238)|(j==239)|(j==249)|(j==244)|(j==231))
accent(i,j);
i++;
}
strcpy(durees,"2");
if (WxMenuBar1->IsChecked(1016))
{
if(WxTextEntryDialog18->ShowModal()==wxID_OK)
{
intermede=WxTextEntryDialog18->GetValue();
if (intermede!=rien)
strcpy(durees,intermede.c_str());
}
}
strcpy(instrm,"");
strcat(instrm,pri); strcat(instrm,obj); strcat(instrm,row); strcat(instrm,ent); strcat(instrm,wai);
strcat(instrm,durees); strcat(instrm,fin); strcat(instrm,ent);
strcpy(recap,"");
strcat(recap,"Ecrire le texte ");
if (strcmp("2",durees))
{
strcat(recap," (");
strcat(recap,durees);
strcat(recap," s)");
}
strcat(recap,": ");
strcat(recap,obj2);
phrase2=wxT(instrm);
phrase=wxT(recap);
sortie=1;
}
break;
}
case 14 : {
if(WxTextEntryDialog21->ShowModal()==wxID_CANCEL)
break; if (WxTextEntryDialog21->GetValue()==rien)
break;
strcpy(obj2,WxTextEntryDialog21->GetValue().c_str());
if(WxTextEntryDialog22->ShowModal()==wxID_CANCEL)
break; if (WxTextEntryDialog22->GetValue()==rien)
break;
strcpy(obj3,WxTextEntryDialog22->GetValue().c_str());
strcpy(durees,dur5);
if (WxMenuBar1->IsChecked(1016))
{
if(WxTextEntryDialog23->ShowModal()==wxID_OK)
{
intermede=WxTextEntryDialog23->GetValue();
if (intermede!=rien)
strcpy(durees,intermede.c_str());
}
}
strcpy(instrm,"");
strcat(instrm,"gotolonglat{ time "); strcat(instrm,durees); if (WxMenuBar1->IsChecked(1016))
if(WxTextEntryDialog4->ShowModal()==wxID_OK)
{
strcat(instrm," distance ");
strcat(instrm,WxTextEntryDialog4->GetValue().c_str());
}
strcat(instrm," latitude ");
strcat(instrm,obj2);
strcat(instrm," longitude ");
strcat(instrm,obj3);
strcat(instrm,fin); strcat(instrm,ent); if (WxMenuBar1->IsChecked(1038)) {
if(WxTextEntryDialog20->ShowModal()==wxID_OK)
{
if (WxTextEntryDialog20->GetValue()!=rien)
{
strcat(instrm,pri); strcat(instrm,mod_phrase(WxTextEntryDialog20->GetValue()).c_str()); strcat(instrm,row); strcat(instrm,ent); }
}
}
strcat(instrm,wai); strcat(instrm,durees); strcat(instrm,fin); strcat(instrm,ent); strcpy(recap,"");
strcat(recap,"Position : latitude=");
strcat(recap,obj2);
strcat(recap,"° longitude=");
strcat(recap,obj3);
strcat(recap,"°");
if (strcmp(dur5,durees))
{
strcat(recap," (en ");
strcat(recap,durees);
strcat(recap," s)");
}
phrase2=wxT(instrm);
phrase=wxT(recap);
sortie=1;
break;
}
}if (sortie==1)
{
if (n_liste==pos1)
{
code[n_liste]=phrase2;
liste[n_liste]=phrase; WxGrid1->SetCellValue(n_liste,0,phrase);
n_liste++;
WxGrid1->AppendRows(1,true); WxGrid1->MoveCursorDown(false); }
else
{
if(liste[pos1]==rien)
{
code[pos1]=phrase2;
liste[pos1]=phrase;
WxGrid1->SetCellValue(pos1,0,phrase);
}
else
if(WxMessageDialog3->ShowModal()==wxID_YES)
{
code[pos1]=phrase2;
liste[pos1]=phrase;
WxGrid1->SetCellValue(pos1,0,phrase);
}
}
for(int t=0;t<n_liste;t++)
WxGrid1->SetCellValue(t,0,liste[t]);
WxGrid1->EnableCellEditControl(false);
}
sortie=0;
}
}
void ProjetzzFrm::WxListBox1Selected(wxCommandEvent& event)
{
jx=0;
for(int k=0;k<15;k++)
{ if (WxListBox1->IsSelected(k))
{ jx=1;
phrase.Printf(wxT("instruction n° %d"), k);
n_instr=k;
}
}
}
void ProjetzzFrm::WxButton1Click(wxCommandEvent& event)
{
int pos1=WxGrid1->GetGridCursorRow();
if(pos1<n_liste)
{
if (WxMessageDialog1->ShowModal()==wxID_YES)
{
WxGrid1->DeleteRows(pos1,1,true);
for (int k1=pos1;k1<n_liste;k1++)
{
liste[k1]=liste[k1+1];
code[k1]=code[k1+1];
}
liste[n_liste]=rien;
code[n_liste]=rien;
n_liste--;
}
for(int t=0;t<n_liste;t++)
{
WxGrid1->SetCellValue(t,0,liste[t]);
}
}
posG=WxGrid1->GetGridCursorRow();
WxGrid1->EnableCellEditControl(false);
}
void ProjetzzFrm::WxButton2Click(wxCommandEvent& event)
{
int pos1=WxGrid1->GetGridCursorRow(); if ((pos1>0)&(pos1<n_liste))
{
wxString phrase3=liste[pos1-1];
liste[pos1-1]=liste[pos1];
liste[pos1]=phrase3;
phrase3=code[pos1-1];
code[pos1-1]=code[pos1];
code[pos1]=phrase3;
WxGrid1->MoveCursorUp(false);
}
for(int t=0;t<n_liste;t++)
WxGrid1->SetCellValue(t,0,liste[t]);
posG=WxGrid1->GetGridCursorRow();
WxGrid1->EnableCellEditControl(false);
}
void ProjetzzFrm::WxButton5Click(wxCommandEvent& event)
{
int pos1=WxGrid1->GetGridCursorRow();
if(pos1<n_liste)
{
WxGrid1->InsertRows(pos1,1,true);
for (int k1=n_liste;k1>=pos1;k1--)
{
liste[k1+1]=liste[k1];
code[k1+1]=code[k1];
}
n_liste++;
liste[pos1]=rien;
code[pos1]=rien;
}
for(int t=0;t<n_liste;t++)
WxGrid1->SetCellValue(t,0,liste[t]);
posG=WxGrid1->GetGridCursorRow();
WxGrid1->EnableCellEditControl(false);
}
void ProjetzzFrm::WxButton4Click(wxCommandEvent& event)
{
int pos1=WxGrid1->GetGridCursorRow(); if (pos1<(n_liste-1))
{
wxString phrase3=liste[pos1+1];
liste[pos1+1]=liste[pos1];
liste[pos1]=phrase3;
phrase3=code[pos1+1];
code[pos1+1]=code[pos1];
code[pos1]=phrase3;
WxGrid1->MoveCursorDown(false);
}
for(int t=0;t<n_liste;t++)
WxGrid1->SetCellValue(t,0,liste[t]);
posG=WxGrid1->GetGridCursorRow();
}
void ProjetzzFrm::WxListBox2Selected(wxCommandEvent& event)
{
}
void ProjetzzFrm::WxListBox2Selected1(wxCommandEvent& event)
{
jx=0;
for(int k=0;k<15;k++)
{ if (WxListBox1->IsSelected(k))
{ jx2=1;
phrase.Printf(wxT("instruction n° %d"), k);
}
}
}
void ProjetzzFrm::Mnuquitter1024Click(wxCommandEvent& event)
{
if(WxMessageDialog2->ShowModal()==wxID_YES)
Destroy();
}
void ProjetzzFrm::Mnuouvrir1021Click(wxCommandEvent& event)
{
bool testlect;
if(WxOpenFileDialog1->ShowModal()==wxID_OK)
{
strcpy(nomfichier,WxOpenFileDialog1->GetFilename().c_str());
i=0;
k=0; fic=fopen(nomfichier,"r"); if( fic==NULL )
{
wxMessageBox("fichier introuvable", _T("Ouvrir un fichier"),wxOK | wxICON_INFORMATION, this);
return;
}
wxMessageBox("fichier trouvé", _T("Ouvrir un fichier"),wxOK | wxICON_INFORMATION, this);
WxGrid1->DeleteRows(0,n_liste,false);
do
{
fread(&lect,1,1,fic); }
while (((lect[0]==10)|(lect[0]=='\t')|(lect[0]=='\n')|(lect[0]==32))&(feof(fic)==0));
if (feof(fic)!=0)
{
wxMessageBox("fichier vide", _T("Ouvrir un fichier"),wxOK | wxICON_EXCLAMATION, this);
return;
}
if (lect[0]!=123)
{
wxMessageBox("Mauvais fichier", _T("Ouvrir un fichier"),wxOK | wxICON_EXCLAMATION, this);
return;
}
do
{
fread(&lect,1,1,fic); }
while (((lect[0]==10)|(lect[0]=='\t')|(lect[0]=='\n')|(lect[0]==32))&(feof(fic)==0));
if (feof(fic)==1)
{
return;
i=1;
}
if (i==0)
{ do
{
if (lect[0]=='#')
{
do
fread(&lect,1,1,fic); while ((lect[0]==' ')&(feof(fic)==0));
j=0;
while ((feof(fic)==0)&(lect[0]!='\n'))
{ recapil[k][j]=lect[0];
instrm[j++]=lect[0];
fread(&lect,1,1,fic);
}
instrm[j]=0;
liste[k]=wxT(instrm);
}
else
{
liste[k]=wxT("Liste d'instructions");
}
strcpy(instrm,"");
if (feof(fic)==0) {
do
fread(&lect,1,1,fic); while (((lect[0]==10)|(lect[0]=='\t')|(lect[0]=='\n')|(lect[0]==32))&(feof(fic)==0));
j=0;
testlect=true;
while ((feof(fic)==0)&((lect[0]!='#')|(testlect==false)))
{ instrm[j++]=lect[0];
if ((lect[0]!=32)&(lect[0]!=10)&(lect[0]!=9)) testlect=false;
if (lect[0]=='\n')
testlect=true;
fread(&lect,1,1,fic);
}
instrm[j-1]=0;
code[k++]=wxT(instrm);
} }
while (feof(fic)==0);
{
strcpy(instrm,code[k-1].c_str());
instrm[j-2]=0;
code[k-1]=wxT(instrm);
}
n_liste=k;
}
fclose(fic);
strcpy(nom_obj,""); i=n_liste;
do
{
i--; j01=strlen(recapil[i]);
if (strncmp(recapil[i],"Aller",5)==0)
{
for (j=13;j<j01;j++)
nom_obj[j-13]=recapil[i][j];
}
else
if (strncmp(recapil[i],"Centrer",7)==0)
{
for (j=15;j<j01;j++)
nom_obj[j-15]=recapil[i][j];
}
}
while((i>0)&(strlen(nom_obj)<1));
WxGrid1->ClearGrid();
WxGrid1->InsertRows(0,n_liste,false);
for(int t=0;t<n_liste;t++)
{
WxGrid1->MoveCursorDown(false);
WxGrid1->SetCellValue(t,0,liste[t]);
}
}
}
void ProjetzzFrm::Mnusauver1022Click(wxCommandEvent& event)
{
if(WxSaveFileDialog1->ShowModal()==wxID_OK)
{
strcpy(nomfichier,WxSaveFileDialog1->GetFilename().c_str());
fic=fopen(nomfichier,"w"); fwrite(&deb,strlen(deb),1,fic); fwrite(&ent,strlen(ent),1,fic); for (k=0;k<n_liste;k++)
{
fwrite(&ent,strlen(ent),1,fic); fwrite(&dies,strlen(dies),1,fic); strcpy(instrm,liste[k].c_str());
fwrite(&instrm,strlen(instrm),1,fic);
fwrite(&ent,strlen(ent),1,fic); strcpy(instrm,code[k].c_str());
fwrite(&instrm,strlen(instrm),1,fic); }
fwrite(&fin,strlen(fin),1,fic); fclose(fic);
}
}
void ProjetzzFrm::Mnunouveau1027Click(wxCommandEvent& event)
{
if (n_liste>0)
{
if(WxMessageDialog7->ShowModal()==wxID_OK)
{
WxGrid1->ClearGrid();
WxGrid1->DeleteRows(0,n_liste,false);
n_liste=0;
}
}
}
void ProjetzzFrm::Mnuaide1028Click(wxCommandEvent& event)
{
}
void ProjetzzFrm::Mnuaide1028Click1(wxCommandEvent& event)
{
}
void ProjetzzFrm::Mnucommandes1030Click(wxCommandEvent& event)
{
wxcommandesDialog->ShowModal();
}
void ProjetzzFrm::Mnusubmenuitem121029Click(wxCommandEvent& event)
{
aproposDialog->ShowModal();
}
void ProjetzzFrm::WxToolButton4Click(wxCommandEvent& event)
{
wxExecute(wxT("celestia.exe"),wxEXEC_NOHIDE,NULL);
}
void ProjetzzFrm::Mnuaidedesoptions1037Click(wxCommandEvent& event)
{
Dlga* Wxdlga = new Dlga(this);
Wxdlga->ShowModal();
}
void ProjetzzFrm::WxPanel1UpdateUI(wxUpdateUIEvent& event)
{
}
void ProjetzzFrm::Mnumodifierlecode1039Click(wxCommandEvent& event)
{
int pos1=WxGrid1->GetGridCursorRow();
if (pos1==n_liste) return;
mod_code* wxmod_code = new mod_code(this);
wxmod_code->code_m=code[pos1];
wxmod_code->nom_m=liste[pos1];
wxmod_code->ShowModal();
code[pos1]=wxmod_code->code_m;
liste[pos1]=wxmod_code->nom_m;
WxGrid1->SetCellValue(pos1,0,liste[pos1]);
}
void ProjetzzFrm::WxGrid1SelectCell(wxGridEvent& event)
{
for(int t=0;t<n_liste;t++)
WxGrid1->SetCellValue(t,0,liste[t]);
}
void ProjetzzFrm::WxGrid1CellChange1(wxGridEvent& event)
{
for(int t=0;t<n_liste;t++)
WxGrid1->SetCellValue(t,0,liste[t]);
posG=WxGrid1->GetGridCursorRow();
}
void ProjetzzFrm::Mnusubmenuitem181041Click(wxCommandEvent& event)
{
char const vrai[]="1",faux[]="0",bloc[]="B";
fic=fopen("miniscript.cfg","w"); if (WxMenuBar1->IsChecked(1016))
fwrite(&vrai,1,1,fic);
else
fwrite(&faux,1,1,fic);
if (WxMenuBar1->IsChecked(1038))
fwrite(&vrai,1,1,fic);
else
fwrite(&faux,1,1,fic);
if (WxMenuBar1->IsChecked(1026))
fwrite(&vrai,1,1,fic);
else
fwrite(&faux,1,1,fic);
if (block==false)
fwrite(&bloc,1,1,fic);
fclose(fic);
}