Okay, it's fixed. The selection box is removed whenever a column drag is in operation.
However, you'll quickly see that unless you take charge of the drop completely, when the columns are reordered the indexes are not moved. This means that when you tab from column to column, the selection box will appear to jump all over the place!
For example, imagine columns 0 1 2 3 4 5 ... etc.
Drag column 2 to column 5 to get the order 0 1 3 4 2 5.
Now when you tab between cells, you will do so in the order 0 1 3 4 2 5 which is a fat lot of good!
Indeed have a look at the following code (nothing to do with egrid 4) and drag column 2 to column 1. You'll see that the output doesn't change.
Code: Select all
If OpenWindow(0, 100, 100, 300, 100, "ListIcon Example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
If CreateGadgetList(WindowID(0))
ListIconGadget(0, 5, 5, 290, 90, "Name", 100, #PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection|#PB_ListIcon_HeaderDragDrop)
AddGadgetColumn(0, 1, "Address", 250)
AddGadgetItem(0, -1, "Harry Rannit"+Chr(10)+"12 Parliament Way, Battle Street, By the Bay")
AddGadgetItem(0, -1, "Ginger Brokeit"+Chr(10)+"130 PureBasic Road, BigTown, CodeCity")
Repeat
Event = WaitWindowEvent()
Debug GetGadgetItemText(0,0,1)
Until Event = #PB_Event_CloseWindow
EndIf
EndIf
I don't think there's much I can do about this as it is the way list view controls operate and it makes sense when you think about it, at least from Windows' point of view. After all, you'd lose track of where your data is otherwise. This way, the user can shift the columns around at will, and yet the programmer can still guarantee that the original indexes correspond to the original data etc.
From an egrid 4 point of view, not much we can do about it I'm afraid. In fact the windows messages (#HDN_ENDDRAG) doesn't even tell us where the column being dragged was actually dumped!
Getting around this would be a little fiddly and is probably not worth the effort to be honest.
I may look like a mule, but I'm not a complete ass.