VCL Frame in Scale rich view

ScaleRichView support and discussion (TRichView add-on for WYSIWYG editing)
Post Reply
Lex
Posts: 7
Joined: Wed Nov 27, 2019 10:14 pm

VCL Frame in Scale rich view

Post by Lex »

Hi,

I'm trying to use a VCL Frame (Tframe) inserted into the TSRichViewEdit. The TFrame contains a TSRVPanel (aligned-client), inside the panel, there is a TSRVPaintBox (aligned-left), TSRVEdit (aligned-client), and a TSRVButton (aligned-right). However, I am having a couple of issues:
  1. The TSRVPaintBox.OnPaint event doesn't seem to draw anything to the canvas? (this event does appear to trigger though)
  2. The TSRVButton.OnClick event doesn't seem to trigger when I click the button?
Image

Just wondering if there's an alternative to TFrame that will work nicely with the scale rich view? Or is there something I can change to make this work?

Thanks in advance :D

Sergey Tkachenko
Site Admin
Posts: 14897
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: VCL Frame in Scale rich view

Post by Sergey Tkachenko »

Can you create a sample project and send to me for testing (richviewgmailcom)

Lex
Posts: 7
Joined: Wed Nov 27, 2019 10:14 pm

Re: VCL Frame in Scale rich view

Post by Lex »

Thanks for the quick response Sergey,

I've just put a sample project together demonstrating what I'm trying to do. Sending it to you now. :D

Sergey Tkachenko
Site Admin
Posts: 14897
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: VCL Frame in Scale rich view

Post by Sergey Tkachenko »

Received.
I'll check it tomorrow.

Lex
Posts: 7
Joined: Wed Nov 27, 2019 10:14 pm

Re: VCL Frame in Scale rich view

Post by Lex »

Hi Sergey,

Just wondering if you've had a chance to take a look at this yet?

I've managed to work around the OnPaint event of the TSRVPaintBox by using the TSRichViewEdit OnPaintComponent event. However, I still have issues with the TSRVButton OnClick, I do have a slight workaround but it doesn't feel as nice as a TSRVButton embedded directly. So I'm still curious about the behavior of scalable controls when embedded in the scale rich view using a frame and whether there's something I can do to make this work nicely. Alternatively, my other option may be to write my own control inheriting from TSRVCustomControl?

Cheers,
Lex.

Sergey Tkachenko
Site Admin
Posts: 14897
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: VCL Frame in Scale rich view

Post by Sergey Tkachenko »

I am sorry for the delay, we need to complete work related to RVMedia release, then I'll check what's wrong with frames.

Lex
Posts: 7
Joined: Wed Nov 27, 2019 10:14 pm

Re: VCL Frame in Scale rich view

Post by Lex »

That's okay, thanks for the update. Get back to me when you can, cheers :D

Sergey Tkachenko
Site Admin
Posts: 14897
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: VCL Frame in Scale rich view

Post by Sergey Tkachenko »

Well, when you insert a nested controls in ScaleRichView, mouse messages are handled correctly only if TSRVPanel or TSRVGroupBox are used as containers. I'll try to fix it, at least for a simple case of TFrame containing controls.

Sergey Tkachenko
Site Admin
Posts: 14897
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: VCL Frame in Scale rich view

Post by Sergey Tkachenko »

I've made corrections in my working version. Now, mouse should work in components in TSRichViewEdit, even if they are inserted in other containers, not only TSRVPanel/TSRVGroupBox. So in your example the button is highlighted below the mouse pointer and can be clicked.
Additionally, I corrected the code that displays the caret in TSRVEdit/TSRVMemo/TSRVComboBox inserted in TSRichViewEdit. Now it can be displayed if these sub-editors are inserted in other containers, not only TSRVPanel/TSRVGroupBox. It is displayed correctly in your frame.
Additionally, the caret in read-only sub-editors in TSRichViewEdit is now hidden only if rvoHideReadOnlyCaret is included in SRichViewEdit.RVEditorOptions (previously, it was never displayed in read-only sub-editors).

Additional notes:
1) I cannot reproduce TSRVPaintBox problem. Do you use the newest version of ScaleRichView?
2) I've made one more fix. By default, when saving to RVF, our editor stores all components together with all their subcomponents. However, this is a problem for frames: https://www.trichview.com/forums/viewto ... 096#p37096. Previously, you could use RichViewWriteControlIgnoreChildren global variable as a workaround. In the next version, our editor will not save subcomponents for frames.

Lex
Posts: 7
Joined: Wed Nov 27, 2019 10:14 pm

Re: VCL Frame in Scale rich view

Post by Lex »

Thanks Sergey,

Will all these changes be included in the next release? Do you have a planned release date or a best guess of when these changes will be available?

Also, responses to your additional notes:
1) I’m using an older version (v8.3.2) of Scale rich view. I’m planning to update to the latest version later this year when going through and updating all our components and development environments. I’ll do some more testing of this later when I get some time, however, the workaround I have seem fine for now.
2) To clarify this means that I’ll no longer need to use the RichViewWriteControlIgnoreChildren workaround? This is fantastic news!

Thanks again Sergey, you’ve gone above and beyond to support my use of frames!

Cheers,
Lex.

Sergey Tkachenko
Site Admin
Posts: 14897
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: VCL Frame in Scale rich view

Post by Sergey Tkachenko »

Yes, these changes will be included in the next update.
Probably in this week: I want to complete porting to SRVControls to Lazarus before releasing.

Unfortunately, a fix for older version is not possible.
SRVControl were almost completely rewritten in ScaleRichView 9, and there are many changes since the last release (related to porting to Lazarus), so they can only be updated as a whole.

Post Reply