Patch level : 12.0 1096

Files correlati     : li0.exe
Commento        :

Crorretta la ricostruzione plafond.
This commit is contained in:
Alessandro Bonazzi 2021-11-12 15:33:49 +01:00
parent dff3992be7
commit a97a79aac6
8 changed files with 98 additions and 40 deletions

View File

@ -1701,7 +1701,7 @@ KEY TReport_select::run()
TFilename path = field().get();
if (select_custom_file(path, "rep", _classe))
{
path = path.name();
path = path.name();
path.ext("");
field().set(path);
}
@ -1712,14 +1712,37 @@ KEY TReport_select::run()
bool TReport_select::check(CheckTime ct)
{
TFilename name = field().get();
if (ct != STARTING_CHECK && name.empty() &&
field().check_type() == CHECK_REQUIRED)
return false;
if (ct == STARTING_CHECK || ct == FINAL_CHECK)
{
if (name.empty())
{
TString_array reps;
bool ok = true;
list_custom_files("rep", _classe, reps);
if (reps.items() > 0)
field().set(((TToken_string &)reps[0]).get(0));
else
field().set("");
}
if (ct == FINAL_CHECK && field().get().empty())
return false;
}
if (field().roman()) // Must exist
ok = name.custom_path();
return ok;
return name.custom_path();
return true;
}
void TReport_select::set_report_class(const char * classe)
{
TString_array reps;
_classe = classe;
list_custom_files("rep", _classe, reps);
if (reps.items())
field().set(reps[0]);
else
field().set("");
}
///////////////////////////////////////////////////////////

View File

@ -83,6 +83,7 @@ protected:
// @access Public Memeber
public:
virtual bool is_kind_of(word cid) const { return cid == CLASS_LIST_BUTTON; }
// @cmember Legge dal file gli item dello sheet
void parse_item(TScanner& scanner);
@ -157,6 +158,7 @@ protected:
// @access Public Member
public:
virtual bool is_kind_of(word cid) const { return cid == CLASS_BROWSE_BUTTON; }
// @cmember Modifica il display
void custom_display();
@ -317,6 +319,8 @@ protected:
virtual TCursor& cursor();
public:
virtual bool is_kind_of(word cid) const { return cid == CLASS_FBROWSE_BUTTON; }
virtual bool check(CheckTime = RUNNING_CHECK);
virtual KEY run();
virtual long find(const TString& val);
@ -332,6 +336,7 @@ protected:
virtual TCursor& cursor();
public:
virtual bool is_kind_of(word cid) const { return cid == CLASS_ABROWSE_BUTTON; }
virtual KEY run();
TAlternative_browse(TEdit_field* ef, int altkey);
@ -343,6 +348,7 @@ class TFile_select : public TBrowse_button
TFilename _filter;
public:
virtual bool is_kind_of(word cid) const { return cid == CLASS_FSELECT_BUTTON; }
// @cmember Controlla la sintassi della input del campo e ne setta i membri
virtual void parse_input(TScanner& scanner);
@ -363,6 +369,7 @@ public:
class TDir_select : public TBrowse_button
{
public:
virtual bool is_kind_of(word cid) const { return cid == CLASS_DSELECT_BUTTON; }
// @cmember Controlla la sintassi della input del campo e ne setta i membri
virtual void parse_input(TScanner& scanner);
@ -384,7 +391,9 @@ class TReport_select : public TBrowse_button
{
TString _classe;
public:
virtual bool is_kind_of(word cid) const { return cid == CLASS_RSELECT_BUTTON; }
// @cmember Controlla la sintassi della input del campo e ne setta i membri
virtual void parse_input(TScanner& scanner);
@ -398,6 +407,9 @@ public:
virtual bool is_filesel() const { return true; }
void set_report_class(const char * classe);
const TString & get_report_class() const { return _classe; }
TReport_select(TEdit_field* ef, const char* classe);
virtual ~TReport_select() { }
};
@ -413,6 +425,7 @@ protected:
virtual void parse_output(TScanner& scanner);
public:
virtual bool is_kind_of(word cid) const { return cid == CLASS_PSELECT_BUTTON; }
virtual KEY run();
// @cmember Controlla la validita' del campo

View File

@ -60,6 +60,14 @@
#define CLASS_MVC_FIELD 256
#define CLASS_TREELIST_FIELD 257
#define CLASS_METROLIST_FIELD 258
#define CLASS_LIST_BUTTON 259
#define CLASS_BROWSE_BUTTON 260
#define CLASS_FBROWSE_BUTTON 261
#define CLASS_ABROWSE_BUTTON 262
#define CLASS_FSELECT_BUTTON 263
#define CLASS_DSELECT_BUTTON 264
#define CLASS_RSELECT_BUTTON 265
#define CLASS_PSELECT_BUTTON 265
#define CLASS_TOOL_FIELD 280
#define CLASS_BUTTON_TOOL 281

View File

@ -55,6 +55,8 @@
#define DLG_EXPORT_PDF 51 /* TAG del bottone Esporta un pdf */
#define DLG_EXPORT_DBF 52 /* TAG del bottone Esporta in dbf */
#define DLG_EXPORT_TEXT 53 /* TAG del bottone Esporta un testo */
#define DLG_OUTPUT 54 /* TAG del campo <output> */
#define DLG_REPORT 55 /* TAG del campo <report> */
#define DLG_USER 100 /* TAG del primo controllo definito dall'utente */

View File

@ -289,11 +289,15 @@ public:
{ return (TMask_field&)_field[i]; }
// @cmember Ritorna il campo contraddistinto dall'identificatore passato
TMask_field& field(short id) const;
// @cmember Ritorna il campo corrispondente ad id se c'e'
TMask_field* find_by_id(short id) const;
// @cmember Ritorna il campo corrispondente ad id se c'e'
TMask_field* find_by_id(short id) const;
// @cmember esiste il campo corrispondente ad id ?
bool exist(short id) const { return find_by_id(id) != nullptr; }
// @cmember Ritorna il campo corrispondente al FIELD fieldname
TMask_field* find_by_fieldname(const char* fieldname) const;
// @cmember Ritorna il campo di edit contraddistinto dall'identificatore passato
// @cmember Ritorna il campo corrispondente al FIELD fieldname
bool exist(const char* fieldname) const { return find_by_fieldname(fieldname) != nullptr; }
// @cmember Ritorna il campo di edit contraddistinto dall'identificatore passato
TEdit_field& efield(short id) const;
// @cmember Ritorna il campo listbox contraddistinto dall'identificatore passato
TList_field& lfield(short id) const;

View File

@ -2811,9 +2811,11 @@ bool TEdit_field::on_key(KEY key)
{
ok = !(check_type() == CHECK_REQUIRED && empty());
// check consistency
if (!ok && _browse != nullptr && _browse->is_kind_of(CLASS_RSELECT_BUTTON))
ok = true;
if (ok && _browse)
{
if (browse())
if (browse() && !_browse->is_kind_of(CLASS_RSELECT_BUTTON))
{
if (ok && check_enabled() && vf != 21) // 21 = NOT_EMPTY_CHECK_FIELD
{

View File

@ -1,3 +1,4 @@
#include <modaut.h>
#include <repapp.h>
#include <utility.h>
@ -8,7 +9,7 @@
bool TReport_application::create()
{
bool ok = user_create();
bool ok = user_create();
if (ok)
return TSkeleton_application::create();
return false;
@ -94,7 +95,7 @@ void TReport_application::execute_print(TReport_book & book, TAutomask & mask, T
book.add(rep, type);
}
TTrec * TReport_application::get_dbase_recdesc(TReport & rep)
TTrec * TReport_application::get_dbase_recdesc(TReport & rep, const TAutomask & mask)
{
TTrec * desc = new TTrec;
TReport_section * head = rep.find_section('H', 0);
@ -167,12 +168,25 @@ void TReport_application::main_loop()
{
TAutomask & m = get_mask();
KEY k;
bool has_rs = main_app().has_module(RSAUT, CHK_DONGLE);
if (m.exist(DLG_EXPORT))
m.enable(DLG_EXPORT, has_rs);
if (m.exist(DLG_EXPORT_EXCEL))
m.enable(DLG_EXPORT_EXCEL, has_rs);
if (m.exist(DLG_EXPORT_PDF))
m.enable(DLG_EXPORT_PDF, has_rs);
if (m.exist(DLG_EXPORT_DBF))
m.enable(DLG_EXPORT_DBF, has_rs);
if (m.exist(DLG_EXPORT_TEXT))
m.enable(DLG_EXPORT_TEXT, has_rs);
if (m.exist(DLG_OUTPUT))
m.show(DLG_OUTPUT, has_rs);
while ((k = m.run()) != K_QUIT)
{
TReport & rep = get_report(m);
TReport_book b(title());
TFilename name = get_filename(rep);
TFilename name = get_output_filename(m, rep);
bool ask_filename = name.blank();
export_type type = _export_printer;
@ -217,7 +231,7 @@ void TReport_application::main_loop()
b.export_text(name, false, true, ask_filename);
break;
case K_DBF :
b.export_dbase(name, false, get_dbase_recdesc(rep), true, ask_filename);
b.export_dbase(name, false, get_dbase_recdesc(rep, m), true, ask_filename);
break;
case K_VISUALIZE:
b.preview();
@ -228,19 +242,12 @@ void TReport_application::main_loop()
}
}
const char * TReport_application::get_filename(const TReport & rep)
const char * TReport_application::get_output_filename(const TAutomask & mask, const TReport & rep)
{
short id = output_id();
TFilename output;
if (id > 0)
output = get_mask().get(id);
else
TFilename output = get_mask().get(output_id());
if (output.blank())
output.tempdir();
output.add(output_name(rep));
TString & str = get_tmp_string(output.len());
str = output;
return str;
output.add(output_name(mask, rep));
return get_tmp_string() = output;
}

View File

@ -23,13 +23,9 @@
//
// @base public | TApplication
class TReport_application : public TSkeleton_application
// @author:(INTERNAL) Guido
// @access:(INTERNAL) Private Member
{
private:
virtual bool create();
virtual bool destroy();
@ -39,10 +35,8 @@ protected: // TApplication
virtual bool firm_change_enabled() const { return true; }
// @cmember Aggiorna i limiti di ricerca sul cambio ditta
virtual void on_firm_change() { return TApplication::on_firm_change(); }
// @cmember Ritorna il report
virtual TReport & get_report(const TAutomask & m) pure;
// @cmember Alloca e ritorna il report una volta usato va distrutto;
virtual TTrec * get_dbase_recdesc(TReport & rep);
virtual TTrec * get_dbase_recdesc(TReport & rep, const TAutomask & mask);
// @cmember Ciclo principale
virtual void main_loop();
// @cmember Inizializzazione dei dati dell'utente
@ -51,16 +45,21 @@ protected: // TApplication
virtual bool user_destroy() { return true; }
// @cmember ritorna la maschera
virtual TAutomask & get_mask() pure;
// @cmember Ritorna il report
virtual TReport & get_report(const TAutomask & m) pure;
void ini2mask(TConfig& ini, TMask& m, bool query);
void mask2ini(const TMask& m, TConfig& ini);
virtual void execute_print(TReport_book & book, TAutomask & mask, TReport & rep, export_type type = _export_printer);
public:
virtual const char * title() const { return "Report application"; }
virtual short output_id() const { return 0; }
virtual const char * output_name(const TReport & rep) const { return rep.filename().name_only(); }
const char * get_filename(const TReport & rep);
virtual const char * title() const { return title(); }
virtual short output_id() const { return DLG_OUTPUT; }
virtual short report_id() const { return DLG_REPORT; }
const char * report_name(const TAutomask & mask) const { return mask.get(report_id()); }
const char * output_name(const TAutomask & mask, const TReport & rep) const { return report_name(mask); }
const char * get_output_filename(const TAutomask & mask, const TReport & rep);
// @cmember Costruttore
TReport_application() { }
// @cmember Distruttore