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,947
  • Dialogs4.01.zip
    72.2 KB · Views: 9,560
Last edited by a moderator:

corwin42

Expert
Licensed User
Longtime User
Anyone had success in adding a ScrollView to a CustomDialog2?

I wanted to create a dialog with scrollable contents and this doesn't seem to be possible. If it is possible and I can't figure out how to do it a simple example would be great.

If it is not possible I think I will have to use a seperate activity instead of the dialog.

Thanks,
Markus
 

boten

Active Member
Licensed User
Longtime User
agraham,
The NumberDialog opens "very wide" even if there's only 1 digit displayed.
Is it possible (in a future version) to adjust the width of the dialog to the necessary minimum , depending of course on the title and the text buttons?

tia
 

bodycode

Member
Licensed User
Longtime User
Possible bug in file dialog - Line returns/multiple line inputs

Hi. I'm using your dialogs libraries and have found them to be very useful. But one dialog box, the file library file dialog box, actually allows line returns (two line string) as a file-save. So, saving something using a file name using your file dialog box would attempt to save a file name composed of two separate lines which of course, results in a big Android OS error.

This is not something I actually attempted on purpose, it happened in the normal day-to-day use and experimentation of the dialog box. It occurred when I set up a file save dialog box, and, the "return key" was used when the Android virtual keyboard popped up, tryting to hit the "enter" key. This error occurred since people also use the "enter" key the same as the "return" key on keyboards when using their computers, as I'm sure you know.

Any way to fix this, so that it behaves like your input dialog box, which actually does not allow double line inputs? PS: If you have a solution that I'm not aware of, can you tell me what it is? Thanks


Thanks in advance.

Regards,
Marshall
 
Last edited:

bodycode

Member
Licensed User
Longtime User
Dialog filename box accepts line return. bug?

I might've posted this somewhere else, hope I didn't. Anyway, in your file dialog box, a user can actually enter a return as an input for a filename! I think this borders on being an actual bug. When a user wants to SAVE data (to a filename), a user can actually enter TWO lines as a filename. That obviously crashes any OS, including Android. I'd like to have a coding design where it would only be possible to enter a single line of text as a filename. That would include ANY more-than-one line input, including any other characters or keypresses that generates a line return. The key that showed me this problem was of course, the "return" key. This was accidental but very revealing. Any way a round this people? I'd really appreciate some input on this problem. This can be reduplicated any number of times since this is a built-in behavior of the dialog library.

Of course, I apologize for the inconvenience my ignorance causes any one :)

I'm not a programmer (yet), only a dabbling newbie hobbiest :(
 
Last edited:

bodycode

Member
Licensed User
Longtime User
Dialog filename box accepts line return. bug?

in your file dialog box, a user can actually enter a return as an input for a filename! I think this borders on being an actual bug. When a user wants to SAVE data (to a filename), a user can actually enter TWO lines as a filename. That obviously crashes any OS, including Android. I'd like to have a coding design where it would only be possible to enter a single line of text as a filename. That would include ANY more-than-one line input, including any other characters or keypresses that generates a line return. The key that showed me this problem was of course, the "return" key. This was accidental but very revealing. Any way a round this people? I'd really appreciate some input on this problem. This can be reduplicated any number of times since this is a built-in behavior of the dialog library.

Erel showed me a workaround that only deals with the final contents of the assigned file name variable, which is after-the-fact input. In other words, the problem still remains and I' looking for a method to prevent more than one line from being input, and not just a solution that deletes a return character in the final file name after the user inputs a file name, because a second line input is still possible. It prevents a crash when a user inputs a file name, but, two-lines or more is still possible even though the workaround deletes anything after the first line. But the dialog box's lack of multi-line filtering will confuse users of my app which I don't want and the problem still remains.

Of course, I apologize for the inconvenience my ignorance causes any one :)

I'm not a programmer (yet), only a dabbling newbie hobbiest :(
 
Last edited:

bodycode

Member
Licensed User
Longtime User
Absolutely awesome. thank you!

Wow. Fantastic! I'm really excited about this. Sounds just like what the doctor ordered, thanks so much for this, didn't even know it existed despite my searches!

Although I haven't even looked at the code, this sounds like a slam dunk by your description.

Marshall

Use the File Explorer class here: http://www.b4x.com/forum/additional...s-file-explorer-visualization.html#post109124
There's no multiline problem and you can change everything if that does not suit you.
 

BarrySumpter

Active Member
Licensed User
Longtime User
Absolutely beautiful library!

Brilliant!

Been looking for a single slider/seekbar for single value like Transparancy / Opacity / Brightness, etc.

Love the seekbars in the Get Color (RGB) and Get Color 3 (HSV) dialogs.


Is there a way I can use only one of the seekbars in a generic dialog as in a single seekbar in the Get Color 3 (HSV) dialog?

i.e.
Custom title, etc
custom seekbar solid border color of my choosing
or custom seekbar gradient border color of my choosing
exactly like Hue and Saturation.
Or a custom color gradiant variation like Saturation.

Mainly to match your other dialogs with my color scheme of my projects etc.

Any help would be greatly appreciated.
 
Last edited:

gjoisa

Active Member
Licensed User
Longtime User
About date dialog

There is new type of date editor in htc phones without + and - buttons . dd, mm, yyyy values can be changed with rolling . (Not like Iphone's spinning wheel)
Can your date dialog get this new look ?
 

bodycode

Member
Licensed User
Longtime User

gjoisa

Active Member
Licensed User
Longtime User
Just have a look at wheelview library . I expect this wheelview like look . In wheel view we have to write much code . But dialog library makes it so simple .
 

Informatix

Expert
Licensed User
Longtime User
I see no possible way to integrate this into anything, because it's not a b4a library! B4a Libs need to contain a Jar and XML, but you pointed me to no such files and have no idea what to do.

@Bodycode
It's a class (it's clearly mentioned in the thread), not a library. A class can be used exactly like a library, except you copy the class in your project folder, not in the library folder. It's source code, not compiled code. You need B4A v2 to use a class. If you need more info on classes, look at the tutorial that Erel made.
 

bodycode

Member
Licensed User
Longtime User
Sorry. Thanks

Ah. Sorry. Thanks, I'll try this.

@Bodycode
It's a class (it's clearly mentioned in the thread), not a library. A class can be used exactly like a library, except you copy the class in your project folder, not in the library folder. It's source code, not compiled code. You need B4A v2 to use a class. If you need more info on classes, look at the tutorial that Erel made.
 

margret

Well-Known Member
Licensed User
Longtime User
@bodycode

This is a Class library not a .jar library. The code is there and works good but you must load the Class into your project. You also must have B4A 2.0 or greater to use the Class code. It is source code and the reason he said if it's not what you needed you could change it.

UPDATE: Looks like more than one of us was typing at the same time... You beat me to it!
 

bodycode

Member
Licensed User
Longtime User
Saving and loading?

Does this allow both saving and loading data into label and textedit view?

Thanks
@Bodycode
It's a class (it's clearly mentioned in the thread), not a library. A class can be used exactly like a library, except you copy the class in your project folder, not in the library folder. It's source code, not compiled code. You need B4A v2 to use a class. If you need more info on classes, look at the tutorial that Erel made.
 

bodycode

Member
Licensed User
Longtime User
Hm... Don't even know where to begin.

Don't know where to begin, I'll do a search of "class tutorials" and see if it's something I can handle.

@bodycode

This is a Class library not a .jar library. The code is there and works good but you must load the Class into your project. You also must have B4A 2.0 or greater to use the Class code. It is source code and the reason he said if it's not what you needed you could change it.

UPDATE: Looks like more than one of us was typing at the same time... You beat me to it!
 

bodycode

Member
Licensed User
Longtime User
I'll do the class tutorial search.

I'll do a class tutorial search here, hope it's something I can handle.

I think I asked this before, can you also save data as well?

Marsh

@Bodycode
It's a class (it's clearly mentioned in the thread), not a library. A class can be used exactly like a library, except you copy the class in your project folder, not in the library folder. It's source code, not compiled code. You need B4A v2 to use a class. If you need more info on classes, look at the tutorial that Erel made.
 

Informatix

Expert
Licensed User
Longtime User
I'll do a class tutorial search here, hope it's something I can handle.

I think I asked this before, can you also save data as well?

Marsh

??? That does not load or save data. That just allows to select a file or a folder (like the File Dialog). Then, you do what you want with the selection (file creation, file deletion, file display, etc.) And I repeat it: it's source code. You can change everything and add any missing function.
Classes are as easy to use as libraries. You copy the class file (ClsExplorer) in your project folder and that's all. To know how to use it, look at the demo. It's fairly simple:
1) Declaration in sub Globals
2) Initialization with .Initialize
3) Opening with .Explorer or .Explorer2
 

Penko

Active Member
Licensed User
Longtime User
There is a bug in this library relayed to DateDialog.

If you do something like this:

B4X:
Dim dateDDD As DateDialog
Dim response As Int
      response = dateDDDD.Show(Themessage, Thetitle, positiveStr, cancelStr, negativeStr, Theicon)

It produces various error during execution, not compile ones.

I found out that you always have to use setDate() or probably the individual properties would also do the job to prevent this buggy behavior.

If it is not a bug, for what reason should I always specify a date? The default behavior may be the current date. But all for all, it shouldn't produce execution errors.

I don't have similar issues with TimeDialog.
 
Status
Not open for further replies.
Top