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 <stdarg.h>
#include <colors.h>
#include <config.h> #include <config.h>
#include <mask.h> #include <mask.h>
#include <urldefid.h> #include <urldefid.h>
@ -41,6 +42,8 @@ bool TSaldaconto_app::create()
open_files(LF_TAB, LF_TABCOM, LF_CLIFO, 0); open_files(LF_TAB, LF_TABCOM, LF_CLIFO, 0);
open_files(LF_PARTITE, LF_SCADENZE, LF_PAGSCA, 0); open_files(LF_PARTITE, LF_SCADENZE, LF_PAGSCA, 0);
load_colors();
_msk = new TMask("sc0100a"); _msk = new TMask("sc0100a");
_msk->set_handler(F_GRUPPO, gruppo_handler); _msk->set_handler(F_GRUPPO, gruppo_handler);
@ -103,6 +106,51 @@ bool TSaldaconto_app::menu(MENU_TAG)
return 0; 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');
}
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
// Handlers generali // Handlers generali
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////

View File

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

View File

@ -47,6 +47,7 @@ STRING F_LINPROF 1
BEGIN BEGIN
PROMPT 19 3 "" PROMPT 19 3 ""
FLAGS "U" FLAGS "U"
/*
USE %LNG USE %LNG
INPUT CODTAB F_LINPROF INPUT CODTAB F_LINPROF
DISPLAY "Codice" CODTAB DISPLAY "Codice" CODTAB
@ -54,6 +55,10 @@ BEGIN
OUTPUT F_LINPROF CODTAB OUTPUT F_LINPROF CODTAB
CHECKTYPE NORMAL CHECKTYPE NORMAL
WARNING "Codice lingua errato" WARNING "Codice lingua errato"
*/
COPY ALL F_CODPROF
CHECKTYPE NORMAL
WARNING "Codice profilo o lingua errato"
END END
STRING F_DESPROF 50 40 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 const char* TEC_mask::get_prof_name() const
{ {
TString& tmp=(TString&)_tmp; TString& tmp=(TString&)_tmp;
tmp = get(F_CODPROF); tmp = get_prof_code();
tmp << get(F_LINPROF); tmp << get_prof_lang();
return _tmp; return _tmp;
} }