Patch level : 4.0 451
Files correlati : Ricompilazione Demo : [ ] Commento : Riportata la versione 3.1 650 git-svn-id: svn://10.65.10.50/trunk@14154 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
8b6153b4c2
commit
503e5dc0a0
@ -10,7 +10,7 @@
|
|||||||
#include <nditte.h>
|
#include <nditte.h>
|
||||||
#include <unloc.h>
|
#include <unloc.h>
|
||||||
|
|
||||||
static const char MAX_STRING[2] = {255, 0};
|
static const char MAX_STRING[2] = {(char) 255, 0};
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// TReport_font
|
// TReport_font
|
||||||
|
@ -127,7 +127,6 @@ bool finisce_per_punto(const TString& str)
|
|||||||
void advanced_draw_paragraph(TWindow& win, const TString_array& para, const RCT& rct,
|
void advanced_draw_paragraph(TWindow& win, const TString_array& para, const RCT& rct,
|
||||||
char halign, char valign, int default_10row_height)
|
char halign, char valign, int default_10row_height)
|
||||||
{
|
{
|
||||||
const bool acapo = para.find("\n") >= 0;
|
|
||||||
|
|
||||||
int leading, ascent, descent;
|
int leading, ascent, descent;
|
||||||
xvt_dwin_get_font_metrics(win.win(), &leading, &ascent, &descent);
|
xvt_dwin_get_font_metrics(win.win(), &leading, &ascent, &descent);
|
||||||
@ -140,14 +139,13 @@ void advanced_draw_paragraph(TWindow& win, const TString_array& para, const RCT&
|
|||||||
const int rct_height = rct.bottom - rct.top;
|
const int rct_height = rct.bottom - rct.top;
|
||||||
int rows = (rct_height * 11) / ky10; // Sto abbondante del 10% (*11/10) altrimenti risulta spesso 0
|
int rows = (rct_height * 11) / ky10; // Sto abbondante del 10% (*11/10) altrimenti risulta spesso 0
|
||||||
|
|
||||||
if (acapo || rows > 1) // Devo scrivere piu' righe?
|
if (rows > 1 || para.items() >1) // Devo scrivere piu' righe?
|
||||||
{
|
{
|
||||||
const int kx10 = xvt_dwin_get_text_width(win.win(), "MMMMMMMMMM", 10);
|
const int kx10 = xvt_dwin_get_text_width(win.win(), "MMMMMMMMMM", 10);
|
||||||
const unsigned columns = (rct.right - rct.left) * 10 / kx10;
|
const unsigned columns = (rct.right - rct.left) * 10 / kx10;
|
||||||
|
|
||||||
TParagraph_string str(para, columns);
|
if (para.items() < rows)
|
||||||
if (str.items() < rows)
|
rows = para.items();
|
||||||
rows = str.items();
|
|
||||||
|
|
||||||
int ybase = rct.top;
|
int ybase = rct.top;
|
||||||
switch (valign)
|
switch (valign)
|
||||||
@ -162,14 +160,14 @@ void advanced_draw_paragraph(TWindow& win, const TString_array& para, const RCT&
|
|||||||
RCT rctline = rct;
|
RCT rctline = rct;
|
||||||
rctline.top = ybase + (ky10 * row) / 10;
|
rctline.top = ybase + (ky10 * row) / 10;
|
||||||
rctline.bottom = rctline.top + ky10 / 10;
|
rctline.bottom = rctline.top + ky10 / 10;
|
||||||
const char* line = str.get();
|
const char* line = para.row(row);
|
||||||
if (halign == 'J' && (row == rows-1 || strlen(line) < columns/2))
|
if (halign == 'J' && (row == rows-1 || strlen(line) < columns/2))
|
||||||
halign = 'L';
|
halign = 'L';
|
||||||
advanced_draw_text_line(win, line, rctline, halign, 'T');
|
advanced_draw_text_line(win, line, rctline, halign, 'T');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
advanced_draw_text_line(win, para, rct, halign, valign);
|
advanced_draw_text_line(win, para.row(0), rct, halign, valign);
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
|
Loading…
x
Reference in New Issue
Block a user