XUI FlexGrid

Discussion in 'Chit Chat' started by Star-Dust, Oct 26, 2018.

  1. Mashiane

    Mashiane Expert Licensed User

    I like this a lot. Hopefully one can add their own custom controls on the row columns? Can they?
     
  2. Johan Hormaza

    Johan Hormaza Active Member Licensed User

    Please post examples:rolleyes:
     
  3. Peter Simpson

    Peter Simpson Expert Licensed User

    Incorrect, I would say to keep the free scrolling but move the header left and right to match the free scrolling moving left and right nomatter what position the actually table is in.

    Nice job @Star-Dust :)
     
  4. Star-Dust

    Star-Dust Expert Licensed User

    I do not think I understood correctly
     
  5. Star-Dust

    Star-Dust Expert Licensed User

    Code:
    Private Sub Application_Start (Nav As NavigationController)
        
    'SetDebugAutoFlushLogs(True) 'Uncomment if program crashes before all logs are printed.
        NavControl = Nav
        Page1.Initialize(
    "Page1")
        Page1.Title = 
    "Page 1"
        Page1.RootPanel.Color = 
    Colors.White
        NavControl.ShowPage(Page1)
        Page1.RootPanel.LoadLayout(
    "Layout1")
     
        FlexGrid1.ColsName=
    Array As String("Num","Selc","Name","Img","Digit")
        FlexGrid1.ColsWidth=
    Array As Int(75dip,50dip,100dip,60dip,150dip)
        FlexGrid1.ColsType=
    Array As Int(FlexGrid1.TypeInt,FlexGrid1.TypeCheck,FlexGrid1.TypeString,FlexGrid1.TypeImage,FlexGrid1.TypeFloat)
        FlexGrid1.ColsAlignment=
    Array As String("CENTER","CENTER","LEFT","LEFT","RIGHT")
     
        
    Dim B As Boolean=False
        
    For i=1 To 25
            B=
    Not(B)
            FlexGrid1.AddRow(
    Array As Object(i,B,"User " & i,Null,Rnd(50,10000)/100))
        
    Next
     
        FlexGrid1.SetCell(
    0,0,100)
        FlexGrid1.SetCell(
    1,2,"User 200")
        FlexGrid1.SetCell(
    0,3,LoadBitmap(File.DirAssets,"b4a.png"))
        FlexGrid1.SetCell(
    2,3,LoadBitmap(File.DirAssets,"b4j.png"))
        FlexGrid1.SetCell(
    4,3,LoadBitmap(File.DirAssets,"b4i.png"))
        FlexGrid1.Invalidate
    End Sub

    Sub FlexGrid1_HeadClick(Index As Int) ' Click Header Column
        FlexGrid1.Selectcol(Index) ' Select all cell of column
    End Sub
    The selection of the row or column you manage as in the example.
    While the single / multiple cell selection manages the class
     
    Last edited: Nov 1, 2018
    Johan Hormaza and Peter Simpson like this.
  6. Star-Dust

    Star-Dust Expert Licensed User

    Video2.gif

    Simply iOS works differently than Android. And Scrollview.Panel.Width has a different effect, so I used Scrollview.ContentWidth
     
    Last edited: Nov 1, 2018
    Johan Hormaza and Peter Simpson like this.
  7. Erel

    Erel Administrator Staff Member Licensed User

    You can use B4XView.ScrollViewContentWidth.
     
    LucaMs and Star-Dust like this.
  8. Star-Dust

    Star-Dust Expert Licensed User

    Thanks, I had not seen this feature
     
  9. LucaMs

    LucaMs Expert Licensed User

    Surely @Mashiane was asking if you can add custom views to your table (and I think it is possible).
     
  10. LucaMs

    LucaMs Expert Licensed User

    I also did not know this method (but I have very little "played" with XUI).
    I immediately wanted to try it :)
     
  11. Star-Dust

    Star-Dust Expert Licensed User

    Now every single cell can have a custom formatting

    img1.png
     
  12. Peter Simpson

    Peter Simpson Expert Licensed User

    It just gets better and better :D
     
    Johan Hormaza likes this.
  13. Star-Dust

    Star-Dust Expert Licensed User

    Small update: Editing a cell

    Video4.gif Video4b.gif
     
    Last edited: Nov 4, 2018
    Johan Hormaza and Peter Simpson like this.
  14. Star-Dust

    Star-Dust Expert Licensed User

    I added the possibility also to edit the text inside the cell.
    Video5.gif
    I am working on the reverse Polish Notation (RPN) in an attempt to add the calculation of formulas inserted into cells, similar to Excel. I hope to succeed.
     
    Johan Hormaza and Filippo like this.
  15. Erel

    Erel Administrator Staff Member Licensed User

    Peter Simpson, ilan and Star-Dust like this.
  16. Star-Dust

    Star-Dust Expert Licensed User

  17. Star-Dust

    Star-Dust Expert Licensed User

    I did the calculation of a formula inserted in a row thanks to Erel's B4XEval class with a small change:
    Video6.gif
     
  18. Erel

    Erel Administrator Staff Member Licensed User

    Tip: try to release early and later add more features.
     
    Johan Hormaza likes this.
  19. Star-Dust

    Star-Dust Expert Licensed User

    I'm afraid there are bugs because I did not have time to try it. Today I added your code in the half-hour break, but I still have to try it.

    Then I have to understand whether to integrate your code in or leave it as an external class so as to be modified according to needs.
     
  20. Peter Simpson

    Peter Simpson Expert Licensed User

    Hiys @Star-Dust
    Your work is excellent as usual and this looks more than seriously promising, this is great stuff...
     
    Johan Hormaza likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice