Form: aggiunta gestione caratteri fincatura

Window/maskfld: corretti errori line() e aggiunto flag allow_pipe nei field


git-svn-id: svn://10.65.10.50/trunk@2184 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
villa 1995-11-21 10:39:05 +00:00
parent 46ac5f6729
commit 97e7c05bbc
5 changed files with 46 additions and 6 deletions

View File

@ -2159,6 +2159,10 @@ bool TForm::parse_general(TScanner &scanner)
_fpx = scanner.integer();
}
else scanner.push();
if (scanner.popkey() == "GR") // Carattere di posizionamento
_fink = scanner.string();
else scanner.push();
extended_parse_general(scanner); // Parse non-standard parameters
}
@ -2178,7 +2182,8 @@ void TForm::print_general(ostream& out) const
out << " CARATTERE \"" << _char_to_pos << "\"\n" ;
out << " INIZIO_POS " << _ipx << " " << _ipy << "\n";
out << " FINE_POS " << _fpx << "\n";
}
}
out << " GRID \"" << (const char*)_fink << "\"\n";
out << "END\n" << endl;
}
@ -2698,7 +2703,7 @@ TForm::TForm(const char* name, const char* code, int lev, const char* desc)
: _name(name), _code(code), _relation(NULL), _cursor(NULL), _rel_desc(NULL),
_isnew(FALSE), _editlevel(lev), _desc(desc), _fontname("Roman 17cpi"),
_fontsize(12), _x(0), _y(0), _char_to_pos('\0'), _ipx(0), _ipy(0), _fpx(0),
_arrange(TRUE), _dirty(FALSE)
_arrange(TRUE), _fink("+,+,+,+,+,+,+,+,+,-,|",','), _dirty(FALSE)
{
main_app().begin_wait();

View File

@ -118,12 +118,16 @@ class TForm : public TObject
bool _arrange; // if TRUE perform arranging every time
int _editlevel; // Edit permission
TString _desc; // form description
TToken_string _fink; // finkatur characters
TPrint_section* exist(char s, pagetype t, bool create = FALSE); // Can be NULL
static void header_handler(TPrinter& p);
static void footer_handler(TPrinter& p);
TToken_string& get_fincatura() { return _fink; }
void set_fincatura(const char* s) { _fink = s; }
protected:
// H = Header, B = Body, F = Footer, R = Relation
TPrint_section& section(char s = 'B', word page = 1);
@ -155,8 +159,14 @@ protected:
virtual word set_footer(word p, bool u);
public:
bool print(long from = 0L, long to = -1L);
TArray& body() { return _body; }
TArray& head() { return _head; }
TArray& foot() { return _foot; }
TArray& back() { return _back; }
const TString& name() const { return _name; }
const TString& code() const { return _code; }
@ -181,6 +191,19 @@ public:
bool dirty() const { return _dirty; }
void set_dirty(bool d = TRUE) { _dirty = d; }
void set_arrange(bool arng = TRUE) { _arrange = arng ; }
// fincazione
char f_topleft() { return _fink.get_char(0); }
char f_topmiddle() { return _fink.get_char(1); }
char f_topright() { return _fink.get_char(2); }
char f_botleft() { return _fink.get_char(3); }
char f_botmiddle() { return _fink.get_char(4); }
char f_botright() { return _fink.get_char(5); }
char f_centerleft() { return _fink.get_char(6); }
char f_centermiddle() { return _fink.get_char(7); }
char f_centerright() { return _fink.get_char(8); }
char f_horizontal() { return _fink.get_char(9); }
char f_vertical() { return _fink.get_char(10); }
// if code == NULL it's a base form
// otherwise it's integrated by a file definition

View File

@ -42,6 +42,7 @@ TMask_field::TField_Flags::TField_Flags()
firm = ghost = FALSE;
password = FALSE;
trim = TRUE;
pipeallowed = FALSE;
}
// Certified 100%
@ -2167,8 +2168,11 @@ const char* TEdit_field::format(const char* d) const
if (_flags.uppercase)
fpark.upper();
for (int p = 0; fpark[p]; p++)
if (fpark[p] == '|') fpark[p] = '/';
if (!_flags.pipeallowed)
{
for (int p = 0; fpark[p]; p++)
if (fpark[p] == '|') fpark[p] = '/';
}
}
return fpark;

View File

@ -115,6 +115,7 @@ protected:
bool uppercase : 1;
bool exchange : 1; // Value exchange
bool zerofilled : 1;
bool pipeallowed : 1;
TField_Flags();
char update(const char*);
@ -204,6 +205,13 @@ public:
bool right_justified() const
{ return _flags.rightjust; }
// @cmember Verifica la alloowance of the pipe
bool pipe_allowed() const
{ return _flags.pipeallowed; }
// @cmember Allowa la pippa
void allow_pipe(bool r = TRUE)
{ _flags.pipeallowed = r; }
// @cmember Ritorna il nome della classe
virtual const char* class_name() const;

View File

@ -930,8 +930,8 @@ void TWindow::line(short x0, short y0, short x1, short y1)
if (t.v == 0) t.v = -CHARY; else t.v += CHARY>>1;
#endif
xvt_dwin_draw_set_pos(_win, f);
xvt_dwin_draw_line(_win, t);
xvt_dwin_draw_set_pos(win(), f);
xvt_dwin_draw_line(win(), t);
}
void TWindow::icon(short x0, short y0, int iconid)