User forums > General (but related to Code::Blocks)

Suggestions for File Tabs

<< < (3/3)

thomas:

--- Quote from: Michael on December 28, 2005, 04:18:13 pm ---Interesting is that [...] pay for bug fixes.
--- End quote ---
Wow, they must be rich. Wish I had one Euro for every bug.


--- Quote ---Yes, if a user would like to move several tabs, this could lead to
--- End quote ---
Even if the user only moves one tab. As long as the user keeps moving the mouse, the tab must be deleted and re-inserted every time it moves one position up or down.
Alternatively, you could show a little marker like they do it in Firefox, but that is quite lame, to be honest. It looks like "hey sorry, we can't afford to do it in real time". In fact, when I first used that feature, I did not even see this little blue arrow. I kept moving the mouse and wondered why the tab did not move...


--- Quote ---Hmmm. I thought that if you insert a page where another page exists already, the old page would be automatically deleted.
--- End quote ---
My fault because I used wrong terminology. You do not have ownership of the page or the contained child (editor in this case), so you must not delete it.

But: You still have to get rid of the page somehow, or else the user will see two pages. For this, you can call the notebook's RemovePage() or DeletePage() functions. In the former case, the child window is not touched (It is not specified who owns the object afterwards. So maybe you could re-add it, supposed you have kept a pointer to it, but who knows...), and in the latter case, it is deleted along with the page (which would be quite bad).
What really happens if you do something like noteBook->Insert(GetPage(someIndex)->GetChild(), someOtherIndex); noteBook->Remove(someIndex); is rather obscure... I seriously doubt it will work, and I would not want to work with such code -- you are juggling with objects that you don't necessarily own and whose allocation state you don't control (or even know).

All in all, this smells of a lot of problems (for a rather small advantage).

tiwag:
maybe we should in this discussion take notice of Yiannis' thoughts about introducing wxIFM.
if wxIFM would be a short-term aim it could be that all the file-tabs-ordering is less important issue.

Michael:

--- Quote from: tiwag on December 28, 2005, 05:00:32 pm ---maybe we should in this discussion take notice of Yiannis' thoughts about introducing wxIFM.
if wxIFM would be a short-term aim it could be that all the file-tabs-ordering is less important issue.

--- End quote ---

Yes, wxIFM...I still remeber the cool demo :). May be it will allow to easier re-arrange tabs. Anyway, as I have told before, a quick&dirty technique is to close and re-opening the files to have them ordered as you wish.

Yesterday, I have also found this Implementation of a custom notebook. The interesting point was this:


--- Quote ---//-----------------------------------------------------------------------------
// wxGtkMuleNotebookPage
//-----------------------------------------------------------------------------

// VZ: this is rather ugly as we keep the pages themselves in an array (it
//     allows us to have quite a few functions implemented in the base class)
//     but the page data is kept in a separate list, so we must maintain them
//     in sync manually... of course, the list had been there before the base
//     class which explains it but it still would be nice to do something
//     about this one day

--- End quote ---

Despite the manually sync (which IMHO could be handle by a map or another STL container), it could be possible to rearrange tabs easier (may be).

Michael

adam:
Well a slighty easier thing to implement first would maybe be a "gravity" that would make sure all tabs slide as far left as possible. This way if a tab is picked up it gets replaced by a smaller gap tab. This would cause all tabs to the right to slide to the gap tab. Then just check if the mouse is over half of the next tab move that tab onto the other side of the gap tab. Then when the user drops the tab they picked up it would just expand and replace the gap tab. Sounds simple enough, but since I have no experience with wxWidgets at all I would know where to start.

Navigation

[0] Message Index

[*] Previous page

Go to full version