Make textentry readonly?
Make textentry readonly?
Hi
Is it really true that it's not possible to set a textentry to readonly? Setting readonly="true" in the XML works for texteditor, but not for textentry. It's not listed in the docs, but then disabled="true" is not listed, either, and works for both of these classes.
What am I missing?
Cheers,
Michael
Is it really true that it's not possible to set a textentry to readonly? Setting readonly="true" in the XML works for texteditor, but not for textentry. It's not listed in the docs, but then disabled="true" is not listed, either, and works for both of these classes.
What am I missing?
Cheers,
Michael
Re: Make textentry readonly?
The disabled attribute belongs to the area class.
This is an upper class of every MOAI class.
You can apply the area class to any object that is displayed visually.
This is an upper class of every MOAI class.
You can apply the area class to any object that is displayed visually.
PostgreSQL-Library V1.0 Final: https://forum.amiga-resistance.info/vie ... =38&t=3591
- airsoftsoftwair
- Posts: 5443
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: Make textentry readonly?
You're right, it's not supported. The problem is that MUI doesn't support it. On Amiga, Textentry uses String.mui and AFAICS MUI doesn't support read-only string gadgets. String.mui only allows to set certain characters that should be rejected but there is no way to tell it to reject all characters that are entered.
On Windows/macOS/Linux it would be easy to support read-only text entry widgets but I like to keep things in sync with the Amiga version but maybe I should make an exception here or file a feature request with the MUI authors
On Windows/macOS/Linux it would be easy to support read-only text entry widgets but I like to keep things in sync with the Amiga version but maybe I should make an exception here or file a feature request with the MUI authors
Re: Make textentry readonly?
Just an idea.
Maybe explicitly setting String.Accept Attribute to an empty String "" ? (Not Nil)
And eventually change FrameType ?
Maybe explicitly setting String.Accept Attribute to an empty String "" ? (Not Nil)
And eventually change FrameType ?
Re: Make textentry readonly?
Indeed, setting accept="" did the trick, now the textentry is readonly. NICE TRICK!
What do you mean by setting the frametype? How do I do that? Couldn't find "frametype" in the RapaGUI doc...
@airsoftsoftwair
Maybe you could add the readonly attribute to textentry and solve it with MUI by using this trick. You would have to ensure that this still works, though:
After this, mytextentry must still accept only numbers.
What do you mean by setting the frametype? How do I do that? Couldn't find "frametype" in the RapaGUI doc...
@airsoftsoftwair
Maybe you could add the readonly attribute to textentry and solve it with MUI by using this trick. You would have to ensure that this still works, though:
Code: Select all
moai.Set("mytextentry", "accept", "0123456789")
(...)
moai.Set("mytextentry", "readonly", True)
(...)
moai.Set("mytextentry", "readonly", False)
Re: Make textentry readonly?
Well, I was thinking in MUI world, maybe FrameStyles are not available in RapaGUI
- airsoftsoftwair
- Posts: 5443
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: Make textentry readonly?
No, they aren't. But using the "accept" tag to simulate a read-only textentry widget is a nice idea so I've added it.
Code: Select all
- New: Added Textentry.ReadOnly [I]; if this is set to TRUE, the text in the widget won't be editable at all
Re: Make textentry readonly?
I assume this can't be made ISG, or you probably would have, right?
- airsoftsoftwair
- Posts: 5443
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: Make textentry readonly?
That comes with RapaGUI 2.0 I guess.airsoftsoftwair wrote: ↑Tue Feb 09, 2021 9:43 pmCode: Select all
- New: Added Textentry.ReadOnly [I]; if this is set to TRUE, the text in the widget won't be editable at all
Would this be the correct syntax?
Code: Select all
<textentry id="Antall" ReadOnly="true"/>