Home » U++ Library support » RichText,QTF,RTF... » Extracting StymeManager
Extracting StymeManager [message #23619] |
Thu, 05 November 2009 22:26  |
Didier
Messages: 725 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
|
|
|
|
|
Goto Forum:
Current Time: Sun Apr 27 12:46:52 CEST 2025
Total time taken to generate the page: 0.00768 seconds
|