Code::Blocks Forums
Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: blueshake on August 21, 2009, 01:29:10 pm
-
hi,I try to implement such a function that when i double click the tab on the notebook,the tab closed.so i need to hook the double click message on wxauinotebook ,but i just found EVT_AUINOTEBOOK_BG_DCLICK
message .
so anyone has any comment on this?
-
hi,I try to implement such a function that when i double click the tab on the notebook,the tab closed.so i need to hook the double click message on wxauinotebook ,but i just found EVT_AUINOTEBOOK_BG_DCLICK
message .
so anyone has any comment on this?
If you look into the wxWidgets sources (stable and trunk) you see that it's just not implemented.And what's more it can not easily be changed, because the event is thrown by wxAuiTabCtrl's OnLeftDClick-event.
It's no problem to inherit a class from wxAuiNotebook, but to make it work you also need to derive a class from wxAuiTabCtrl and overwrite wxAuiNotebooks functions where the tabctrl get's created, but some of these functions also use wxTabFrame, but wxTabFrame is only declared in auibook.cpp, and therefore you can not use it in derived classes.
You can have a look into the wxWidgets bug-tracker, whether a bug-report exists about that issue, and if not you can post one.
-
thanks,jens.
so it seems impossible to implement this function in codeblock.what a pity. :(
-
Actually, you could just push a new wxEvtHandler on the tab control window object that intercepts the event first. See wxWindow::PushEventHandler.
-
Actually, you could just push a new wxEvtHandler on the tab control window object that intercepts the event first. See wxWindow::PushEventHandler.
Thanks TDragon, didn't know this.
This might (hopefully) help a lot.
-
hi,jens
would you have any plan to do this (what TDragon said) to make the tab on wxauinotebook could be closed
by double click?
-
Hi blueshake,
the editor tabs can be closed also with a Ctrl+W shortcut and this works in my eyes much faster then a double-click on a tab. If we get access to the double click event, we should think also about other features.
Although I am not a friend of eclipse there you have the possibilty to double-click on a editor tab and then all message panels, project explorer etc. are minimized and the selected editor appears. With another double click the message panel etc. appear again. Sometimes this can be very helpful if you have a lot of docked windows and want to concentrate on a single file.
-
hi,mariocup
the functionlity you mentioned above seems very interesting.
but the problem is I have no chance to access wxauinotebook
double click message,and as what jens said,there is no double
click message in wxauinotebook.so the method is to do what
TDragon mentioned.but this is out of my ability.
so do you have any idea on what TDragon said?
-
I started looking into it, but sometimes my boss wants me to work for money.
Maybe this evening, but I'm not sure if it is possible at all, because it's not easy to get the wxTabCtrl's.