home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / files / program / rs2lang / exemple.c next >
Encoding:
C/C++ Source or Header  |  1993-10-23  |  2.3 KB  |  78 lines

  1. #include <stdio.h>
  2. #include <stddef.h>
  3. #include <gemfast.h>
  4. #include <osbind.h>
  5. #include <ctype.h>
  6. #include <types.h>
  7.  
  8. #include "ressourc.h"
  9. #include "ressourc.c"
  10.  
  11. char *reso[] = {
  12.   "[3][| haute ou moyenne | rĂ©solution seulement !][ArrĂȘt]",
  13.   "[3][| high or medium | resolution only ! ][ abort ]",
  14.   "[3][| high or medium | resolution only ! ][ abort ]"  } ;
  15. char *lico[] = {
  16.   "[1][| Aimez-vous les arbres ? |][ retourne ]",
  17.   "[1][| Do you like trees ? |][ return ]",
  18.   "[1][| Do you like trees ? |][ Ende ]" } ;
  19.  
  20. int xd, yd, wd, hd, itemh ;
  21. int savrez, phys_handle ;
  22. long _STKSIZ = 1000 ;
  23.  
  24. do_fenetre(ai,ax,ay,aw,ah)     /* ouverture d'une fenetre */
  25. int *ax,*ay,*aw,*ah ;
  26. OBJECT *ai ;
  27. {
  28.    form_center(ai, ax, ay, aw, ah ) ;             /* centre le dialogue */
  29.    form_dial(FMD_START,0,0,0,0,*ax,*ay,*aw,*ah);  /* reserve screen ram */
  30.    objc_draw(ai,0,10,*ax,*ay,*aw,*ah) ;           /* dessine dialogue   */
  31. }
  32.  
  33.  
  34. do_dialog()                    /*   dessine et gere le dialogue  */
  35. {
  36.       int nlii ;
  37.       char debgr ;
  38.  
  39.       do_fenetre(&rs_ob[ARBRE1], &xd, &yd, &wd, &hd) ;
  40.       while ((itemh = form_do(&rs_ob[ARBRE1],-1 )) != FINI )
  41.         {
  42.           objc_change(&rs_ob[ARBRE1],itemh,0,xd,yd,wd,hd,0,0) ;
  43.           form_dial(FMD_FINISH,0,0,0,0,xd,yd,wd,hd);
  44.           switch (itemh) {
  45.           case LANGUE :  nxt_lg() ;
  46.                          break ;
  47.           case ICONE  :  form_alert( 1, lico[lang] ) ;
  48.           default     :  break ;
  49.           }
  50.           do_fenetre(&rs_ob[ARBRE1], &xd, &yd, &wd, &hd) ;
  51.         }
  52.       objc_change(&rs_ob[ARBRE1],itemh,0,xd,yd,wd,hd,0,0) ;
  53.       form_dial(FMD_FINISH,0,0,0,0, xd,yd,wd,hd);  /* libere screen ram */   
  54.       return itemh;
  55. }
  56.  
  57.  
  58. /*   main - starts the application. */
  59.  
  60. main()
  61. {
  62.       int  dummy, key ;
  63.               
  64.       appl_init();                              /* init application */
  65.       lang = 0 ;
  66.       if ((savrez = Getrez()) != 0 )            /* test resolution  */
  67.          { 
  68.          met_rsc() ;                             /* init ressources  */
  69.          phys_handle = graf_handle(&dummy, &dummy, &dummy, &dummy);
  70.          graf_mouse(ARROW, NULL);
  71.          do_dialog();
  72.          }
  73.       else
  74.          form_alert( 1, reso[lang] ) ;
  75.       appl_exit();
  76. }
  77.  
  78.