New Property Suggestion - "ForceFontSize"

General TRichView support forum. Please post your questions here
Post Reply
DickBryant
Posts: 148
Joined: Wed Dec 07, 2005 2:02 pm
Contact:

New Property Suggestion - "ForceFontSize"

Post by DickBryant »

Since many of us use single-line RVE's as data display and/or entry it would be great if the RVE had a property ForceFontSize. If -1 is entered then the RVE behaves as presently, if a positive integer is entered then all text displayed by the RVE is forced to the entered font size - but WITHOUT changing the associated textstyle size in the assocaited RVStyle component.

Thus, with a 12 pixel high RVE one could make an edit to a 30 pt text item and clearly see the text. When displayed back in its "home" RVE it would still be 30 pt.
Sergey Tkachenko
Site Admin
Posts: 17310
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

You can implement this feature using TRVStyle.OnApplyStyle event:

Code: Select all

Sender.TextStyles.Apply(Canvas, rvbdUnspecified, True);
Canvas.Font.Size := NN;
DoDefault := False;
dave novo
Posts: 105
Joined: Wed Aug 31, 2005 2:13 am

Post by dave novo »

Hi Dick,

Why would one care if the text style was modified or not. Is your single line editor (where you want 12pt) using the same rich view stream as your main editor, where you are using 30 pt? i.e. are you shuttling the data back and forth?
DickBryant
Posts: 148
Joined: Wed Dec 07, 2005 2:02 pm
Contact:

Post by DickBryant »

Sergey,

I don't think your suggestion does what I described. Consider two rve's that both use the same rvstyle. Both are onscreen at the same time. One needs to display the styles in their normal form. The other needs to have all font sizes forced to xx.

Dave,

Exactly. My app uses a large table in a 'masterrve' and data is pulled and replaced into this table as the application works with the data. Virtually all of the ancillary rve's use the same rvstyle as the master.
shmp
Posts: 140
Joined: Sun Aug 28, 2005 10:19 am
Location: Sabah, Malaysia.
Contact:

Post by shmp »

Hello Dick,

I would not prefer a ForceFontSize as it would not be a good standard in a VCL.

In your case, it is advisable to use two rvstyle; one for each rve. But before displaying anything in the second rve window, you could dump (or assign) the 'master' style to the second rvstyle. In this case you could change any text item without affecting the 'master'.

I am using this technique because I can always revert to the original style setting. There is however one problem. The second rve is for display only.

Hope this help.

Henry
DickBryant
Posts: 148
Joined: Wed Dec 07, 2005 2:02 pm
Contact:

Post by DickBryant »

Thanks for the suggestion, Henry. I do use the technique you suggest (a second RVStyle) for printing out (or displaying in table format) the information where I offer the option of "font levelling" - i.e. forcing all fonts to a given size to reduce the size of the printout or for better consistency.

However, this will not work in the 'edit controls' because I need the ability to have these controls automatically update the MAIN RVStyle should the user make a font style change when entering data into one of them.
Post Reply