hi pals,
please look at the following code - it was a result of massive help i got here and as final result i generated to suite my needs
it displays 2 types of messages - a confirm and a regular message with as much as i could flexibility
it works fine for me
two questions:
1: the message window allows scrolling
is there a way to prevent it?
or at least to make sure the title isn't scrolled
2:
as i want to be flexibe - is there a way to keep the title background same color as the background of the message boddy as it made by the theme?
this is not critical...
thanks
edit:
out of this scope - is there a way in B4A to create a function with optional parameters like in visual studio ?
please look at the following code - it was a result of massive help i got here and as final result i generated to suite my needs
it displays 2 types of messages - a confirm and a regular message with as much as i could flexibility
it works fine for me
two questions:
1: the message window allows scrolling
is there a way to prevent it?
or at least to make sure the title isn't scrolled
2:
as i want to be flexibe - is there a way to keep the title background same color as the background of the message boddy as it made by the theme?
this is not critical...
thanks
edit:
out of this scope - is there a way in B4A to create a function with optional parameters like in visual studio ?
B4X:
Public Sub zShowDialog (Title As String, TitlebackColor As Int, TitleTextColor As Int, _
Msg As String, msgAlign As String, btnYES As String, btnNO As String, FontSize As Int, fontColor As Int, _
Theme As String, DialogHeight As Int) As ResumableSub
Dim bRet As Boolean = False
Private xui As XUI
Dim prefdialog As PreferencesDialog
If DialogHeight<150dip Then DialogHeight=150dip
If FontSize<12 Then FontSize=12
If btnYES="" And btnNO="" Then btnNO="Got It!"
If msgAlign="" Then msgAlign="Right"
If (msgAlign.ToUpperCase<>"RIGHT") And (msgAlign.ToUpperCase<>"LEFT") And (msgAlign.ToUpperCase<>"CENTER") Then msgAlign="Right"
msgAlign=msgAlign.ToUpperCase
prefdialog.Initialize(Activity, "", 300dip, DialogHeight)
If Title <> "" Then
prefdialog.AddSeparator(Title)
End If
prefdialog.AddMultilineTextItem("First", "", DialogHeight)
If Theme.ToUpperCase="LIGHT" Then
prefdialog.Theme = prefdialog.THEME_LIGHT
Else
prefdialog.Theme = prefdialog.THEME_DARK
End If
If Title<>"" Then
If TitlebackColor<>0 Then prefdialog.SeparatorBackgroundColor = TitlebackColor
If TitleTextColor<>0 Then prefdialog.SeparatorTextColor = TitleTextColor
End If
Dim Data As Map = CreateMap("First": Msg)
Dim sf As Object = prefdialog.ShowDialog(Data, btnYES, btnNO)
For i = 0 To prefdialog.PrefItems.Size - 1
Dim pi As B4XPrefItem = prefdialog.PrefItems.Get(i)
If pi.ItemType = prefdialog.TYPE_MULTILINETEXT Then
Dim ft As B4XFloatTextField = prefdialog.CustomListView1.GetPanel(i).GetView(0).Tag
ft.TextField.SetTextAlignment("CENTER",msgAlign.ToUpperCase)
Dim xfont As B4XFont=xui.CreateFont(Typeface.DEFAULT_BOLD,FontSize)
ft.textfield.Font = xfont
ft.TextField.TextColor = fontColor
ft.TextField.Enabled = False
End If
Next
Wait For (sf) Complete (Result As Int)
If Result = xui.DialogResponse_Positive Then
bRet = True
Else
bRet = False
End If
Return bRet
End Sub