Custom Listbox

If I understand right, you want the left column to remain unchanged, while you scroll horizontally and vertically the rest of the columns ?

What about this :
freeze.xojo_binary_project

To completely freeze the left column and prevent it from scrolling vertically would take placing code in Mousewheel that nullify the scroll. Or, more simply, to disable it. But it looks grey.

Hi @Michel Bujardet,

Yes, that is correct.

This is pretty close. Thank you VERY much for this.
It looks like you have created a set of listboxes and populate the data when they open.
When you Freeze the left column you hide the first listbox and then instantiate two more: one left which is now frozen and one right, correct?

While the approach to instantiating the two listboxes is different and very nice it still suffers from the same problems that Karen and others have mentioned: row highlighting, scrollbar disconnect, etc.

Craig, do you use a single cell like Excel or an entire row highlighted like Michel’s freeze project?

Hi Merv,

I expect to highlight be able to do a little bit of both. For example:
Clicking on the left most column highlights the entire row (like clicking on the row number in Excel.)
Clicking on any cell to the right of that allows the cell to be highlighted.
Double clicking on the cell allows it to be edited.

Does that make sense?

[quote=229886:@Craig Boyd]Hi @Michel Bujardet,

Yes, that is correct.

This is pretty close. Thank you VERY much for this.
It looks like you have created a set of listboxes and populate the data when they open.
When you Freeze the left column you hide the first listbox and then instantiate two more: one left which is now frozen and one right, correct?

While the approach to instantiating the two listboxes is different and very nice it still suffers from the same problems that Karen and others have mentioned: row highlighting, scrollbar disconnect, etc.[/quote]

Don’t expect this kind of thing to be easy. It will require work to get to what you want.

But I believe all what you describe can be done.

Scrollbar disconnect is a lot less terrible than you think.

I did not understand you wanted both frozen column and the rest to be vertically synchronized, or that selection should be too. I have updated the project with a dozen lines of codes that now just do that.

Just redownload and see.

After messing with it a couple of hours, I have no doubt this is double with a single ListBox using cell paint and text events to draw the cursor and to highlight a selected row. But unfortunately I am on a big project deadline in 2 months, so I just don’t have any more time to investigate. There are a lot of edge cases that has to be dealt with so this is a decent size project to get it right and working properly. But I do think it is doable.

Hi @Michel Bujardet

I know. You are absolutely right.
Please understand that I am not sitting here expecting the community to write this code for me. If that is the way I have come across I apologize.

It is precisely because I do know that this kind of thing would take some work that I was desperately looking around for an existing 3rd party solution. It appears that this does not exist at the moment.

Many of you have spent real time (i.e. more than 15 or 20 minutes) to help me and point me in a couple good directions. And again I am very grateful. I have already spent considerable time on this:
a) before I discovered the Einhugur StyleGrid ~ experimenting on the two listbox approach
b)on the Einhugur StyleGrid only to discover that it is low on their priority list and likely needs a rewrite (not faulting them AT ALL about their priorities ~ from my pleasant emails with Bjorn I am sure they are spending their time on the right things for them)
c) and now some time yesterday and this afternoon.

And with all these ideas I am likely going to be spending even more time in the days to come. And thanks to you, Michel, I have something new to learn that I have somehow missed before: members! So thank you VERY much for that. :slight_smile:

Merv,

Again, thank you for your time. Should I get something satisfactory working I will post it someplace where the whole community can get to it and use it.

Sincerely,

Craig

@Michel Bujardet Thank you! That gets me that much closer!

Sincerely,

Craig

That was the case with merging cells in a generic fashion.

As i said because I had only considered smooth scrolling, I did no try to work out doing this with a single listbox… I might take a look at this over the holidays.

  • Karen

DataView does provide column locking and quite a bit more including Retina. I’ll be posting an update (hopefully tomorrow) with 64bit compatibility, improvements for El Capitan rendering, multiline text and a few other improvements. I’ve tried to keep the API’s as compatible with the Xojo Listbox as I could. Feel free to try it out.

I like doing things simple. :slight_smile:
I have an OS X Declare somewhere for the correct HighLightColor. If you need it, let me know and I’ll go search for it.

And as mentioned above, DataView looks very cool if you don’t want all the hassle.

Hi @jim mckay

Thanks for pointing this out. I will try to make some time to dig through DataView in the next day or two and let you know if I have any questions.

And @Marco Hof thanks for your sample project. I will take a look it as well.

Be sure to grab the latest DataView. It is much improved!