I needed my application to know when a tab has been moved, either inside or between notebooks.
So I implemented a new message type: wxEVT_COMMAND_FLATNOTEBOOK_PAGE_MOVED. To get a pointer both to the old and new Notebook, I used both SetEventObject and SetClientData, so the event class was not modified.
My app needs to maintain windows lists outside of the Notebook class, and their states should be in sync. I turned off the 'generate event' flag while moving the page between notebooks, since it became difficult for the app to keep track of the state otherwise (it only sees that selection has changed in target notebook). The new event type tells exactly what has happened.
Also, I sometimes received event.GetSelection()==-1. I changed that so that negative indexes are never sent.
Other comments:
On my system (I use the tabs at the bottom) I found that the icon tended to get too close to the line that is drawn under it (no padding). Defining wxFNB_HEIGHT_SPACER 12 made it look better.
Another minor detail is the distance from the icon to the icon to the text which is a bit long I find (half distance would be great).
Yet another... (getting picky here) when increasing the window size, it would be nice if the tabs popped into view automatically when there was enough space.
Allright!
Regards
// Arne S.
Patch for Cpp and Header file