Patch level : 10.0

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :
Mostra esempio corretto per campi VALUTA in editor dei form


git-svn-id: svn://10.65.10.50/branches/R_10_00@21150 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2010-11-18 11:53:17 +00:00
parent 425e9e5fea
commit f49dd37cf1
3 changed files with 14 additions and 15 deletions

View File

@ -1419,6 +1419,8 @@ protected: // TForm_string
virtual const char* get() const; virtual const char* get() const;
// @cmember Manda il messaggio al campo <p dest> // @cmember Manda il messaggio al campo <p dest>
virtual void send_message(const TString& cmd, TForm_item& dest) const; virtual void send_message(const TString& cmd, TForm_item& dest) const;
const char* example() const { return "12.345.678,90"; }
public: public:
virtual TObject* dup() const; virtual TObject* dup() const;
virtual TCurrency get_currency() const; virtual TCurrency get_currency() const;
@ -4459,19 +4461,14 @@ bool TForm::write_profile()
sec->print_on(cur); sec->print_on(cur);
sec->set_dirty(FALSE); sec->set_dirty(FALSE);
err = _isnew ? rform.write() : rform.rewrite(); err = _isnew ? rform.write_rewrite() : rform.rewrite_write();
if (err != NOERR)
err = _isnew ? rform.rewrite() : rform.write();
for (word i = 0; i < sec->fields() && err == NOERR; i++) for (word i = 0; i < sec->fields() && err == NOERR; i++)
{ {
TForm_item& fi = sec->field(i); TForm_item& fi = sec->field(i);
if (fi.dirty()) if (fi.dirty())
{ {
fi.print_on(cur); fi.print_on(cur);
err = _isnew ? rform.write() : rform.rewrite(); err = _isnew ? rform.write_rewrite() : rform.rewrite_write();
if (err != NOERR)
err = _isnew ? rform.rewrite() : rform.write();
fi.set_dirty(FALSE); fi.set_dirty(FALSE);
} }
} }

View File

@ -723,7 +723,7 @@ bool TPrint_section::repos_fields(const char* name, int size)
ps.form().fontname() = name; ps.form().fontname() = name;
ps.form().fontsize() = size; ps.form().fontsize() = size;
// Aggiorna lo spreadsheet // Aggiorna lo spreadsheet
TSheet_field& ms = (TSheet_field&)ps._msk->field(F_FIELDS); TSheet_field& ms = ps._msk->sfield(F_FIELDS);
TToken_string tt(128); TToken_string tt(128);
const word flds = ps.fields(); const word flds = ps.fields();
for (word i = 0; i < flds; i++) for (word i = 0; i < flds; i++)
@ -1005,7 +1005,7 @@ bool TPrint_section::detail_field_notify (TSheet_field& s, int r, KEY k)
else else
if (k == K_SPACE) if (k == K_SPACE)
{ {
if (_cur_form && TString(_cur_form->section_mask()).left(2) == "ba") if (_cur_form && TFixed_string(_cur_form->section_mask()).starts_with("ba"))
{ {
TString80 name(s.mask().get(F_FONT)); TString80 name(s.mask().get(F_FONT));
int size = s.mask().get_int(F_SIZE); int size = s.mask().get_int(F_SIZE);
@ -1025,7 +1025,7 @@ bool TPrint_section::detail_field_notify (TSheet_field& s, int r, KEY k)
bool TPrint_section::edit( bool TPrint_section::edit(
const char* title) // @parm Titolo della maschera di edit const char* title) // @parm Titolo della maschera di edit
{ {
const bool is_ba_editor = TString(_form->section_mask()).left(2) == "ba"; const bool is_ba_editor = TFixed_string(_form->section_mask()).starts_with("ba");
bool nstd_dirty = FALSE; bool nstd_dirty = FALSE;
bool font_found = FALSE; bool font_found = FALSE;
@ -1053,7 +1053,7 @@ bool TPrint_section::edit(
} }
else else
_form->pre_edit_checks(m,_cur_sect); _form->pre_edit_checks(m,_cur_sect);
TSheet_field& ms = (TSheet_field&)m.field(F_FIELDS); TSheet_field& ms = m.sfield(F_FIELDS);
m.hide(F_OFSVR);//Offset verticale, per _columnwise. Non ancora usato. m.hide(F_OFSVR);//Offset verticale, per _columnwise. Non ancora usato.
if (_columnwise) if (_columnwise)
@ -1130,7 +1130,7 @@ bool TPrint_section::edit(
bool ok = FALSE; bool ok = FALSE;
while (m.run() != K_ESC) while (m.run() != K_ESC)
{ {
TSheet_field& ms = (TSheet_field&)m.field(F_FIELDS); TSheet_field& ms = m.sfield(F_FIELDS);
const int items = ms.items(); const int items = ms.items();
int i; int i;
@ -1139,8 +1139,10 @@ bool TPrint_section::edit(
TToken_string& tt = ms.row(i); TToken_string& tt = ms.row(i);
ok = tt.get_char(prn_id - 101)==' '; ok = tt.get_char(prn_id - 101)==' ';
} }
if (i==items && !ok) error_box("Selezionare almeno una colonna stampabile."); if (i==items && !ok)
if (ok) break; error_box("Selezionare almeno una colonna stampabile.");
if (ok)
break;
} }
_msk = NULL; _msk = NULL;
if (!ok) return FALSE; if (!ok) return FALSE;

View File

@ -2242,7 +2242,7 @@ int TSystemisamfile::packfile(
int TSystemisamfile::zap() int TSystemisamfile::zap()
{ {
safely_close_closeable_isamfiles(); safely_close_closeable_isamfiles();
return packfile(TRUE, TRUE); return packfile(true, true);
} }
// @doc EXTERNAL // @doc EXTERNAL