B4J Question wrong height in nested xCLV ?

Patent

Member
Licensed User
Longtime User
Dear community,

what occurs if i am dragging the MainForm Right-Window-Bound to let me say 5 Pixels wider?
I'm not thinking of the MainForm Resize Event.
What happens internaly?
Is it possible to do that "magic things" manually?

Because of:
If i do this resizing with the mouse, the layout of my horizontal CLV is redrawn correctly.
(the height after CLV.resizeItem(index, width) is always 20 Pixels too high and so the horizontal CLV is scrollable vertikal by mousewheel, which is ugly and maybe a Bug.
This will be corrected with the Resizing by mouse).

I have a really stripped project attached. There a two horiz. CLV's in a vert. CLV.
If you click on the two arrows of any day-element; after the nice animation, the height of this day element is 20Pixels higher and so you are able to scroll with the mouse-wheel vertical.
This is corrected after window sizing - by the magic behind o_O
I dont think this code is wrong, nothing special, maybe a Bug (in xCLV lib ?) :rolleyes:

thanks for thinking
Patent
 

Attachments

  • testCLV.zip
    6.5 KB · Views: 105

Patent

Member
Licensed User
Longtime User
nice movie....:)

after clicking on an item, it seems the underlaying pane become too large in height. after resizing this is corrected!?

Maybe interesting: if the mainform is too wide, so that the horiz. scrollbar is away, the clv could scrolled 2 or 3 Pixels vertically!!
 

Attachments

  • test.zip
    56.7 KB · Views: 112
Last edited:
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
It is not clear what causes it. As a workaround you can disable mouse wheel scrolling:
B4X:
Sub FillClvAll
    For i = 1 To 2        '2 DAYS
        Dim p As B4XView = xui.CreatePanel("")
        p.SetLayoutAnimated(0, 0, 0, ClvAll.AsView.Width, heightForADay)    
        p.LoadLayout("OneDay")                                                
        
        Dim tmpLblDatumDay As Label = LblDatumDay        
        tmpLblDatumDay.Text=DateTime.Date(DateTime.Now+i * DateTime.TicksPerDay)
        Dim tmpLblTime As Label = LblTime
        tmpLblTime.Text="Timescale  " & i
        ClvDay.sv.Color=xui.Color_Red            
        ClvDay.AsView.Tag=ClvDay    
        ClvAll.Add(p,"whole Day "&i)
        Dim r As Reflector
        r.Target = ClvDay.sv
        r.AddEventFilter("mousewheel", "javafx.scene.input.ScrollEvent.SCROLL")
        Log(ClvDay.sv.ScrollViewContentHeight)
    Next
End Sub

Private Sub MouseWheel_Filter (e As Event)
    e.Consume
End Sub
 
Upvote 0

Patent

Member
Licensed User
Longtime User
thank you for investigation.
I tried also to access all parent panes and fidle with height, but no success.šŸ˜•
 
Upvote 0
Top