B4A Library Dialogs library

Status
Not open for further replies.
This library contains several modal, that is blocking, dialogs by which the user can enter data. Presently they are an InputDialog for numbers and text, a TimeDialog for times and and a DateDialog for dates.

Note that modal dialogs can close unexpectedly and not return to your code if the Activity needs to close, most likely because the user rotated the device. There is a brief discussion of this in the overall library help in the xml. This can also occur with the Basic4android modal dialogs InputList, InputMultiList, Msgbox and Msgbox2 whose modal mechanism is used by the dialogs in this library.

Edit : - Version 1.1 posted with minor bug fix. See post #6 for details.

Edit : - Version 1.2 posted with Color dialogs. See post #16 for details.

Edit : - Version 1.3 posted with bug fix. See post #19 for details.

Edit : - Version 1.4 posted with a Number dialog. See post #20 for details.

Edit : - Version 1.5 posted with some enhancements. See post #28 for details.

Edit : - Version 1.6 posted with a File Dialog. See post #30 for details.

Edit : - Version 1.7 posted with a minor UI change. See post #33 for details.

Edit : - Version 1.8 posted with a Custom dialog. See post #37 for details.

Edit : - Version 1.9 posted with a bug fix. See post #42 for details.

Edit : - Version 2.0 posted with a bug fix. See post #48 for details.

Edit : - Version 2.1 posted with a second Custom dialog. See post #68 for details.

Edit : - Version 2.2 posted. See post #75 for details.

Edit : - Version 2.3 posted. See post #90 for details.

Edit : - Version 2.4 posted. See post #135 for details.

Edit : - Version 2.5 posted. See post #148 for details.

Edit : - Version 2.6 posted. See post #155 for details.

Edit : - Version 2.7 posted. See post #168 for details.

Edit : - Version 2.8 posted. See post #206 for details.

Edit :- Version 2.91 posted by Mildev. See post #317 for details. His version 2.91 is based on my unpublished v2.9 which set the text box in FileDialog to SingleLine mode.

Edit : - Version 2.92 posted. See post #341 for details.

Edit (Erel): Version 3.00 posted. Developers using B4A v6.80+ should use this version.

V4.01 is released with several improvements: https://www.b4x.com/android/forum/t...-dialogs-and-async-methods.80204/#post-507930

B4A version | Dialogs library version
------------------------------------
7.0+ 4+
6.8 3.00
<6.8 2.92
 

Attachments

  • Dialogs2.92.zip
    59.4 KB · Views: 12,994
  • Dialogs3.00.zip
    48.9 KB · Views: 2,946
  • Dialogs4.01.zip
    72.2 KB · Views: 9,560
Last edited by a moderator:

CharlesR

Member
Licensed User
Longtime User
Thank you for your earlier help. I am getting on well with your excellent dialogs but have one question which is probably very simple. I am using this code to get an opening time, but would like to pad it so it displays hour and minutes both as 2 digits eg in the format 06:00 please could you show me how to do that. Sorry for another newbie question.

Sub openTime_Click
Dim td As TimeDialog
Td.Hour = 06
Td.Minute = 00
Td.Is24Hours = True
ret = Td.Show("Set the opening time", "Opening Time", "Yes", "No", " ", Bmp)
openingTime = Td.Hour & ":" & Td.Minute
openTime.Text = openingTime
ToastMessageShow(ret & " : " & Td.Hour & ":" & Td.Minute, False)
End Sub

Charles
 

alfcen

Well-Known Member
Licensed User
Longtime User
Hello Charles,

Please try this:

DateTime.TimeFormat="HH:mm"
openTime.Text = DateTime.Time(td.TimeTicks)

Cheers
Robert
 

CharlesR

Member
Licensed User
Longtime User
I am obviously missing something very simple, but in the previous time dialog, the returned time displays in the button, but in this number version it does not. Can anyone explain what I am doing wrong please?

Sub getfloorArea_Click
Dim nd As NumberDialog
nd.Digits = 5
nd.Number = 6000
nd.Decimal = 0
nd.ShowSign = False
ret = nd.Show("Floor Area", "Yes", "No", " ", Bmp)
floorArea = nd.Number
End Sub

Thanks Charles
 

agraham

Expert
Licensed User
Longtime User
It seems a shame to post a new version and see the download count drop from 376 to 0 :( This must be the most downloaded library I have written. :)

I can't believe that it didn't occur to me to do this until now. Adding a view to the original Custom dialog required specifying its absolute position within the dialog as well as its size. This made centering the view in the dialog a bit hit and miss on different screen sizes.

I have now added a Custom2 dialog that requires only the view size specifying, the added View will be automatically centred in the dialog.

By the way, Android 3.0 Honeycomb appears to automatically wrap a dialog to the size of the added view, ignoring the top and left parameters so Custom and Custom2 dialogs appear identical on my Motorola Xoom. EDIT :- This is not in fact correct. I was being mislead by having an overrlarge Panel that I was adding to a Custom dialog!
 
Last edited:

tremara1

Active Member
Licensed User
Longtime User
new version

I love this library, it is a tool I will use alot. I just downloaded ver 2.1 when I unzipped it there is no .jar or .xml. There was a demo which throws an error
B4X:
Error parsing program.
Error description: Unknown type: customdialog2
Are you missing a library reference?
Occurred on line: 124
Dim cd As CustomDialog2
my current library is 2.0...did I miss something? ...again thanks for all your great work.
 

Cor

Active Member
Licensed User
Longtime User
using 2.1

when clicking for the second time the custom dialog button you will get at remove view error
 

Cor

Active Member
Licensed User
Longtime User
It goes wrong when i wanted to add a label to the pnl

and i wanted to update this label outside the custum click routine

I have now updated my routine and it is working ok, without label
 

Colin

New Member
Licensed User
Longtime User
FileDialog FileFilter

I want to limit the files in a filedialog to a specific file extension but show all files of that type regardless of case. I think I read somewhere that the filter (or android) is case sensitive.

Does the FileDialog FileFilter allow multi file types as it does in Basic4PPC or only a single file type?
Does it support wildcards?

Thanks
Colin
 

aklisiewicz

Active Member
Licensed User
Longtime User
I have copied the files to the
C:\Program Files\Anywhere Software\Basic4android\Libraries\Dialogs2.2
but I cannot see the library on the reference list list.

Am I missing something ?

Arthur
 

klaus

Expert
Licensed User
Longtime User
You must unzip the the zip file.
Copy Dialogs.jar and Dialogs.xml to
C:\Program Files\Anywhere Software\Basic4android\Libraries

If you have installed a folder for the addidtinal libraries you could copy these two files to this folder rather than to the folder above.

Best regards.
 
Last edited:
Status
Not open for further replies.
Top