'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
End Sub
Sub Activity_Create(FirstTime As Boolean)
login
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub login
Dim username As String
username=getusername
Dim Id As InputDialog
Dim p As Panel
Dim etun As EditText
Dim etpw As EditText
Dim lblun As Label
Dim lblpw As Label
p.Initialize("")
etun.Initialize("etun")
etpw.Initialize("etpw")
lblun.Initialize("")
lblpw.Initialize("")
etun.SingleLine = True
etpw.SingleLine = True
etpw.PasswordMode=True
Dim cd As CustomDialog
cd.AddView(p,2dip,0,90%x-4dip,220dip)
p.AddView(etun,40dip,80dip,p.Width-80dip,48dip)
p.AddView(etpw,40dip,150dip,p.Width-80dip,48dip)
p.AddView(lblun,40dip,60dip,p.Width-80dip,40dip)
p.AddView(lblpw,40dip,130dip,p.Width-80dip,40dip)
p.Color=Colors.Black
etun.Hint="Username"
etpw.Hint="Password"
lblun.Text="Username"
lblpw.Text="Password"
etun.Text=username
cd.Show("XverhelstX Login","Login","Cancel","Login & Save username",Null)
lblun.RequestFocus
If cd.Response = DialogResponse.CANCEL Then
'Cancel stuff
Return
Else If cd.Response=DialogResponse.NEGATIVE Then
saveusername
Msgbox("Your user name has bee saved","User Name Saved")
Else
'authenticate
Msgbox("Log in no save","User name not saved")
End If
'Authenticate
End Sub
Sub saveusername
'authenticate user
'there is no value in saving a user that does not pass authentification
'if authenticate user =true then
'save user name to text file
'else
'failed authenticate
'end if
End Sub
Sub getusername() As String
'username = read file where username is stored
Dim use As String
use="Only Me!" 'in live app var use would = the contents of the text file
Return use
End Sub