|
|
Home » Developing U++ » U++ TheIDE and Library: Releases and ChangeLogs » RichText/QTF minimal cell height
|
Re: RichText/QTF minimal cell height [message #4428 is a reply to message #4426] |
Sun, 06 August 2006 19:58   |
|
Thanks for such a quick implementation.
Take a look at this:
#include <CtrlLib/CtrlLib.h>
#include <Report/Report.h>
GUI_APP_MAIN
{
String qtf;
Vector<String> data;
int rows=4;
int cols=3;
int i;
double leftMargin=1.0;
double topMargin=.5;
// 8.5" x 600 dots/in = 5100 dots
// 11" x 600 dots/in = 6600 dots
Size sz(5100-(1200*leftMargin),6600-(1200*topMargin));
Report report(sz);
int rowheight=sz.cy/rows;
for(i=1;i<(rows*cols+1);i++)
data.Add("cell "+AsString(i));
qtf << "[ $$0,0#00000000000000000000000000000000:Default]";
qtf << "[{_}\r\n";
qtf << "[ {{500";
for(i=1;i<cols;i++)
qtf << ":500";
qtf << "H" << rowheight << "l/0r/0t/0b/0 ";
// Cell one doesn't start with ::
qtf << "[s0;= " << data[0] << "]\r\n";
for(i=1;i<data.GetCount();i++)
{
qtf << ":: [s0;= " << data[i] << "]\r\n";
}
qtf << "}}]\r\n";
report << qtf;
Perform(report);
}
It didn't apply to last row.
Also, interestingly, report.NoHeader().NoFooter() crashed the program.
|
|
|
Re: RichText/QTF minimal cell height [message #4430 is a reply to message #4428] |
Sun, 06 August 2006 20:17   |
|
Doing some more testing, I am alerting myself of the calculated row height. I am then printing it to a pdf and examining the contents.
When it said 600dots, the pdf rows were 900 dots.
When it said 1200dots, pdf was 1500.
3000 printed with 3300.
Where are these extra 300 dots coming from in each row?
|
|
|
|
Re: RichText/QTF minimal cell height [message #4434 is a reply to message #4433] |
Mon, 07 August 2006 02:53   |
|
Thanks. You have no idea how much help you are.
luzr wrote on Sun, 06 August 2006 17:02 | The reason why it did not applied to the last row is that the row would extent past physical page (hard to find a right solution here...).
|
The tests have the borders just so you can see it. In the app I'm developing the widths are zero. If you add up the rows (after the fix you applied) it is exactly the correct number of dots. But the last row still displays short. As a test, I saidint rowheight=sz.cy/rows-1; and it shows correctly (although each row is one dot short).
It's like somewhere in there it says
if (requested min height < whats available)
make it requested min height
when it should be <=
Or am I incorrect?
|
|
|
|
|
|
Goto Forum:
Current Time: Tue Jul 01 15:54:23 CEST 2025
Total time taken to generate the page: 0.05138 seconds
|
|
|