B4A Library SD: Dialogs

(No WRAP, No Java Only B4A)

I finally finished my first Library. I suppose it's full of bugs. I rely on your messages and your benevolence (Do not be too bad with me)

There are already many Dialogs libraries already, but since B4A 7.01 is available, the question arises. How do people who have an old version without WaitFor and Sleep will have to keep obsolete libraries because the new ones will no longer be supported.

So I decided to create an updated library that would use both DoEvents (the so hated) but it would work without it. Here is my library.

With the attached examples you can see how to use the bookstore in the ways (with and without DoEvents). Probably you can also use it in a third way with WaitFor, but I have not tried it.

SD_Dialogs
Author:
Star-Dust
Version: 0.07
  • ColorDIalog
    Events:
    • Response (Response as int As , RGBcolor as int As )
    Fields:
    • response As Int
    • rgbcolor As Int
    Methods:
    • argb (alpha As Int, Red As Int, Green As Int, Blue As Int) As Int
    • class_globals As String
    • doeventwaitresponse As Int
    • initialize (Me_CallBack As Object, EventName As String) As String
      Initializes the object. You can add parameters to this method if needed.
    • show (Title As String, Positive As String, Cancel As String, Negative As String) As String
  • DateDialog
    Events:
    • Response (Response as int As , DateTick as long As )
    Fields:
    • datetick As Long
    • response As Int
    Methods:
    • IsInitialized As Boolean
      Tests whether the object has been initialized.
    • class_globals As String
    • datatotext (Tick As Long) As String
    • doeventwaitresponce As Int
    • getdayofmounth As Int
      only get
    • getmounth As Int
      only get
    • getyear As Int
      only get
    • initialize (MeCallBack As Object, EventName As String, Date As Long) As String
      Initializes the object. You can add parameters to this method if needed.
    • setdate (DayOfMounth As Int, Mounth As Int, Year As Int) As String
    • show (Title As String, Positive As String, Cancel As String, Negative As String) As String
  • Dialogs
    Fields:
    • cancel As Int
    • input_type_decimal_number As Int
    • input_type_email As Int
    • input_type_first_upcase As Int
    • input_type_multi_line As Int
    • input_type_no_suggest As Int
    • input_type_none As Int
    • input_type_numbers As Int
    • input_type_password As Int
    • input_type_phone As Int
    • input_type_suggest As Int
    • input_type_text As Int
    • input_type_upcase As Int
    • negative As Int
    • positive As Int
    • response_not_initialized As Int
    • response_not_selected As Int
    Methods:
    • process_globals As String
  • FileDialog
    Events:
    • Response (Response as int As , FileName as string As )
    Fields:
    • filename As String
    • path As String
    • response As Int
    • showonlyfolders As Boolean
    Methods:
    • addfilter (Filter As String, Description As String) As String
    • class_globals As String
    • clearfilter As String
    • doeventwaitresponse As Int
    • initialize (MyActivity As ActivityWrapper, Me_CallBack As Object, EventName As String) As String
      Initializes the object. You can add parameters to this method if needed.
    • show (Title As String, Positive As String, Cancel As String, Negative As String) As String
    • timerdialog (MillSec As Int) As String
    Permissions:
    • android.permission.WRITE_EXTERNAL_STORAGE
  • InputDialog
    Events:
    • Response (Response as int As , InputText as string As )
    Fields:
    • colorestyle As Int
    • hint As String
    • input As String
    • input_type_decimal_number As Int
    • input_type_email As Int
    • input_type_first_upcase As Int
    • input_type_multi_line As Int
    • input_type_no_suggest As Int
    • input_type_none As Int
    • input_type_numbers As Int
    • input_type_password As Int
    • input_type_phone As Int
    • input_type_suggest As Int
    • input_type_text As Int
    • input_type_upcase As Int
    • inputtype As Int
    • response As Int
    • showkeyboard As Boolean
    • style_ellipse As Int
    • style_fringe As Int
    • style_trapeze As Int
    Methods:
    • class_globals As String
    • doeventwaitresponse As Int
    • initialize (MyActivity As ActivityWrapper, Me_CallBack As Object, EventName As String) As String
      Initializes the object. You can add parameters to this method if needed.
    • show (Message As String, Title As String, Positive As String, Cancel As String, Negative As String) As String
      -100 Error not initialized
    • styledshow (Message As String, Title As String, Positive As String, Cancel As String, Negative As String, GraficStyle As Int) As String
      -100 Error not initialized
      Stlye 0 = Trapezio
      Style 1 = Ellisse
      Style 2 = Frangia
    • timerdialog (MillSec As Int) As String
  • ListDialog
    Events:
    • Response (Response as int As , ListResponse as List As )
    Fields:
    • colorestyle As Int
    • listresponse As List
    • response As Int
    Methods:
    • class_globals As String
    • doeventwaitresponse As Int
    • initialize (Me_CallBack As Object, EventName As String) As String
      Initializes the object. You can add parameters to this method if needed.
    • show (ListItem As List, Title As String, MultiSelect As Boolean, Positive As String, Cancel As String, Negative As String) As String
      -100 Error not initialized
    • timerdialog (MillSec As Int) As String
  • MessageBox
    Events:
    • Response (Response as int As )
    Fields:
    • colorestyle As Int
    • response As Int
    • style_ellipse As Int
    • style_fringe As Int
    • style_trapeze As Int
    Methods:
    • class_globals As String
    • doeventwaitresponse As Int
    • initialize (MyActivity As ActivityWrapper, Me_CallBack As Object, EventName As String) As String
      Initializes the object. You can add parameters to this method if needed.
    • newmsgbox (Message As String, Title As String, Positive As String, Cancel As String, Negative As String) As String
      -100 Error not initialized
    • styledmsgbox (Message As String, Title As String, Positive As String, Cancel As String, Negative As String, GraficStyle As Int) As String
      -100 Error not initialized
      Stlye 0 = Trapezio
      Style 1 = Ellisse
      Style 2 = Frangia
    • timerdialog (MillSec As Int) As String
  • SignatureDialog
    Events:
    • Response (Response as int As , Signature as bitmap As )
    Fields:
    • colorestyle As Int
    • response As Int
    • sign As BitmapWrapper
    Methods:
    • class_globals As String
    • doeventwaitresponse As Int
    • initialize (Me_CallBack As Object, EventName As String) As String
      Initializes the object. You can add parameters to this method if needed.
    • show (Title As String, Positive As String, Negative As String) As String
      -100 Error not initialized
    • timerdialog (MillSec As Int) As String
  • TimeDialogs
    Events:
    • Response (Response as int As , TimeTick as long As )
    Fields:
    • response As Int
    • timetick As Long
    Methods:
    • IsInitialized As Boolean
      Tests whether the object has been initialized.
    • class_globals As String
    • doeventwaitresponce As Int
    • initialize (MeCallBack As Object, EventName As String, Time As Long) As String
      Initializes the object. You can add parameters to this method if needed.
    • show (Title As String) As String
____________________________________________________________________________
rel. 0.0.2
New:
NameEvent on Initialize: You can raise an Event other than Class_Response (See spoiler)
Initializing so Class.Initialize(Activity, Me, "NameEvent"), when it raise the event, launches the sub NameEvent_Response (Arg ...).

If a StringEvent that contains underscores (for example, Class.Initialize(Activity, Me, "Event_Click") call the sub with the exact name entered as a topic, In this case, Event_Click, without passing arguments.

rel. 0.0.3
New:
Field: Intercept_KEYCODE_BACK As Boolean

rel. 0.0.5
New: Modify Initialize
, not required pass Activity

rel. 0.0.6
New:
Fix Bug FileDialog, Add button "create folder"

rel. 0.0.7
New:
Fix Bug DateDialog, B4A 8.8+ and SDK28+

New XUI version of the multi-platform library is available. You can download it from here
 

Attachments

  • Dialog_Example.zip
    9.8 KB · Views: 956
  • SD_Dialogs 0.06 (for B4A 6).zip
    70.8 KB · Views: 584
  • SD_Dialogs 0.06 (for B4A 7 or up).zip
    71.3 KB · Views: 579
  • SD_Dialogs 0.07.zip
    74.6 KB · Views: 845
Last edited:

Star-Dust

Expert
Licensed User
Longtime User
Hello,

Bug corrected with version 0.07. You will be able to download a new version to post#1
Note: this version works with B4A 8.8 +

However, a new XUI version of the multi-platform library is available.
You can download it from here
 

iz0ndg

Active Member
Licensed User
Longtime User
The example with 0.07 library at compile time it gives me this error:
B4X:
B4A Versione: 9.01.2
Java Versione: 8
Analisi del Codice.    (0.01s)
Building folders structure.    (0.02s)
Compilazione del codice.    (0.04s)
Compilazione del codice di layouts    (0.00s)
Organizzazione Librerie.    (0.00s)
Generazione file R.    (0.00s)
Compilazione del codice Java prodotto.    (0.00s)
Conversione byte code - ottimizzazione dex.    Error
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lb4a/example/designerscripts/LS_main;
1 error; aborting

Version 0.06 work fine
 

Star-Dust

Expert
Licensed User
Longtime User
This error means that the same class appears in two referenced jars.
Try if the example I attached works correctly

The new version corrects a parameter error in an IF STATEMENT, it does not change any more. The difference which is filled in with B4A 9.01 for Android SDK 26. But I updated the SDK to version 28 and this creates several changes

see here and here
 
Last edited:

iz0ndg

Active Member
Licensed User
Longtime User
This error means that the same class appears in two referenced jars.
Try if the example I attached works correctly

I don't know why (a B4A bug ???) but the error was due to the "main" name of the layout. Once the file is renamed, everything is working again!;)
 

Star-Dust

Expert
Licensed User
Longtime User
I don't know why (a B4A bug ???) but the error was due to the "main" name of the layout. Once the file is renamed, everything is working again!;)
There is a small error in the Jar file. Download it again and it won't give you this error anymore
 
Top