Hello Richview Support,
While working with Richviewedits I found some dissonances regarding fonts.
If I change the font at the end of a sentence and start typing immediately, everything is fine, and I can start writing with the selected font.
Nevertheless, if I click at the current cursor position, the font resets.
In other applications like MS Word, it does not reset.
Is there anything I can do to have the same behavior as in MS Word?
Richviewedit Font resets after clicking at the cursor position
Re: Richviewedit Font resets after clicking at the cursor position
While testing, I found another dissonance regarding fonts from selected paragraphs.
Situation:
I have a paragraph that contains two or more different fonts. I select the complete section. Now the combo box for the font is filled with the last font.
Selection starts from the top. Selection starts from the bottom. The font combo box is empty if I have the same situation in MS Word. Is there anything I can do to get the same behavior as in MS Word?
Situation:
I have a paragraph that contains two or more different fonts. I select the complete section. Now the combo box for the font is filled with the last font.
Selection starts from the top. Selection starts from the bottom. The font combo box is empty if I have the same situation in MS Word. Is there anything I can do to get the same behavior as in MS Word?
Re: Richviewedit Font resets after clicking at the cursor position
tomr,
Just FYI, I tried this in Word 2013, LibreOffice 7.4 and online Word and they all "reset" this way for me. I didn't always see the font name change in the font combo box immediately but they did "reset" as I started to type.
Stan (I'm not with richview "support," just saw your post and tried it myself)
Just FYI, I tried this in Word 2013, LibreOffice 7.4 and online Word and they all "reset" this way for me. I didn't always see the font name change in the font combo box immediately but they did "reset" as I started to type.
Stan (I'm not with richview "support," just saw your post and tried it myself)
Re: Richviewedit Font resets after clicking at the cursor position
tomr,
I tried your selection thing with different fonts in both the rich edit and scale rich edit demos. And both of those show the font name of the selection point text as you are seeing. I think all that is is the way Sergey coded his demos. In my current app I coded mine to display the word [Mutliple] (in brackets) if mutible fonts are in the selection. I did this in the rve CurTextStyleChanged procedure (I just use a regular richview edit in my app).
Same thing for the font size combo:
So, I think you'd just need to write some code to do that in your app.
Stan (I'm not with richview "support," just saw your post and tried it myself)
I tried your selection thing with different fonts in both the rich edit and scale rich edit demos. And both of those show the font name of the selection point text as you are seeing. I think all that is is the way Sergey coded his demos. In my current app I coded mine to display the word [Mutliple] (in brackets) if mutible fonts are in the selection. I did this in the rve CurTextStyleChanged procedure (I just use a regular richview edit in my app).
Code: Select all
rv.GetSelectionBounds(FStart, FSOff, FEnd, FEoff, true);
fi := rv.Style.TextStyles[rv.GetItemStyle(FStart)];
for i := FStart to FEnd do
begin
fi2 := rv.Style.TextStyles[rv.GetItemStyle(i)];
if fi.FontName <> fi2.FontName then
begin
SRDCvsRVEFont.Caption := '[Multiple]';
//This could be set to SRDCvsRVEFont.Caption := '' to mimic Word behavior
break;
end;
end;
Code: Select all
for i := FStart to FEnd do
begin
fi2 := rv.Style.TextStyles[rv.GetItemStyle(i)];
if fi.Size <> fi2.Size then
begin
//Reset Combo
cmbFontSize.Text := '';
break;
end;
end;
Stan (I'm not with richview "support," just saw your post and tried it myself)
Re: Richviewedit Font resets after clicking at the cursor position
Hello standay,
thank you for your reply.
I have got Word 2016 installed and for me, it works as described above.
Implementing the CurTextStyleChanged Event is a Good Idea, I will try it.
thank you for your reply.
I have got Word 2016 installed and for me, it works as described above.
Implementing the CurTextStyleChanged Event is a Good Idea, I will try it.
-
- Site Admin
- Posts: 17602
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: Richviewedit Font resets after clicking at the cursor position
1. Yes, if the user changes font, types nothing, then clicks in the editor, the current text style is reset to the font at the position of the caret. I did not think that this is a problem because usually users change font to type content. And the comboboxes should focus the editor after selection, so clicking is not needed.
2. Yes, combo boxes of RichViewActions (TRVFontComboBox, TRVFontSizeComboBox, TRVStyleTemplateComboBox), unlike controls in RichViewActions dialogs, do not analyze the whole selection, they reflect the content at the caret position.
If you want, I can add an option in one of future updates.
2. Yes, combo boxes of RichViewActions (TRVFontComboBox, TRVFontSizeComboBox, TRVStyleTemplateComboBox), unlike controls in RichViewActions dialogs, do not analyze the whole selection, they reflect the content at the caret position.
If you want, I can add an option in one of future updates.
Re: Richviewedit Font resets after clicking at the cursor position
Hello Sergey,
Thank you for your fast reply and additional Information.
1. Ah ok, that makes sense. You are right, usually, extra clicking is unnecessary.
2. I would appreciate it if you add such an option in the future,
Thank you for your fast reply and additional Information.
1. Ah ok, that makes sense. You are right, usually, extra clicking is unnecessary.
2. I would appreciate it if you add such an option in the future,