rem: fin_edition_echeance (); } } return FALSE; break;  case GDK_plus :		 case GDK_KP_Add :    if ( no_widget == SCHEDULER_FORM_DATE || no_widget == SCHEDULER_FORM_FINAL_DATE ) { gtk_signal_emit_stop_by_name ( GTK_OBJECT ( widget ), "key-press-event"); if ( ( ev -> state & GDK_SHIFT_MASK ) != GDK_SHIFT_MASK ) inc_dec_date ( widget_formulaire_echeancier[no_widget], ONE_DAY ); else inc_dec_date ( widget_formulaire_echeancier[no_widget], ONE_WEEK ); return TRUE; } return FALSE;  case GDK_minus :		 case GDK_KP_Subtract :    if ( no_widget == SCHEDULER_FORM_DATE || no_widget == SCHEDULER_FORM_FINAL_DATE ) { gtk_signal_emit_stop_by_name ( GTK_OBJECT ( widget ), "key-press-event"); if ( ( ev -> state & GDK_SHIFT_MASK ) != GDK_SHIFT_MASK ) inc_dec_date ( widget_formulaire_echeancier[no_widget], - ONE_DAY ); else inc_dec_date ( widget_formulaire_echeancier[no_widget], - ONE_WEEK ); return TRUE; } return FALSE;  case GDK_Page_Up :		 case GDK_KP_Page_Up :    if ( no_widget == SCHEDULER_FORM_DATE || no_widget == SCHEDULER_FORM_FINAL_DATE ) { gtk_signal_emit_stop_by_name ( GTK_OBJECT ( widget ), "key-press-event"); if ( ( ev -> state & GDK_SHIFT_MASK ) != GDK_SHIFT_MASK ) inc_dec_date ( widget_formulaire_echeancier[no_widget], ONE_MONTH ); else inc_dec_date ( widget_formulaire_echeancier[no_widget], ONE_YEAR ); return TRUE; } return FALSE;  case GDK_Page_Down :		 case GDK_KP_Page_Down :    if ( no_widget == SCHEDULER_FORM_DATE || no_widget == SCHEDULER_FORM_FINAL_DATE ) { gtk_signal_emit_stop_by_name ( GTK_OBJECT ( widget ), "key-press-event"); if ( ( ev -> state & GDK_SHIFT_MASK ) != GDK_SHIFT_MASK ) inc_dec_date ( widget_formulaire_echeancier[no_widget], - ONE_MONTH ); else inc_dec_date ( widget_formulaire_echeancier[no_widget], - ONE_YEAR ); return TRUE; } return FALSE;  default:  return FALSE;
add: no_widget = ( no_widget + 1 ) % SCHEDULER_FORM_TOTAL_WIDGET;  while ( !( GTK_WIDGET_VISIBLE ( widget_formulaire_echeancier[no_widget] ) && GTK_WIDGET_SENSITIVE ( widget_formulaire_echeancier[no_widget] ) && ( GTK_IS_COMBOFIX ( widget_formulaire_echeancier[no_widget] ) || GTK_IS_ENTRY ( widget_formulaire_echeancier[no_widget] ) || GTK_IS_BUTTON ( widget_formulaire_echeancier[no_widget] ) ))) no_widget = ( no_widget + 1 ) % SCHEDULER_FORM_TOTAL_WIDGET;    if ( no_widget == SCHEDULER_FORM_DATE && etat.entree == 0 ) { fin_edition_echeance (); return TRUE; }    if ( no_widget == SCHEDULER_FORM_DEBIT ) {   if ( gtk_widget_get_style ( widget_formulaire_echeancier[SCHEDULER_FORM_DEBIT] ) == style_entree_formulaire[ENGRIS] && gtk_widget_get_style ( widget_formulaire_echeancier[SCHEDULER_FORM_CREDIT] ) == style_entree_formulaire[ENCLAIR] ) no_widget = SCHEDULER_FORM_CREDIT; }    if ( no_widget == SCHEDULER_FORM_CREDIT ) if ( gtk_widget_get_style ( widget_formulaire_echeancier[SCHEDULER_FORM_DEBIT] ) == style_entree_formulaire[ENCLAIR] ) { no_widget = SCHEDULER_FORM_DEVISE; gtk_widget_set_style (widget_formulaire_echeancier[SCHEDULER_FORM_CREDIT], style_entree_formulaire[ENGRIS] ); gtk_entry_set_text ( GTK_ENTRY (widget_formulaire_echeancier[SCHEDULER_FORM_CREDIT]), _("Credit") ); }   if ( GTK_IS_COMBOFIX ( widget_formulaire_echeancier[no_widget] ) ) { gtk_widget_grab_focus ( GTK_COMBOFIX ( widget_formulaire_echeancier[no_widget] ) -> entry ); gtk_entry_select_region ( GTK_ENTRY ( GTK_COMBOFIX ( widget_formulaire_echeancier[no_widget] ) -> entry ), 0, -1 ); } else { if ( GTK_IS_ENTRY ( widget_formulaire_echeancier[no_widget] ) ) gtk_entry_select_region ( GTK_ENTRY ( widget_formulaire_echeancier[no_widget] ), 0, -1 ); gtk_widget_grab_focus ( widget_formulaire_echeancier[no_widget]  ); } return TRUE;  case GDK_Return :		 case GDK_KP_Enter :  if ( !etat.formulaire_echeance_dans_fenetre ) {   if ( ( ev -> state & GDK_CONTROL_MASK ) == GDK_CONTROL_MASK ) { switch ( no_widget ) { case SCHEDULER_FORM_DATE : case SCHEDULER_FORM_FINAL_DATE :  popup_cal = gsb_calendar_new ( widget ); gtk_signal_connect_object ( GTK_OBJECT ( popup_cal ), "destroy", GTK_SIGNAL_FUNC ( ferme_calendrier ), GTK_OBJECT ( widget ) ); gtk_widget_grab_focus ( GTK_WIDGET ( popup_cal ) ); break ;  default : break ; } }  else {   gtk_widget_grab_focus ( liste_echeances ); fin_edition_echeance (); } } return FALSE; break;  case GDK_plus :		 case GDK_KP_Add :    if ( no_widget == SCHEDULER_FORM_DATE || no_widget == SCHEDULER_FORM_FINAL_DATE ) { gtk_signal_emit_stop_by_name ( GTK_OBJECT ( widget ), "key-press-event"); if ( ( ev -> state & GDK_SHIFT_MASK ) != GDK_SHIFT_MASK ) inc_dec_date ( widget_formulaire_echeancier[no_widget], ONE_DAY ); else inc_dec_date ( widget_formulaire_echeancier[no_widget], ONE_WEEK ); return TRUE; } return FALSE;  case GDK_minus :		 case GDK_KP_Subtract :    if ( no_widget == SCHEDULER_FORM_DATE || no_widget == SCHEDULER_FORM_FINAL_DATE ) { gtk_signal_emit_stop_by_name ( GTK_OBJECT ( widget ), "key-press-event"); if ( ( ev -> state & GDK_SHIFT_MASK ) != GDK_SHIFT_MASK ) inc_dec_date ( widget_formulaire_echeancier[no_widget], - ONE_DAY ); else inc_dec_date ( widget_formulaire_echeancier[no_widget], - ONE_WEEK ); return TRUE; } return FALSE;  case GDK_Page_Up :		 case GDK_KP_Page_Up :    if ( no_widget == SCHEDULER_FORM_DATE || no_widget == SCHEDULER_FORM_FINAL_DATE ) { gtk_signal_emit_stop_by_name ( GTK_OBJECT ( widget ), "key-press-event"); if ( ( ev -> state & GDK_SHIFT_MASK ) != GDK_SHIFT_MASK ) inc_dec_date ( widget_formulaire_echeancier[no_widget], ONE_MONTH ); else inc_dec_date ( widget_formulaire_echeancier[no_widget], ONE_YEAR ); return TRUE; } return FALSE;  case GDK_Page_Down :		 case GDK_KP_Page_Down :    if ( no_widget == SCHEDULER_FORM_DATE || no_widget == SCHEDULER_FORM_FINAL_DATE ) { gtk_signal_emit_stop_by_name ( GTK_OBJECT ( widget ), "key-press-event"); if ( ( ev -> state & GDK_SHIFT_MASK ) != GDK_SHIFT_MASK ) inc_dec_date ( widget_formulaire_echeancier[no_widget], - ONE_MONTH ); else inc_dec_date ( widget_formulaire_echeancier[no_widget], - ONE_YEAR ); return TRUE; } return FALSE;  default:  return FALSE;
context: gboolean pression_touche_formulaire_echeancier ( GtkWidget *widget,						 GdkEventKey *ev,						 gint no_widget ){  GtkWidget *popup_cal;  /* si etat.entree = 1, la touche entre finit l'opration ( fonction par dfaut ) */  /* sinon elle fait comme tab */  if ( !etat.entree && ( ev -> keyval == GDK_Return || ev -> keyval == GDK_KP_Enter ))    ev->keyval = GDK_Tab ;  switch ( ev -> keyval )    {    case GDK_Escape :		/* chap */      echap_formulaire_echeancier();      return FALSE;    case GDK_Tab :      if ( GTK_IS_ENTRY ( widget ) )	gtk_entry_select_region ( GTK_ENTRY ( widget ), 0, 0);      else	if ( GTK_IS_COMBOFIX ( widget ) )	  gtk_entry_select_region ( GTK_ENTRY ( GTK_COMBOFIX ( widget ) -> entry ), 0, 0);      /* on fait perdre le focus au widget courant pour faire         les changements automatiques si ncessaire */      gtk_widget_grab_focus ( liste_echeances );      /* on donne le focus au widget suivant */      no_widget = ( no_widget + 1 ) % SCHEDULER_FORM_TOTAL_WIDGET;      while ( !( GTK_WIDGET_VISIBLE ( widget_formulaire_echeancier[no_widget] ) &&		 GTK_WIDGET_SENSITIVE ( widget_formulaire_echeancier[no_widget] ) &&		 ( GTK_IS_COMBOFIX ( widget_formulaire_echeancier[no_widget] ) ||		   GTK_IS_ENTRY ( widget_formulaire_echeancier[no_widget] ) ||		   GTK_IS_BUTTON ( widget_formulaire_echeancier[no_widget] ) )))	no_widget = ( no_widget + 1 ) % SCHEDULER_FORM_TOTAL_WIDGET;      /* si on se retrouve sur la date et que etat.entree = 0,	 on enregistre l'opration */      if ( no_widget == SCHEDULER_FORM_DATE &&	   etat.entree == 0 )	{	  fin_edition_echeance ();	  return TRUE;	}      /* si le prochain est le dbit, on vrifie s'il n'y a rien dans	 cette entre et s'il y a quelque chose dans l'entre du	 crdit */      if ( no_widget == SCHEDULER_FORM_DEBIT )	{	  /* si le dbit est gris et le crdit est noir, on met sur le crdit */	  if ( gtk_widget_get_style ( widget_formulaire_echeancier[SCHEDULER_FORM_DEBIT] ) == style_entree_formulaire[ENGRIS] &&	       gtk_widget_get_style ( widget_formulaire_echeancier[SCHEDULER_FORM_CREDIT] ) == style_entree_formulaire[ENCLAIR] )	    no_widget = SCHEDULER_FORM_CREDIT;	}      /* si le prochain est le crdit et que le dbit a t rempli,	 on se met sur la devise et on efface le crdit */      if ( no_widget == SCHEDULER_FORM_CREDIT )	if ( gtk_widget_get_style ( widget_formulaire_echeancier[SCHEDULER_FORM_DEBIT] ) == style_entree_formulaire[ENCLAIR] )	  {	    no_widget = SCHEDULER_FORM_DEVISE;	    gtk_widget_set_style (widget_formulaire_echeancier[SCHEDULER_FORM_CREDIT],				  style_entree_formulaire[ENGRIS] );	    gtk_entry_set_text ( GTK_ENTRY (widget_formulaire_echeancier[SCHEDULER_FORM_CREDIT]),				 _("Credit") );	  }      /* on slectionne le contenu de la nouvelle entre */      if ( GTK_IS_COMBOFIX ( widget_formulaire_echeancier[no_widget] ) )	{	  gtk_widget_grab_focus ( GTK_COMBOFIX ( widget_formulaire_echeancier[no_widget] ) -> entry );	  gtk_entry_select_region ( GTK_ENTRY ( GTK_COMBOFIX ( widget_formulaire_echeancier[no_widget] ) -> entry ), 0, -1 );	}      else	{	  if ( GTK_IS_ENTRY ( widget_formulaire_echeancier[no_widget] ) )	    gtk_entry_select_region ( GTK_ENTRY ( widget_formulaire_echeancier[no_widget] ), 0, -1 );	  gtk_widget_grab_focus ( widget_formulaire_echeancier[no_widget]  );	}      return TRUE;    case GDK_Return :		/* touches entre */    case GDK_KP_Enter :      if ( !etat.formulaire_echeance_dans_fenetre )	{/*	 gtk_signal_emit_stop_by_name ( GTK_OBJECT ( widget ),					"key-press-event");*/	 /* si la touche CTRL est elle aussi active, alors c'est que l'on est	    probablement sur un champ de date et que l'on souhaite ouvrir	    un calendrier */	 if ( ( ev -> state & GDK_CONTROL_MASK ) == GDK_CONTROL_MASK )	   {	    switch ( no_widget )	      {	       case SCHEDULER_FORM_DATE :	       case SCHEDULER_FORM_FINAL_DATE :		 popup_cal = gsb_calendar_new ( widget );		 gtk_signal_connect_object ( GTK_OBJECT ( popup_cal ),					     "destroy",					     GTK_SIGNAL_FUNC ( ferme_calendrier ),					     GTK_OBJECT ( widget ) );		 gtk_widget_grab_focus ( GTK_WIDGET ( popup_cal ) );		 break ;		 default :		 break ;	      }	   }	 /* si la touche CTRL n'est pas active, alors on valide simplement	    la saisie de l'chance */	 else	   {	    /* on fait perdre le focus au widget courant pour faire	       les changements automatiques si ncessaire */	    gtk_widget_grab_focus ( liste_echeances );	    fin_edition_echeance ();	   }	}      return FALSE;      break;    case GDK_plus :		/* touches + */    case GDK_KP_Add :      /* si on est dans une entree de date, on augmente d'un jour         (d'une semaine) la date */      if ( no_widget == SCHEDULER_FORM_DATE ||	   no_widget == SCHEDULER_FORM_FINAL_DATE )	{	  gtk_signal_emit_stop_by_name ( GTK_OBJECT ( widget ),					 "key-press-event");	  if ( ( ev -> state & GDK_SHIFT_MASK ) != GDK_SHIFT_MASK )	    inc_dec_date ( widget_formulaire_echeancier[no_widget], ONE_DAY );	  else	    inc_dec_date ( widget_formulaire_echeancier[no_widget], ONE_WEEK );	  return TRUE;	}      return FALSE;    case GDK_minus :		/* touches - */    case GDK_KP_Subtract :      /* si on est dans une entree de date, on diminue d'un jour         (d'une semaine) la date */      if ( no_widget == SCHEDULER_FORM_DATE ||	   no_widget == SCHEDULER_FORM_FINAL_DATE )	{	  gtk_signal_emit_stop_by_name ( GTK_OBJECT ( widget ),					 "key-press-event");	  if ( ( ev -> state & GDK_SHIFT_MASK ) != GDK_SHIFT_MASK )	    inc_dec_date ( widget_formulaire_echeancier[no_widget], - ONE_DAY );	  else	    inc_dec_date ( widget_formulaire_echeancier[no_widget], - ONE_WEEK );	  return TRUE;	}      return FALSE;    case GDK_Page_Up :		/* touche PgUp */    case GDK_KP_Page_Up :      /* si on est dans une entree de date,         on augmente d'un mois (d'un an) la date */      if ( no_widget == SCHEDULER_FORM_DATE ||	   no_widget == SCHEDULER_FORM_FINAL_DATE )	{	  gtk_signal_emit_stop_by_name ( GTK_OBJECT ( widget ),					 "key-press-event");	  if ( ( ev -> state & GDK_SHIFT_MASK ) != GDK_SHIFT_MASK )	    inc_dec_date ( widget_formulaire_echeancier[no_widget], ONE_MONTH );	  else	    inc_dec_date ( widget_formulaire_echeancier[no_widget], ONE_YEAR );	  return TRUE;	}      return FALSE;    case GDK_Page_Down :		/* touche PgDown */    case GDK_KP_Page_Down :      /* si on est dans une entree de date,         on augmente d'un mois (d'un an) la date */      if ( no_widget == SCHEDULER_FORM_DATE ||	   no_widget == SCHEDULER_FORM_FINAL_DATE )	{	  gtk_signal_emit_stop_by_name ( GTK_OBJECT ( widget ),					 "key-press-event");	  if ( ( ev -> state & GDK_SHIFT_MASK ) != GDK_SHIFT_MASK )	    inc_dec_date ( widget_formulaire_echeancier[no_widget], - ONE_MONTH );	  else	    inc_dec_date ( widget_formulaire_echeancier[no_widget], - ONE_YEAR );	  return TRUE;	}      return FALSE;    default:      /* Reverting to default handler */      return FALSE;    }  return TRUE;}