Patch level : 10.0

Files correlati     : agalib.lib bagn001.msk bagn003.msk
Ricompilazione Demo : [ ]
Commento            :
Rimodernate tutte le maschere di stampa.
Corrette scrollbar sull'anteprima di stampa


git-svn-id: svn://10.65.10.50/trunk@18434 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2009-03-06 12:11:03 +00:00
parent a01d16defe
commit 89661c31cc
14 changed files with 233 additions and 110 deletions

View File

@ -72,7 +72,7 @@ END
BOOLEAN MSK_ISGRAPHICS
BEGIN
PROMPT 46 7 "Stampa elementi grafici"
PROMPT 46 7 "Elementi grafici"
END
ENDPAGE

View File

@ -6,3 +6,5 @@
#define F_FROMPAGE 106
#define F_TOPAGE 107
#define F_FORM 108
#define F_LINES 109
#define F_ORIENT 110

View File

@ -1,75 +1,118 @@
#include <bagn003.h>
PAGE "Stampa" -1 -1 66 11
PAGE "Stampa" -1 -1 66 14
GROUPBOX DLG_NULL 64 6
GROUPBOX DLG_NULL 64 4
BEGIN
PROMPT 1 0 "@bStampante"
END
STRING F_PRINTER 80 50
STRING F_PRINTER 80 56
BEGIN
PROMPT 2 1 "Stampante "
FLAGS "D"
PROMPT 2 1 "Nome "
FLAGS "L"
END
STRING F_FORM 80 50
STRING F_FORM 80 56
BEGIN
PROMPT 2 2 "Form "
FLAGS "D"
PROMPT 2 2 "Form "
FLAGS "L"
END
GROUPBOX DLG_NULL 40 5
BEGIN
PROMPT 1 4 "@bCarattere standard"
END
STRING F_FONT 80 32
BEGIN
PROMPT 2 3 "Font "
FLAGS "D"
PROMPT 2 5 "Font "
FLAGS "L"
END
NUMBER F_SIZE 4
NUMBER F_SIZE 3
BEGIN
PROMPT 48 3 "Carattere "
PROMPT 2 6 "Dimensioni carattere "
FLAGS "LU"
END
NUMBER F_LINES 3
BEGIN
PROMPT 2 7 "Linee per pollice "
FLAGS "LU"
END
GROUPBOX DLG_NULL 23 5
BEGIN
PROMPT 42 4 "@bParametri di stampa"
END
RADIOBUTTON F_ORIENT 1 20
BEGIN
PROMPT 43 4 ""
ITEM "1|Foglio verticale"
ITEM "2|Foglio orizzontale"
FLAGS "D"
END
BOOLEAN F_ISGRAPHICS
BEGIN
PROMPT 2 4 "Stampa elementi grafici"
PROMPT 44 7 "Elementi grafici"
FLAGS "D"
END
GROUPBOX DLG_NULL 64 4
BEGIN
PROMPT 1 6 "@bSelezione"
PROMPT 1 9 "@bSelezione"
END
NUMBER F_FROMPAGE 4
BEGIN
PROMPT 2 7 "Da pagina "
PROMPT 2 10 "Da pagina "
CHECKTYPE REQUIRED
FLAGS "U"
END
NUMBER F_TOPAGE 4
BEGIN
PROMPT 2 8 "a pagina "
PROMPT 2 11 "a pagina "
FLAGS "U"
END
NUMBER F_COPIES 3
BEGIN
PROMPT 43 7 "Numero di copie "
PROMPT 43 10 "Numero di copie "
FLAGS "U"
CHECKTYPE REQUIRED
END
BUTTON DLG_PRINT 10 2
ENDPAGE
TOOLBAR "topbar" 0 0 0 2
BUTTON DLG_PRINT 2 2
BEGIN
PROMPT -12 -1 ""
PROMPT 1 -1 ""
END
BUTTON DLG_NULL 2 2
BEGIN
PROMPT -1 -1 ""
END
BUTTON DLG_INFO 10 2
BEGIN
PROMPT 2 -1 ""
END
BUTTON DLG_HELP 2 2
BEGIN
PROMPT 3 -1 ""
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -22 -1 ""
PROMPT 4 -1 ""
END
ENDPAGE

View File

@ -38,6 +38,7 @@
#define DLG_HELP 34 /* TAG del bottone Help */
#define DLG_EXPORT 35 /* TAG del bottone Esporta*/
#define DLG_IMPORT 36 /* TAG del bottone Importa*/
#define DLG_PREVIEW 37 /* TAG del bottone Anteprima*/
#define DLG_USER 100 /* TAG del primo controllo definito dall'utente */
/* @M

View File

@ -547,17 +547,17 @@ TFile_info::~TFile_info()
TFile_info& TFile_manager::fileinfo(TIsam_handle num) const
{
TFile_info* i = (TFile_info*)_fileinfo.objptr(num);
if (i == NULL && num > 0 && num < LF_EXTERNAL)
if (i == NULL && num >= LF_USER && num < LF_EXTERNAL)
{
TFilename name;
i = new TFile_info(num, name);
if (i->ok())
//if (i->ok())
((TFile_manager*)this)->_fileinfo.add(i, num);
else
/* else
{
delete i;
i = NULL;
}
}*/
}
CHECKD(i, "Unknown file ", num);

View File

@ -465,7 +465,9 @@ bool TPrint_txt_info::edit()
msk.set(F_FORM, p.get_form_name());
msk.set(F_FONT, p.fontname());
msk.set(F_SIZE, p.get_char_size());
msk.set(F_ISGRAPHICS, p.isgraphics() ? "X" : "");
msk.set(F_LINES, p.get_lines_per_inch());
msk.set(F_ORIENT, p.is_portrait() ? 1 : 2);
msk.set(F_ISGRAPHICS, p.isgraphics());
msk.set(F_FROMPAGE, _pagefrom);
msk.set(F_TOPAGE, _lastpage);
msk.set(F_COPIES, _copies);
@ -2219,3 +2221,10 @@ void TPrinter::set_portrait_orientation(bool portrait)
if (portrait != is_portrait)
xvt_app_escape(XVT_ESC_SET_PRINTER_INFO, rcd, &pw, &ph, NULL, NULL);
}
bool TPrinter::is_landscape() const
{
long ph = 0, pw = 0;
xvt_app_escape (XVT_ESC_GET_PRINTER_INFO, _print_rcd, &ph, &pw, NULL, NULL);
return pw > ph;
}

View File

@ -624,6 +624,9 @@ public:
void set_portrait_orientation(bool port = true);
void set_landscape_orientation(bool land = true) { set_portrait_orientation(!land); }
bool is_landscape() const;
bool is_portrait() const { return !is_landscape(); }
bool manual_setup() const { return _manual_setup; }
};

View File

@ -202,7 +202,7 @@ void TIndwin::update_txt()
set_color(NORMAL_COLOR, MASK_BACK_COLOR);
set_opaque_text(TRUE);
set_font();
advanced_draw_paragraph(*this, _text, r, 'L', 'C', CHARY);
advanced_draw_paragraph(w, _text, r, 'L', 'C', CHARY);
}
void TIndwin::update()

View File

@ -723,6 +723,7 @@ static void sort_files(TString_array& files)
if (files.row(j) == files.row(j-1))
files.destroy(j);
}
files.pack();
}
static bool get_xml_attr(const TString& line, const char* attr, TString& value)
@ -824,7 +825,7 @@ bool list_custom_files(const char* ext, const char* classe, TString_array& files
bool select_custom_file(TFilename& path, const char* ext, const char* classe)
{
TArray_sheet sheet(-1, -1, 78, 20, TR("Selezione"), HR("Nome@8|Classe@8|Descrizione@50|Custom"));
TArray_sheet sheet(-1, -1, 78, 20, TR("Selezione"), HR("Nome@16|Classe@8|Descrizione@50|Custom"));
TString_array& files = sheet.rows_array();
TFilename first = path.name(); first.ext(""); // Riga su cui posizionarsi
bool ok = list_custom_files(ext, classe, files);

View File

@ -23,15 +23,13 @@ static bool _print_aborted = false;
// Utility
///////////////////////////////////////////////////////////
static void advanced_draw_justified_text_line(TWindow& win, const char* text, short x, short y, short dx)
static void advanced_draw_justified_text_line(WINDOW w, const char* text, short x, short y, short dx)
{
TString256 txt(text); txt.rtrim();
int spaces = 0;
for (int s = 0; txt[s]; s++)
if (isspace(txt[s])) spaces++;
WINDOW w = win.win();
// Il testo e' giustificabile se ha degli spazi ed occupa meno della riga
if (spaces > 0)
{
@ -61,10 +59,8 @@ static void advanced_draw_justified_text_line(TWindow& win, const char* text, sh
xvt_dwin_draw_text(w, x, y, txt, -1); // Stringa senza spazi
}
void advanced_draw_text_line(TWindow& win, const char* text, const RCT& r, char halign, char valign)
void advanced_draw_text_line(WINDOW w, const char* text, const RCT& r, char halign, char valign)
{
WINDOW w = win.win();
const short dx = r.right-r.left;
const short dy = r.bottom-r.top;
short x = r.left;
@ -109,7 +105,7 @@ void advanced_draw_text_line(TWindow& win, const char* text, const RCT& r, char
if (can_draw)
{
if (halign == 'J')
advanced_draw_justified_text_line(win, text, x, y, dx);
advanced_draw_justified_text_line(w, text, x, y, dx);
else
xvt_dwin_draw_text(w, x, y, text, -1);
if (restore_clip)
@ -130,14 +126,14 @@ bool finisce_per_punto(const TString& str)
return yes;
}
void advanced_draw_paragraph(TWindow& win, const TString_array& para, const RCT& rct,
void advanced_draw_paragraph(WINDOW win, const TString_array& para, const RCT& rct,
char halign, char valign, int default_10row_height)
{
const int rows = para.items();
if (rows > 1) // Devo scrivere piu' righe?
{
int leading, ascent, descent;
xvt_dwin_get_font_metrics(win.win(), &leading, &ascent, &descent);
xvt_dwin_get_font_metrics(win, &leading, &ascent, &descent);
int ky10 = (leading + ascent + descent) * 10;
// Aggiusta l'altezza di una riga standard, se necessario
@ -257,16 +253,18 @@ protected:
void page_select();
void popup_menu(EVENT* ep);
const TReport_link* find_link(const PNT& pnt) const;
void draw_page(int pg);
virtual void handler(WINDOW win, EVENT* ep);
virtual void update();
virtual bool on_key(KEY k);
void update_scroll_range();
void do_scroll(int kx, int ky);
public:
virtual PNT log2dev(long lx, long ly) const;
void update_scroll_range();
TAssoc_array& alinks() { return _alinks; }
TPointer_array& plinks() { return _plinks; }
@ -277,7 +275,7 @@ public:
PNT TPrint_preview_window::log2dev(long lx, long ly) const
{
PNT pnt = { short(lx), short(ly) };
PNT pnt = { short(ly), short(lx) };
const TPoint res = _book->page_res();
if (res.x > 0 && res.y > 0) // Should always be true :-)
@ -295,38 +293,37 @@ PNT TPrint_preview_window::log2dev(long lx, long ly) const
void TPrint_preview_window::update_scroll_range()
{
PNT pnt = { 0, 0 };
update_thumb(0, 0); // Azzero origine
const TPoint res = _book->page_res();
if (res.x > 0 && res.y > 0) // Should always be true :-)
{
const TPoint size = _book->page_size();
pnt.h = short(size.x * _zoom / res.x);
pnt.v = short(size.y * _zoom / res.y);
const TPoint pag = _book->page_size();
const PNT pnt = log2dev(pag.x, pag.y);
RCT rct; xvt_vobj_get_client_rect(win(), &rct);
pnt.h -= rct.right; if (pnt.h < 0) pnt.h = 0;
pnt.v -= rct.bottom; if (pnt.v < 0) pnt.v = 0;
set_thumb_size(rct.right, rct.bottom);
}
RCT rct; xvt_vobj_get_client_rect(win(), &rct);
const PNT siz = { rct.bottom, rct.right };
update_thumb(0, 0);
set_scroll_max(pnt.h, pnt.v);
set_thumb_size(siz.h, siz.v);
}
void TPrint_preview_window::update()
void TPrint_preview_window::draw_page(int pg)
{
clear(MASK_BACK_COLOR);
RCT rct; xvt_vobj_get_client_rect(win(), &rct);
const TPoint size = _book->page_size();
const PNT pag = log2dev(size.x, size.y);
const PNT ori = log2dev(0, 0);
if (ori.h > 0) rct.left = ori.h;
if (ori.v > 0) rct.top = ori.v;
if (pag.h < rct.right) rct.right = pag.h;
if (pag.v < rct.bottom) rct.bottom = pag.v;
hide_pen();
hide_pen(); // Disegna foglio bianco
set_brush(COLOR_WHITE);
xvt_dwin_draw_rect(win(), &rct); // Disegna foglio bianco
xvt_dwin_draw_rect(win(), &rct);
set_pen(COLOR_GRAY); // Disegna ombra grigia
const PNT poly[4] = { {rct.bottom,rct.left+1}, {rct.bottom,rct.right+1}, {rct.top+1,rct.right+1}, {0,0} };
xvt_dwin_draw_polyline(win(), poly, 3); // Disegna ombra
if (_grid)
{
@ -343,7 +340,7 @@ void TPrint_preview_window::update()
const int cpi = _book->cpi();
for (int j = 1; cpi > 0; j++)
{
set_pen(j%10 ? XVT_MAKE_COLOR(232,232,255) : XVT_MAKE_COLOR(255,192,255));
set_pen(j%10 ? XVT_MAKE_COLOR(232,232,255) : XVT_MAKE_COLOR(255,192,255));
const short x = short(j * res.x / cpi);
if (x > size.x)
break;
@ -351,17 +348,55 @@ void TPrint_preview_window::update()
}
}
_book->print_page(*this, _page);
_book->print_page(*this, pg);
}
TString80 str; str.format(FR("Pagina %u di %u"), _page, _book->pages());
void TPrint_preview_window::update()
{
clear(MASK_BACK_COLOR);
draw_page(_page);
size_t last_page = _page;
const size_t pages = _book->pages();
if (_page < pages)
{
const TPoint o = origin();
set_origin(0, 0);
const TPoint size = _book->page_size();
const PNT pag = log2dev(size.x, size.y);
RCT rct; xvt_vobj_get_client_rect(win(), &rct);
const int nh = rct.right / (pag.h+2), nv = rct.bottom / (pag.v+2);
if (nh > 1 || nv > 1)
{
for (int v = 0; v < nv; v++)
{
for (int h = 0; h < nh; h++)
{
if ((h > 0 || v > 0) && last_page < pages)
{
set_origin(o.x - h*rct.right/nh, o.y - v*rct.bottom/nv);
draw_page(++last_page);
}
}
}
}
set_origin(o.x, o.y);
}
TString80 str;
if (last_page > _page)
str.format(FR("Pagine da %u a %u di %u"), _page, last_page, pages);
else
str.format(FR("Pagina %u di %u"), _page, pages);
statbar_set_title(TASK_WIN, str);
TMask& m = owner().mask();
m.enable(DLG_FIRSTREC, _page > 1);
m.enable(DLG_PREVREC, _page > 1);
m.enable(DLG_FINDREC, _book->pages() > 1);
m.enable(DLG_NEXTREC, _page < _book->pages());
m.enable(DLG_LASTREC, _page < _book->pages());
m.enable(DLG_FINDREC, pages > 1);
m.enable(DLG_NEXTREC, _page < pages);
m.enable(DLG_LASTREC, _page < pages);
}
#define POPUP_FIRST 20883
@ -383,7 +418,7 @@ void TPrint_preview_window::popup_menu(EVENT* ep)
menu[3].tag = POPUP_LAST; menu[3].text = (char*)PR("Ultima"); menu[3].enabled = _page < _book->pages();
menu[4].tag = -1; menu[4].separator = true;
menu[5].tag = POPUP_ZOOMIN; menu[5].text = (char*)PR("Zoom +"); menu[5].enabled = _zoom < 300;
menu[6].tag = POPUP_ZOOMOUT; menu[6].text = (char*)PR("Zoom -"); menu[6].enabled = _zoom > 50;
menu[6].tag = POPUP_ZOOMOUT; menu[6].text = (char*)PR("Zoom -"); menu[6].enabled = _zoom > 35;
menu[7].tag = -1; menu[7].separator = true;
menu[8].tag = POPUP_GRID; menu[8].text = (char*)PR("Griglia"); menu[8].enabled = true;
menu[8].checkable = true; menu[8].checked = _grid;
@ -396,7 +431,7 @@ void TPrint_preview_window::page_select()
{
TMask m(TR("Ricerca"), 1, 28, 4);
m.add_number(101, 0, PR("Pagina "), 1, 1, 4, "U").check_type(CHECK_REQUIRED);
m.add_number(101, 0, PR("Pagina "), 1, 1, 4, "U").check_type(CHECK_REQUIRED);
m.add_button(DLG_OK, 0, "", -12, -1, 10, 2);
m.add_button(DLG_CANCEL, 0, "", -22, -1, 10, 2);
if (m.run())
@ -497,7 +532,7 @@ void TPrint_preview_window::handler(WINDOW win, EVENT* ep)
if (processed) _page = _book->pages();
break;
case POPUP_ZOOMIN : if (_zoom < 300) { _zoom += 10; update_scroll_range(); } break;
case POPUP_ZOOMOUT: if (_zoom > 50) { _zoom -= 10; update_scroll_range(); } break;
case POPUP_ZOOMOUT: if (_zoom > 35) { _zoom -= 10; update_scroll_range(); } break;
case POPUP_GRID : _grid = !_grid; break;
default:processed = false; break;
}
@ -576,11 +611,10 @@ bool TPrint_preview_window::on_key(KEY k)
TPrint_preview_window::TPrint_preview_window(int x, int y, int dx, int dy, WINDOW parent,
TWindowed_field* owner, TBook* book)
: TField_window(x, y, dx, dy, parent, owner), _book(book), _page(1), _zoom(100), _grid(false)
{
: TField_window(x, y, dx, dy, parent, owner), _book(book),
_page(1), _zoom(100), _grid(false)
{
_pixmap = true;
update_scroll_range();
TConfig ini(CONFIG_GUI, "Preview");
_grid = ini.get_bool("Grid");
}
@ -646,8 +680,9 @@ bool TPreview_mask::on_key(KEY k)
case K_NEXT :
case 'G' :
case 'g' :
dispatch_e_char(_pvf->win().win(), k);
return true;
if (_pvf != NULL)
return _pvf->win().on_key(k);
break;
default:
break;
}
@ -657,10 +692,25 @@ bool TPreview_mask::on_key(KEY k)
void TPreview_mask::handler(WINDOW win, EVENT* ep)
{
// Riflessione eventi di scroll
if (ep->type == E_HSCROLL || ep->type == E_VSCROLL)
::dispatch_event(_pvf->win().win(), *ep, false);
else
switch (ep->type)
{
case E_HSCROLL:
case E_VSCROLL:
if (_pvf != NULL)
::dispatch_event(_pvf->win().win(), *ep, false);
break;
case E_SIZE:
if (_pvf != NULL)
{
TPrint_preview_window& ppw = (TPrint_preview_window&)_pvf->win();
xvt_vobj_maximize(ppw.win());
ppw.update_scroll_range();
}
break;
default:
TAutomask::handler(win, ep);
break;
}
}
bool TPreview_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
@ -671,13 +721,13 @@ bool TPreview_mask::on_field_event(TOperable_field& o, TField_event e, long joll
switch (o.dlg())
{
case DLG_FIRSTREC: idm = POPUP_FIRST; break;
case DLG_PREVREC : idm = POPUP_PREV; break;
case DLG_PREVREC : idm = POPUP_PREV; break;
case DLG_FINDREC : idm = POPUP_SEARCH; break;
case DLG_NEXTREC : idm = POPUP_NEXT; break;
case DLG_LASTREC : idm = POPUP_LAST; break;
default: break;
}
if (idm > 0)
if (idm > 0 && _pvf != NULL)
dispatch_e_menu(_pvf->win().win(), idm);
}
return true;
@ -693,9 +743,9 @@ TMask_field* TPreview_mask::parse_field(TScanner& scanner)
return TAutomask::parse_field(scanner);
}
TPreview_mask::TPreview_mask(TBook* book) : _book(book)
TPreview_mask::TPreview_mask(TBook* book) : _book(book), _pvf(NULL)
{
read_mask("bagn008", 0, -1);
read_mask("bagn008", 0, -1);
set_handlers();
}
@ -1137,7 +1187,7 @@ void TBook::print_doc(TWindow& win, const TFilename& name)
TPoint ps = page_size();
TRectangle rect(TPoint(0,0), ps);
RCT page; win.log2dev(rect, page);
advanced_draw_text_line(win, name, page, 'C', 'T');
advanced_draw_text_line(win.win(), name, page, 'C', 'T');
TString8 ext = name.ext(); ext.lower();
if (ext == "bmp" || ext == "gif" || ext == "jpg" || ext == "jpeg" || ext == "png")
@ -1266,7 +1316,7 @@ bool TBook::print_page(TWindow& win, size_t page)
xvt_font_set_style(newfont, xvt_font_get_style(oldfont) | XVT_FS_UNDERLINE);
xvt_dwin_set_font(w, newfont);
win.set_color(COLOR_BLUE, dct.back_color);
advanced_draw_text_line(win, stringona, rct, _horizontal_alignment, _vertical_alignment);
advanced_draw_text_line(w, stringona, rct, _horizontal_alignment, _vertical_alignment);
win.set_color(dct.fore_color, dct.back_color);
xvt_dwin_set_font(w, oldfont);
xvt_font_destroy(oldfont);
@ -1352,7 +1402,7 @@ bool TBook::print_page(TWindow& win, size_t page)
if (str == "<pages/>")
{
TString8 str; str.format("%u", pages());
advanced_draw_text_line(win, str, rct, _horizontal_alignment, _vertical_alignment);
advanced_draw_text_line(w, str, rct, _horizontal_alignment, _vertical_alignment);
continue;
}
if (str.starts_with("<pen "))
@ -1397,7 +1447,7 @@ bool TBook::print_page(TWindow& win, size_t page)
break;
paragrafo.add(str);
}
advanced_draw_paragraph(win, paragrafo, rct,
advanced_draw_paragraph(win.win(), paragrafo, rct,
_horizontal_alignment, _vertical_alignment,
default_10row_height);
@ -1846,8 +1896,9 @@ bool TBook::print(size_t pagefrom, size_t pageto, word copies)
msk.set(F_FORM, p.get_form_name());
msk.set(F_FONT, p.fontname());
msk.set(F_SIZE, p.get_char_size());
msk.set(F_ISGRAPHICS, p.isgraphics() ? "X" : "");
msk.set(F_LINES, p.get_lines_per_inch());
msk.set(F_ORIENT, p.is_portrait() ? 1 : 2);
msk.set(F_ISGRAPHICS, p.isgraphics());
msk.set(F_FROMPAGE, 1);
msk.set(F_TOPAGE, pages());
msk.set(F_COPIES, 1);
@ -2635,7 +2686,14 @@ bool TReport_book::print(size_t pagefrom, size_t pageto, word copies)
msk.set(F_FONT, _report->print_font().name());
msk.set(F_SIZE, _report->print_font().size());
}
msk.set(F_ISGRAPHICS, p.isgraphics() ? "X" : "");
else
{
msk.set(F_FONT, p.fontname());
msk.set(F_SIZE, p.get_char_size());
}
msk.set(F_LINES, lpi());
msk.set(F_ORIENT, p.is_portrait() ? 1 : 2);
msk.set(F_ISGRAPHICS, p.isgraphics());
msk.set(F_FROMPAGE, 1);
msk.set(F_TOPAGE, pages());
msk.set(F_COPIES, 1);

View File

@ -131,15 +131,15 @@ public:
virtual int cpi() const;
virtual int logical_page_width() const { return _logical_page_width; }
virtual int logical_page_height() const { return _logical_page_height; }
virtual bool print(size_t pagefrom = 0, size_t pageto = 0, word copies = 0);
virtual bool archive(const char* repname = NULL);
virtual bool print(size_t pagefrom = 0, size_t pageto = 0, word copies = 0);
virtual bool archive(const char* repname = NULL);
TReport_book(const char* name = NULL);
};
bool advanced_set_draw_tools(TWindow& win, PAT_STYLE pat, int border, COLOR fore, COLOR back);
void advanced_draw_rect(TWindow& win, const RCT& r, PAT_STYLE pat, int border, COLOR fore, COLOR back, int radius, int shade);
void advanced_draw_text_line(TWindow& win, const char* text, const RCT& r, char halign, char valign);
void advanced_draw_paragraph(TWindow& win, const TString_array& text, const RCT& r,
void advanced_draw_text_line(WINDOW win, const char* text, const RCT& r, char halign, char valign);
void advanced_draw_paragraph(WINDOW win, const TString_array& text, const RCT& r,
char halign, char valign, int default_row_height);
#endif

View File

@ -83,66 +83,66 @@ void TButton_tool::create(WINDOW toolbar)
switch (dlg())
{
case DLG_OK:
if (_ctl_data._prompt.empty())
if (_ctl_data._prompt.blank())
_ctl_data._prompt = TR("Conferma");
set_exit_key(K_ENTER);
if (_ctl_data._bmp_up <= 0)
_ctl_data._bmp_up = BMP_OK;
_ctl_data._bmp_up = TOOL_OK;
break;
case DLG_CANCEL:
if (_ctl_data._prompt.empty())
if (_ctl_data._prompt.blank())
_ctl_data._prompt = TR("Annulla");
_virtual_key = K_ESC;
set_exit_key(K_ESC);
if (_ctl_data._bmp_up <= 0)
_ctl_data._bmp_up = BMP_CANCEL;
_ctl_data._bmp_up = TOOL_CANCEL;
break;
case DLG_DELREC:
if (_ctl_data._prompt.empty())
if (_ctl_data._prompt.blank())
_ctl_data._prompt = TR("~Elimina");
set_exit_key(K_DEL);
if (_ctl_data._bmp_up <= 0)
_ctl_data._bmp_up = BMP_DELREC;
_ctl_data._bmp_up = TOOL_DELREC;
break;
case DLG_PRINT:
if (_ctl_data._prompt.empty())
if (_ctl_data._prompt.blank())
_ctl_data._prompt = TR("~Stampa");
set_exit_key(K_ENTER);
if (_ctl_data._bmp_up <= 0)
_ctl_data._bmp_up = BMP_PRINT;
_ctl_data._bmp_up = TOOL_PRINT;
break;
case DLG_SETPRINT:
if (_ctl_data._prompt.empty())
_ctl_data._prompt = TR("Imposta Stampante");
if (_ctl_data._prompt.blank())
_ctl_data._prompt = TR("Imposta");
set_exit_key(M_FILE_PG_SETUP);
if (_ctl_data._bmp_up <= 0)
_ctl_data._bmp_up = BMP_SETPRINT;
_ctl_data._bmp_up = TOOL_SETPRINT;
break;
case DLG_QUIT:
if (_ctl_data._prompt.empty())
if (_ctl_data._prompt.blank())
_ctl_data._prompt = TR("Fine");
_virtual_key = K_F4; // Alt+F4
set_exit_key(K_QUIT);
if (_ctl_data._bmp_up <= 0)
_ctl_data._bmp_up = BMP_QUIT;
_ctl_data._bmp_up = TOOL_QUIT;
break;
case DLG_SELECT:
if (_ctl_data._bmp_up <= 0)
_ctl_data._bmp_up = BMP_SELECT;
_ctl_data._bmp_up = TOOL_SELECT;
set_exit_key(K_ENTER);
break;
case DLG_HELP:
if (_ctl_data._prompt.empty())
if (_ctl_data._prompt.blank())
_ctl_data._prompt = TR("Help");
if (_ctl_data._bmp_up <= 0)
_ctl_data._bmp_up = BMP_HELP;
_ctl_data._bmp_up = TOOL_HELP;
set_exit_key(K_F1);
break;
case DLG_INFO:
if (_ctl_data._prompt.empty())
_ctl_data._prompt = TR("Informazioni");
if (_ctl_data._prompt.blank())
_ctl_data._prompt = TR("Info");
if (_ctl_data._bmp_up <= 0)
_ctl_data._bmp_up = BMP_INFO;
_ctl_data._bmp_up = TOOL_INFO;
set_exit_key(K_F2);
break;
default:

View File

@ -104,9 +104,10 @@
#define BMP_DIRDNSEL 173
#define BMP_PDF 174
#define BMP_ARCHIVE 175
#define BMP_PREVIEW 176
#define BMP_FONT 179
#define BMP_COPY 180
#define BMP_CLOSETURN 206
#define BMP_CLOSESCONTR 207
#define BMP_SUSPSCONTR 208
@ -145,6 +146,8 @@
#define TOOL_HELP 163
#define TOOL_SETPRINT 165
#define TOOL_LENTE 166
#define TOOL_PDF 174
#define TOOL_PREVIEW 176
#define TOOL_FONT 179
#define TOOL_COPY 180
#define TOOL_PREF 204

View File

@ -355,6 +355,9 @@ protected:
// @cmember Converte le coordinate logiche (caratteri) in coordinate fisiche (pixel)
virtual PNT log2dev(long x, long y) const;
// @cmember Forza le coordinate dell'origine: USO INTERNO
void set_origin(long x, long y) { _origin.set(x, y); }
// @access Public Member
public:
// @cmember Costruttore