Patch level : 2.1 88

Files correlati     : ba8.exe
Ricompilazione Demo : [ ]
Commento            :

Corretto inserimento sezioni di raggruppamento


git-svn-id: svn://10.65.10.50/trunk@12251 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2004-07-21 10:53:10 +00:00
parent 8839356d80
commit 76b5f2f519
3 changed files with 18 additions and 10 deletions

View File

@ -582,8 +582,8 @@ void TSection_properties_mask::vedo_non_vedo()
{
const char type = get(F_TYPE)[0];
const int level = get_int(F_LEVEL);
show(F_X, level == 0 && type != 'H');
show(F_Y, level == 0 && type != 'H');
const bool can_pos = (type != 'H' && level == 0) || (type == 'F' && level == 1);
show(F_X, can_pos); show(F_Y, can_pos);
show(F_CONDITION, type == 'B' && level > 0);
show(F_GROUP_BY, type == 'H' && level > 1);
show(F_KEEP_WITH_NEXT, level > 1 && type == 'H');
@ -621,7 +621,9 @@ void TSection_properties_mask::set_section(const TReport_section& rs)
set(F_TYPE, s);
set(F_LEVEL, rs.level());
if (rs.level() == 0)
vedo_non_vedo();
if (field(F_X).active())
{
set_num(F_X, rs.pos().x);
set_num(F_Y, rs.pos().y);
@ -648,12 +650,11 @@ void TSection_properties_mask::set_section(const TReport_section& rs)
set(F_PRESCRIPT, rs.prescript());
set(F_POSTSCRIPT, rs.postscript());
vedo_non_vedo();
}
void TSection_properties_mask::get_section(TReport_section& rs) const
{
if (rs.level() == 0)
if (field(F_X).active())
{
const TPoint pos(get_num(F_X), get_num(F_Y));
rs.set_pos(pos);
@ -768,7 +769,7 @@ protected:
void add_field();
void edit_field(TReport_field& rf);
void fields_properties();
void add_section();
bool add_section();
void section_properties();
void report_properties();
@ -910,7 +911,7 @@ bool TReport_mask::load_report()
bool TReport_mask::delete_report()
{
TFilename path; get_rep_path(path);
const bool ok = yesno_box(FR("Si desidera eliminare il file %s"), (const char*)path);
const bool ok = path.exist() && yesno_box(FR("Si desidera eliminare il file '%s'"), (const char*)path);
if (ok)
{
::remove(path);
@ -922,7 +923,9 @@ bool TReport_mask::delete_report()
void TReport_mask::on_print()
{
#ifdef DBG
TReport_book book("ba8300.txt");
TFilename tmp; tmp.tempdir();
tmp.add("ba8300.txt");
TReport_book book(tmp);
#else
TReport_book book;
#endif
@ -1108,7 +1111,7 @@ void TReport_mask::fields_properties()
}
}
void TReport_mask::add_section()
bool TReport_mask::add_section()
{
TMask m(TR("Nuova sezione"), 1, 32, 5);
m.add_radio(101, 0, "", 1, 0, 22, "H|B", TR("Raggruppamento|Corpo alternativo"), "");
@ -1131,11 +1134,14 @@ void TReport_mask::add_section()
{
_tree.goto_node(type, level);
tfield(F_SECTIONS).select_current();
_curr_section = &_report.section(type, level);
section_properties();
return true;
}
else
error_box(TR("Livello non ammesso: %d"), level);
}
return false;
}
void TReport_mask::section_properties()

View File

@ -75,7 +75,6 @@ BEGIN
FLAGS "H"
END
MEMO F_CONDITION 48 3
BEGIN
// Visibile sezioni con livello > 0

View File

@ -433,6 +433,7 @@ void TReport_window::offset_selection(const TPoint& p)
if (f.selected())
f.offset(p);
}
rs.sort();
}
void TReport_window::resize_selection(const TPoint& p)
@ -577,6 +578,8 @@ bool TReport_window::on_key(KEY k)
}
break;
default:
if (k > K_CTRL) // Gestione acceleratori
dispatch_e_char(parent(), k);
break;
}
return TField_window::on_key(k);