B4A Library Dialogs library

Status
Not open for further replies.

pwme

Member
Licensed User
Longtime User
it is possibile?

I have an dialog box with radio buttons.

I would like to "auto close" the dialog box when I choose an radio button. Is it possibile?

Sub rb_CheckedChange(Checked As Boolean)
Dim e As RadioButton

e= Sender
If e.Checked Then
' Close. Same as choose "ok" button
End If

End Sub
 

pwme

Member
Licensed User
Longtime User
Yes,

you are right, but not in my case. With inputlist you can have only one radio button for each row. I have created more radio buttons on the same line

example

° A ° B ° C ° D ° E
° F ° G ° H ° I ° J

(excuse me for bad example)


so in this case dialog it's better. Is there a "close" property ?

thank you for your answer
 

pwme

Member
Licensed User
Longtime User
It works! Great Job!

just a little strange behaviour. I have a button to call the dialog. If I click very very very quickly the BA4 opens 2 instance. So when you close the first, you still see your dialog (and you can't close it). But normally (normal click) it works without problem. I like to close all possible bugs.

How to check if dialog open is already running?

if db=null?

many thanks again
 

Informatix

Expert
Licensed User
Longtime User

Define a global boolean: IsDialogOpened
Set it to true when you open the dialog and check whether it's true before displaying the dialog.
 

yuhong

Member
Licensed User
Longtime User
I want use customdialog,I want custom define Title ,button style etc...
Can you help me ?
 

dwsands

Member
Licensed User
Longtime User
I made a change to Dialogs (now v2.93) that I would like to see made to the official version if you are willing. The change is:
  • Made the textview where the resulting color was displayed an edittext so that it could be used to enter text. So an associated SetText, GetText and SetHint were added along with the appropriate code. In my case I only needed to see the textcolor as black but I would assume others would want to change the textcolor as well. I only made changes to the colordialog but the other 2 color dialogs getting the same changes would be valuable to others as well.
Thanks for considering this...David
 

wimpie3

Well-Known Member
Licensed User
Longtime User
Is it possible to change the background colors to make the dialogs look more like InputMap and InputList ?
 

slugger

Member
Licensed User
Longtime User
Hi,

I have a panel with a listview inside and I use the CustomDialog to show it on the screen.

Unfortunately the last line (line # 100) of the listview is not visible but it's covered by the button at the bottom of the dialog, see the attached image.

Is there a way to get the net inner height of the CustomDialog window (without the top title and the bottom buttons) so I can adjust the panel height?
 

Attachments

  • Screenshot_2013-08-23-17-23-31.jpg
    27 KB · Views: 259

slugger

Member
Licensed User
Longtime User
Did you try the Better Dialogs library?

I am trying right now but the results are the same, take a look at the attached screenshot.

This is the code I am using to show the dialog:

B4X:
   Dim lvLog As ListView
    Dim BD As BetterDialogs

    lvLog.Initialize("lvLog")
   
    lvLog.Color=Colors.Yellow
    lvLog.SingleLineLayout.Label.TextColor=Colors.Black
    lvLog.SingleLineLayout.Label.Typeface=Typeface.DEFAULT_BOLD
    lvLog.SingleLineLayout.Label.TextSize=20
   
    Dim i As Int
    For i=0 To 100
        lvLog.AddSingleLine("This is line # " & i)
    Next
       
    If lvLog.Size>0 Then lvLog.SetSelection(lvLog.Size -1)
       
    Dim btnCancel As Button
   
    btnCancel.Initialize("")
    btnCancel.Text = "<Font Color='Yellow'>C</Font>ancel"
    btnCancel.TextColor = Colors.White
    'btnCancel.Background = CreateStateListDrawable
       
    BD.CustomDialog("Events Log",-1,-1,lvLog,100%x,PanelHeight,10dip,Colors.Yellow,Null,btnCancel,Null,False,"BD1")

Panelheight is a variable that contains the height of the upper side of the screen and is calculated like this:

PanelHeight=pnlButton.Top-2

where pnlButton is a panel at the bottom of the screen.

The output is like the one I got using Dialogs.

 

slugger

Member
Licensed User
Longtime User
Apparently I found a way to show all the lines.

I ask for the height of the items of the listview and subtract that height from the DlgHeight parameter:


B4X:
Dim lvHeight As Float
 
lvHeight=lvLog.SingleLineLayout.ItemHeight
BD.CustomDialog("Events Log",-1,-1,lvLog,100%x,PanelHeight-lvHeight,10dip,Colors.Yellow,Null,btnCancel,Null,False,"BD1")
 

icefairy333

Active Member
Licensed User
Longtime User
os:android 2.3(error) android 4.0.4(ok)
using the filedialog with showfolderonly=true and chosen:/sdcard/1/
the modify function return /sdcard/1
and the org function return /sdcard
the "/sdcard" is a link of "/mnt/sdcard" made by os
public String getFilePath()
throws Exception
{
return filepath.getAbsolutePath();//use this is ok on android 2.3
// return this.filepath.getCanonicalPath(); //use this it will return a wrong path
}

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