B4A Library Dialogs library

Status
Not open for further replies.

aklisiewicz

Active Member
Licensed User
Longtime User
I did that, but the library is still not on the list, I'm not getting why some of the libraries register fine and some don't (?)
Now getting to the App:
It compiles fine and runs but the only thing I can get from it is a student list. Nothing else. I see there are some procedures defined (i.e. FillStudentsTable, ExportToJSON etc.) but it seems like there is no access to it. I would suggest when posting an example like this to put some description as what the App supposed to do, otherwise it is confusing for newbies like me.

Arthur
 
Last edited:

klaus

Expert
Licensed User
Longtime User
Where did you install B4A ?
Is it in C:\Program Files\Anywhere Software\Basic4android ?

In your previous post you say that you copied the files to
C:\Program Files\Anywhere Software\Basic4android\Libraries\Dialogs2.2

You must copy Dialogs.jar and Dialogs.xml to
C:\Program Files\Anywhere Software\Basic4android\Libraries
with their orignal names.

Best regards.
 
Last edited:

aklisiewicz

Active Member
Licensed User
Longtime User
OK, I thought if I could store it in subfolder (it would be more organized this way). Also I did not expect to close and reopen application for see the changes. After copying to the main LIB folder I can see it now, but

when I compile an example I still get error:


Compiling code. Error
Error parsing program.
Error description: Unknown type: colordialog
Are you missing a library reference?
Occurred on line: 71
Dim cd As ColorDialog



Thank you - Arthur
 

aklisiewicz

Active Member
Licensed User
Longtime User
that was it, I checked it and it works.
This library looks great, I really love it!
Thank you for your time.



PS>
one other problem I have (but it is not related to your App only) is the timeout message I get while compiling some Apps (including yours), and without pushing it further it sits there with this message on the screen. do you know if there is any way to resolve this ?

Arthur
 

Christian

Member
Licensed User
Longtime User
Hi Andrew,

thank you for supplying the dialogs library. When using the code below and entering a number like 12.3 the number dialog returns 123 thus not returning the decimal separator. Do you have any idea what goes wrong?

With regards

Christian

B4X:
'using dialogs library version 2.2
Sub Globals
   Dim lblInput As Label
   Dim nd As NumberDialog
End Sub

Sub Activity_Create(FirstTime As Boolean)
   lblInput.Initialize("lblInput")
   lblInput.Color=Colors.White
   lblInput.TextColor=Colors.Black
   lblInput.TextSize=30
   Activity.AddView(lblInput,10,10,60,30)
   nd.Digits=4
   nd.Decimal=1
   nd.ShowSign=True
End Sub

Sub lblInput_Click
   nd.Show ("","OK","","",Null)
   lblInput.Text=nd.Number
End Sub
 

klaus

Expert
Licensed User
Longtime User
You could try to change the Timeout value.
Sometimes, I remove an existing Emulator and create a new one.

Best regards.
 

alfcen

Well-Known Member
Licensed User
Longtime User
Please write:

lblInput.Text = nd.Number / 10

or:

lblInput.Text = nd.Number / Power(10,nd.Decimal)

for multiple use.
 

IvanR

New Member
Licensed User
Longtime User
TimeDialog showing hour+1

Hi

Thank you for the great library. I'm using the TimeDialog with 24 hours format.

The TimeDialog shows always one hour later than what I set in xx.Hour, e.g.
this code snippet


Dim td As TimeDialog
Dim txt as String

txt = "18:35"

Td.Hour = DateTime.GetHour(DateTime.TimeParse(txt))
Td.Minute = DateTime.GetMinute(DateTime.TimeParse(txt))
Td.Is24Hours = True

ret = Td.Show("Enter time", "Time", "OK", "Cancel", "", Null)


shows "19:35" within the dialog.

Do I have to subtract 1 from the hour value before passing it to the TimeDialog?

Thank you in advance for your help!

Ivan
 

agraham

Expert
Licensed User
Longtime User
I assume, although you don't show it, that you must have changed DateTime.TimeFormat as with the default setting your code fragment throws an "Unparseable date" exception. Having inserted that in the code I do not see the effect you describe. The expected values of 18 and 35 are shown in the dialog.
B4X:
   Dim td As TimeDialog
   Dim txt As String
   txt = "18:35"
   DateTime.TimeFormat = "HH:mm"
   Td.Hour = DateTime.GetHour(DateTime.TimeParse(txt))
   Td.Minute = DateTime.GetMinute(DateTime.TimeParse(txt))
   Td.Is24Hours = True
   ret = Td.Show("Enter time", "Time", "OK", "Cancel", "", Null)
 

IvanR

New Member
Licensed User
Longtime User
Yes, you are right. I forgot to mention that I have changed the format as follows

DateTime.TimeFormat = "HH:mm"
 

vangogh

Active Member
Licensed User
Longtime User
wish... numeric keypad

the "getnumber" is a bit "strange". you compose a number using +/- on a predefined lenght...

what about a nice numeric keypad?

thanx
 

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
I have the following code in my app:

B4X:
Dim fi As String
Dim ret, ret2 As Int
Dim xx As Boolean
[FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] fd [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#008b8b][FONT=Courier New][SIZE=2][COLOR=#008b8b][FONT=Courier New][SIZE=2][COLOR=#008b8b]FileDialog[/COLOR][/SIZE][/FONT]
[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT]
[SIZE=2][FONT=Courier New][SIZE=2][FONT=Courier New]fd.FastScroll = [/FONT][/SIZE][/FONT][/SIZE][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]True[/COLOR][/SIZE][/FONT]
[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]fd.FilePath = [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]File[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2].DirDefaultExternal[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]fd.FileFilter = [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]".sav"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT]
ret = -2
 
Do While ret = -2
    fd.ChosenName = ""
    ret = fd.Show("Choose a deal to replay:", "Open", "Cancel", "Delete", Null) 
    If fd.ChosenName = "" Then Return
 
    If File.Exists(File.DirDefaultExternal, fd.ChosenName) = False Then
        Msgbox(fd.ChosenName & " does not exist.", "")
        ret = -2 ' repeat loop
 
    Else If ret = -2 Then
        ret2 = Msgbox2("Confirm: delete?", fd.ChosenName, "Yes", "No", "", Null)
        If ret2 = -1 Then
            xx = File.Delete(File.DirDefaultExternal, fd.ChosenName)
            If xx = False Then Msgbox(fd.ChosenName & " was not deleted.","")
        End If
    End If
Loop

I thought that I had read somewhere that the three options in fd.Show returned -1, -2, -3, but instead, it is returning -1, -3, -2 such that Cancel= -3 and Delete= -2. Is there something in my code causing this?

Also, I would like to add an option to email a file, but it appears that fd.Show is limited to 3 options. Is there a better way to accomplish all of this?
 

kickaha

Well-Known Member
Licensed User
Longtime User
Your code will also be easier to follow if you use DialogResponse.CANCEL etc instead of numbers.
 

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
Your code will also be easier to follow if you use DialogResponse.CANCEL etc instead of numbers.

If you check my code, you'll see that most of what I'm operating on is when the user has selected DELETE, which I substituted for NEGATIVE, so using DialogResponse.NEGATIVE (since there is obviously no .DELETE) wouldn't help the readability, I don't think.
 

kkolle

Member
Licensed User
Longtime User
Hi Andrew,

I´m using the TimeDialog!
When I´m using the keyboard to set the minutes to "00" I still get the initialized minutes.
I hope the attached screenshots could help!

Greetings from germany
 

Attachments

  • 01.jpg
    16 KB · Views: 334
  • 02.jpg
    12.3 KB · Views: 325
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…