Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REQ] TALMemo - Add Text property ( Text lines ) #353

Open
maurobotta opened this issue Oct 18, 2024 · 3 comments
Open

[REQ] TALMemo - Add Text property ( Text lines ) #353

maurobotta opened this issue Oct 18, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@maurobotta
Copy link

Hi,

For TALMemo, i can't found a "add / Items.add" only a Text ( simple string )

I have much code with OldMemo.Lines.Add('xxxxx') , and is not easy to convert.

Best Regards

Mauro

@Zeus64
Copy link
Collaborator

Zeus64 commented Oct 18, 2024

The issue arises because the concept of "lines" can be confusing. As the text wraps inside the memo, when you use OldMemo.Lines.Add('xxxxx'), it doesn't necessarily mean you're adding one visible line to the memo; it could span multiple lines. Similarly, retrieving Memo.Lines[5] (for example) doesn't necessarily correspond to the visible line number 5 in the memo. That's why a memo primarily has a Text property instead of focusing on Lines.

Would it be possible for you to replace OldMemo.Lines.Add('xxxxx') with OldMemo.Text := OldMemo.Text + #13#10 + 'xxxxx'; ?

@maurobotta
Copy link
Author

Would it be possible for you to replace OldMemo.Lines.Add('xxxxx') with OldMemo.Text := OldMemo.Text + #13#10 + 'xxxxx'; ?

Yes, of course, but is complicate. Memo.Items.Add is very popular line of code.

@Zeus64
Copy link
Collaborator

Zeus64 commented Oct 18, 2024

I know but it's really a bad logic, only on delphi you can see it :( but yes it's possible to fake the Items, it's would be very simple to do by editing the alcinoe.fmx.memo.pas and add it. it's will be a simple fake TstringList that simple read the text property or set the text property.

@Zeus64 Zeus64 added the enhancement New feature or request label Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants