RapaGUI Textentry Bug

Report any Hollywood bugs here
Post Reply
User avatar
Redlion
Posts: 111
Joined: Sun Jul 10, 2011 5:05 am
Location: Perth, Western Australia

RapaGUI Textentry Bug

Post by Redlion »

I am trying to write a program that has a Password to login, I can get it to work when entering the password in a Textentry object and then pressing the Login button. If the password is invalid, it clears the Textentry object and sets it as the ActiveObject, all good. But when I have Notify="Acknowledge" set for the Textentry object, enter a in valid password and press return/enter, it does not work like clicking the Login button.

Here is the simplest code I could make that reproduces the error.

Code: Select all

;*** This script requires the RapaGUI plugin ******************************************************
@REQUIRE "RapaGUI"

;*** Setup GUI **************************************************************************************
moai.CreateApp([[
<?xml version="1.0" encoding="iso-8859-1"?>
<application id="app">
    <window Id="main" width="1024" height="768" margin="10" Open="false">
        <hgroup color="#607BAA">
            <button Id="end_main"> OK </button>
        </hgroup>
    </window>

     <window Title=" LOGIN" Width="300" Id="pswd" Margin="10" Open="False" 
        Closegadget="False" MinimizeGadget="False" MaximizeGadget="False" SizeGadget="False">
        <vgroup color="#608CAF">
            <vspace Height="10"/>
            <hgroup>
                <hspace Width="20"/>  
                <vgroup Padding="10" Spacing="5">
                    <text Align="Center" Fontsize="big"> Please enter your Password </text>
                    <hgroup>
                        <text Align="Left" Fontsize="big">Password : </text>
                        <textentry Id="logapp" Password="1" Notify="Acknowledge" Fontsize="big" Weight="250"></textentry>
                    </hgroup>
                </vgroup>
                <hspace Width="20"/>
            </hgroup>
            <vgroup>
                <vspace Height="10"/>
                <hline/>
                <vspace Height="10"/>
            </vgroup>
            <vgroup>
                <vspace Height="2"/>
                <hgroup>
                    <hspace Width="10"/>
                    <button Id="logOK" notify="Pressed" weight="50" fontsize="big"> LOGIN </button>
                    <hspace Width="40"/>
                    <button Id="logcancel" notify="Pressed" weight="50" fontsize="big"> CANCEL </button>
                    <hspace Width="10"/>
                </hgroup>
                <vspace Height="5"/>
            </vgroup>
        </vgroup>
    </window>

</application>
]])

;*** Handler for all incoming events **************************************************************
Function E_EventFunc(msg) 
    Switch msg.action
        Case "RapaGUI"
            Switch msg.attribute
        
                Case "CloseRequest": ; ============================================================
                    Switch msg.id
                        Case "main"                                            
                            End

                    EndSwitch

                Case "Pressed": ; =================================================================
                     Switch msg.id
                        Case "end_main"
                            End

                        Case "logOK"
                            Password$ = moai.Get("logapp", "Text")
                            If Password$ = Login$
                                moai.Set("pswd", "Open", False) 
                                moai.Set("main", "Open", True)
                            Else
                                PTry = PTry + 1
                                moai.Request(" INCORRECT LOGIN ! ",
                                             " You entered an invalid Password." .. 
                                             "\n You have only ".. (4 - PTry).. " tries left.","OK")
                                moai.Set("logapp", "Text", "")
                                If PTry = 4
                                   END
                                EndIf  
                                moai.Set("pswd", "Activeobject", "logapp")
                            EndIf

                        Case "logcancel"       
                            End

                     EndSwitch

                 Case "Acknowledge": ; =============================================================
                    Switch msg.id
                        Case "logapp"
                            Password$ = moai.Get("logapp", "Text")
                            If Password$ = Login$
                                moai.Set("pswd", "Open", False) 
                                moai.Set("main", "Open", True)
                            Else
                                PTry = PTry + 1
                                moai.Request(" INCORRECT LOGIN ! ",
                                             " You entered an invalid Password." .. 
                                             "\n You have only " .. (4 - PTry) .. " tries left.", "OK")
                                moai.Set("logapp", "Text", "")
                                If PTry = 4
                                   END
                                EndIf  
                                moai.Set("pswd", "Activeobject", "logapp")
                            EndIf

                    EndSwitch

              EndSwitch

        EndSwitch
EndFunction

;*** listen to these events ***********************************************************************
InstallEventHandler({RapaGUI = E_EventFunc})

Login$ = "Amiga"

moai.Set("pswd", "Open", True)
moai.Set("pswd", "Activeobject", "logapp")

;*** main loop ************************************************************************************
Repeat
    WaitEvent
Forever
Once I enter an incorrect password and press enter it will tell me how many trys I have left, press the OK button on the error message, and the Textentry object clears and I can enter about 2 letters before the cursor disappears.

I have tried turning Off notifications but that made no difference. Adding in the Requester seem to help a bit but it still did not work like hitting the Login button.

I have spent a lot of time trying all sorts of work arounds but with no joy.

Hope I have explained it good enough for you.

Cheers
Leo
----------------------------------------------------------------------------------------
Redlion
Sam460 Lite
A4000 A3000 A2000 A1200 A1000 A600 A500 CD32
plouf
Posts: 584
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: RapaGUI Textentry Bug

Post by plouf »

i haev try your example in win11 and 68k
i Type "Amiga" then Enter, and get login (message OK appear) ?!
Christos
User avatar
Redlion
Posts: 111
Joined: Sun Jul 10, 2011 5:05 am
Location: Perth, Western Australia

Re: RapaGUI Textentry Bug

Post by Redlion »

@ plouf

It works if you put in the correct password, try it with an incorrect password.

Cheers
Leo
----------------------------------------------------------------------------------------
Redlion
Sam460 Lite
A4000 A3000 A2000 A1200 A1000 A600 A500 CD32
User avatar
jPV
Posts: 675
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

Re: RapaGUI Textentry Bug

Post by jPV »

I can't see any difference if I do it by the button or the enter key. On which platform you see the issue?
plouf
Posts: 584
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: RapaGUI Textentry Bug

Post by plouf »

ok i see it now

ORIGINAL textentry has focus WHILE you are typing (letter 1 letter 2 etc)
AFTER error message, AFTER the first letter the focus is lost

happens is AOS 3 / AOS 4 / NOT IN WINDOWS

i have minimize code to the minimun to demostrate

Code: Select all

;*** This script requires the RapaGUI plugin ******************************************************
@REQUIRE "RapaGUI", {link=True}

;*** Setup GUI **************************************************************************************
moai.CreateApp([[
<?xml version="1.0" encoding="iso-8859-1"?>
<application id="app">

     <window Title="LOGIN" Width="300" Id="pswd" >
        <vgroup >
                        <text Align="Left">Password : </text>
                        <textentry Id="logapp"  Notify="Acknowledge"></textentry>
        </vgroup>
    </window>

</application>
]])

;*** Handler for all incoming events **************************************************************
Function E_EventFunc(msg) 
    Switch msg.action
        Case "RapaGUI"
            Switch msg.attribute
        
                 Case "Acknowledge": ; =============================================================
                    Switch msg.id
                        Case "logapp"
                            Password$ = moai.Get("logapp", "Text")
                            If Password$ = Login$
                                moai.Request(" CORRECT","","ok")
																End
                            Else
                              moai.Request(" INCORRECT LOGIN ! ","", "OK")
                              moai.Set("logapp", "Text", "")
                            EndIf
												
                    EndSwitch
							
              EndSwitch

        EndSwitch
EndFunction

;*** listen to these events ***********************************************************************
InstallEventHandler({RapaGUI = E_EventFunc})

Login$ = "Amiga"

moai.Set("pswd", "Activeobject", "logapp")

;*** main loop ************************************************************************************
Repeat
    WaitEvent
Forever

Christos
User avatar
jPV
Posts: 675
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

Re: RapaGUI Textentry Bug

Post by jPV »

Doesn't happen on MorphOS. Which MUI version you have in OS3?
plouf
Posts: 584
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: RapaGUI Textentry Bug

Post by plouf »

os3 (old amikit winuae) mui5 / 21.227 / 31.08.2021
os4 21.1 / 29.08.2016

i try in mos, yes MorphOS / windows are both Working ok
Christos
User avatar
jPV
Posts: 675
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

Re: RapaGUI Textentry Bug

Post by jPV »

Someone should try with MUI 3.8 on OS3. If it works, then it's a bug in the AmigaOS MUI5 clone...
plouf
Posts: 584
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: RapaGUI Textentry Bug

Post by plouf »

seems you are right...
i found a AiaB r10 with mui 3.9 and it is working properly..
Christos
User avatar
airsoftsoftwair
Posts: 5626
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: RapaGUI Textentry Bug

Post by airsoftsoftwair »

MUI5 bugs can be reported here: https://github.com/amiga-mui/muidev/issues
Post Reply