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

Suggestions for File Tabs

<< < (2/3) > >>

killerbot:
Rearranging tabs : Firefox has that ability (from version 1.5), so if CB can do it at version 1.1 -->  :P :P :P

rickg22:
Heh I don't think we can implement Firefox's XUL engine :roll: Oh well...

Michael:
I have done a fast search about how to rearrange tabs. It seems that in the wxTabControl there are two methods that could be useful, if only the wxTab and company would not have been "deprecated" (these classes are just kept for backward compatibility and now it is adviced to use wxNotebook :roll:).


--- Quote ---wxTabControl::GetRowPosition
int GetRowPosition()

Returns the position of the tab in the layer or row.

--- End quote ---


--- Quote ---wxTabControl::SetRowPosition
void SetRowPosition(int pos)

Sets the position on the layer (row).

--- End quote ---

Anyway, it would not be possible with wxNotebook to use the InsertPage method?


--- Quote ---wxNotebook::InsertPage
bool InsertPage(int index, wxNotebookPage* page, const wxString& text, bool select = FALSE, int imageId = -1)

Inserts a new page at the specified position.

--- End quote ---

For example, if a user wishes to move page X after page Y, page X is inserted at the position of page Y and page Y at the position of page X.

Michael

thomas:

--- Quote from: Michael on December 27, 2005, 05:50:33 pm ---Anyway, it would not be possible with wxNotebook to use the InsertPage method?
--- End quote ---
Certainly that is possible, and it is probably the only possible way. But like all Add()/Insert() methods, this calls the copy operator on your control, which means that
a) it is quite CPU-hungry if the user keeps dragging around tabs in a frenzy
b) you have to delete the original tab, or you will have two identical tabs
c) a + b = flicker

Michael:

--- Quote from: thomas on December 28, 2005, 10:24:05 am ---Certainly that is possible, and it is probably the only possible way.

--- End quote ---

Yes, I think so. Anyway, I have found with google some references that were interesting, but when I clicked to the link, the related webpage did not contain the requested info :?. Interesting is that in wxWidgets you can propose to pay someone for a new features or bug fixes.


--- Quote from: thomas on December 28, 2005, 10:24:05 am ---But like all Add()/Insert() methods, this calls the copy operator on your control, which means that
a) it is quite CPU-hungry if the user keeps dragging around tabs in a frenzy

--- End quote ---

Yes, if a user would like to move several tabs, this could lead to high CPU consume and reduces the responsiveness of C::B.


--- Quote from: thomas on December 28, 2005, 10:24:05 am ---b) you have to delete the original tab, or you will have two identical tabs

--- End quote ---

Hmmm. I thought that if you insert a page where another page exists already, the old page would be automatically deleted. If this is not the case, then special care should be given to indexes manipulation.


--- Quote from: thomas on December 28, 2005, 10:24:05 am ---c) a + b = flicker

--- End quote ---

And flicker is bad and should be avoided. I just wonder if the "double buffering" technique used with e.g., images could not be used here too.

Michael

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version