96 lines
		
	
	
		
			2.0 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			96 lines
		
	
	
		
			2.0 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
// Handler di marco sui campi delle maschere
 | 
						|
#ifndef __CHECKS_H
 | 
						|
#include <checks.h>
 | 
						|
#endif
 | 
						|
 | 
						|
#ifndef __MASK_H
 | 
						|
#include <mask.h>
 | 
						|
#endif
 | 
						|
 | 
						|
#ifndef __MASKFLD_H
 | 
						|
#include <maskfld.h>
 | 
						|
#endif
 | 
						|
 | 
						|
#ifndef __KEYS_H
 | 
						|
#include <keys.h>
 | 
						|
#endif
 | 
						|
 | 
						|
#ifndef __STRINGS_H
 | 
						|
#include <strings.h>
 | 
						|
#endif
 | 
						|
 | 
						|
#ifndef __VEUML_H
 | 
						|
#include "VeUML.h"
 | 
						|
#endif
 | 
						|
 | 
						|
#ifndef __VEUML1_H
 | 
						|
#include "VeUML1.h"
 | 
						|
#endif
 | 
						|
 | 
						|
#ifndef __VE0100C_H
 | 
						|
#include "ve0100c.h"
 | 
						|
#endif
 | 
						|
 | 
						|
bool    ora_hndl(TMask_field& field, KEY key)
 | 
						|
{
 | 
						|
  if (key == K_TAB)
 | 
						|
  {
 | 
						|
    if (field.to_check(key))
 | 
						|
    {
 | 
						|
      TFixed_string ora(field.get(),6);
 | 
						|
      ora.trim();
 | 
						|
      if (ora.not_empty() || field.required())
 | 
						|
      {
 | 
						|
        //                              bool changed = FALSE;
 | 
						|
        if (isdigit(ora[0]))
 | 
						|
        {
 | 
						|
          if (ora[2] != ':')
 | 
						|
          {
 | 
						|
            if (ora.len()>4) ora.overwrite(":",2);
 | 
						|
            else ora.insert(":", 2);
 | 
						|
            //                                          changed = TRUE;
 | 
						|
          }
 | 
						|
        }
 | 
						|
        bool ok;
 | 
						|
        ok = ((isdigit(ora[0]))&&(isdigit(ora[1]))&&(isdigit(ora[3]))&&(isdigit(ora[4])));
 | 
						|
        ok &= ((atoi(&(ora[0]))<24)&&(atoi(&(ora[3]))<60));
 | 
						|
        if (!ok)
 | 
						|
        {
 | 
						|
          error_box("Ora errata o formato non valido");
 | 
						|
          return FALSE;
 | 
						|
        }
 | 
						|
        else    /* if (changed) */
 | 
						|
        {
 | 
						|
          field.set((ora));
 | 
						|
          //                                                    field.picture_data((ora),TRUE);
 | 
						|
          //                                                    field.picture_data((ora.strip(":")),FALSE);
 | 
						|
        }
 | 
						|
      }
 | 
						|
    }
 | 
						|
  }
 | 
						|
  return TRUE;
 | 
						|
}
 | 
						|
 | 
						|
bool    codcli_hndl(TMask_field& field, KEY key)
 | 
						|
{
 | 
						|
  if (key == K_TAB)
 | 
						|
  {
 | 
						|
    if (field.to_check(key))
 | 
						|
    {
 | 
						|
      field.send_key(K_TAB,F_CODVAL);
 | 
						|
      field.send_key(K_TAB,F_CODLIN);
 | 
						|
      field.send_key(K_TAB,F_CODPAG);
 | 
						|
      field.send_key(K_TAB,F_CODABIA);
 | 
						|
      field.send_key(K_TAB,F_CODCABA);
 | 
						|
      field.send_key(K_TAB,F_INDSP);
 | 
						|
    }
 | 
						|
  }
 | 
						|
  return TRUE;
 | 
						|
}
 | 
						|
 | 
						|
bool    dummy_hndl(TMask_field& field, KEY key)
 | 
						|
{
 | 
						|
  warning_box("Al campo %d è arrivato un KEY %d",field.dlg(),key);
 | 
						|
  return TRUE;
 | 
						|
}
 |