sc0100.cpp Aggiunta gestione righe colorate

sc0100.h      Aggiunte variabili di supporto ai colori
sc0101.cpp    Corretto messaggio d'errore sugli importi
sc2100a.uml   Modificata ricerca sul codice lingua
sc2101.cpp    Cambiate due chiamate dirette con funzioni membro


git-svn-id: svn://10.65.10.50/trunk@4288 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1997-04-18 10:06:00 +00:00
parent d56dbd6525
commit c8741666c9
5 changed files with 64 additions and 4 deletions

View File

@ -1,5 +1,6 @@
#include <stdarg.h>
#include <colors.h>
#include <config.h>
#include <mask.h>
#include <urldefid.h>
@ -40,6 +41,8 @@ bool TSaldaconto_app::create()
{
open_files(LF_TAB, LF_TABCOM, LF_CLIFO, 0);
open_files(LF_PARTITE, LF_SCADENZE, LF_PAGSCA, 0);
load_colors();
_msk = new TMask("sc0100a");
_msk->set_handler(F_GRUPPO, gruppo_handler);
@ -101,6 +104,51 @@ bool TSaldaconto_app::menu(MENU_TAG)
}
}
return 0;
}
void TSaldaconto_app::load_colors()
{
TConfig conf(CONFIG_USER, "cg2");
TAssoc_array& colori = (TAssoc_array&)conf.list_variables();
for (THash_object* o = colori.get_hashobj(); o; o = colori.get_hashobj())
{
const TString& key = o->key();
if (key.len() == 7 && key.compare("Color", 5, TRUE) == 0)
{
const COLOR col = conf.get_color(key);
TString* strcol = new TString(15);
strcol->format("%ld", col);
_colori.add(key.mid(5), strcol);
}
}
}
COLOR TSaldaconto_app::type2color(char tipor, char tipoc)
{
COLOR col;
if (tipor > ' ')
{
const char key[3] = { tipoc, tipor, '\0' };
TString* colstr = (TString*)_colori.objptr(key);
if (colstr == NULL)
{
colstr = new TString(8);
colstr->format("%ld", tipoc == 'B' ? NORMAL_BACK_COLOR : NORMAL_COLOR);
_colori.add(key, colstr);
}
col = atol(*colstr);
}
else
{
col = tipoc == 'B' ? NORMAL_BACK_COLOR : NORMAL_COLOR;
}
return col;
}
void TSaldaconto_app::type2colors(char tipor, COLOR& back, COLOR& fore)
{
back = type2color(tipor, 'B');
fore = type2color(tipor, 'F');
}
///////////////////////////////////////////////////////////

View File

@ -20,6 +20,8 @@ class TSaldaconto_app : public TApplication
TPartite_array _partite;
TAssoc_array _colori;
bool _allow_firm;
bool _ges_val;
@ -36,11 +38,16 @@ protected:
void edit_partite(const TMask& m);
void load_colors();
COLOR type2color(char tipor, char tipoc);
public:
TMask& curr_mask() { return *_msk; }
TPartite_array& partite() { return _partite; }
bool gestione_valuta() const { return _ges_val; }
void type2colors(char tipor, COLOR& back, COLOR& fore);
void gioca_cambi(TMask& m, int force = 0x0);
static bool totale_handler(TMask_field& f, KEY k);

View File

@ -1049,7 +1049,7 @@ bool TSaldaconto_app::totale_handler(TMask_field& f, KEY k)
if (totdoc != imppag)
{
TString msg(80);
msg << "Il totale documento inserito" << totdoc.string(".");
msg << "Il totale documento inserito " << totdoc.string(".");
msg << "\nnon coincide con l'importo pagato " << imppag.string(".");
msg << ".\nSi desidera modificarli?";
ok = !f.yesno_box(msg);

View File

@ -47,13 +47,18 @@ STRING F_LINPROF 1
BEGIN
PROMPT 19 3 ""
FLAGS "U"
USE %LNG
/*
USE %LNG
INPUT CODTAB F_LINPROF
DISPLAY "Codice" CODTAB
DISPLAY "Descrizione@50" S0
OUTPUT F_LINPROF CODTAB
CHECKTYPE NORMAL
WARNING "Codice lingua errato"
*/
COPY ALL F_CODPROF
CHECKTYPE NORMAL
WARNING "Codice profilo o lingua errato"
END
STRING F_DESPROF 50 40

View File

@ -95,8 +95,8 @@ const TString& TEC_mask::get_prof_lang() const
const char* TEC_mask::get_prof_name() const
{
TString& tmp=(TString&)_tmp;
tmp = get(F_CODPROF);
tmp << get(F_LINPROF);
tmp = get_prof_code();
tmp << get_prof_lang();
return _tmp;
}