B4J Library jRLDialogsX - Dialogs Library

Douglas Farias

Expert
Licensed User
Longtime User
only to report too, the ToastMessage is not on the center on the screen, this show on the botton right on my pc
 

rwblinn

Well-Known Member
Licensed User
Longtime User
Update 20150910 - Post #1 lists all the methods.
NEW:Set the Parent Form
B4X:
'Set the parent form for a dialog. This must be called prior calling the dialog.
'Parameter: The form to be used as parent window.
'Example: SetParentWindow(MainForm)
'Notes:
'To reset the parentwindow, call SetParentWindow(Null)
'The parent window can not be set for ToastMessageShow
SetParentWindow(ParentForm As Form)
Example
B4X:
Sub btnInformationDialog_Action
    Dlg.SetParentWindow(MainForm)
    Dlg.InformationDialog("Information Title", "My Header", "My Content")
End Sub

FIX:ToastMessage centered on Screen

Example b4jexample enhanced.

@Suntzu, @Douglas: thanks for feedback and ideas
 
Last edited:

Suntzu

Member
Licensed User
Longtime User
Hi Robert,

I confirm that the new version works perfectly in a multiple monitor setup. In fact, it works whichever monitor I use.

Thanks a bunch!
 

specci48

Well-Known Member
Licensed User
Longtime User
Hi rwblinn,

here a small addition from my side, perhaps it should find it's way into the great(!) library on the next update.
Opening a TextInputDialog3 without a preset text, the textfield didn't get the initial focus, which I found very annoying.

So I made the following code changes:

B4X:
import javafx.application.Platform;
...
final TextField field1 = new TextField();
Platform.runLater(new Runnable() {
         @Override
         public void run() {
            field1.requestFocus();
        }
});

Maybe this could also work for other dialogs, setting the focus to the preferred view.

specci48
 

rwblinn

Well-Known Member
Licensed User
Longtime User
Hi,

very good catch - appreciated. I have updated the library accordingly. See next post.
 

TorontoJim

Member
Licensed User
Longtime User
Rob, I'm getting a LOT of use from this library. Two things to add to the wish list:

MessageHTMLDialog:

1.) Include the ability to link to anchors, i.e. <a href="#niftystuff">Jump to nifty stuff</a> and then further down <a name="niftystuff"></a>

2.) The ability to link to an external browser, rather than calling the external link into the dialogue.

I'm not complaining, I love this library!
 

rwblinn

Well-Known Member
Licensed User
Longtime User
Update 20160411 - Post #1 lists all the methods.
UPD:MessageHTMLDialog handles anchors if defined like href="#myanchor" ... name="myanchor" ...
@TorontoJim : Thanks for the enhancement suggestions. Number 1 is implemented, number 2 is on the ToDo list (not found proper way to do so).
 

LWGShane

Well-Known Member
Licensed User
Longtime User
@rwblinn - This is a really amazing library! Thanks for this!
 

Suntzu

Member
Licensed User
Longtime User
Hi Robert,

Is it possible to add the following functionalities:

1. Set a default selected item in the list for ChoiceDialog, SelectDialog, ListDialog, and ListDialog2.
2. Support enter key to select an item from the list (ChoiceDialog, SelectDialog, ListDialog, and ListDialog2). This is to support keyboard keys.
3. Support escape key to exit while the focus is in the list (ChoiceDialog, SelectDialog, ListDialog, and ListDialog2). This is to support keyboard keys.

I hope this is not asking for too much.

Thank you in advance.
 
Last edited:

rwblinn

Well-Known Member
Licensed User
Longtime User
Update 20160801 - Post #1 lists all the methods.
UPD:Set default selected item for ChoiceDialog, SelectDialog, ListDialog, and ListDialog2.
@Suntzu: For your post #30 requests 2&3 have not found a solution yet (need to explore). Recommend to use tab and enter keys in the meantime.
 

Philip Prins

Active Member
Licensed User
Longtime User
Hello ,

Sometimes the toastmessage does not appear on the screen, i can see a icon coming in the taskbar and disappearing but not a toast message on the screen.
B4X:
Dlg.Initialize  
Dlg.ToastMessage("Text",5000)

Am i doing something wrong?
Regards
Philip
 

rwblinn

Well-Known Member
Licensed User
Longtime User
Hi,

have tested few scenarios using jRLDialogs 1.47, B4J 4.70, Java 1.8.0_112, to verify the issue mentioned in post #33. See below.
Could it be, that the toastmessage is hidden by a form (see Test 3 below)?
Could you share more code info when calling toastmessage, so I can verify further.

B4X:
' Test1 ToastMessage: OK
  MainForm = Form1
  MainForm.RootPane.LoadLayout("Main")
  Dlg.Initialize
  MainForm.Show
  Dlg.ToastMessage("TEST ToastMessage", 5000)

' Test2 ToastMessage: OK
  MainForm = Form1
  MainForm.RootPane.LoadLayout("Main")
  MainForm.Show
  Dlg.Initialize
  Dlg.ToastMessage("TEST ToastMessage", 5000)

' Test3 ToastMessage: The message appears first, but then hidden by the mainform showed in the foreground. To show the toastmessage in the foreground, the mainform layout must be shown prior calling toastmessage.
  Dlg.Initialize
  Dlg.ToastMessage("TEST ToastMessage", 5000)
  MainForm = Form1
  MainForm.RootPane.LoadLayout("Main")
  MainForm.Show
 

Art

Member
Licensed User
Longtime User
Hi and thank you for the library. Is it possible to use TextInputDialog2 to input 3 fields (smtpserver, user name, passw)? Thanks in advance.
 

rwblinn

Well-Known Member
Licensed User
Longtime User
Hi,

thanks for your request.
The library does not support a dialog for two text fields and a password field. See below reference what is supported.
Two possible options to solve your request using the library:
a) Create two dialogs: one for the smtpserver using TextInputDialog and the next for username/password using LoginDialog
b) Enhance the library with a method LoginDialog3 which has two text fields and a password field (no icon) - I can do that after B4J v5.50 is released.

Reference
For login, current versions has two methods which return a map holding username and password. Each dialog has two fields from type text and password.
'Show a Login Dialog.
B4X:
LoginDialog(Title As String , Header As String) As Map

'Show a Login Dialog with Icon and default UserName.
B4X:
LoginDialog2(Title As String , Header As String, UserName As String) As Map

B4X:
TextInputDialog2
has two text fields. Not suitable for your request.
 
Reactions: Art

Art

Member
Licensed User
Longtime User
Hi,
Thank you for the quick reply. The two dialogs solution (TextInputDialog3 and LoginDialog) worked like a charme. Now I only need to localize 'Username' and 'Password' (translate into Portuguese). Can it be done? Thanks again, Rob.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…