Author Topic: wxauinotebook  (Read 5918 times)

Offline blueshake

  • Regular
  • ***
  • Posts: 459
wxauinotebook
« 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?
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7253
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: wxauinotebook
« Reply #1 on: August 21, 2009, 01:45:18 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?

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.

Offline blueshake

  • Regular
  • ***
  • Posts: 459
Re: wxauinotebook
« Reply #2 on: August 21, 2009, 02:10:33 pm »
thanks,jens.
so it seems impossible to implement this function in codeblock.what a pity. :(
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: wxauinotebook
« Reply #3 on: August 21, 2009, 05:59:19 pm »
Actually, you could just push a new wxEvtHandler on the tab control window object that intercepts the event first. See wxWindow::PushEventHandler.
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7253
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: wxauinotebook
« Reply #4 on: August 21, 2009, 06:13:30 pm »
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.

Offline blueshake

  • Regular
  • ***
  • Posts: 459
Re: wxauinotebook
« Reply #5 on: August 25, 2009, 11:30:07 am »
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?
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?

Offline mariocup

  • Developer
  • Lives here!
  • *****
  • Posts: 586
Re: wxauinotebook
« Reply #6 on: August 25, 2009, 12:47:24 pm »
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.

Offline blueshake

  • Regular
  • ***
  • Posts: 459
Re: wxauinotebook
« Reply #7 on: August 25, 2009, 02:08:36 pm »
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?
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7253
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: wxauinotebook
« Reply #8 on: August 25, 2009, 02:20:28 pm »
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.