Private Sub SetWidthItem (Pref As PreferencesDialog, Key As String, wwidth As Double) 'Changes the Width of combo.. etc
For i = 0 To Pref.PrefItems.Size - 1
Dim pi As B4XPrefItem = Pref.PrefItems.Get(i)
If pi.key = Key Then
Dim oldx As Double=Pref.CustomListView1.GetPanel(i).GetView(1).Left
Dim oldw As Double=Pref.CustomListView1.GetPanel(i).GetView(1).width
Pref.CustomListView1.GetPanel(i).GetView(1).Left=(oldx + oldw)-wwidth
Pref.CustomListView1.GetPanel(i).GetView(1).width=wwidth
End If
Next
End Sub
Private Sub SetAlignmentItem (Pref As PreferencesDialog, Key As String, aligntext As String) 'not works - i wanna at number fields text to be at right side...
For i = 0 To Pref.PrefItems.Size - 1
Dim pi As B4XPrefItem = Pref.PrefItems.Get(i)
If pi.key = Key Then
Pref.CustomListView1.GetPanel(i).GetView(1).SetTextAlignment("CENTER", aligntext)
End If
Next
End Sub
Private Sub SetDisableItem (Pref As PreferencesDialog, Key As String, disable As Boolean) ' This works very good - suprisely..
For i = 0 To Pref.PrefItems.Size - 1
Dim pi As B4XPrefItem = Pref.PrefItems.Get(i)
If pi.key = Key Then
Pref.CustomListView1.GetPanel(i).GetView(0).Enabled=disable
End If
Next
End Sub
'All can be run at..
Private Sub PrefDialog_BeforeDialogDisplayed (Template As Object)
'for example:
SetDisableItem(prefdialog,"idsyn",False)
SetAlignmentItem(prefdialog,"idsyn","RIGHT") ' --->not works
SetAlignmentItem(prefdialog,"codesyn","RIGHT") ' --->not works
SetWidthItem(prefdialog,"howpay",300dip)