Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ TheIDE and Library: Releases and ChangeLogs » RichText/QTF minimal cell height
RichText/QTF minimal cell height [message #4426] Sun, 06 August 2006 16:14 Go to next message
mirek is currently offline  mirek
Messages: 14263
Registered: November 2005
Ultimate Member
...now added. In QTF, it is "Hn" where n is minimal cell height in dots. (Minimal because if content of cell is taller, it takes over).

Mirek
Re: RichText/QTF minimal cell height [message #4428 is a reply to message #4426] Sun, 06 August 2006 19:58 Go to previous messageGo to next message
rbmatt is currently offline  rbmatt
Messages: 90
Registered: July 2006
Location: Tennesse, USA
Member

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 Go to previous messageGo to next message
rbmatt is currently offline  rbmatt
Messages: 90
Registered: July 2006
Location: Tennesse, USA
Member

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 #4433 is a reply to message #4428] Sun, 06 August 2006 23:02 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14263
Registered: November 2005
Ultimate Member
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...).

When you are computing that row height, you forgot to add thickness of table grid lines.

NoHeader and NoFooter should be now fixed.

The physical height problem was also a bug - fixed.

Thanks for reporting Smile

Going to sync uvs...

Mirek
Re: RichText/QTF minimal cell height [message #4434 is a reply to message #4433] Mon, 07 August 2006 02:53 Go to previous messageGo to next message
rbmatt is currently offline  rbmatt
Messages: 90
Registered: July 2006
Location: Tennesse, USA
Member

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 said
int 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?
Re: RichText/QTF minimal cell height [message #4435 is a reply to message #4434] Mon, 07 August 2006 08:37 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14263
Registered: November 2005
Ultimate Member
Forget borders, I am speaking about grid lines and table frame...

(In fact, I am confused that subtracting 1 would solve that - it is too little Wink

Mirek
Re: RichText/QTF minimal cell height [message #4437 is a reply to message #4434] Mon, 07 August 2006 13:35 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14263
Registered: November 2005
Ultimate Member
rbmatt wrote on Sun, 06 August 2006 20:53


when it should be <=
Or am I incorrect?


OK, you was right, it was < vs. <= issue Smile

Now fixed.

Mirek
Re: RichText/QTF minimal cell height [message #4440 is a reply to message #4437] Tue, 08 August 2006 06:19 Go to previous message
rbmatt is currently offline  rbmatt
Messages: 90
Registered: July 2006
Location: Tennesse, USA
Member

luzr wrote on Mon, 07 August 2006 07:35

Now fixed.

Mirek, you are awesome. Thanks so much.
Previous Topic: Report::Margins
Next Topic: EditField topic created, chapters 17 and 18 of GUI tutorial added
Goto Forum:
  


Current Time: Tue Jul 01 15:54:23 CEST 2025

Total time taken to generate the page: 0.05138 seconds