Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Close button for tabs

<< < (5/8) > >>

rickg22:

--- Quote from: thomas on August 01, 2005, 05:56:06 pm ---Putting the close button in the tab row is a good idea, I think. Not only does it use space more efficiently, but it is also compatible with what the user would expect.
--- End quote ---

The problem is, we DON'T know how to do it :(

But I have an Idea. Volunteers welcome.

* Take the wxNotebook sourcecode from wx2.6.x univ, and copy it to make our own wxNoteboox (the x is for "close" :lol: ) with the button in the tab row. I suppose it's easy, since in 2.6 notebook uses a special tab control. We only have (in theory) to add a sizer to the panel and put the button to the right of it. The tricky thing of course, is handling the version differences in 2.4 with 2.6, and getting rid of so many ifdef's to make it a compact and portable class. Since it's wxuniv we're talking about, I really hope (repeat: HOPE) there aren't many compatibility problems.

So if anyone wants to try, we'd really appreciate it. You don't have to add any event handling code to it, just draw the darn button. I'll take care of the rest.

zieQ:
I've heard about the HitTest for wxNotebook that could help detecting middle/right-click on the tabs, but this may be wxMSW- and wxUniv-specific. We must intercept click events on the widget.

For the close button on the tabs, my (simple) google search gave: not possible with native widgets but maybe subclassing the wxUniv's wxNotebook or wxBookCtrl ! So I advocate for the close button in the toolbar or at the right of the toolbar. After all why not: it does not waste space and could be placed near the place we expect it to be.

zieQ:
OK, look at this one:
http://lists.wxwidgets.org/archive/wx-users/msg35887.html

David Perfors:
So some people want to have it, and some not :? how to solve that problem ...

Urxae:
Couldn't you just hack this by making the wxNotebook only as high as the tabs themselves, and then manually switching the editor that's displayed? That way, the wxNotebook width and the editor width are independant...
Not very 'neat' though. Just a thought.


--- Quote from: mispunt on August 01, 2005, 06:36:56 pm ---So some people want to have it, and some not :? how to solve that problem ...

--- End quote ---

In the way Yiannis solved it: add a preference option. Of course, then the problem becomes "what should be the default value of that option" ;)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version