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 » LineEdit, EditFields, DocEdit » How to Print a file inside LineEdit
Re: How to Print a file inside LineEdit [message #3245 is a reply to message #3244] Tue, 16 May 2006 01:35 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
forlano wrote on Mon, 15 May 2006 17:13

luzr wrote on Mon, 15 May 2006 22:00


You can "avoid" qtf by calling DeQtf for texts you pass... That will add escape characters that will "quote" original text in Qtf.

void  VegaTab4::PrintCB()
{ 	Report r;
//	r.Header("[A2> Page $$P");
	r << "Round 1";
    r << DeQtf("===================================================================");
    r << DeQtf("  1 =   4 Karpov, Igor         -   2 Karpov, Vadim         = 1 - 0");
    r << DeQtf("-------------------------------------------------------------------");
    Print( r, 1, "Preview");
//	Perform(r); //same format error
}


Mirek

I tried and it works. Unfortunatly there is again one more problem Smile : by default it is set the proportional font. Instead i would like to print with courier font to preserve the vertical alignment present in the file. Using UWord I got the format command to print with courier, say 11. So I've tried to embed one
Quote:



What about reading QTF reference instead? Smile

http://upp.sourceforge.net/srcdoc$RichText$QTF$en-us.html



text line in a formatted command line with courier font like this:
void  VegaTab4::PrintCB()
{ 	Report r;
    r << "[ $$0,0#00000000000000000000000000000000:Default]"
         "[{_}%EN-US" 
         "[s0;C+92 Round 1 ]";  //it's OK
 
    r << "[s0;C+92 " << DeQtf("Round 1") << " ]";  // doesn't work
    r << "[s0;C+92 " << DeQtf("=====================================================") <<" ]" ;
   Print( r, 1, "Preview");
}

This produce problem (see attached picture) because do not recognise the final " ]" and this seems strange to me.

I've even tried
    r.SetFont(Courier(12)); 

with no success. So, is there a way to set by default the Courier font?

Luigi
index.php?t=getfile&id=137&private=0


There is one tricky thing about Report::operator<< - it takes each call as separate qtf text. So

r << "[s0;C+92 " << DeQtf("Round 1") << " ]";


makes for 3 separate texts.

To fix it, simply add texts together:

r << "[s0;C+92 " + DeQtf("Round 1") + " ]";


(Note that adding here is possible becase DeQtf returns String).


Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to let appear by default the bar in the LineEdit?
Next Topic: Append separate Strings to a DocEdit[SOLVED]
Goto Forum:
  


Current Time: Sun Apr 28 05:57:21 CEST 2024

Total time taken to generate the page: 1.94970 seconds