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,14 +177,17 @@ XVT_FNTID xvt_default_font(bool bold)
|
|||||||
ROWY = (pc.bottom - pc.top) / 25;
|
ROWY = (pc.bottom - pc.top) / 25;
|
||||||
const int COLX = (pc.right - pc.left) / 80;
|
const int COLX = (pc.right - pc.left) / 80;
|
||||||
|
|
||||||
TString str(80, 'M');
|
// Vecchio metodo di calcolo di CHARX dipendente dalla moda
|
||||||
CHARX = xvt_dwin_get_text_width(TASK_WIN, str.get_buffer(), str.size()) / str.size();
|
// TString str(80, 'M');
|
||||||
|
// CHARX = xvt_dwin_get_text_width(TASK_WIN, str.get_buffer(), str.size()) / str.size();
|
||||||
|
|
||||||
int leading, ascent, descent;
|
int leading, ascent, descent;
|
||||||
xvt_dwin_get_font_metrics(TASK_WIN, &leading, &ascent, &descent);
|
xvt_dwin_get_font_metrics(TASK_WIN, &leading, &ascent, &descent);
|
||||||
CHARY = ascent + descent + 1;
|
CHARY = ascent + descent + 1;
|
||||||
BASEY = ascent;
|
BASEY = ascent;
|
||||||
|
|
||||||
|
CHARX = 3*ascent/4; // Nuovo metodo di calcolo di CHARX piu' stabile
|
||||||
|
|
||||||
if (CHARX > COLX)
|
if (CHARX > COLX)
|
||||||
CHARX = COLX;
|
CHARX = COLX;
|
||||||
|
|
||||||
@ -2292,13 +2295,12 @@ void TDropDownList::on_mouse_down(const PNT& pt)
|
|||||||
if (_open)
|
if (_open)
|
||||||
{
|
{
|
||||||
RCT rct;
|
RCT rct;
|
||||||
|
|
||||||
xi_get_rect(_obj, (XinRect*)&rct);
|
xi_get_rect(_obj, (XinRect*)&rct);
|
||||||
if (xvt_rect_has_point(&rct, pt))
|
if (xvt_rect_has_point(&rct, pt))
|
||||||
return; // E' nel campo di testo proprietario della lista
|
return; // E' nel campo di testo proprietario della lista
|
||||||
|
|
||||||
xvt_vobj_get_outer_rect((WINDOW)xi_get_window(_xi_lst->itf), &rct);
|
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();
|
close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ public:
|
|||||||
const real& get_change(exchange_type& et) const;
|
const real& get_change(exchange_type& et) const;
|
||||||
real get_base_change() const;
|
real get_base_change() const;
|
||||||
real get_contro_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 char* val = NULL, const real& exc = ZERO, exchange_type et = _exchange_undefined);
|
||||||
TExchange(const TExchange& exc) { copy(exc); }
|
TExchange(const TExchange& exc) { copy(exc); }
|
||||||
@ -60,9 +60,9 @@ public:
|
|||||||
static const TString& get_base_val();
|
static const TString& get_base_val();
|
||||||
static const TString& get_firm_val();
|
static const TString& get_firm_val();
|
||||||
static const TString& get_euro_val();
|
static const TString& get_euro_val();
|
||||||
static int get_base_dec(bool price = FALSE);
|
static int get_base_dec(bool price = false);
|
||||||
static int get_firm_dec(bool price = FALSE);
|
static int get_firm_dec(bool price = false);
|
||||||
static int get_euro_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_firm_change(exchange_type& ce);
|
||||||
static const real& get_euro_change();
|
static const real& get_euro_change();
|
||||||
|
|
||||||
@ -110,15 +110,15 @@ public:
|
|||||||
int sign() const { return _num.sign(); }
|
int sign() const { return _num.sign(); }
|
||||||
TCurrency abs() const;
|
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 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;
|
int decimals() const;
|
||||||
|
|
||||||
TCurrency(bool price = FALSE) : _price(price) { }
|
TCurrency(bool price = false) : _price(price) { }
|
||||||
TCurrency(const TCurrency& cur) { copy(cur); }
|
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 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 TExchange& chg, bool price = false);
|
||||||
virtual ~TCurrency() { }
|
virtual ~TCurrency() { }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ TDate::TDate(const char* s)
|
|||||||
if (!isdigit(s[i])) break;
|
if (!isdigit(s[i])) break;
|
||||||
if (i == 8)
|
if (i == 8)
|
||||||
{
|
{
|
||||||
TString16 str(s);
|
TString8 str(s);
|
||||||
d = atoi(((const char *)str)+6); str.cut(6);
|
d = atoi(((const char *)str)+6); str.cut(6);
|
||||||
m = atoi(((const char *)str)+4); str.cut(4);
|
m = atoi(((const char *)str)+4); str.cut(4);
|
||||||
y = atoi(((const char *)str)+0);
|
y = atoi(((const char *)str)+0);
|
||||||
|
@ -1169,7 +1169,7 @@ void TPrinter::init_formlen(
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_formwidth = int (pw * 10L / phr);
|
_formwidth = int (pw * (_ch_size * 10 / 12) / phr);
|
||||||
_horz_offset = 0;
|
_horz_offset = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2052,6 +2052,20 @@ HIDDEN BOOLEAN calc_font_callback(long data)
|
|||||||
return win != NULL_WIN;
|
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)
|
HIDDEN BOOLEAN calc_cols_callback(long data)
|
||||||
{
|
{
|
||||||
int &numcols=*(int *)data;
|
int &numcols=*(int *)data;
|
||||||
@ -2088,20 +2102,7 @@ HIDDEN BOOLEAN calc_cols_callback(long data)
|
|||||||
return win != NULL_WIN;
|
return win != NULL_WIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
int TPrinter::calc_font_size(int columns) const
|
// Funzione chiamata solo da sv1200, ma non si capisce perche' non usi la formwidth()
|
||||||
{
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
int TPrinter::calc_num_cols() const
|
int TPrinter::calc_num_cols() const
|
||||||
{
|
{
|
||||||
int numcols;
|
int numcols;
|
||||||
@ -2111,4 +2112,3 @@ int TPrinter::calc_num_cols() const
|
|||||||
|
|
||||||
return numcols;
|
return numcols;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -218,8 +218,6 @@ void TPrintwin::paint_row(long j)
|
|||||||
|
|
||||||
paint_background(j);
|
paint_background(j);
|
||||||
|
|
||||||
if (_chary > 1)
|
|
||||||
{
|
|
||||||
_txt.read_line(j);
|
_txt.read_line(j);
|
||||||
|
|
||||||
int pos = 0;
|
int pos = 0;
|
||||||
@ -261,21 +259,6 @@ void TPrintwin::paint_row(long j)
|
|||||||
paint_image(row, cp);
|
paint_image(row, cp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
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)
|
|
||||||
{
|
|
||||||
_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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// @doc INTERNAL
|
// @doc INTERNAL
|
||||||
@ -297,7 +280,7 @@ bool TPrintwin::print_band(
|
|||||||
const long first_row = (long)page * _formlen;
|
const long first_row = (long)page * _formlen;
|
||||||
const int rows = (r.bottom - r.top) / _chary;
|
const int rows = (r.bottom - r.top) / _chary;
|
||||||
const int top = r.top / _chary;
|
const int top = r.top / _chary;
|
||||||
const long lines = _txt.lines() + _frlc;
|
const long lines = _txt.lines();
|
||||||
int k;
|
int k;
|
||||||
|
|
||||||
for (k = top; k < top+rows; 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(page_from > 0, "Invalid page start ", page_from);
|
||||||
CHECKD(copies > 0, "Invalid number of copies ", copies);
|
CHECKD(copies > 0, "Invalid number of copies ", copies);
|
||||||
|
|
||||||
_frlc = 0;
|
|
||||||
_blank_lines_to_print = 0;
|
_blank_lines_to_print = 0;
|
||||||
|
|
||||||
for (word c = 0; c < copies && !_aborted; c++)
|
for (word c = 0; c < copies && !_aborted; c++)
|
||||||
@ -400,17 +382,6 @@ TPrintwin::TPrintwin(TTextfile& txt)
|
|||||||
_formlen = p.formlen();
|
_formlen = p.formlen();
|
||||||
p.formlen(_pagelen);
|
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();
|
_formwidth = p.formwidth();
|
||||||
_inited = TRUE;
|
_inited = TRUE;
|
||||||
}
|
}
|
||||||
|
@ -35,8 +35,6 @@ class TPrintwin : public TWindow
|
|||||||
int _pagelen;
|
int _pagelen;
|
||||||
// @cmember:(INTERNAL) Larghezza del modulo di stampa
|
// @cmember:(INTERNAL) Larghezza del modulo di stampa
|
||||||
int _formwidth;
|
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>)
|
// @cmember:(INTERNAL) L'intero background della pagina (vedi <c TPrintapp>)
|
||||||
TArray* _bg;
|
TArray* _bg;
|
||||||
@ -62,8 +60,6 @@ class TPrintwin : public TWindow
|
|||||||
int _char_size;
|
int _char_size;
|
||||||
// @cmember:(INTERNAL) Altre caratteristihce del font (vedi XVT)
|
// @cmember:(INTERNAL) Altre caratteristihce del font (vedi XVT)
|
||||||
bool _inited;
|
bool _inited;
|
||||||
// @cmember:(INTERNAL) Thanks to Fralc Consultores Inc.
|
|
||||||
int _frlc;
|
|
||||||
// @cmember:(INTERNAL) linee voute da stampare (per offset)
|
// @cmember:(INTERNAL) linee voute da stampare (per offset)
|
||||||
bool _blank_lines_to_print;
|
bool _blank_lines_to_print;
|
||||||
|
|
||||||
|
@ -179,7 +179,8 @@ void TIndwin::update_bar()
|
|||||||
const unsigned long mm = ss / 60;
|
const unsigned long mm = ss / 60;
|
||||||
ss -= mm *60;
|
ss -= mm *60;
|
||||||
TString80 n;
|
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 = r;
|
||||||
b.top = b.bottom+2;
|
b.top = b.bottom+2;
|
||||||
@ -189,7 +190,7 @@ void TIndwin::update_bar()
|
|||||||
xvt_dwin_set_cbrush(w, &brush);
|
xvt_dwin_set_cbrush(w, &brush);
|
||||||
xvt_dwin_set_std_cpen(w, TL_PEN_HOLLOW);
|
xvt_dwin_set_std_cpen(w, TL_PEN_HOLLOW);
|
||||||
xvt_dwin_draw_rect(w, &b);
|
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
|
else
|
||||||
|
@ -58,7 +58,7 @@ void TRelation_application::set_key_filter()
|
|||||||
if (expr.not_empty())
|
if (expr.not_empty())
|
||||||
{
|
{
|
||||||
expr.insert("(", 0);
|
expr.insert("(", 0);
|
||||||
expr << ")AND(" << rf << ')';
|
expr << ")&&(" << rf << ')';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
expr = rf;
|
expr = rf;
|
||||||
|
@ -23,32 +23,20 @@ struct TPoint
|
|||||||
// @cmember Coordinate del punto
|
// @cmember Coordinate del punto
|
||||||
long x,y;
|
long x,y;
|
||||||
|
|
||||||
// @cmember Costruttore
|
void set(long sx, long sy) { x = sx; y = sy; }
|
||||||
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
|
|
||||||
// @cmember Operatore di assegnamento tra punti
|
// @cmember Operatore di assegnamento tra punti
|
||||||
TPoint& operator= (const PNT& pnt)
|
TPoint& operator =(const TPoint& pnt) { x = pnt.x; y = pnt.y; return *this; }
|
||||||
{ 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; }
|
|
||||||
// @cmember Confronta se due punti sono uguali (TRUE se uguali)
|
// @cmember Confronta se due punti sono uguali (TRUE se uguali)
|
||||||
bool operator ==(const TPoint& p)
|
bool operator ==(const TPoint& p) { return p.x == x && p.y == y; }
|
||||||
{ return p.x == x && p.y == y; }
|
|
||||||
// @cmember Confronta se due punti sono diversi (TRUE se diversi)
|
// @cmember Confronta se due punti sono diversi (TRUE se diversi)
|
||||||
bool operator !=(const TPoint& p)
|
bool operator !=(const TPoint& p) { return p.x != x || p.y != y; }
|
||||||
{ 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
|
class TRectangle : public TPoint
|
||||||
|
Loading…
x
Reference in New Issue
Block a user