Patch level : 2.1 nopatch
Files correlati : Ricompilazione Demo : [ ] Commento : Roba buona per i nuovi report git-svn-id: svn://10.65.10.50/trunk@12000 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
93a119075e
commit
3dbe76d6ae
@ -177,13 +177,16 @@ XVT_FNTID xvt_default_font(bool bold)
|
||||
ROWY = (pc.bottom - pc.top) / 25;
|
||||
const int COLX = (pc.right - pc.left) / 80;
|
||||
|
||||
TString str(80, 'M');
|
||||
CHARX = xvt_dwin_get_text_width(TASK_WIN, str.get_buffer(), str.size()) / str.size();
|
||||
// Vecchio metodo di calcolo di CHARX dipendente dalla moda
|
||||
// TString str(80, 'M');
|
||||
// CHARX = xvt_dwin_get_text_width(TASK_WIN, str.get_buffer(), str.size()) / str.size();
|
||||
|
||||
int leading, ascent, descent;
|
||||
xvt_dwin_get_font_metrics(TASK_WIN, &leading, &ascent, &descent);
|
||||
CHARY = ascent + descent + 1;
|
||||
BASEY = ascent;
|
||||
|
||||
CHARX = 3*ascent/4; // Nuovo metodo di calcolo di CHARX piu' stabile
|
||||
|
||||
if (CHARX > COLX)
|
||||
CHARX = COLX;
|
||||
@ -2292,13 +2295,12 @@ void TDropDownList::on_mouse_down(const PNT& pt)
|
||||
if (_open)
|
||||
{
|
||||
RCT rct;
|
||||
|
||||
xi_get_rect(_obj, (XinRect*)&rct);
|
||||
if (xvt_rect_has_point(&rct, pt))
|
||||
return; // E' nel campo di testo proprietario della lista
|
||||
|
||||
xvt_vobj_get_outer_rect((WINDOW)xi_get_window(_xi_lst->itf), &rct);
|
||||
if (!xvt_rect_has_point(&rct, pt))
|
||||
if (!xvt_rect_has_point(&rct, pt)) // Fuori dalla lista
|
||||
close();
|
||||
}
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ public:
|
||||
const real& get_change(exchange_type& et) const;
|
||||
real get_base_change() const;
|
||||
real get_contro_change() const;
|
||||
int decimals(bool price = FALSE) const;
|
||||
int decimals(bool price = false) const;
|
||||
|
||||
TExchange(const char* val = NULL, const real& exc = ZERO, exchange_type et = _exchange_undefined);
|
||||
TExchange(const TExchange& exc) { copy(exc); }
|
||||
@ -60,9 +60,9 @@ public:
|
||||
static const TString& get_base_val();
|
||||
static const TString& get_firm_val();
|
||||
static const TString& get_euro_val();
|
||||
static int get_base_dec(bool price = FALSE);
|
||||
static int get_firm_dec(bool price = FALSE);
|
||||
static int get_euro_dec(bool price = FALSE);
|
||||
static int get_base_dec(bool price = false);
|
||||
static int get_firm_dec(bool price = false);
|
||||
static int get_euro_dec(bool price = false);
|
||||
static const real& get_firm_change(exchange_type& ce);
|
||||
static const real& get_euro_change();
|
||||
|
||||
@ -110,15 +110,15 @@ public:
|
||||
int sign() const { return _num.sign(); }
|
||||
TCurrency abs() const;
|
||||
|
||||
const char* string(bool dotted = FALSE) const;
|
||||
const char* string(bool dotted = false) const;
|
||||
void read(const TRectype& rec, const char* field, const char *val = NULL, const char *exchange = NULL, const char* et = NULL);
|
||||
void write(TRectype& rec, const char* field, const char *val = NULL, const char *exchange = NULL, const char* et = NULL, bool forceval = FALSE) const;
|
||||
void write(TRectype& rec, const char* field, const char *val = NULL, const char *exchange = NULL, const char* et = NULL, bool forceval = false) const;
|
||||
int decimals() const;
|
||||
|
||||
TCurrency(bool price = FALSE) : _price(price) { }
|
||||
TCurrency(bool price = false) : _price(price) { }
|
||||
TCurrency(const TCurrency& cur) { copy(cur); }
|
||||
TCurrency(const real& num, const char* val = "", const real& exchg = ZERO, exchange_type et = _exchange_undefined, bool price = FALSE);
|
||||
TCurrency(const real& num, const TExchange& chg, bool price = FALSE);
|
||||
TCurrency(const real& num, const char* val = "", const real& exchg = ZERO, exchange_type et = _exchange_undefined, bool price = false);
|
||||
TCurrency(const real& num, const TExchange& chg, bool price = false);
|
||||
virtual ~TCurrency() { }
|
||||
};
|
||||
|
||||
|
@ -84,7 +84,7 @@ TDate::TDate(const char* s)
|
||||
if (!isdigit(s[i])) break;
|
||||
if (i == 8)
|
||||
{
|
||||
TString16 str(s);
|
||||
TString8 str(s);
|
||||
d = atoi(((const char *)str)+6); str.cut(6);
|
||||
m = atoi(((const char *)str)+4); str.cut(4);
|
||||
y = atoi(((const char *)str)+0);
|
||||
|
@ -1169,7 +1169,7 @@ void TPrinter::init_formlen(
|
||||
}
|
||||
else
|
||||
{
|
||||
_formwidth = int (pw * 10L / phr);
|
||||
_formwidth = int (pw * (_ch_size * 10 / 12) / phr);
|
||||
_horz_offset = 0;
|
||||
}
|
||||
}
|
||||
@ -2052,6 +2052,20 @@ HIDDEN BOOLEAN calc_font_callback(long data)
|
||||
return win != NULL_WIN;
|
||||
}
|
||||
|
||||
int TPrinter::calc_font_size(int columns) const
|
||||
{
|
||||
font_data fd;
|
||||
fd._name = fontname();
|
||||
fd._size = get_char_size();
|
||||
fd._columns = columns;
|
||||
|
||||
xvt_print_open();
|
||||
xvt_print_start_thread(calc_font_callback, (long)&fd);
|
||||
xvt_print_close();
|
||||
|
||||
return fd._size;
|
||||
}
|
||||
|
||||
HIDDEN BOOLEAN calc_cols_callback(long data)
|
||||
{
|
||||
int &numcols=*(int *)data;
|
||||
@ -2088,20 +2102,7 @@ HIDDEN BOOLEAN calc_cols_callback(long data)
|
||||
return win != NULL_WIN;
|
||||
}
|
||||
|
||||
int TPrinter::calc_font_size(int columns) const
|
||||
{
|
||||
font_data fd;
|
||||
fd._name = fontname();
|
||||
fd._size = get_char_size();
|
||||
fd._columns = columns;
|
||||
|
||||
xvt_print_open();
|
||||
xvt_print_start_thread(calc_font_callback, (long)&fd);
|
||||
xvt_print_close();
|
||||
|
||||
return fd._size;
|
||||
}
|
||||
|
||||
// Funzione chiamata solo da sv1200, ma non si capisce perche' non usi la formwidth()
|
||||
int TPrinter::calc_num_cols() const
|
||||
{
|
||||
int numcols;
|
||||
@ -2111,4 +2112,3 @@ int TPrinter::calc_num_cols() const
|
||||
|
||||
return numcols;
|
||||
}
|
||||
|
||||
|
@ -218,64 +218,47 @@ void TPrintwin::paint_row(long j)
|
||||
|
||||
paint_background(j);
|
||||
|
||||
if (_chary > 1)
|
||||
{
|
||||
_txt.read_line(j);
|
||||
_txt.read_line(j);
|
||||
|
||||
int pos = 0;
|
||||
|
||||
const char* cp;
|
||||
while((cp = _txt.piece()) != NULL)
|
||||
{
|
||||
const int st = _txt.get_style();
|
||||
const COLOR bg = trans_color(_txt.get_background());
|
||||
const COLOR fg = trans_color(_txt.get_foreground());
|
||||
set_color(fg, bg);
|
||||
|
||||
int pos = 0;
|
||||
|
||||
const char* cp;
|
||||
while((cp = _txt.piece()) != NULL)
|
||||
{
|
||||
const int st = _txt.get_style();
|
||||
const COLOR bg = trans_color(_txt.get_background());
|
||||
const COLOR fg = trans_color(_txt.get_foreground());
|
||||
if (bg != fg) // Testo vero
|
||||
{
|
||||
set_color(fg, bg);
|
||||
set_font(printer().fontname(), st, _char_size);
|
||||
|
||||
if (bg != fg) // Testo vero
|
||||
{
|
||||
set_color(fg, bg);
|
||||
set_font(printer().fontname(), st, _char_size);
|
||||
const char* beg = cp;
|
||||
while (*beg)
|
||||
{
|
||||
for (; *beg == ' '; beg++) // Salta spazi iniziali
|
||||
pos++;
|
||||
|
||||
const char* beg = cp;
|
||||
while (*beg)
|
||||
{
|
||||
for (; *beg == ' '; beg++) // Salta spazi iniziali
|
||||
pos++;
|
||||
|
||||
if (*beg)
|
||||
{
|
||||
int len = 0;
|
||||
const char * end;
|
||||
for (end = beg; *end && (*end != ' ' || *(end+1) != ' '); end++)
|
||||
len++; // Misura stringa da stampare
|
||||
xvt_dwin_draw_text(win(), _hofs + LEN_SPACES(win(), pos), y, (char*)beg, len);
|
||||
pos += len;
|
||||
beg = end;
|
||||
}
|
||||
}
|
||||
}
|
||||
else // Testo trasparente (elementi grafici aggiuntivi)
|
||||
{
|
||||
if (*cp == 'i')
|
||||
paint_image(row, cp);
|
||||
if (*beg)
|
||||
{
|
||||
int len = 0;
|
||||
const char * end;
|
||||
for (end = beg; *end && (*end != ' ' || *(end+1) != ' '); end++)
|
||||
len++; // Misura stringa da stampare
|
||||
xvt_dwin_draw_text(win(), _hofs + LEN_SPACES(win(), pos), y, (char*)beg, len);
|
||||
pos += len;
|
||||
beg = end;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
set_font(printer().fontname(), XVT_FS_NONE, _char_size);
|
||||
#if XVT_OS == XVT_OS_WIN32
|
||||
// Questa e' la patch per TTY.DRV.
|
||||
if (j > 0 && (j % _realformlen) == 0)
|
||||
else // Testo trasparente (elementi grafici aggiuntivi)
|
||||
{
|
||||
_frlc++;
|
||||
xvt_dwin_draw_text(win(), 0, y , "", -1);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
xvt_dwin_draw_text(win(), 0, y, (char*)(const char*)_txt.line(j - _frlc), -1);
|
||||
}
|
||||
if (*cp == 'i')
|
||||
paint_image(row, cp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// @doc INTERNAL
|
||||
@ -297,7 +280,7 @@ bool TPrintwin::print_band(
|
||||
const long first_row = (long)page * _formlen;
|
||||
const int rows = (r.bottom - r.top) / _chary;
|
||||
const int top = r.top / _chary;
|
||||
const long lines = _txt.lines() + _frlc;
|
||||
const long lines = _txt.lines();
|
||||
int k;
|
||||
|
||||
for (k = top; k < top+rows; k++)
|
||||
@ -325,7 +308,6 @@ bool TPrintwin::do_print(word page_from, word page_to, word copies)
|
||||
CHECKD(page_from > 0, "Invalid page start ", page_from);
|
||||
CHECKD(copies > 0, "Invalid number of copies ", copies);
|
||||
|
||||
_frlc = 0;
|
||||
_blank_lines_to_print = 0;
|
||||
|
||||
for (word c = 0; c < copies && !_aborted; c++)
|
||||
@ -400,17 +382,6 @@ TPrintwin::TPrintwin(TTextfile& txt)
|
||||
_formlen = p.formlen();
|
||||
p.formlen(_pagelen);
|
||||
|
||||
if (p.is_generic())
|
||||
{
|
||||
long pw, ph, phr, pvr; // Printer width, height, horizontal and vertical resolution
|
||||
xvt_app_escape (XVT_ESC_GET_PRINTER_INFO, p.get_printrcd(), &ph, &pw, &pvr, &phr);
|
||||
if (pvr != 0)
|
||||
_realformlen = int(ph * p.get_lines_per_inch() / pvr);
|
||||
else
|
||||
_realformlen = 66;
|
||||
}
|
||||
else
|
||||
_realformlen = 66; // Anche se non e' importante settarlo in altri casi.
|
||||
_formwidth = p.formwidth();
|
||||
_inited = TRUE;
|
||||
}
|
||||
|
@ -35,8 +35,6 @@ class TPrintwin : public TWindow
|
||||
int _pagelen;
|
||||
// @cmember:(INTERNAL) Larghezza del modulo di stampa
|
||||
int _formwidth;
|
||||
// @cmember:(INTERNAL) Lunghezza reale (vale per stampanti Generico/Solo testo) del modulo di stampa
|
||||
int _realformlen;
|
||||
|
||||
// @cmember:(INTERNAL) L'intero background della pagina (vedi <c TPrintapp>)
|
||||
TArray* _bg;
|
||||
@ -62,8 +60,6 @@ class TPrintwin : public TWindow
|
||||
int _char_size;
|
||||
// @cmember:(INTERNAL) Altre caratteristihce del font (vedi XVT)
|
||||
bool _inited;
|
||||
// @cmember:(INTERNAL) Thanks to Fralc Consultores Inc.
|
||||
int _frlc;
|
||||
// @cmember:(INTERNAL) linee voute da stampare (per offset)
|
||||
bool _blank_lines_to_print;
|
||||
|
||||
|
@ -179,7 +179,8 @@ void TIndwin::update_bar()
|
||||
const unsigned long mm = ss / 60;
|
||||
ss -= mm *60;
|
||||
TString80 n;
|
||||
n.format(FR("%d%% - Tempo residuo stimato %02lu:%02lu:%02lu"), int(prc*100.0+0.5), hh, mm, ss);
|
||||
n.format(FR("%d%% - %s %02lu:%02lu:%02lu"),
|
||||
int(prc*100.0+0.5), TR("Tempo residuo stimato"), hh, mm, ss);
|
||||
|
||||
b = r;
|
||||
b.top = b.bottom+2;
|
||||
@ -189,7 +190,7 @@ void TIndwin::update_bar()
|
||||
xvt_dwin_set_cbrush(w, &brush);
|
||||
xvt_dwin_set_std_cpen(w, TL_PEN_HOLLOW);
|
||||
xvt_dwin_draw_rect(w, &b);
|
||||
xvt_dwin_draw_text(w, r.left, r.bottom+CHARY, n, -1);
|
||||
xvt_dwin_draw_text(w, r.left, r.bottom+CHARY-1, n, -1);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -58,7 +58,7 @@ void TRelation_application::set_key_filter()
|
||||
if (expr.not_empty())
|
||||
{
|
||||
expr.insert("(", 0);
|
||||
expr << ")AND(" << rf << ')';
|
||||
expr << ")&&(" << rf << ')';
|
||||
}
|
||||
else
|
||||
expr = rf;
|
||||
|
@ -23,32 +23,20 @@ struct TPoint
|
||||
// @cmember Coordinate del punto
|
||||
long x,y;
|
||||
|
||||
// @cmember Costruttore
|
||||
TPoint(long sx = 0, long sy = 0) : x(sx), y(sy)
|
||||
{}
|
||||
|
||||
/*
|
||||
//TPoint(const PNT& pnt) { set(pnt); }
|
||||
// @cmember Setta le coordinate x e y del punto
|
||||
void set(const PNT& pnt)
|
||||
{ x = pnt.h/CHARX; y = pnt.v/CHARY; }
|
||||
// @cmember Setta le coordinate x e y del punto
|
||||
void set(long sx, long sy) { x = sx; y = sy; }
|
||||
// @cmember Operatore di assegnamento tra punti
|
||||
TPoint& operator= (const PNT& pnt)
|
||||
{ set(pnt); return *this; }
|
||||
*/
|
||||
|
||||
void set(long sx, long sy)
|
||||
{ x = sx; y = sy; }
|
||||
// @cmember Operatore di assegnamento tra punti
|
||||
TPoint& operator= (const TPoint& pnt)
|
||||
{ set(pnt.x,pnt.y); return *this; }
|
||||
TPoint& operator =(const TPoint& pnt) { x = pnt.x; y = pnt.y; return *this; }
|
||||
// @cmember Confronta se due punti sono uguali (TRUE se uguali)
|
||||
bool operator ==(const TPoint& p)
|
||||
{ return p.x == x && p.y == y; }
|
||||
bool operator ==(const TPoint& p) { return p.x == x && p.y == y; }
|
||||
// @cmember Confronta se due punti sono diversi (TRUE se diversi)
|
||||
bool operator !=(const TPoint& p)
|
||||
{ return p.x != x || p.y != y; }
|
||||
bool operator !=(const TPoint& p) { return p.x != x || p.y != y; }
|
||||
TPoint& operator +=(const TPoint& pnt) { x += pnt.x; y += pnt.y; return *this; }
|
||||
void reset() { x = y = 0; }
|
||||
|
||||
// @cmember Costruttori
|
||||
TPoint() : x(0), y(0) { }
|
||||
TPoint(long sx, long sy) : x(sx), y(sy) { }
|
||||
TPoint(const TPoint& p) : x(p.x), y(p.y) { }
|
||||
};
|
||||
|
||||
class TRectangle : public TPoint
|
||||
|
Loading…
x
Reference in New Issue
Block a user