Author Topic: Close button for tabs  (Read 36637 times)

Offline Funto

  • Multiple posting newcomer
  • *
  • Posts: 81
Re: Close button for tabs
« Reply #15 on: August 01, 2005, 03:55:37 pm »
Personnaly I think it would be better to put this button at the same level as the tabs, as does Firefox, instead of in this empty vertical column whichs wastes size.
Middle-click is a good idea too.

As there are so many persons who like this feature, I think it's a bad idea to disable it by default mandrav, since as says Urxae, new users not being able to close a tab efficiently wouldn't keep using C::B.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Close button for tabs
« Reply #16 on: August 01, 2005, 05:23:04 pm »
i've just updated VERSION_1_0 from cvs and the closebutton is there and working,
but no checkbox in environment settings - it looks like that in anonymous cvs
actually is the version which was commited by rickg originally.

That's right. I added the configuration part a little later.
Also, whenever xrc files are changed, don't forget to run update.bat ;)

Yiannis.
Be patient!
This bug will be fixed soon...

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Close button for tabs
« Reply #17 on: August 01, 2005, 05:24:25 pm »
As there are so many persons who like this feature, I think it's a bad idea to disable it by default mandrav, since as says Urxae, new users not being able to close a tab efficiently wouldn't keep using C::B.

What's the problem Funto?
I don't like it, you don't like it, many people don't like it. It wastes space. Those that like it can just enable it once. Is it that hard?

Yiannis.
Be patient!
This bug will be fixed soon...

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Close button for tabs
« Reply #18 on: August 01, 2005, 05:33:57 pm »
Yes, adding the configuration was the next step. Anyway, I think I've realized how to make it more pretty. Instead of putting the button at the RIGHT of the tabs, I'll put it to the LEFT :D

And yes, it's quite easy to disable (I actually was going to do it today - thanks Yiannis)

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Close button for tabs
« Reply #19 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.
There may be an overdraw issue when there are a lot of tabs, but Firefox has that bug too, and it is quite possible to cope with, really.
 
The middle-click thing is a brilliant idea, but has the problem that it is not obvious, so it should be available in addition, but not the default way to close a tab.
I've been using Firefox (and Firebird) for so long that I don't remember what Internet Explorer looks like, but it never occurred to me to use the middle button on a tab. Maybe I'd have known had I ever read the documentation, but honestly, who reads docs anyway. :)
A UI should be obvious to every user running the program for the first time. A red "x" in the tab row is pretty obvious.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Close button for tabs
« Reply #20 on: August 01, 2005, 06:07:28 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.

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

  • Guest
Re: Close button for tabs
« Reply #21 on: August 01, 2005, 06:19:43 pm »
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

  • Guest
Re: Close button for tabs
« Reply #22 on: August 01, 2005, 06:25:27 pm »

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
Re: Close button for tabs
« Reply #23 on: August 01, 2005, 06:36:56 pm »
So some people want to have it, and some not :? how to solve that problem ...
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

Offline Urxae

  • Regular
  • ***
  • Posts: 376
Re: Close button for tabs
« Reply #24 on: August 01, 2005, 06:54:54 pm »
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.

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

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" ;)

Offline Funto

  • Multiple posting newcomer
  • *
  • Posts: 81
Re: Close button for tabs
« Reply #25 on: August 01, 2005, 07:51:04 pm »
Mandrav, I never said I didn't like the possibility to put a close button, on the contrary I think it is necessary (or at least a "close" item in a popup menu when right clicking on the tab).
The problem is that it wastes space, so as says zieQ, the best solution would be to put this button at the right of the toolbar.

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Close button for tabs
« Reply #26 on: August 01, 2005, 08:28:08 pm »
Which is the reason for me asking to use a derivative of wxNotebook (wx2.6 "universal" version)

OK this is what we'll do:

I'll put the button to the LEFT of the notebook (for now, until something better's done). Default option is _OFF_. I'll add a "did you know" hint to tell users about the feature.

_YOU_ will research on using the wxnotebook (2.6 univ) and do some tests.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Close button for tabs
« Reply #27 on: August 01, 2005, 08:31:33 pm »
Mandrav, I never said I didn't like the possibility to put a close button, on the contrary I think it is necessary (or at least a "close" item in a popup menu when right clicking on the tab).
The problem is that it wastes space, so as says zieQ, the best solution would be to put this button at the right of the toolbar.

Don't get me wrong. All I 'm saying is it is disabled by default because not all people like it. For those who do like it, it's simple as a click to enable it. That's all.

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.

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

To add it in the tabs row is easy (I 've done it). The problem is that it interferes with the left-right spinbox that appears when not all tabs fit in the row...

Yiannis.
Be patient!
This bug will be fixed soon...

Offline kagerato

  • Multiple posting newcomer
  • *
  • Posts: 56
    • kagerato.net
Re: Close button for tabs
« Reply #28 on: August 02, 2005, 02:53:13 am »
Quote from: mandrav
To add it in the tabs row is easy (I 've done it). The problem is that it interferes with the left-right spinbox that appears when not all tabs fit in the row...

Personally, it seems to be more consistent and less complicated for tab bars to deal with an excess of open windows/documents by shrinking the size of each individual tab.  The expansion to multiple lines is inelegant IMO, and it's clear that the overlapping placement of the spinbox and the close button interfere with one another.

The optimal solution is, of course, to improve the original widget which the tab bar derives from so that it supports any combination setting of tabs, spin box, and close button.  One can wonder how much work that would take.

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Close button for tabs
« Reply #29 on: August 02, 2005, 05:07:07 am »
I posted a topic in "help wanted". We need to implement a wxNotebook-like class but with a closebutton :) For that we need to use the wxTabCtrl class. Those interested please reply in the other topic. Thanks.