We load text as HTML which was previously saved with TAdvMiniHTMLIO. We have SpeedButtons representing the formatting of the text with the Down
-State.
This works in general except for the first SelectionChanged
-Event. When it fires the first time and the cursor stands on a text that is formatted, the formatting isn't read correctly.
Steps to reproduce:
- Place a TAdvRichEditor and TAdvMiniHTMLIO on a form
- Load Text into the RichEditor
- Place the cursor into a red word - first event does nothing
- Place the cursor somwhere else and back to a red word (or to another red word directly) -
GetSelectionTextColor()
works as expected.
Code for loading the text:
this->AdvRichEditorMiniHTMLIO1->Load(L"<FONT color=\"#000000\">11.12.2023 Christian - Eine Ergänzung<BR></FONT><FONT color=\"#000000\">07.12.2023 </FONT><FONT color=\"#000000\">Christian - <BR></FONT><FONT color=\"#000000\">04.12.2013: </FONT><U><FONT color=\"#DF0715\">Auftragskopie </FONT></U><FONT color=\"#000000\">an </FONT>", NULL, NULL);
Code for the SelectionChanged-Event:
if (this->AdvRichEditor1->GetSelectionTextColor() == StringToColor(L"0x1507DF"))
ShowMessage(L"Rot");
Edit: We are using TAdvRichEditor Version 1.8.9.10 and C++ Builder 12 Athens.