campo-sirio/include/colmask.h
alex 06339d0074 Patch level : 10.0 220
Files correlati     : ve0.exe lv3.exe co0.exe
Ricompilazione Demo : [ ]
Commento            :

Implementata la possibilità di colorare le righe dei documenti definendo nella maschera (file maschera.ini) delle regle come quelle sottoesposte ;

RuleName(1) = Merce Cara
Rule(1) = PREZZO>1000|N
BgCol(1) = 0,192,192
FgCol(1) = 0,0,0
RuleName(2) = Merce Carissima
Rule(2) = PREZZO>10000|N
BgCol(2) = 0,0,192
FgCol(2) = 0,0,0
RuleName(3) = Riga vuota
Rule(3) = STR(TIPORIGA!="05")&&(QTA==0)&&(PREZZO==0)|N
BgCol(3) = 128,0,128
FgCol(3) = 255,255,255

I nnumeri di riga cominciano da 1, nella regola !N significa formula numerica, i colori sono definiti come r,g,b. Si possono utilizzare campi della maschera di riga (#id camop) DELLATESTATA (#-campo) della testata documento (33.nomecampo) della riga documeno (34.nome campo) e DIRTY che significa riga modificata


git-svn-id: svn://10.65.10.50/trunk@18205 c028cbd2-c16b-5b4b-a496-9718f37d4682
2009-02-05 14:39:36 +00:00

46 lines
1.3 KiB
C++
Executable File

#ifndef __COLMASK_H
#define __COLMASK_H
#ifndef __COLORS_H
#include <colors.h>
#endif
#ifndef __VARMASK_H
#include <varmask.h>
#endif
class TColor_row_mask;
class TColor_object_props;
class TSelect_color_mask : public TVariable_mask
{
TColor_row_mask * _sheet_mask;
TArray _color_defs;
TFilename _mask_name;
TString _paragraph;
HIDDEN TMask * get_mask(int, TMask&);
TColor_object_props * row(int r) const { return (TColor_object_props *) _color_defs.objptr(r);}
int items() const { return _color_defs.items();}
protected:
void init(const char * mask_name, const char * para = NULL);
static bool color_handler(TMask_field& f, KEY k);
static bool reset_handler(TMask_field& f, KEY k);
void save() const ;
public:
int add_color_def(const char * key, const char * prompt, COLOR back = NORMAL_BACK_COLOR, COLOR fore = NORMAL_COLOR);
void get_color_def(const char * key, COLOR & back, COLOR & fore) const ;
void get_cur_colors(COLOR & back, COLOR & fore) const ;
int key2pos(const char * key) const;
COLOR get_back_color(int pos) const;
COLOR get_fore_color(int pos) const;
TSelect_color_mask(const char * mask_name, const char * para = NULL);
TSelect_color_mask(const TSheet_field & field);
virtual ~TSelect_color_mask();
};
#endif