Everyfink is now working

git-svn-id: svn://10.65.10.50/trunk@2359 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
villa 1995-12-28 10:31:20 +00:00
parent 3d2f9a8ec4
commit c6f7fdfff1
3 changed files with 37 additions and 14 deletions

View File

@ -841,12 +841,12 @@ void TForm_item::read_from(TToken_string& s)
_x = _section->columnwise() ? s.get_int(col_id - 101) : s.get_int(xps_id - 101);
_y = _section->columnwise() ? s.get_int(len_id - 101) : s.get_int(yps_id - 101);
_ofs = s.get_int(spc_id - 101);
_flag.set_shown(s.get(prn_id - 101) != "X");
_flag.set_shown(s.get(prn_id - 101)[0] != 'X');
if (_section->columnwise())
{
_flag.set_finkl(s.get(fnl_id - 101) != "X");
_flag.set_finkr(s.get(fnr_id - 101) != "X");
_flag.set_finkl(s.get(fnl_id - 101)[0] != 'X');
_flag.set_finkr(s.get(fnr_id - 101)[0] != 'X');
}
set_dirty();
}
@ -1895,7 +1895,7 @@ TForm_item* TGraphic_section::parse_item(const TString& s)
bool TGraphic_section::update()
{
_back.cut(0);
_back = "";
const bool ok = TPrint_section::update();
printer().setbackground(_back);
return ok;
@ -1951,8 +1951,11 @@ TMask* TPrint_section::_msk = NULL;
TPrint_section::TPrint_section(TForm* f, char st, pagetype pt, bool sub)
: _height(0), _form(f), _sec_type(st), _page_type(pt), _dirty(FALSE),
_subsection(sub), _repeat_count(0), _ofspc(0), _nfld(0), _temp(0)
{ _tab[0] = -1; }
_subsection(sub), _repeat_count(0), _ofspc(0), _nfld(0), _temp(0),
_columnwise(FALSE)
{
reset_tabs();
}
TPrint_section::~TPrint_section()
{
@ -1995,6 +1998,12 @@ TPrintrow& TPrint_section::row(int num)
}
return *pr;
}
void TPrint_section::reset_tabs()
{
for (int i = 0; i < MAXCOLUMNS; i++)
_tab[i] = -1;
}
int TPrint_section::tab(int col)
{
@ -2018,7 +2027,10 @@ int TPrint_section::tab(int col)
// cumulate offsets
for (i = 1; i < _nfld; i++)
_tab[i] += _tab[i-1];
}
}
// se manca la colonna, vai a prendere quella immediatamente prima
while (_tab[col] == -1 && col > 0)
col--;
ret = _tab[col];
}
return ret;
@ -2633,8 +2645,8 @@ bool TPrint_section::edit(const char* title)
if (!_dirty)
for (word j = 0; j < fields(); j++)
_dirty |= field(j).dirty();
_dirty |= field(j).dirty();
set_dirty(_dirty);
return (_dirty || des_dirty);
}
@ -3213,8 +3225,10 @@ long TForm::records() const
bool TForm::genera_fincatura(pagetype p, int y1, int y2, int* rows)
{
const TPrint_section* body = exist('B', p);
TPrint_section* body = exist('B', p);
if (body == NULL) return FALSE;
body->reset_tabs();
bool istemp = exist('G', p) == NULL;
@ -3223,6 +3237,10 @@ bool TForm::genera_fincatura(pagetype p, int y1, int y2, int* rows)
int j = 0, start = 999, end = 0, wlast = 0;
int cols[MAXCOLUMNS];
for (word k = grs->fields(); k > 0; k--)
if (grs->field(k-1).temp())
grs->destroy_field(k-1);
for (int i = 0; i < (int)body->fields(); i++)
{

View File

@ -251,6 +251,7 @@ public:
TPrintrow& row(int num);
TForm& form() const { return *_form; }
TArray& field_array() { return _item; }
TForm_item& field(int n) const { return (TForm_item&)_item[n]; }
TForm_item& find_field(short id) const;
void destroy_field(int n) { _item.destroy(n, TRUE); }
@ -286,7 +287,8 @@ public:
void set_dirty(bool d = TRUE) { _dirty = d; }
bool columnwise() const { return _columnwise; }
// ritorna l'offset della colonna corrispondente se columnwise
int tab(int col);
int tab(int col);
void reset_tabs();
const TPrint_section& operator=(const TPrint_section& ps) { return copy(ps); }
TPrint_section(TForm* parent, char st, pagetype pt, bool subsection = FALSE);

View File

@ -165,9 +165,12 @@ void TPrint_intersector::v_line(int x1, int y1, int len)
void TPrint_intersector::add(TGraphic_shape s, int x1, int y1, int x2, int y2)
{
// rows/columns start at 0
x1 --; y1 --;
x2 --; y2 --;
// rows start at 0
y1 --; y2 --;
// columns pure, ma e' possibile che siano gia' 0 se la generazione
// e' stata automatica (colonna 1. campo - 1)
if (x1 > 0) x1 --;
if (x2 > 0) x2 --;
switch (s)
{