Marcador com numeração

General TRichView support forum. Please post your questions here
Post Reply
Reinaldo Barreto
Posts: 10
Joined: Wed Dec 06, 2006 5:23 pm
Location: Salvador, Bahia - Brasil

Marcador com numeração

Post by Reinaldo Barreto »

How to do so that the numeric characterses of the marker with numeration are with the same style that is used by the text?

Sergey,

Consegui implementer o marcador com numeração, mas, o estilo para os números não é alterado.

Como fazer para que os caracteres numéricos assumam o estilo do texto digitado ?
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Use (may be create a new) list style with level, having Font property with
the same attributes as RVStyle1.TextStyles[RichViewEdit1.CurTextStyleNo].
RichViewActions does not support it.
Reinaldo Barreto
Posts: 10
Joined: Wed Dec 06, 2006 5:23 pm
Location: Salvador, Bahia - Brasil

Marcador de numeração com estilo de fonte diferente do texto

Post by Reinaldo Barreto »

Sergey, everything well!

It includes the code like you he/she sent and it didn't work.

In OnClick of the button of I retreat with numeration marker it is like this:
DBRichViewEdit1.ApplyListStyle(1, 0, 1, True, False);

Caracter of the I number it doesn't move for the same of the text

Example.: 1. THE text is like Verdana and the number is like Currier New.

-----------------------------------------
Sergey, tudo bem !

Inclui o código como você enviou e não funcionou.

No OnClick do botão de recuo com marcador de numeração está assim:
DBRichViewEdit1.ApplyListStyle(1, 0, 1, True, False);

O Caracter do numero não muda para o mesmo do texto

Ex.: 1. O texto está como Verdana e o número está como Currier New.
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Yes, you need to create a new list style having font properties of the current text
Reinaldo Barreto
Posts: 10
Joined: Wed Dec 06, 2006 5:23 pm
Location: Salvador, Bahia - Brasil

Source styles in the marker with numeration

Post by Reinaldo Barreto »

Sergey,

I did in the way that you suggested as it proceeds: it attributes for the marker the same source and size of the text that this being typed accordingly below:

RVStyle1.ListStyles[1] .Levels[0] .Font.Name := RVStyle1.TextStyles[DBRichViewEdit1.CurTextStyleNo] .FontName;

RVStyle1.ListStyles[1] .Levels[0] .Font.Size := RVStyle1.TextStyles[DBRichViewEdit1.CurTextStyleNo] .Size;

DBRichViewEdit1.ApplyListStyle(1, 0, 1, True, False);

He/she is assisting perfectly to the several source types that are used the only problem it is when the whole text uses the source VERDANA and in the text of the numeration marker he/she wants himself to use another source. In that case the source moves, but the number continues with the source of the text.

If he/she has as doing that implementação it informs me, but with the previous alteration he/she is assisting perfectly.

Thank you for the help,

Reinaldo

--------------------------------------------------

Sergey,

fiz da maneira que você sugeriu como segue: atribui para o marcador a mesma fonte e tamanho do texto que esta sendo digitado conforme abaixo:

RVStyle1.ListStyles[1].Levels[0].Font.Name := RVStyle1.TextStyles[DBRichViewEdit1.CurTextStyleNo].FontName;

RVStyle1.ListStyles[1].Levels[0].Font.Size := RVStyle1.TextStyles[DBRichViewEdit1.CurTextStyleNo].Size;

DBRichViewEdit1.ApplyListStyle(1, 0, 1, True, False);

Está atendendo perfeitamente aos diversos tipos de fonte que são utilizados o único problema é quando o texto todo utiliza a fonte VERDANA e no texto do marcador de numeração deseja-se utilizar outra fonte. Nesse caso a fonte muda, mas o número continua com a fonte do texto.

Se tiver como fazer essa implementação me informe, mas com a alteração anterior está atendendo perfeitamente.

Obrigado pela ajuda,

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

Post by Sergey Tkachenko »

If you modify properties of styles that already used, call DBRichViewEdit1.Reformat.

Another solution may be in creating new style with the given properties:

Code: Select all

var ListStyle: TRVListInfo;
  ListNo: Integer;

ListStyle := TRVListInfo.Create(nil);
ListStyle.Assign(RVStyle.ListStyles[1]);
ListStyle.Levels[0].Font.Name :=
  RVStyle1.TextStyles[DBRichViewEdit1.CurTextStyleNo].Size; 
ListStyle.Levels[0].Font.Size :=
  RVStyle1.TextStyles[DBRichViewEdit1.CurTextStyleNo].Size; 
ListNo := RVStyle1.FindSuchStyle(ListStyle, True);
ListStyle.Free;
DBRichViewEdit1.ApplyListStyle(ListNo, 0, 1, True, False); 
The results of your and my code are different.
In your code, when applying this command, all numbers (even in not selected paragraphs) will be changed to the current font. But only one list style will be used, numbering will be continued through the document (unless you set UseStartFrom parameter to True).
In my code, new list style with its own list counter is created. So, probably, your code is more appropriate.
Post Reply