MagicFoundation / Alcinoe

Alcinoe Component Library For Delphi. Full opengl video player, WebRTC delphi wrapper, native ios/android TEdit, Improuved firemonkey controls, Firebase cloud messaging, Android/ios facebook sdk login, Json/Bson Parser, ImageMagick wrapper, MongoDb client And much more
Apache License 2.0
996 stars 220 forks source link

Add support for ReadOnly in TALEdit / TALMemo #346

Closed maurobotta closed 3 weeks ago

maurobotta commented 1 month ago

Hi

Is possibile Add support for ReadOnly in TALEdit / TALMemo ?

Like Enabled False but not gray....

Thank you.

Zeus64 commented 1 month ago

Hello, TALEdit and TALMemo are simply wrappers for the native OS edit/memo components (like EditText on Android, UITextField on iOS, NSTextField on macOS, and Edit on Windows). The issue is that ReadOnly is not natively supported by all platforms. For example, on Android, you must set the enabled property to false, as there is no ReadOnly property. Personally, I always find it a bit confusing to have an edit control that looks exactly like a regular one but doesn’t allow editing. It feels more intuitive to have the edit field grayed out to indicate that input is disabled.

However, if you want this ReadOnly feature, you can implement it in the master branch and submit a pull request (PR). I'll approve it, but before doing so, consider if setting enabled = false might be a better alternative than introducing ReadOnly = false.