mailbox.* Trasformate in TString alcune TString16

mask.h       Aggiunti alcuni cast per eliminare i warning a 32 bit
maskfld.cpp  Aggiunti alcuni cast per eliminare i warning a 32 bit
msksheet.cpp Corretta gestione campi di tipo checkbox


git-svn-id: svn://10.65.10.50/trunk@6351 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1998-03-13 10:31:30 +00:00
parent 138208fcc9
commit e9ba8ee47e
6 changed files with 26 additions and 15 deletions

View File

@ -10,14 +10,24 @@
TMessage::TMessage(const char* to, const char* sub,
const char* text, const char* from)
{
TString80 rec(to);
TString rec(to);
if (rec.not_empty() && (rec.len() != 6 || rec.strip(" -") != to))
rec = cmd2name(to);
_to = rec;
_subject = sub;
_text = text;
_from = (from == NULL || *from == '\0') ? main_app().name() : from;
_flags = 0x00; // _number = -1;
rec = from;
if (rec.not_empty())
{
if (rec.len() != 6 || rec.strip(" -") != from)
rec = cmd2name(from);
}
else
rec = main_app().name();
_from = rec;
_flags = 0x00;
}
void TMessage::send()
@ -156,11 +166,12 @@ void TMailbox::send(TMessage& m)
// strcpy(to_path, getenv("TMPDIR") == NULL ? MAILDIR : getenv("TMPDIR"));
TFilename to_path; to_path.tempdir();
to_path << "/" << m.to() << ".mbx";
to_path.add(m.to());
to_path.ext("mbx");
ofstream fto(to_path, ios::app);
CHECK(fto.good(),"send: trouble opening mailbox file");
fto << m.from() << '\n' << m.subject() << '\n' << m.body() << '\n';
fto << m.from() << '\n' << m.subject() << '\n' << m.body() << '\n';
fto.close();
}

View File

@ -16,7 +16,7 @@
// @base public | TObject
class TMessage : public TObject
// @author:(INTERNAL) Guido
// @author:(INTERNAL) Villa
{
@ -26,11 +26,11 @@ class TMessage : public TObject
// @access:(INTERNAL) Private Member
// @cmember:(INTERNAL) Applicazione che lancia il messaggio
TString16 _from;
TString _from;
// @cmember:(INTERNAL) Applicazione che deve ricevere il messaggio
TString16 _to;
TString _to;
// @cmember:(INTERNAL) Oggetto del messaggio
TString80 _subject;
TString _subject;
// @cmember:(INTERNAL) Testo del messaggio
TString _text;
// @cmember:(INTERNAL) Flag di controllo del messaggio

View File

@ -218,7 +218,7 @@ public:
{ return _mode; }
// @cmember Setta la chiave da testare per l'autopremimento
void set_test_field(int id)
void set_test_field(short id)
{ if (_test_fld < 0) _test_fld = id; }
void set_focus_field(short id);

View File

@ -2239,10 +2239,10 @@ bool TBrowse::do_link(bool insert)
}
TExternal_app a(app);
a.run();
int err = a.run();
field().mask().set_focus();
if (mail.check())
if (err == 0 && mail.check())
{
TMessage* rcv = mail.next_s(insert ? MSG_AI : MSG_LN);
if (rcv != NULL)

View File

@ -173,7 +173,7 @@ public:
// @cmember Abilita il trim degli spazi
void set_trim(bool t)
{ _flags.trim = t ? 3 : 0; }
{ _flags.trim = byte(t ? 3 : 0); }
// @cmember Setta la giustificazione a destra del campo
void set_justify(bool r)

View File

@ -951,10 +951,10 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
src = e->raw2win(src); // Get formatted string
}
if ((*src == '\0' || (*src == 'X' && src[1] == '\0')) &&
if ((src == NULL || *src == '\0' || (*src == 'X' && src[1] == '\0')) &&
e->is_kind_of(CLASS_BOOLEAN_FIELD))
{
xiev->v.cell_request.icon_rid = *src > 0 ? ICO_CHECK_ON : ICO_CHECK_OFF;
xiev->v.cell_request.icon_rid = (src && *src) ? ICO_CHECK_ON : ICO_CHECK_OFF;
}
if (cell_disabled(rec, col))