B4A Library Dialogs library

Status
Not open for further replies.

mhdi

Member
Licensed User
Longtime User
Thankyou. That works.

Another two

1) Is it possible to programatically disable a dialog button? For example, I want to disable the OK button until some condition is met.
2) I have a TabHost and the dialog positions itself below the tabs. How can I make the dialog position itself at the top of the screen?

Thanks again,
 

mrjaw

Active Member
Licensed User
Longtime User
There is help for this library. I saw the examples but would be nice if it has a helpfile to read before.

how can I do to read a String

x=Dlg.String()

Thks!
 

Penko

Active Member
Licensed User
Longtime User
B4X:
Dim Id As InputDialog
   Dim ret As Int
   Bmp.Initialize(File.DirAssets, "icon.png")
   Id.InputType = Id.INPUT_TYPE_TEXT
   Id.Input = ""
   Id.Hint = "This is my hint"
   Id.HintColor = Colors.DarkGray 
   
   ret =  Id.Show("Please enter something", "This is my title", "Yes", "Cancel", "",Bmp)
   Msgbox(ret,"Selection")
Msgbox("You entered: " & Id.Input)

This code is from the previous page, I just fixed some logical mistakes. What can be improved is that you check ret against DialogResponse.POSITIVE so that the logic is executed when the user has clicked YES only. That should happen exactly after calling Show(). The buttons you don't need should be left as empty string in the corresponding argument.

If you don't need an icon, just pass Null to the last argument instead of Bmp.





Sent from my HTC Desire using Tapatalk
 
Last edited:

joneden

Active Member
Licensed User
Longtime User
Hi Andrew,

Not sure if you're still active on this or not but I'll post my queries anyway

1) An entry in post 52 mentioned about programatically closing a customdialog, I take it that it's still not possible to do and that the three buttons on the bottom do all that.

2) I'm having issues with making a MsgBox and ProgressDialog open while the customdialog is open. Am I correct that this is not possible owing to the way Android works? I'll just do some fudges to make it work if that's the case - would prefer not to but such is life.

3) I'm using a Jelly Bean device, Galaxy S2 with latest CM10 - nice , and find that I can click outside the customdialog and that closes the dialog. Is there a way to stop that? If not are you planning an update or should I just implement a fudge to reload the customdialog?

Those issues aside it's a fantastic set of dialogs!

Cheers,

Jon
 

gapi

Active Member
Licensed User
Longtime User
Hi, I use dialog custom in project ... I added six EditText in the dialog but I would need more, how I can scroll the contents of the dialog?

tnx
 

joneden

Active Member
Licensed User
Longtime User
That's easy enough - I use customdialog2 and you add a ScrollView to it

B4X:
uxPopupInfo.AddView(uxPopupInfoScrollView, 85%x, 250dip)

Before that add a panel to the scroll view with the EditText views on it...

Hope that helps

Jon
 

agraham

Expert
Licensed User
Longtime User
... programatically closing a customdialog, I take it that it's still not possible to do and that the three buttons on the bottom do all that.
Correct.

I'm having issues with making a MsgBox and ProgressDialog open while the customdialog is open.
You can't do this.

and find that I can click outside the customdialog and that closes the dialog. Is there a way to stop that?
No.
 

joneden

Active Member
Licensed User
Longtime User
Cool thanks for letting me know. I have work arounds for all issues now...

Cheers,

Jon
 

gapi

Active Member
Licensed User
Longtime User

scrollview don't have a 'addView' method for add a panel o it !! How can do it ? :BangHead: tnx

reply from me to me :s scrollview.Panel.addView() it's the solution! ^^ thanks @joneden
 
Last edited:

mrjaw

Active Member
Licensed User
Longtime User
Hi!
I need to show a little report, just text, and I dont know that control to use. I thougth use dialog but I need a scroll because this report will be large.

What kind of view recomend me ? MsgBox?
 

mrjaw

Active Member
Licensed User
Longtime User
There is a dialog that the Edit view has few lines instead of one ?
 

newSteve

Member
Licensed User
Longtime User
Close Keyboard

I don't know what I'm missing, but I can't get the keyboard to close at all. I have a droid X, Android 2.3.4, I open an input dialog, click on the box, keyboard pops up, I enter the text, click add, everything works, but the keyboard won't close. There has to be a way to close it. If I hit enter, the keyboard goes away, but then I still have to click Add.

Any help?

 

Erel

B4X founder
Staff member
Licensed User
Longtime User
That looks like a CallSub has become a CallSubDelayed in the ListView code. Only Erel can tell.
The previous post was deleted by the author, so I'm not sure what is the context of this question. ListView_ItemClick now uses BA.RaiseEventFromUI instead of BA.RaiseEvent. It should have been changed before. It is somewhat similar to CallSubDelayed, though CallSubDelayed is much more sophisticated.
 

trisium

Member
Licensed User
Longtime User

Hi Erel,
I use a custom dialog (modal) with a listview. In the previous version of B4A the ListView_ItemClick-event was triggered when an item was tapped in the listview, in the version 2.20 (same project without any changes in code) the ListView_ItemClick-event only gets called when the dialog is closed. It occurs to me that you explain here the reason for this behaviour - but i don't understand what i have to change in my code... :BangHead: Could you help me?
Many thanks!
Tom
 

joneden

Active Member
Licensed User
Longtime User
Hi Erel,

Referencing the previous two posts, you said you would need to use a non-modal approach for the spinner (actually listbox but I'm getting the same issue with a spinner). Is there no way around this such as reflector? Seems weird to me as other click events all work on the custom dialog - I have image views reacting to clicks, checkboxes etc....

Alternatively do you happen to know if there is a custom spinner type control that might work instead?

Regards,

Jon
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…