Kirix Support Forums

Using wxAuiNotebook

Please post all general questions, comments, bug reports, and any other wxAUI feedback here.

Using wxAuiNotebook

Postby Julian Smart on Sun Nov 05, 2006 4:51 pm

Hi,

I've been trying to create an app with 3 tabbed areas - left, right, and bottom. If I do this with 3 wxAuiNotebooks in 3 separate AUI panes, I can't drag tabs from one pane to another, only to different zones in the same pane. However, when I drag tabs to the different zones I can get the effect I want within a single wxAuiNotebook/pane. Is the idea that if you want this kind of behaviour, you only create one pane and notebook that holds all tabs, and then somehow specify the zones where the initial tabs will be? Any hints on how to specify that, and whether I'm thinking around the right lines, will be apprecated.

Many thanks!

Julian
Julian Smart
Registered User
 
Posts: 17
Joined: Sun Nov 05, 2006 4:45 pm

Postby Ben on Mon Nov 06, 2006 1:31 am

Hi Julian,

Right now, the wxAuiNotebook control is a closed system, not allowing dragging from one notebook to another. While it allows notebook splitting, dragging a tab from one notebook to another remains unimplemented. Let me see what I can cook up for you in the next few days. It's possible that it's quite easy to implement some kind of foreign control tab drag.

The problem with this approach as a long-term solution is that it does nothing to implement the notion of tabs + perspectives. In other words, the dock manager will not be aware of where any given tab is at a certain moment, and thus will be unable to save a perspective 100%.

Basically, implementing this control was 'phase 1' of implementing tabs in wxAUI. We needed a set of classes that would integrate well (work with perspectives) with the docking architecture of wxAUI, and that's why we couldn't use other standalone notebook controls, like wxNotebook or wxFlatNotebook.

Phase 2 of the implementation is to integrate the tab components into the docking facilities already present in wxAuiManager. This way, when you move a tab from one area of the screen to another, the perspective will note that and save/restore it appropriately.

Unfortunately, given the current deadlines, we ran out of time for tabs/phase 2 for the upcoming wxWidgets release. We hope to give it some attention after the release.

For those people who don't really care about perspectives, the foreign tab drag solution should be quite adequate. Let me take a look and see if it's a big deal to code or not. My initial guess is it isn't, and that I'll be able to implement something soon.

All the best,
Ben
User avatar
Ben
Kirix Support Team
 
Posts: 525
Joined: Mon Dec 19, 2005 6:29 am

Postby Julian Smart on Mon Nov 06, 2006 2:35 am

Hi Ben,

Many thanks for the explanation, I look forward to further enhancements to wxAuiNotebook when you get time. wxAui is looking extremely nice these days - a good incentive for folks to start using 2.8.

Best regards,

Julian
Julian Smart
Registered User
 
Posts: 17
Joined: Sun Nov 05, 2006 4:45 pm

Postby Ben on Mon Nov 06, 2006 8:52 am

Hi Julian,

I've gone ahead and implemented this feature. You can try it out in the aui sample. It's not a default option, so you'll have to add the wxAUI_NB_TAB_EXTERNAL_MOVE flag.

In addition to the flag, there is another additional step. I didn't think that it would be good if controls allowed any tab drag by default. I'm imagining several notebooks grouping two entirely different families of tabs. In many programs, it wouldn't make sense for the user to be able to drag one tab from one to the other control, without the control's permission.

Therefore wxAuiNotebook will always send an event asking for "permission" to do the drag drop. This event must be given explicit permission (evt.Allow()) in order for the notebook tab drag to happen. The event name is wxEVT_COMMAND_AUINOTEBOOK_ALLOW_DND.

This is all enabled by default in the updated aui sample. To try it out, load up the sample, add another notebook via View->Create Notebook, and then try dragging the welcome page from the existing notebook to your new one.

If you have any problems, please let me know.

All the best,
Ben
User avatar
Ben
Kirix Support Team
 
Posts: 525
Joined: Mon Dec 19, 2005 6:29 am

Postby Julian Smart on Mon Nov 06, 2006 1:29 pm

Hi Ben,

Wow! Fantastically quick work. It now does exactly what I want - this is so cool.

Many many thanks!

Julian
Julian Smart
Registered User
 
Posts: 17
Joined: Sun Nov 05, 2006 4:45 pm

Return to wxAUI Questions, Thoughts & Feedback