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 » U++ Library support » RichText,QTF,RTF... » QTF text alignment in tables
QTF text alignment in tables [message #26783] Thu, 27 May 2010 13:42 Go to next message
bushman is currently offline  bushman
Messages: 134
Registered: February 2009
Experienced Member
Is it possible to right-align text inside a table cell?
I´ve tried {{1:1 left-aligned ::> right-aligned }} and {{1:1 left-aligned :: [> right-aligned] }}, but both failed.

Thanks!
Re: QTF text alignment in tables [message #26784 is a reply to message #26783] Thu, 27 May 2010 14:07 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

kropniczki wrote on Thu, 27 May 2010 13:42

Is it possible to right-align text inside a table cell?
I´ve tried {{1:1 left-aligned ::> right-aligned }} and {{1:1 left-aligned :: [> right-aligned] }}, but both failed.

Thanks!


Hi kropniczki,

This should work:
{{1:1:1 [< left aligned]:: [= center aligned]:: [> right aligned]}}


Litlle hint: If you want to use some complex QTF, you can try to design it in T++ (or in UWord) and read the .tpp (or .qtf) file in plain text editor to get the idea Wink

Best regards,
Honza
Re: QTF text alignment in tables [message #26790 is a reply to message #26784] Fri, 28 May 2010 13:02 Go to previous messageGo to next message
bushman is currently offline  bushman
Messages: 134
Registered: February 2009
Experienced Member
Yes, thank u so much for the prompt answer!
Although it does work wonderfully when I´m using UWord, it fails if I try to output the formatted text to a printer, like in

String qtf;
qtf = "{{5000:5000 [s0;>%% right-align] :: [s0;%% whatever]}}";
Report report;	
report << qtf;	
Perform(report);


Anyway, it simply does NOT right-align the text. Could it be, dare to say, due to some bug? What am I doing wrong?

Thanks again!

[Updated on: Fri, 28 May 2010 13:11]

Report message to a moderator

Re: QTF text alignment in tables [message #26791 is a reply to message #26790] Fri, 28 May 2010 13:40 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

kropniczki wrote on Fri, 28 May 2010 13:02

Yes, thank u so much for the prompt answer!
Although it does work wonderfully when I´m using UWord, it fails if I try to output the formatted text to a printer, like in

String qtf;
qtf = "{{5000:5000 [s0;>%% right-align] :: [s0;%% whatever]}}";
Report report;	
report << qtf;	
Perform(report);


Anyway, it simply does NOT right-align the text. Could it be, dare to say, due to some bug? What am I doing wrong?

Thanks again!


Hi,

I tested it just simply using PromptOK("qtf text..."). If it works on screen and fails on printer, than it is most probably a bug.

I'm afraid I can't help on this one Sad Hopefully someone else will have a look at it...

Honza
Re: QTF text alignment in tables [message #26798 is a reply to message #26790] Fri, 28 May 2010 15:10 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
[quote title=kropniczki wrote on Fri, 28 May 2010 07:02]
qtf = "{{5000:5000 [s0;>%% right-align] :: [s0;%% whatever]}}";


The problem is caused by the space you have placed before "::" - this means that for the last character of paragraph, the right align is not active anymore. And attributes of this character are used to determine the format of whole paragraph.
Re: QTF text alignment in tables [message #26803 is a reply to message #26798] Fri, 28 May 2010 20:03 Go to previous messageGo to next message
bushman is currently offline  bushman
Messages: 134
Registered: February 2009
Experienced Member
U must be a genius!!!
Not only you present the solution to the problem, but also explain why, which is amazing!!

Now not only ´>´ works, but also ´=´ and ´<´.

Many thanks! Very Happy Very Happy
Re: QTF text alignment in tables [message #28212 is a reply to message #26803] Mon, 23 August 2010 14:10 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
BTW, I've got an handy QTFStr class which encapsulates some of QTF behaviour, in particular for tables.
I made it because is *very* easy on qtf to make mistakes with some spaces or other stuffs, in particular in tables.

The class contains some generic stuffs and a part relative to my app, but that one is easy to strip.

An example of code using QTFStr class :

QTFStr qtf;

qtf.StartTable(1, 5, 5, 7, 8).TableTitle("I'm a table");
qtf
    ("")("second col")("third col")("fourth col")("fifth col")
    ("first col").AlignCenter()("center on table remainder", 3)
    .AlignLeft().TableSubTitle("this is bold and spans over all columns")
;
qtf.EndTable();


It doesn't support tables in tables, but it's trivial to add (I'll do it when I'll need it).

If somebody is interested on it, I'll be happy to post the code somewhere.

Ciao

Max
Re: QTF text alignment in tables [message #28218 is a reply to message #28212] Mon, 23 August 2010 16:01 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
mdelfede wrote on Mon, 23 August 2010 14:10



It doesn't support tables in tables, but it's trivial to add (I'll do it when I'll need it).




Hmmmm ... added Smile
Added also pushing/popping of format parameters for easier usage.

Ciao

Max
Re: QTF text alignment in tables [message #30787 is a reply to message #28218] Sat, 22 January 2011 16:15 Go to previous messageGo to next message
bushman is currently offline  bushman
Messages: 134
Registered: February 2009
Experienced Member

Would you mind disclosing those classes? Rolling Eyes

Tks!

Re: QTF text alignment in tables [message #33131 is a reply to message #30787] Sat, 09 July 2011 16:36 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
kropniczki wrote on Sat, 22 January 2011 16:15


Would you mind disclosing those classes? Rolling Eyes

Tks!




Ops... I've seen the post just now Rolling Eyes

If you're still interested, here is my code.... beware that it's not cleaned up and it contains many stuffs which are useful just to my app.
But you can easily strip the unneeded parts....

Max
  • Attachment: QTFStr.zip
    (Size: 5.90KB, Downloaded 405 times)
Re: QTF text alignment in tables [message #33911 is a reply to message #33131] Sun, 25 September 2011 21:49 Go to previous message
forlano is currently offline  forlano
Messages: 1182
Registered: March 2006
Location: Italy
Senior Contributor
mdelfede wrote on Sat, 09 July 2011 16:36


Ops... I've seen the post just now Rolling Eyes

If you're still interested, here is my code.... beware that it's not cleaned up and it contains many stuffs which are useful just to my app.
But you can easily strip the unneeded parts....

Max



Hello Max,

perhaps your class is what I am looking for to write easily qtf document including a table. Let me ask you if you have some minimalist demo showing some key feature of the class to start with.

Grazie,
Luigi
Previous Topic: How to include OLE objects
Next Topic: QTF to HTML
Goto Forum:
  


Current Time: Thu Mar 28 18:58:08 CET 2024

Total time taken to generate the page: 0.02351 seconds