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... » Extracting StymeManager
Extracting StymeManager [message #23619] Thu, 05 November 2009 22:26 Go to next message
Didier is currently offline  Didier
Messages: 680
Registered: November 2008
Location: France
Contributor
Hi,

I have done some simple modifications to RichEdit in order to be able to use StyleManager in my apps.
The aim is to allow modification of predefined styles to be able configure the look of my reports.

The StyleManager can now be used the following way to modify a RichText var (in the example it's: 'reportStyles' )
and save it back to a file as QTF text.

void FNPSA_compet::openStyleManager()
{
	StyleManager sm;
	sm.load(reportStyles);
	if( sm.Execute() != IDOK ) return;
	sm.SaveStyle();
	reportStyles = sm.AsRichText();
	
	// Save styles to file
	FileOut fileWriter;
	fileWriter.Open("FNPSA_Styles.ini");
	fileWriter << sm.AsQTF();
	fileWriter.Close();
}


The global var ' reportStyles ' is afterwards inserted at the begining of all my reports, like in the following example:
String reportStr= Upp::AsQTF(FNPSA_compet::getStyles());
reportStr += ...... my report data .....



I've joined a patch that has to be applied on top of SVN rev 1665.

StyleManager itself could be modified inorder to disable style erasing/adding/renaming and also desactivating some other functions of the StyleManager


Re: Extracting StymeManager [message #23626 is a reply to message #23619] Sat, 07 November 2009 08:29 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
OK, why not. I performed a little cleanup of the code and StyleManager is now public.

Mirek
Re: Extracting StymeManager [message #23630 is a reply to message #23626] Sat, 07 November 2009 16:15 Go to previous message
Didier is currently offline  Didier
Messages: 680
Registered: November 2008
Location: France
Contributor
Thanks Smile

Previous Topic: Page Totals in a table?
Next Topic: Zooming font of RichText to the size of StdFont
Goto Forum:
  


Current Time: Fri Mar 29 08:01:19 CET 2024

Total time taken to generate the page: 0.02092 seconds