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

Free the Editors

<< < (3/9) > >>

David Perfors:
When you use wxAUINotebook that is also a possibility... but wxAUINotebook is a 2.8 thing and doesn't have customizable tabs layout

dmoore:
for lack of a better name, I'm working on TearawayNotebook. It's derived from wxFlatNotebook, but necessarily required some hacks to wxFlatNotebook to get control of page display routines.

Anyway, anywhere you can use wxFlatNotebook you should be able to simply substitute TearawayNotebook and have the option to turn notebook pages into dockable windows. Closing the dockable window returns them to the notebook that owns them. I'm working on a tab icon to indicate a detached state for detached pages. The biggest hurdle will be coming up with a way of making the detached pages part of the persistent CB layout.

i'll put up a patch/win32 build soon (next few days)

NB: Is it just me or do undocked dockable windows always show a focused state? (I'm currently on linux). If so, it's a little bit annoying because I want to give the user visual indication of where their window is if they click on a detached tab.

Pecan:

--- Quote from: dmoore on July 02, 2007, 11:13:53 pm ---NB: Is it just me or do undocked dockable windows always show a focused state? (I'm currently on linux). If so, it's a little bit annoying because I want to give the user visual indication of where their window is if they click on a detached tab.

--- End quote ---

For me on XpSp2, undocked dockable windows have the always-on-top attribute, but they do lose focus to other windows.

Here, the OpenFilesList undocked window is always-on-top of everything else, but the editor has focus as you can see by the current line bar.
 

dmoore:
@Pecan: the "always on top" flag also works on linux, but they always show a focused state. maybe a wxAUI bug?


Anyway...

I'm attaching what I've done for now in patch form. A win32 build of Rev 4207 with patch applied (but without contrib plugins) can be found here: http://www.savefile.com/files/859819. Unfortunately, it is not as elaborate as planned because CBs dockable event handlers aren't fully fleshed out.

How to use the build: (after downloading and extracting the files or building the patched source and starting CB) :
1. You should be able to right click on any editor or message tab and select "detach" (except for the start page - it behaves strangely)
2. the editor/message log will move to a floating dockable (you will have to move the dockable window each time as I have not written any persistent placement code yet - I suspect I will need to use a dockable window registry to do this). The tab will remain in place (this is due to point 5 below)
3. The editor/message page of the notebook will now be empty if you click on that tab (but the detached window will be focused).
4. In the editor, I've used a broken file link to indicate the detached state of the file (my attempt at artwork was uninspired, so I reverted to one of the standard icons). There is no indication of the detached state in the message log (could maybe use a greyed out text/icon for the message tab and a greyed out text for the editor tab?)
5. To reattach the editor/message window into its notebook right click on the tab and select "reattach" (unfortunately, getting the editor to reattach upon clicking the close check box turned out to be non-trivial, as is any kind of dragging and dropping, but hopefully we'll get to this eventually)

If anyone plans to apply the patch I suggest doing so over a fresh checkout of code::blocks...  I've tried to keep ugly hacks to a minimum but this is still at a very experimental stage, so a few hacks were necessary :), especially to wxFlatNotebook. The only substantive changes to flatnotebook that needed to be made is to declare TearawayNotebook a friend in wxPageContainer, to make the Add/Remove/Delete/DeleteAll/SetSelection methods of wxFlatNotebook virtual and to make private members of wxFlatNotebook protected.



[attachment deleted by admin]

dmoore:
another screenshot:

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version