B4J Question Set different background colors for portions of text.

MrKim

Well-Known Member
Licensed User
Longtime User
I though BBLabel was the answer to my prayers but it appear there is no way to set the background color for individual portions of text. Is that true?

Or let me just state my problem. Perhaps someone has an answer.

I want to set 10 to 20 columns of text in a scrollable list. I want to be able to set the font color, background color, Text size, and bold for each column.
The list will generally contain between 10 and 200 rows but could go to maybe 500 but that would be rare and I don't care if that is slow. One column on each row may have a picture.

Does not need to be editable. Does need to be drag and drop. The user needs to be able to click anywhere on the row to drag and drop it.

What is the most efficient - in terms of speed - method to accomplishing this. I don't mind writing more code but it needs to be fast as the list will be refreshed frequently.

Text area is fast but doesn't do colors. BBLabel was very slow - required lazy loading - but evidently only does text color, not background. My next thought is a whole bunch of textfields or labels in a row with a pane on top for the drag and drop, Or just set every label to be drag and drop, but before I spent hours trying that I thought I'd see if anyone here has any better tjoughts.

Thanks for your ideas.
 

MrKim

Well-Known Member
Licensed User
Longtime User
Why are you using BBLabel?
You should use BBCodeView for scrollable text.
Because I need to be able drag and drop based on each row.
You should use it instead of the complete list.
I'm not sure what this means.
It is not simple to change the columns background color.
So basically I need to use a separate view for each field and make each one draggable?
 
Upvote 0

MrKim

Well-Known Member
Licensed User
Longtime User
BBCodeView is indeed not relevant if you need each row to be draggable.
Do you have a suggestion? I am fiddling with B4XTable at the moment. Tying to see if it will do all I want.
 
Upvote 0

MrKim

Well-Known Member
Licensed User
Longtime User
B4XTable seems to offer a lot of what I want but does not appear to have a scrollbar? Or at least not a vertical one.
 
Upvote 0

MrKim

Well-Known Member
Licensed User
Longtime User
Another thing that you can try is B4JTextFlow. It is available in XUI Views and was used to create rich strings before BCTextEngine was available.
Sigh, it doesn't offer backcolor either.
 
Upvote 0

MrKim

Well-Known Member
Licensed User
Longtime User
It is page based. No vertical scrolling.
Makes it tough to review data from row to row for comparison. Too bad, it is truly a thing of beauty. Also, it would be nice it it allowed formatting columns, not just number columns (including of course the backcolor).
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…