B4J Question B4XDialog scroll ?

Gianni M

Well-Known Member
Licensed User
Longtime User
B4X:
    'Root As Form
    '
    Dim Dialog As B4XDialog
    Dialog.Initialize(Root.RootPane)
    Dim CustomPanel As B4XView
    CustomPanel = xui.CreatePanel("")
    CustomPanel.SetLayoutAnimated(0, 0, 0, Root.Width - 160dip, Root.Height - 190dip)
    CustomPanel.LoadLayout("LayoutClienti") 
    ' there are many TextField and Label on Vertical axis, and on PC with low resolution (example 800 x 600)
    ' not all objects are displayed
    'into LayoutClienti, there is a Pane and ALL TextField
    '
    Dialog.BackgroundColor = xui.Color_White
    Dialog.ButtonsColor = xui.Color_White
    Dialog.BorderColor = xui.Color_Gray
    Dialog.ButtonsTextColor = 0xFF007DC3
    Dialog.Title = "Clienti"
    '
    Dim rs As Object = Dialog.ShowCustom(CustomPanel, "OK", "NO", "")
    Wait For (rs) Complete (Result As Int)
it is possible to scroll with Dialog?
this is start-up of new project, and i can modify all (layout and code)
 

Gianni M

Well-Known Member
Licensed User
Longtime User
Simply load a layout with a CustomListView
do i need to change the code ?
can you help me understand better?
B4X:
Dim CustomPanel As B4XView
    CustomPanel = xui.CreatePanel("")
    CustomPanel.SetLayoutAnimated(0, 0, 0, Root.Width - 160dip, Root.Height - 190dip)
    CustomPanel.LoadLayout("LayoutClienti")
 
Upvote 0

Alexander Stolte

Expert
Licensed User
Longtime User
Example project is attached.
B4X:
    Dialog.Initialize(Root)
    Dim CustomPanel As B4XView
    CustomPanel = xui.CreatePanel("")
    CustomPanel.SetLayoutAnimated(0, 0, 0, Root.Width - 160dip, Root.Height - 190dip)
    CustomPanel.LoadLayout("frm_ListView")

    For i = 0 To 20 -1
        CustomListView1.AddTextItem("Test " & (i+1),"")
    Next
    
    Dialog.BackgroundColor = xui.Color_White
    Dialog.ButtonsColor = xui.Color_White
    Dialog.BorderColor = xui.Color_Gray
    Dialog.ButtonsTextColor = 0xFF007DC3
    Dialog.Title = "Clienti"
    '
    Dim rs As Object = Dialog.ShowCustom(CustomPanel, "OK", "NO", "")
    Wait For (rs) Complete (Result As Int)
 

Attachments

  • B4XDialog with xCustomListView.zip
    5.3 KB · Views: 83
Upvote 1

Gianni M

Well-Known Member
Licensed User
Longtime User
B4X:
Dialog.Initialize(Root)
    Dim CustomPanel As B4XView
    CustomPanel = xui.CreatePanel("")
    CustomPanel.SetLayoutAnimated(0, 0, 0, Root.Width - 160dip, Root.Height - 190dip)
    CustomPanel.LoadLayout("frm_ListView")
    'how to load myLayout ?
    'i no need to create a "form" via code
    For i = 0 To 20 -1
        CustomListView1.AddTextItem("Test " & (i+1),"")
    Next
    'wish CustomListView1 load custom layout from internal designer (bjl)
this code is perfect, but how to load myLayout ?
 
Upvote 0
Top