/******************************************************************************/
/*                                                                            */
/*  DLG_PRNT - external callees and dialog callbacks for printing             */
/*                                                                            */
/******************************************************************************/

#define STRICT
#include <windows.h>
#include <commctrl.h>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <ctype.h>
#include "const.h"
#include "classes.h"
#include "funcdefs.h"
#include "blocks.rh"
#include "extern.h"

extern "C"

INT_PTR CALLBACK DialogPrintParams ( HWND hdwnd , UINT message ,
                                     WPARAM wParam , LPARAM /* lParam */ )
{
   int id ;
   switch ( message ) {
      
      case WM_INITDIALOG:
         SetDlgItemInt ( hdwnd , IDC_PRINT_FRACTION ,
                         print_params.fraction , FALSE ) ;
         SetDlgItemInt ( hdwnd , IDC_PRINT_VERTICAL_SCALING ,
                         print_params.vert_scaling , FALSE ) ;
         return TRUE ;
         
      case WM_COMMAND:
         id = LOWORD ( wParam ) ;
         switch ( id ) {
            case IDOK:
               print_params.fraction = GetDlgItemInt (
                  hdwnd , IDC_PRINT_FRACTION , NULL , FALSE ) ;
               print_params.vert_scaling = GetDlgItemInt (
                  hdwnd , IDC_PRINT_VERTICAL_SCALING , NULL , FALSE ) ;
               EndDialog ( hdwnd , TRUE ) ;
               return TRUE ;  // Tell Windows we processed this message
            case IDCANCEL:
               EndDialog ( hdwnd , FALSE ) ;
               return TRUE ;  // Tell Windows we processed this message
            }
      }
      
   return FALSE ;  // Tell Windows we did not process this message
}
