TChromeTabs
TChromeTabs copied to clipboard
Access Violation when dragging Tab to other RemoteContainer
When dragging (and dropping) a Tab to an other Container it sometimes happens that the following access violation gets triggered:
I've made a quick video so you can see when this AV occurs: http://gfycat.com/InferiorEagerItaliangreyhound
It seems like SetControlPosition gets an invalid ChromeTabsControl and therefore crashes?
Best regards, Homer
Workaround:
In function TCustomChromeTabs.InsertDroppedTab: TChromeTab;
If you comment out: // SetControlPosition(TabControls[FActiveDragTabObject.DropTabIndex], // FDragTabControl.ControlRect, // FALSE);
the AV doesn't occur anymore.
The code you commented out is needed otherwise the tab will resize when dropped. I couldn't repeat the problem, but I've added a check to make sure is FDragTabControl assigned:
if FDragTabControl <> nil then
begin
SetControlPosition(TabControls[FActiveDragTabObject.DropTabIndex],
FDragTabControl.ControlRect,
FALSE);
end;
Can you take a look at the new version (committing soon) and see you still get the error. If you do, please send me your demo and I'll take a look.
The inital problem is solved now, yay! Thanks!
However if you have 2 tabs in one Container and want to to drag and drop one into another container which has 0 tabs you'll get an "Argument out of bounds exception". This happens if you release the mouse button while the tab is invisible.
- Create ChromeTabs with 2 tabs
- Create ChromeTabs with 0 tabs
- Move one tab over to the other slowly until the tab gets invisible
- Release the mousebutton now while the tab is still invisible
Video for clarification: http://gfycat.com/NippyGraciousHalcyon
I have recreated the demo as closely as I can using your videos, but cannot repeat the problem, no matter how many times I try. I guess you have some property set that I can't see in the video. Can you please send me a copy of the project you are using?
I use the standard ChromeTabs settings. However i forgot to mention they are place on 2 panels. I've zipped an example: https://www.dropbox.com/s/8trx795p5ttv2w0/chrometabstest.zip?dl=0
Any news on this? The dropbox-link is broken.