Page 1 of 1

How to change properties for hidden text?

Posted: Tue Jan 28, 2014 5:50 pm
by Jim Knopf
Hi, me again

how can I change the outfit of hidden text? Without dotted underline instead of this color gray.

Posted: Wed Jan 29, 2014 1:48 pm
by Sergey Tkachenko
Sorry, dotted underlined are hard-coded

Posted: Thu Jan 30, 2014 10:47 pm
by Jim Knopf
and text color?

Posted: Fri Jan 31, 2014 8:30 am
by Sergey Tkachenko
Color can be changed in OnApplyStyleColor event

Posted: Sat Feb 01, 2014 1:12 pm
by Jim Knopf
Can you give me a hint how?

- RVEdit: Settings are 'use predefined set of styles' (necessary to protect of importet formatting)
- style No 15 in TRVStyle has options = rvteoHidden

It works but would be fine to recognize hidden text immediately as such one.

Posted: Sun Feb 02, 2014 12:39 pm
by Sergey Tkachenko
Sorry, I understand your settings but I do not understand the question.

Posted: Mon Feb 03, 2014 11:10 pm
by Jim Knopf
sorry for poor explanation.

If I change text color of style 15 I can apply dark colors as clNavy or clGreen but no lighter ones, clSilver e.g.

And I don't know how to change color of hidden text by OnApplyStyleColor event.

Posted: Tue Feb 04, 2014 12:14 pm
by Sergey Tkachenko
First, I do not understand why do you need some special code or settings for hidden text, if you only have a single text style used for hidden text.
Just assign RVStyle.TextStyles[15].Color := clNavy to change its text.

OnApplyStyleColor can be used if you want to display some text with different colors, not with colors specified in Color or BackColor properties.

Something like:

Code: Select all

procedure TMyForm.MyRVStyleApplyStyleColor(Sender: TRVStyle; Canvas: TCanvas;
  StyleNo: Integer; DrawState: TRVTextDrawStates; var DoDefault: Boolean);
begin
  if (rvteoHidden in Sender.TextStyles[StyleNo].Options) and 
    not (rvtsSelected in DrawState) then begin
    Canvas.Font.Color := clNavy;
    Canvas.Brush.Style := bsClear;
    DoDefault := False;
  end;
end;
This code makes all hidden text color = clNavy.

Posted: Wed Feb 05, 2014 10:13 am
by Jim Knopf
The reason why I tried out an other way is, that I can't change RVStyle.TextStyles[15].Color. I can, sure, but it has no effect. May be because of I use 'use a predefined set of styles' in my rvEdit.

So I assume that the editor is searching a style as similar as possible if I assign 'hidden' to a selected text and creates a new one if it dont' find one. If the color of RVStyle.TextStyles[15] is dark (clNavy, clGreen) perhaps it is 'enough similar' and it accepts the existing style. E.g. gray or silver is not similar > makes its own new style. I hope I could explain my problem? Sorry I know it sounds a little complicated ...

Posted: Wed Feb 05, 2014 10:16 am
by Jim Knopf
But the code you posted under MyRVStyleApplyStyleColor works fine, thank you so much!

Posted: Mon Apr 25, 2016 2:32 pm
by lkessler
I too would like the option to display hidden text without the dotted underline.

Louis