B4A Library [Class] Flexible Table

LucaMs

Expert
Licensed User
Longtime User
As you want to fix the first column you should use only 2 ScrollViews.

Yes, this was one "request", thank you. (I did it few months ago placing a listview on the left of a Table .

The problem is that every time svColumns(i).ScrollPosition is called it raises a ScrollChanged event. Calling itself again !


Yes, a recursive call, I know, sigh


I'm trying using a global variable like "IsScrolling" and also checking the sender, but, at the moment, without success. I would need of a "scrollingCompleted" event.

Thank you, Klaus.
 

LucaMs

Expert
Licensed User
Longtime User
I have almost reached the target (attached).

The problem is to find the point where set to Null the ScrollView that started the scrolling (svStarter)
 

Attachments

  • HSV and SV test 4.zip
    12.5 KB · Views: 221

LucaMs

Expert
Licensed User
Longtime User
The problem is to find the point where set to Null the ScrollView that started the scrolling (svStarter)

... just for now, I used a timer.

I think it is possible to use an OnTouchListener: if the user press again on a ScrollView, set svStarter = Null


(I have found that, in English, this is called "soliloquy" )
 

Attachments

  • HSV and SV test 5.zip
    12.5 KB · Views: 226

LucaMs

Expert
Licensed User
Longtime User
@luciano deri, non ho capito lo scopo del timer, della velocità (una variabile, cE, non è inizializzata) etc.

Per me era sufficiente il fatto che puoi usare una ScrollView all'interno di una HorizontalView.


I did not understand the purpose of the timer, speed (BTW, a variable, cE, is "empty") etc.

For me it was enough the fact that you can use a ScrollView inside a HorizontalView.
 

Jay Young

Member
Licensed User
Longtime User
I am trying to load a sqlite db that i made into the flextable example and i keep getting errors the first one is on
line 324 cd1.Initialize(cColumnColors(i), 0) where (i) = index 5 and length = 5, i have a feeling this has to do with more columns in my db than the one that came with the example, any help on where to set these in the example.

error msg: java.lang.ArrayIndexOutOfBoundsException: length=5; index=5
 

klaus

Expert
Licensed User
Longtime User
Sorry, but without seeing the whole code it's impossible to give you a concrete answer.
You should at least post the whole code where you initialize the Table class and where you load the database, or better post a small project showing the problem.
 

luciano deri

Active Member
Licensed User
Longtime User
Control this:
  1. How many column have the quary.
  2. in DBTABLE.SetHeaderColors(Array As Int(Colors.Magenta,Colors.Blue,..)) are there enough colors for each column of the query?
  3. in DBTABLE.SetColumnsWidths(Array As Int(25%x,75%X)) are there enough dimension for each column of the query?
  4. Every where you have a array for define same propetis of colum you must control that there are enough colors for each column of the query
 

Jay Young

Member
Licensed User
Longtime User

Hey thanks for your help i found out what is was I was not setting the number of colors in the code below, my table has 16 columns the example only had 5 in the Array


B4X:
    Dim tf() As Typeface
    tf = Array As Typeface(Typeface.DEFAULT, Typeface.DEFAULT_BOLD, Typeface.DEFAULT, Typeface.DEFAULT_BOLD, Typeface.DEFAULT, Typeface.DEFAULT, Typeface.DEFAULT, Typeface.DEFAULT, Typeface.DEFAULT, Typeface.DEFAULT, Typeface.DEFAULT, Typeface.DEFAULT, Typeface.DEFAULT, Typeface.DEFAULT, Typeface.DEFAULT, Typeface.DEFAULT)
    Table1.SetTypeFaces(tf)

    Table1.UseColumnColors = True
    Table1.SetColumnColors(Array As Int(Colors.White, 0xFF98F5FF, 0xFFFFC0FF, 0xFFC0FFC0, 0xFFFFFFC0, 0xFFFFFFC0, 0xFFFFFFC0, 0xFFFFFFC0, 0xFFFFFFC0, 0xFFFFFFC0, 0xFFFFFFC0, 0xFFFFFFC0, 0xFFFFFFC0, 0xFFFFFFC0, 0xFFFFFFC0, 0xFFFFFFC0))
    Table1.SetTextColors(Array As Int(Colors.Black, 0xFF800000, 0xFF0000FF, 0xFF004000, 0xFF400040, 0xFF400040, 0xFF400040, 0xFF400040, 0xFF400040, 0xFF400040, 0xFF400040, 0xFF400040, 0xFF400040, 0xFF400040, 0xFF400040, 0xFF400040))
    Table1.SetHeaderColors(Array As Int(Colors.Black, 0xFF800000, 0xFF0000FF, 0xFF004000, 0xFF400040, 0xFF400040, 0xFF400040, 0xFF400040, 0xFF400040, 0xFF400040, 0xFF400040, 0xFF400040, 0xFF400040, 0xFF400040, 0xFF400040, 0xFF400040))
    Table1.SetHeaderTextColors(Array As Int(Colors.White, 0xFF98F5FF, 0xFFFFC0FF, 0xFFC0FFC0, 0xFFFFFFC0, 0xFFFFFFC0, 0xFFFFFFC0, 0xFFFFFFC0, 0xFFFFFFC0, 0xFFFFFFC0, 0xFFFFFFC0, 0xFFFFFFC0, 0xFFFFFFC0, 0xFFFFFFC0, 0xFFFFFFC0, 0xFFFFFFC0))
>
 

Jay Young

Member
Licensed User
Longtime User
using Flexible Table is it possible to click on a cell and change the value and update it in the sqlite db?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…