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 » U++ Widgets - General questions or Mixed problems » Qtf and drawing
Re: Qtf and drawing [message #1058 is a reply to message #1040] Sat, 18 February 2006 19:04 Go to previous message
mirek is currently offline  mirek
Messages: 14265
Registered: November 2005
Ultimate Member
Well, as the things were little bit too ugly, I have added direct solution for this problem:

QtfRichObject solves problems when generating qtf by code and combining it with graphics.

It creates simple helper object that stores RichObject and converts itself to string (using ToString) with special QTF syntax that contains the value of the pointer to stored RichObject. QTFParser then picks the pointer...

This both greately simplifies the client code AND reduces all the overhead needed to convert RichObject to QTF and back... The only thing to be careful about is that QtfRichObject MUST exist by the time QTF is parsed (otherwise the pointer stored in QTF text would be dangling).

Demostrated by QtfDrawing example:

GUI_APP_MAIN
{
    DrawingDraw dw(100, 100);
    dw.DrawRect(0, 0, 100, 100, White);
    dw.DrawEllipse(10, 10, 80, 80, Red, 5, Blue);
    dw.DrawRect(50, 50, 50, 50, Yellow);
    QtfRichObject pict(CreateDrawingObject(dw.GetResult(), Size(500, 500), Size(500, 500)));
    String qtf;
    qtf << "[A6 This is some drawing in QTF: " << pict << "&";
    qtf << "[C3*@B And now in the table: {{1:1 " << pict << ":: Another cell " << pict << "}}";
    PromptOK(qtf);
}


Mirek
 
Read Message
Read Message
Read Message
Previous Topic: tray icon & balloon notification
Next Topic: How to set transparency level for static rectangle?
Goto Forum:
  


Current Time: Tue Jul 08 13:58:49 CEST 2025

Total time taken to generate the page: 0.04504 seconds