Home » U++ Library support » RichText,QTF,RTF... » Does a Ctrl may be a RichObject ?
|
|
|
Re: Does a Ctrl may be a RichObject ? [message #23314 is a reply to message #23288] |
Thu, 08 October 2009 16:32   |
 |
mirek
Messages: 14255 Registered: November 2005
|
Ultimate Member |
|
|
koldo wrote on Wed, 07 October 2009 06:02 |
luzr wrote on Wed, 07 October 2009 11:16 |
koldo wrote on Mon, 05 October 2009 17:49 | Hello all
I would like to know how to insert Ctrl like EditString, Button or DropList inside a RichEdit.
Here I enclose you a simulated screenshot from RichTextObject example.

With it it would be possible to fill forms made with RichEdit and launch functions.
Best regards
Koldo
|
At the moment, this would be hard.
The only way is to use
http://www.ultimatepp.org/reference$RichTextLayoutTracer.htm l
and then place widgets over the RichText.
Mirek
|
Sorry Mirek
Could you detail this a little bit more? 
|
Use RichTextLayoutTracer to find out where are positions of various widgets you want to display (invent some way how to specify that in Qtf, e.g. misusing text in index would work), then, having positions, overlay them over the RichText.
Mirek
|
|
|
|
Re: Does a Ctrl may be a RichObject ? [message #52496 is a reply to message #23314] |
Thu, 10 October 2019 17:57   |
jjacksonRIAB
Messages: 227 Registered: June 2011
|
Experienced Member |
|
|
mirek wrote on Thu, 08 October 2009 16:32
Use RichTextLayoutTracer to find out where are positions of various widgets you want to display (invent some way how to specify that in Qtf, e.g. misusing text in index would work), then, having positions, overlay them over the RichText.
Mirek
I know this is an old topic but I have an interest in doing something like this for the project I'm working on, but I'm using Raw RichText, the code hierarchy is proving quite difficult to understand and I don't know if the information here is still up to date. Could you perhaps provide some direction as to where I can obtain the graphical extents of an element, a Para, or even a Cell etc so I can position a Ctrl to track with it?
[Updated on: Thu, 10 October 2019 17:58] Report message to a moderator
|
|
|
Re: Does a Ctrl may be a RichObject ? [message #52510 is a reply to message #52496] |
Mon, 14 October 2019 10:35  |
 |
mirek
Messages: 14255 Registered: November 2005
|
Ultimate Member |
|
|
jjacksonRIAB wrote on Thu, 10 October 2019 17:57mirek wrote on Thu, 08 October 2009 16:32
Use RichTextLayoutTracer to find out where are positions of various widgets you want to display (invent some way how to specify that in Qtf, e.g. misusing text in index would work), then, having positions, overlay them over the RichText.
Mirek
I know this is an old topic but I have an interest in doing something like this for the project I'm working on, but I'm using Raw RichText, the code hierarchy is proving quite difficult to understand and I don't know if the information here is still up to date. Could you perhaps provide some direction as to where I can obtain the graphical extents of an element, a Para, or even a Cell etc so I can position a Ctrl to track with it?
It basically hijacks Paint.
You need to create your own RichTextLayoutTracer derived instance. Then pointer to it into your PageDraw derived instance. PageDraw::Paint can/should be NOP. Then call RichText::Paint with this page draw and you should get Layout coordinates in RichTextLayoutTracer methods.
(I do not have a good example right now... I might prepare something later.)
Mirek
|
|
|
Goto Forum:
Current Time: Sat Apr 26 09:36:27 CEST 2025
Total time taken to generate the page: 0.00877 seconds
|