Quantcast
Channel: Embarcadero Community - Embarcadero Community
Viewing all articles
Browse latest Browse all 3212

How to load from memory stream to firemonkey (FMX) memo component in C++ Builder?

$
0
0

I used to use below code to load plenty of text to VCL Memo.

LogMemo->Lines->BeginUpdate();
LogMemo->SelStart = LogMemo->GetTextLen();
LogMemo->SelLength = 0;

LogMemo->SelText = AnsiString((char *)LogMemoBufPtr->Memory, LogMemoBufPtr->Size);
LogMemo->SelStart = LogMemo->GetTextLen();
LogMemo->Perform(EM_SCROLLCARET, 0, 0);
LogMemo->Lines->EndUpdate();

But in FMX Memo component, I can't use "LogMemo->SelText = AnsiString(strFromMemStream)" anymore. And I also can't use "GetTextLen" method to set selection start.

I tried to modify the code in below but it still didn't work. It always overwrite original content and can't append new text.

LogMemo->Lines->BeginUpdate();
LogMemo->GoToTextEnd();
LogMemo->SelStart = LogMemo->Text.Length();
LogMemo->SelLength = 0;

LogMemo->Text = AnsiString((char *)LogMemoBufPtr->Memory, LogMemoBufPtr->Size);
LogMemo->GoToTextEnd();
LogMemo->SelStart = LogMemo->Text.Length();
LogMemoBufPtr->Clear();
LogMemo->Lines->EndUpdate();

Is there any one know how to do it in FMX Memo component or just to display plenty of text smoothly?

Using "Append" caused slow display/performance.

 

Thanks!


Viewing all articles
Browse latest Browse all 3212

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>