Assume I have a paragraph of text and it is a single Item. I place the caret at the start of some line, I use the down arrow key to highlight some whole lines of text.
At this point the caret is at the start of a non-highlighted line of text. All the highlighted text is in the lines above the caret.
I now change the paragraph style and text style of the highlighted block.
The highlighted block changes correctly, but the remainder of the item (from the current caret position to the end of this Item) takes on the new paragraph style.
So basically the new paragraph style is being applied up to the end of the Item and not the end of the highlighted block. The text style is applied correctly.
If I highlight the text and leave the caret at the end of the previous line then it's OK.
Can this be fixed?
TRichViewEdit - Highlighting Text
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
As I understand, the beginning of the selection is in the first paragraph, the end of the selection is in the second paragraph.
This selection is different comparing to the selection ending at the end of the first paragraph: it includes (an empty) beginning of the second paragraph.
In this case a paragraph style is applied to the both paragraphs. It is expected and happens in all text editors.
This selection is different comparing to the selection ending at the end of the first paragraph: it includes (an empty) beginning of the second paragraph.
In this case a paragraph style is applied to the both paragraphs. It is expected and happens in all text editors.
Not quite. Maybe I'll explain a bit better.
There is only one paragraph of text all contained in a single item.
I put the caret at position 0 on a line.
I now start to highlight some text using the Shift+Down Arrow key.
I now have a number of whole lines (as displayed visually in the RichViewEdit) highlighted.
Now I press a button in my program which changes the Font colour, the Back colour and the Background colour of the highlighted block.
The problem is that the Background colour is applied to the highlighted block AND to the rest of the un-highlighted text.
Changing the Font colour and the Back colour of the highlighted block has created a new item with its own new style, so I assume that what was the original single paragraph could now also be changed so that the highlighted block is a paragraph in its own right.
There is only one paragraph of text all contained in a single item.
I put the caret at position 0 on a line.
I now start to highlight some text using the Shift+Down Arrow key.
I now have a number of whole lines (as displayed visually in the RichViewEdit) highlighted.
Now I press a button in my program which changes the Font colour, the Back colour and the Background colour of the highlighted block.
The problem is that the Background colour is applied to the highlighted block AND to the rest of the un-highlighted text.
Changing the Font colour and the Back colour of the highlighted block has created a new item with its own new style, so I assume that what was the original single paragraph could now also be changed so that the highlighted block is a paragraph in its own right.
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
OK, I understand. I'll try and think of a way around this.
Basically I need to change the style of a highlighted block of text. So in this instance, the highlighted block of text needs to become a new paragraph so I can change the colour of the font, the BackColor and the Background.Color.
All unhighlighted text needs to remain unchanged.
Basically I need to change the style of a highlighted block of text. So in this instance, the highlighted block of text needs to become a new paragraph so I can change the colour of the font, the BackColor and the Background.Color.
All unhighlighted text needs to remain unchanged.
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact: