home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / biology / gsrc208a.zip / EDREPORT.C < prev    next >
C/C++ Source or Header  |  1992-12-05  |  3KB  |  90 lines

  1. #include "copyleft.h"
  2.  
  3. /*
  4.     GEPASI - a simulator of metabolic pathways and other dynamical systems
  5.     Copyright (C) 1989, 1992  Pedro Mendes
  6. */
  7.  
  8. /*************************************/
  9. /*                                   */
  10. /*         GWSIM - Simulation        */
  11. /*        MS-WINDOWS front end       */
  12. /*                                   */
  13. /*           Report Options          */
  14. /*             dialog box            */
  15. /*                                   */
  16. /*           QuickC/WIN 1.0          */
  17. /*                                   */
  18. /*   (include here compilers that    */
  19. /*   compiled GWSIM successfully)    */
  20. /*                                   */
  21. /*************************************/
  22.  
  23.  
  24. #include <windows.h>
  25. #include <string.h>
  26. #include "defines.h"                    /* symbols also used in .DLG files        */
  27. #include "globals.h"                    /* gepasi's own symbols                    */
  28. #include "gwsim.h"                        /* macros, function prototypes, etc.    */
  29. #include "gep2.h"                        /* gepasi's variables                    */
  30. #include "simgvar.h"                    /* global variables                        */
  31.  
  32. #pragma alloc_text( CODE5, EdReport)
  33.  
  34. BOOL FAR PASCAL EdReport(HWND hDlg, WORD message, WORD wParam, LONG lParam)
  35. {
  36.  static HWND hStruct, hStab, hStdCC, hNonCC, hStdEla, hNonEla;
  37.  
  38.  switch( message )
  39.  {
  40.   case WM_INITDIALOG:
  41.    /* get handles to the check boxes                                */
  42.    hStruct = GetDlgItem( hDlg, IDC_STRUCT );
  43.    hStab   = GetDlgItem( hDlg, IDC_STAB );
  44.    hStdCC  = GetDlgItem( hDlg, IDC_MCA1 );
  45.    hNonCC  = GetDlgItem( hDlg, IDC_MCA2 );
  46.    hStdEla = GetDlgItem( hDlg, IDC_MCA3 );
  47.    hNonEla = GetDlgItem( hDlg, IDC_MCA4 );
  48.  
  49.    /* fill in the current set of options                            */
  50.    SendMessage( hStruct, BM_SETCHECK, (WORD) options.structan, 0 );
  51.    SendMessage( hStab, BM_SETCHECK, (WORD) options.staban, 0 );
  52.    SendMessage( hStdCC, BM_SETCHECK, (WORD) options.stdcc, 0 );
  53.    SendMessage( hNonCC, BM_SETCHECK, (WORD) options.noncc, 0 );
  54.    SendMessage( hStdEla, BM_SETCHECK, (WORD) options.stdela, 0 );
  55.    SendMessage( hNonEla, BM_SETCHECK, (WORD) options.nonela, 0 );
  56.  
  57.    return TRUE;
  58.  
  59.   case WM_COMMAND:
  60.    switch( wParam )
  61.    {
  62.     case IDC_HELP:            /* Help on this Dialog Box                */
  63.         WinHelp( hDlg, (LPSTR) szHelpFile, HELP_KEY, (DWORD) (LPSTR) "Report options" );
  64.      break;
  65.  
  66.     case IDOK:
  67.      /* read all variables from the controls        */
  68.      options.structan = (int) SendMessage( hStruct, BM_GETCHECK, 0, 0 );
  69.      options.staban      = (int) SendMessage( hStab, BM_GETCHECK, 0, 0 );
  70.      options.stdcc      = (int) SendMessage( hStdCC, BM_GETCHECK, 0, 0 );
  71.      options.noncc      = (int) SendMessage( hNonCC, BM_GETCHECK, 0, 0 );
  72.      options.stdela      = (int) SendMessage( hStdEla, BM_GETCHECK, 0, 0 );
  73.      options.nonela      = (int) SendMessage( hNonEla, BM_GETCHECK, 0, 0 );
  74.  
  75.      /* signal that changes were made                */
  76.      notsaved = 1;
  77.  
  78.      /* close the dialog box and return                */
  79.      EndDialog( hDlg, IDOK );
  80.      return TRUE;
  81.  
  82.     case IDCANCEL:
  83.      /* close the dialog box and return            */
  84.      EndDialog( hDlg, IDCANCEL );
  85.      return TRUE;
  86.    }
  87.  
  88.   default: return FALSE;
  89.  }
  90. }