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: 13,033
  • Dialogs3.00.zip
    48.9 KB · Views: 2,972
  • Dialogs4.01.zip
    72.2 KB · Views: 9,647
Last edited by a moderator:

fransvlaarhoven

Active Member
Licensed User
Longtime User
Hello,

there seems to be a problem with library dialogs version 3.00 and B4A version 6.80

As instructed, i replaced library dialogs version 2.92 with library dialogs version 3.00 when upgrading to B4A version 6.80.

However, it seems to be that the method "ShowCalendar" is no longer supported.

Dim dialog As DateDialog
dialog.ShowCalendar= True

Please advise on how to solve the problem
 

rscheel

Well-Known Member
Licensed User
Longtime User
Hello,

there seems to be a problem with library dialogs version 3.00 and B4A version 6.80

As instructed, i replaced library dialogs version 2.92 with library dialogs version 3.00 when upgrading to B4A version 6.80.

However, it seems to be that the method "ShowCalendar" is no longer supported.

Dim dialog As DateDialog
dialog.ShowCalendar= True

Please advise on how to solve the problem

You have to delete .ShowCalendar and re-select.
 

DonManfred

Expert
Licensed User
Longtime User
B4X:
Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    'Activity.LoadLayout("Layout1")
  
    dia.ShowCalender = True
  
End Sub

Sub Activity_Resume
    dia.Show("Test","Title","OK","Cancel","Negative",Null)
  
End Sub
works for me
 
Last edited:

SandroB4A

Member
Licensed User
Longtime User
Hello,
I use Filedialog to let the user saving a text file somewhere on his phone.
The app propose a default filename trough .ChosenName property but once the user changes the directory the filename disappears from the upper EditText.
Is there a way to avoid that? or to add a separate .DefaultName property?

Tks
 

miguelconde

Member
Licensed User
Longtime User
Hello .

I have an error using the dialog library (InputDialog )
I saw the other comment about it but the solution dont work for me.

B4A version: 6.50
Parsing code. (1.81s)
Compiling code. (0.89s)
Compiling layouts code. (0.01s)
Organizing libraries. (0.00s)
Generating R file. (0.11s)
Compiling generated Java code. Error
javac 1.8.0_131
src\com\sfanetcloud\sfanetmovil\ordenes.java:373: error: package anywheresoftware.b4a.agraham.dialogs.InputDialog does not exist
public anywheresoftware.b4a.agraham.dialogs.InputDialog.DateDialog _entradafecha = null;
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error

I have b4a 6.5 on a ubuntu 16.04 and VirtualBox VM with Windows 7, the
same setting like my old windows 7 PC. This app have many years and
i did not change. Just try to compiled on the VM with the same setting.


Thank you.
 

senat56

Member
Licensed User
Longtime User
v3.00
Error
(Line: 104) If open.Response=DialogResponse.POSITIVE Then
java.lang.NullPointerException

B4X:
Sub Button1_Click
    Dim open As FileDialog
     If open.Show("Select file","Ok","Cancel","",Null)=DialogResponse.POSITIVE Then
     End If
End Sub
 

senat56

Member
Licensed User
Longtime User
First click - no showing , two click - closing and current log

LogCat connected to: B4A-Bridge: Sony C6503
--------- beginning of main
Installing file.
PackageAdded: package:FileInDir.com
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = true **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = true **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = true **
Installing file.
PackageAdded: package:FileInDir.com
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
An error occurred:
(Line: 104) If open.Show("Select file","Ok","Cancel","",Null
java.lang.NullPointerException
 
Status
Not open for further replies.
Top