// 776400.cpp - Selezione parametri di stampa
#include <confapp.h>
#include <mask.h>
#include <isam.h>
#include <sheet.h>
#include <prefix.h>  
#include <lffiles.h>  
#include <utility.h>  

#include "776400a.h"
#include "77lib.h"     

class TPar_Stampa : public TConfig_application
{
    TString16       _section;
    TConfig*        _user_cnf, * _studio_cnf;
    
  public:
//  virtual bool preprocess_config  (TMask& mask, TConfig& config);
//  virtual bool postprocess_config (TMask& mask, TConfig& config);
//  virtual bool postprocess_config_changed(const char* par, const char* var,const char* oldv, const char* newv);

    virtual bool user_create(); 
    virtual bool user_destroy();

    TPar_Stampa() : TConfig_application(CONFIG_USER) {}
    virtual ~TPar_Stampa() {}
};

HIDDEN TPar_Stampa& app() { return (TPar_Stampa&) main_app(); }

bool TPar_Stampa::user_create()
{
  const char* edit_mask = "776400a";
  _section = name(); 
  _section.cut(2); 

// Configurazioni
  _user_cnf = new TConfig(CONFIG_USER, _section);
  _user_cnf->get("EdMask", _section, -1, edit_mask);

  _studio_cnf = new TConfig(CONFIG_STUDIO);  

  return TRUE;
}

bool TPar_Stampa::user_destroy()
{
  delete _user_cnf;
  delete _studio_cnf;
  return TRUE;
}

/* 
bool TPar_Stampa::postprocess_config (TMask& m, TConfig& config)
{ 
  if (m.last_key() == K_ENTER)
  { 
// Registro i parametri di stampa nei parametri utente
   
    bool stampa_su_modulo = m.get_bool(F_MODULO);  
    _user_cnf->set(ST_MODULO, stampa_su_modulo);
    
    bool stampa_data_modulo = m.get_bool(F_DATA);  
    _user_cnf->set(ST_DATA, stampa_data_modulo);
    
    bool stampa_doc = m.get_bool(F_DOCUMENTI);  
    _user_cnf->set(ST_DOC, stampa_doc);
  }
  return TRUE;
}
*/

int ParametriStampa(int argc, char* argv[])
{
  TPar_Stampa app;
  app.run(argc, argv, "Parametri di stampa");
  return 0;
}

