Bug in CustomTreeCtrl when Shift+Selecting?

Using the shift key to select multiple items causes all child nodes to be selected in between the first and last selection, even if they are unexpanded. To the best of my knowledge and experience wxTreeCtrl only selects what is currently expanded/visible.

This could either be a problem with GetSelections, or more likely how the Shift+Click event is handled when selecting the second item.

My application using a standard TreeCtrl always returned what I expected from GetSelections however CustomTreeCtrl does not seem to; as I said unexpanded/unvisible children in between the selections are also being considered selected. Am I doing something wrong or is this a bug?