Highlight a Cell while MouseDrag ?

I implemented a Text Option-Drag (Drag Text from TextEdit and release it onto a ListBox Cell) and it works (more or less) fine.

I even get the “Copy” MouseCursor.

But instead of TextEdit to TextEdit Copy drag, I do not get a user feedback cursor when the MouseCursor is above the ListBox.

Did I miss come code (in the Xojo’s ListBox Part) ?

Nota: I have an alternate two background set of colours: I am normally able to knos (predict is the word to use) where I will release the MouseCursor at drag time, but it is not always the case [in USER MODE]. So, I think any user will have to face at this too.

Ideas ?

While driving to get here from home, I had an idea:
In DragOver, select the Row below the MouseCursor using the provided code to get Row (and Column) in the ListBox doc and adding:

Me.Index = Row

It seems to be good.* Now… what if I only want to highlight only the Cell below the MouseCursor ?

Ideas ?

  • I feel far more comfortable with the Row highlited below my Mouse Cursor.

Nota: I started that project because:
I do not like spreadsheets
TextEdit is no more easy to deal with list (it was long time ago when its name was… different ! I forgot it).

Now with multicolored background Rows (both alternate and special colors), a list view is easy to look at / found all fiels of the same Row.

You mean like this? DL

InvalidateCell during the drag is your friend.

It is not hard to do… Just a bit tedious

  • Karen

YES ! (from the screen shot) this looks like a friend (what I was looking for).

Thanks a lot, Karen, Axel.

Because of my hard disk troubles, I do not get time to implement the solution given here, but I am really happy to (recall and) wrote about it here: this was implemented after I generate the project pdf source and so this is not in the sources. I hope that I will be able to re-write this into my project.

I am also fortunate (?) to have the last compiled application (I put the last one into my Applications folder): I will be able to fine tune the current project to looks like what it was before the black day.

Thank you all.

PS: I fired your example Axel: nice and probably a bit better than what I was thinking (I believe this is a good addition as a user perspective).

Axel: did you wrote that before I asked or took the challenge and gave the solution ?

The link above is a corrupt file, maybe Tim can repair it.


Axel: the project seems OK.

I added two GridLines (vertical/horizontal dotted lines) and re-run the project; nice.

What about selecting many Cells in the same column ?

keep track of the row/col of the first cell you click
and highlight all cells from those coordinates to the row/col where the mouse is

you can clamp it to a single row, single column, or a rectangular section of the grid like excel does

I posted the new link because someone asked for it.
Some of Dropbox to xojo.io converted files are broken.
Tim mentioned it before that there were problems there.