Esempio n. 1
0
bool FenetreSaisie::qt_invoke( int _id, QUObject* _o )
{
	switch ( _id - staticMetaObject()->slotOffset() ) {
		case 0: Login(); break;
		case 1: Terminer(); break;
		case 2: Reservation(); break;
		case 3: SelectionnerOk0(); break;
		case 4: SelectionnerOk1(); break;
		case 5: SelectionnerOk2(); break;
		case 6: SelectionnerOk3(); break;
		case 7: SelectionnerOk4(); break;
		case 8: SelectionnerOk((int)static_QUType_int.get(_o+1)); break;
		case 9: Precedent(); break;
		case 10: Suivant(); break;
		case 11: Effacer(); break;
		case 12: Recherche(); break;
		case 13: Rendu0(); break;
		case 14: Rendu1(); break;
		case 15: Rendu2(); break;
		case 16: Rendu((int)static_QUType_int.get(_o+1)); break;
		case 17: languageChange(); break;
		default:
		return QDialog::qt_invoke( _id, _o );
	}
	return TRUE;
}
Esempio n. 2
0
/*****************************************************
Fonction :
Retour :
*****************************************************/
Liste_Ville* Ajouter_Fin_voisins(Liste_Ville *L, Ville V, float dist){
   	Liste_Ville* Nouvelle_Ville;
    Nouvelle_Ville = (Liste_Ville*)malloc(sizeof(Liste_Ville));
   	Nouvelle_Ville->v = V;
   	Nouvelle_Ville->Ville_Suivant = NULL;
	Nouvelle_Ville->dist=dist;

   	 if(L ==NULL){
   	    L=Nouvelle_Ville;
   	    return L;
  	 }else{
        Liste_Ville* Tmp = L;

        while(!Est_Vide(Suivant(Tmp))){
     	       Tmp = Suivant(Tmp);
        }
        Tmp->Ville_Suivant = Nouvelle_Ville;
        return L;
   	 }
}
Esempio n. 3
0
/*
 *  Constructs a FenetreSaisie as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The dialog will by default be modeless, unless you set 'modal' to
 *  TRUE to construct a modal dialog.
 */
FenetreSaisie::FenetreSaisie( QWidget* parent, const char* name, bool modal, WFlags fl )
    : QDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "FenetreSaisie" );

    textTitre = new QLabel( this, "textTitre" );
    textTitre->setGeometry( QRect( 210, 20, 160, 21 ) );
    QFont textTitre_font(  textTitre->font() );
    textTitre_font.setFamily( "Helvetica [Adobe]" );
    textTitre_font.setPointSize( 18 );
    textTitre_font.setBold( TRUE );
    textTitre->setFont( textTitre_font ); 
    textTitre->setAlignment( int( QLabel::AlignCenter ) );

    textNom = new QLabel( this, "textNom" );
    textNom->setGeometry( QRect( 30, 50, 59, 20 ) );

    lineSaisieNom = new QLineEdit( this, "lineSaisieNom" );
    lineSaisieNom->setGeometry( QRect( 100, 50, 220, 20 ) );

    ButtonLogin = new QPushButton( this, "ButtonLogin" );
    ButtonLogin->setGeometry( QRect( 440, 50, 85, 20 ) );
    ButtonLogin->setAutoDefault( FALSE );

    ButtonReservation = new QPushButton( this, "ButtonReservation" );
    ButtonReservation->setGeometry( QRect( 740, 420, 85, 20 ) );
    ButtonReservation->setAutoDefault( FALSE );

    ButtonTerminer = new QPushButton( this, "ButtonTerminer" );
    ButtonTerminer->setGeometry( QRect( 550, 50, 85, 20 ) );
    ButtonTerminer->setAutoDefault( FALSE );

    lineNom[0] = new QLineEdit( this, "lineNom" );
    lineNom[0]->setGeometry( QRect( 30, 110, 220, 20 ) );
    lineNom[0]->setReadOnly( TRUE );
    lineNom[1] = new QLineEdit( this, "lineNom" );
    lineNom[1]->setGeometry( QRect( 30, 135, 220, 20 ) );
    lineNom[1]->setReadOnly( TRUE );
    lineNom[2] = new QLineEdit( this, "lineNom" );
    lineNom[2]->setGeometry( QRect( 30, 160, 220, 20 ) );
    lineNom[2]->setReadOnly( TRUE );

    linePrenom[0] = new QLineEdit( this, "linePrenom" );
    linePrenom[0]->setGeometry( QRect( 260, 110, 160, 20 ) );
    linePrenom[0]->setReadOnly( TRUE );
    linePrenom[1] = new QLineEdit( this, "linePrenom" );
    linePrenom[1]->setGeometry( QRect( 260, 135, 160, 20 ) );
    linePrenom[1]->setReadOnly( TRUE );
    linePrenom[2] = new QLineEdit( this, "linePrenom" );
    linePrenom[2]->setGeometry( QRect( 260, 160, 160, 20 ) );
    linePrenom[2]->setReadOnly( TRUE );

    lineTitre[0] = new QLineEdit( this, "lineTitre" );
    lineTitre[0]->setGeometry( QRect( 430, 110, 290, 20 ) );
    lineTitre[0]->setReadOnly( TRUE );
    lineTitre[1] = new QLineEdit( this, "lineTitre" );
    lineTitre[1]->setGeometry( QRect( 430, 135, 290, 20 ) );
    lineTitre[1]->setReadOnly( TRUE );
    lineTitre[2] = new QLineEdit( this, "lineTitre" );
    lineTitre[2]->setGeometry( QRect( 430, 160, 290, 20 ) );
    lineTitre[2]->setReadOnly( TRUE );

    ButtonRendu[0] = new QPushButton( this, "ButtonRendu" );
    ButtonRendu[0]->setGeometry( QRect( 740, 110, 85, 20 ) );
    ButtonRendu[0]->setAutoDefault( FALSE );
    ButtonRendu[1] = new QPushButton( this, "ButtonRendu" );
    ButtonRendu[1]->setGeometry( QRect( 740, 135, 85, 20 ) );
    ButtonRendu[1]->setAutoDefault( FALSE );
    ButtonRendu[2] = new QPushButton( this, "ButtonRendu" );
    ButtonRendu[2]->setGeometry( QRect( 740, 160, 85, 20 ) );
    ButtonRendu[2]->setAutoDefault( FALSE );

    ButtonPrecedent = new QPushButton( this, "ButtonPrecedent" );
    ButtonPrecedent->setGeometry( QRect( 60, 365, 85, 20 ) );
    ButtonPrecedent->setAutoDefault( FALSE );

    ButtonEffacer = new QPushButton( this, "ButtonEffacer" );
    ButtonEffacer->setGeometry( QRect( 330, 365, 85, 20 ) );
    ButtonEffacer->setAutoDefault( FALSE );

    ButtonSuivant = new QPushButton( this, "ButtonSuivant" );
    ButtonSuivant->setGeometry( QRect( 600, 365, 85, 20 ) );
    ButtonSuivant->setAutoDefault( FALSE );

    lineRecherche = new QLineEdit( this, "lineRecherche" );
    lineRecherche->setGeometry( QRect( 430, 190, 290, 20 ) );

    lineNomOk[0] = new QLineEdit( this, "lineNomOk" );
    lineNomOk[0]->setGeometry( QRect( 30, 230, 220, 20 ) );
    lineNomOk[0]->setReadOnly( TRUE );
    lineNomOk[1] = new QLineEdit( this, "lineNomOk" );
    lineNomOk[1]->setGeometry( QRect( 30, 255, 220, 20 ) );
    lineNomOk[1]->setReadOnly( TRUE );
    lineNomOk[2] = new QLineEdit( this, "lineNomOk" );
    lineNomOk[2]->setGeometry( QRect( 30, 280, 220, 20 ) );
    lineNomOk[2]->setReadOnly( TRUE );
    lineNomOk[3] = new QLineEdit( this, "lineNomOk" );
    lineNomOk[3]->setGeometry( QRect( 30, 305, 220, 20 ) );
    lineNomOk[3]->setReadOnly( TRUE );
    lineNomOk[4] = new QLineEdit( this, "lineNomOk" );
    lineNomOk[4]->setGeometry( QRect( 30, 330, 220, 20 ) );
    lineNomOk[4]->setReadOnly( TRUE );

    linePrenomOk[0] = new QLineEdit( this, "linePrenomOk" );
    linePrenomOk[0]->setGeometry( QRect( 260, 230, 160, 20 ) );
    linePrenomOk[0]->setReadOnly( TRUE );
    linePrenomOk[1] = new QLineEdit( this, "linePrenomOk" );
    linePrenomOk[1]->setGeometry( QRect( 260, 255, 160, 20 ) );
    linePrenomOk[1]->setReadOnly( TRUE );
    linePrenomOk[2] = new QLineEdit( this, "linePrenomOk" );
    linePrenomOk[2]->setGeometry( QRect( 260, 280, 160, 20 ) );
    linePrenomOk[2]->setReadOnly( TRUE );
    linePrenomOk[3] = new QLineEdit( this, "linePrenomOk" );
    linePrenomOk[3]->setGeometry( QRect( 260, 305, 160, 20 ) );
    linePrenomOk[3]->setReadOnly( TRUE );
    linePrenomOk[4] = new QLineEdit( this, "linePrenomOk" );
    linePrenomOk[4]->setGeometry( QRect( 260, 330, 160, 20 ) );
    linePrenomOk[4]->setReadOnly( TRUE );

    lineTitreOk[0] = new QLineEdit( this, "lineTitreOk" );
    lineTitreOk[0]->setGeometry( QRect( 430, 230, 270, 20 ) );
    lineTitreOk[0]->setReadOnly( TRUE );
    lineTitreOk[1] = new QLineEdit( this, "lineTitreOk" );
    lineTitreOk[1]->setGeometry( QRect( 430, 255, 270, 20 ) );
    lineTitreOk[1]->setReadOnly( TRUE );
    lineTitreOk[2] = new QLineEdit( this, "lineTitreOk" );
    lineTitreOk[2]->setGeometry( QRect( 430, 280, 270, 20 ) );
    lineTitreOk[2]->setReadOnly( TRUE );
    lineTitreOk[3] = new QLineEdit( this, "lineTitreOk" );
    lineTitreOk[3]->setGeometry( QRect( 430, 305, 270, 20 ) );
    lineTitreOk[3]->setReadOnly( TRUE );
    lineTitreOk[4] = new QLineEdit( this, "lineTitreOk" );
    lineTitreOk[4]->setGeometry( QRect( 430, 330, 270, 20 ) );
    lineTitreOk[4]->setReadOnly( TRUE );

    lineReserveOk[0] = new QLineEdit( this, "lineReserveOk" );
    lineReserveOk[0]->setGeometry( QRect( 700, 230, 20, 20 ) );
    lineReserveOk[0]->setReadOnly( TRUE );
    lineReserveOk[1] = new QLineEdit( this, "lineReserveOk" );
    lineReserveOk[1]->setGeometry( QRect( 700, 255, 20, 20 ) );
    lineReserveOk[1]->setReadOnly( TRUE );
    lineReserveOk[2] = new QLineEdit( this, "lineReserveOk" );
    lineReserveOk[2]->setGeometry( QRect( 700, 280, 20, 20 ) );
    lineReserveOk[2]->setReadOnly( TRUE );
    lineReserveOk[3] = new QLineEdit( this, "lineReserveOk" );
    lineReserveOk[3]->setGeometry( QRect( 700, 305, 20, 20 ) );
    lineReserveOk[3]->setReadOnly( TRUE );
    lineReserveOk[4] = new QLineEdit( this, "lineReserveOk" );
    lineReserveOk[4]->setGeometry( QRect( 700, 330, 20, 20 ) );
    lineReserveOk[4]->setReadOnly( TRUE );

    ButtonSelectionnerOk[0] = new QPushButton( this, "ButtonSelectionnerOk" );
    ButtonSelectionnerOk[0]->setGeometry( QRect( 740, 230, 85, 20 ) );
    ButtonSelectionnerOk[0]->setAutoDefault( FALSE );
    ButtonSelectionnerOk[1] = new QPushButton( this, "ButtonSelectionnerOk" );
    ButtonSelectionnerOk[1]->setGeometry( QRect( 740, 255, 85, 20 ) );
    ButtonSelectionnerOk[1]->setAutoDefault( FALSE );
    ButtonSelectionnerOk[2] = new QPushButton( this, "ButtonSelectionnerOk" );
    ButtonSelectionnerOk[2]->setGeometry( QRect( 740, 280, 85, 20 ) );
    ButtonSelectionnerOk[2]->setAutoDefault( FALSE );
    ButtonSelectionnerOk[3] = new QPushButton( this, "ButtonSelectionnerOk" );
    ButtonSelectionnerOk[3]->setGeometry( QRect( 740, 305, 85, 20 ) );
    ButtonSelectionnerOk[3]->setAutoDefault( FALSE );
    ButtonSelectionnerOk[4] = new QPushButton( this, "ButtonSelectionnerOk" );
    ButtonSelectionnerOk[4]->setGeometry( QRect( 740, 330, 85, 20 ) );
    ButtonSelectionnerOk[4]->setAutoDefault( FALSE );

    textSaisie = new QLabel( this, "textSaisie" );
    textSaisie->setGeometry( QRect( 30, 190, 330, 20 ) );

    textMessage = new QTextEdit( this, "textMessage" );
    textMessage->setGeometry( QRect( 30, 420, 685, 58 ) );
    textMessage->setReadOnly( TRUE );

    textInformation = new QLabel( this, "textInformation" );
    textInformation->setGeometry( QRect( 30, 390, 80, 20 ) );
    QFont textInformation_font(  textInformation->font() );
    textInformation_font.setFamily( "Helvetica [Adobe]" );
    textInformation_font.setBold( TRUE );
    textInformation->setFont( textInformation_font ); 

    textSelection = new QLabel( this, "textSelection" );
    textSelection->setGeometry( QRect( 30, 80, 180, 20 ) );
    languageChange();
    resize( QSize(850, 500).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( ButtonLogin, SIGNAL( clicked() ), this, SLOT( Login() ) );
    connect( ButtonReservation, SIGNAL( clicked() ), this, SLOT( Reservation() ) );
    connect( lineSaisieNom, SIGNAL( returnPressed() ), this, SLOT( Login() ) );
    connect( ButtonEffacer, SIGNAL( clicked() ), this, SLOT( Effacer() ) );
    connect( ButtonTerminer, SIGNAL( clicked() ), this, SLOT( Terminer() ) );
    connect( ButtonPrecedent, SIGNAL( clicked() ), this, SLOT( Precedent() ) );
    connect( ButtonSuivant, SIGNAL( clicked() ), this, SLOT( Suivant() ) );
    connect( lineRecherche, SIGNAL( returnPressed() ), this, SLOT( Recherche() ) );
    connect( ButtonRendu[0], SIGNAL( clicked() ), this, SLOT( Rendu0() ) );
    connect( ButtonRendu[1], SIGNAL( clicked() ), this, SLOT( Rendu1() ) );
    connect( ButtonRendu[2], SIGNAL( clicked() ), this, SLOT( Rendu2() ) );
    connect( ButtonSelectionnerOk[0], SIGNAL( clicked() ), this, SLOT( SelectionnerOk0() ) );
    connect( ButtonSelectionnerOk[1], SIGNAL( clicked() ), this, SLOT( SelectionnerOk1() ) );
    connect( ButtonSelectionnerOk[2], SIGNAL( clicked() ), this, SLOT( SelectionnerOk2() ) );
    connect( ButtonSelectionnerOk[3], SIGNAL( clicked() ), this, SLOT( SelectionnerOk3() ) );
    connect( ButtonSelectionnerOk[4], SIGNAL( clicked() ), this, SLOT( SelectionnerOk4() ) );
}
Esempio n. 4
0
int Transmission(int erreur)
{
TUnixMessage		Message;
UTEditFile		*Params;
WTEditFile		*Result;
register int		Status;
register integer16 	Size=sizeof(UTEditFile)-1;
TIdFile 		*Id;
int			taille;
char			*tmp;

	if (erreur==0) {

// on vérifie qu'il y a encore des bloc à envoyer
	if (encours!=NULL) Id=encours->suiv;
			else return 0;

// on recupere la taille du bloc de données compréssées
	taille=Id->indice->taille;

// on calcul la taille des parametres du message sortant
	Size+=taille;

// on alloue la mémoire
	if ((Params=(UTEditFile *)malloc(Size))==NULL) {
		errno=ENOMEM;
		return (-1);
		}

// Initialisation des parametres du message sortant
	Params->nbFen=Id->nbFen;
	if (Id->indice->suiv==NULL) Params->fin=FIN_FICHIER;
		else Params->fin=0;
	Params->nbBloc=++(Id->dernierBloc);
	tmp=Params->data;

// recopie du bloc de données compressées
	fseek(Id->Lecture,Id->indice->deb,SEEK_SET);
	while (taille--) *(tmp++)=(char)getc(Id->Lecture);

// construction du message
	memset(&Message,0,sizeof(Message));
	winmsg_build_message(&Message, UWF_EDIT_FILE,Params,Size);

//       envoie du message
       Status=winmsg_send_receive(&Message,&Message,0);
       free(Params);
 
	
//	Status=WIN_UWFEditFile(&Message);
//	free(Params);

// vérification du résultat de la transmission 
	if (Status!=UWS_OK)
		return (-1);
	
// Vérification de la validité du resultat
	Result=(WTEditFile *) Message.Data;

	switch (Result->code) {
		case T_OK : LibererCelluleId(Id);Suivant();break;
		case ERR_BLOC :
		case ERR_INC  :
		case ERR_FERMEE   : 
		case FIN_FICHIER      :	
		default	      :	SupprimerTete();break;
		}

	winmsg_free_message(&Message);

	}
	else {

// calcul de la taille du message d'erreur
	Size+=1;

// on alloue la mémoire
	if ((Params=(UTEditFile *)malloc(Size))==NULL) {
		errno=ENOMEM;
		return (-1);
		}

// intialisation des parametres sortants
	Params->nbFen=0;
	Params->nbBloc=(char)erreur;

// construction du message
	memset(&Message,0,sizeof(Message));
	winmsg_build_message(&Message,UWF_EDIT_FILE,Params,Size);

// envoie du message
	Status=winmsg_send_receive(&Message,&Message,0);
	free(Params);

// vérification du résultat de la transmission
	if (Status!=UWS_OK)
		return (-1);

	winmsg_free_message(&Message);
	
	}

	return (encours!=NULL);
}