Adding a popup box to enter 4 different items

dardie72

New Member
Licensed User
Longtime User
Is there an easy way to pop up a dialog box when a user clicks a button on the main activity, where the dialog box has 4 areas to edit text (like name, address, phone, email), like msgbox style.

Thanks
Darryl
 

mc73

Well-Known Member
Licensed User
Longtime User
Perhaps, you can create a centered panel, in which you place your editTextBoxes, and make it popup (visible) at the buttonClick. There is also the dialogs library of Agraham, I think you should take a look at it.
 
Upvote 0

BarrySumpter

Active Member
Licensed User
Longtime User
I'm looking to do the same thing now.

With the panel solution is there a way to make it look like that special (toast or reflection ?) messages box ( msgbox ).

With Agraham Dialogs Library is there a way to input more than one input text on one dialog? i.e. uID & PW

I've been looking around for a couple of hours and could have sworn someone had figured it out but can't seem to find it.

update:
This looks promising:
http://www.b4x.com/forum/basic4android-updates-questions/18839-customdialog-events.html#post108971
 
Last edited:
Upvote 0

ItWorks

Member
Licensed User
Longtime User
Popup Box

Hi Darryl

In fact I've just posted a solution that would work for you see attached.

Make a panel into your dialog , then hide or show it as you want.

Regards
ItWorks
 

Attachments

  • FloatingWindow.zip
    2.5 KB · Views: 459
Upvote 0

ukimiku

Active Member
Licensed User
Longtime User
With Agrahams Dialog lib, you can have Custom Dialogs with several views that are "modal", so they appear to behave like msgbox()

Regards,
 
Upvote 0

BarrySumpter

Active Member
Licensed User
Longtime User
Thanks to all for the suggestions.

A quick and simple popup for Login with UserID and Password text input using CustomDialog.

You can add all kinds of views as you need.


B4X:
'Activity module

Sub Process_Globals
End Sub

Sub Globals

    Dim cd As CustomDialog

    Dim btn As Button

    Dim txtUID As EditText
    Dim txtPW As EditText
    Dim chkRememberUID As CheckBox
  Dim chkRememberPW As CheckBox

End Sub
Sub btn_Click

    'Msgbox ("Button Click","")
    'Show(Title As String, Positive As String, Cancel As String, Negative As String, icon As android.graphics.Bitmap) As Int
  'cd.Show("Login:", "Ok", "Cancel", "", Null) 
  cd.Show("", "Login", "", "", Null) 

    'Msgbox( cd.Response,"")
    
    If cd.Response = -1 Then 'OK
        Msgbox ("You entered:" & CRLF & "User ID: " & txtUID.Text & CRLF & "Password: " & txtPW.Text & CRLF & "Rem User ID: " & chkRememberUID.Checked & CRLF & "Rem Password: " & chkRememberPW.Checked, "")
    End If

'CustomDialog
'Response As Int  [read only]   -1 = OK   -3 Cancel
'Returns the response code that the dialog returned when it last closed.
'Show (Title As String, Positive As String, Cancel As String, Negative As String, icon As android.graphics.Bitmap) As Int
'Shows a modal custom dialog with the specified title.
'Title - The dialog title.
'Positive - The text To show For the "positive" Button. Pass "" If you don't want to show the button.
'Cancel - The text To show For the "cancel" Button. Pass "" If you don't want to show the button.
'Negative - The text To show For the "negative" Button. Pass "" If you don't want to show the button.
'Icon - A Bitmap that will be drawn near the title. Pass Null If you don't want to show an icon.
'Returns one of the DialogResponse values.

End Sub

Sub Activity_Create(FirstTime As Boolean)

        btn.Initialize("btn") 
        btn.Text = "Login"
        Activity.AddView(btn,50,50,150,150)

        Dim pnl1 As Panel
        pnl1.Initialize ("")
        cd.AddView(pnl1, 0, 30, 250dip, 150dip) 

        Dim lblUID As Label
        lblUID.Initialize("")
        lblUID.Text = "User ID: "
        lblUID.TextSize = 18
        pnl1.AddView(lblUID, 10dip, 5dip, 100dip, 40dip) 

        txtUID.Initialize("")
        txtUID.Hint = "Enter User ID"
        pnl1.AddView(txtUID, 85dip, 0, 165dip, 40dip) 

        Dim lblPW As Label
        lblPW.Initialize("")
        lblPW.Text = "Password: "
        lblPW.TextSize = 18
        pnl1.AddView(lblPW, 10dip, 50dip, 100dip, 40dip) 

        txtPW.Initialize("")
        txtPW.Hint = "Enter Password"
        txtPW.PasswordMode = True
        pnl1.AddView(txtPW, 85dip, 45dip,  165dip, 40dip) 
        
        chkRememberUID.Initialize("")
        chkRememberUID.Text = "Remember UID"
        pnl1.AddView(chkRememberUID, 85dip, 85dip, 210dip, 40dip) 
        
        chkRememberPW.Initialize("")
        chkRememberPW.Text = "Remember PW"
        pnl1.AddView(chkRememberPW, 85dip, 120dip, 210dip, 40dip) 
        
        
 
End Sub

Sub Activity_Resume
  'btn_Click
End Sub
 
Last edited:
Upvote 0
Top