Kirix Support Forums

Creating a background tab

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

Creating a background tab

Postby disasm on Thu Nov 09, 2006 1:22 am

Is it possible to create a tab (a wxAuiMDIChildFrame derived window) in the background? i.e. not have it steal focus from the currently selected tab?

Is it also possible to remove a tab without stealing focus first?
disasm
Registered User
 
Posts: 16
Joined: Tue Jan 10, 2006 8:56 pm

Postby Ben on Fri Nov 10, 2006 8:36 am

Hello disasm,

Yes, as of a few hours ago :-).

Just create your child frame with the wxMINIMIZE style. Using this flag makes sense because an inactive tab is really the equivalent of a minimized window.

By the way, this is a good way to really reduce flicker when you create a new tab child-- first create it with wxMINIMIZE, and then call wxAuiMDICildFrame::Activate() to show it once all child windows are positioned correctly.

The other way to do the same thing without wxMINIMIZE is to call wxAuiMDIChildFrame::Show(false) before calling Create(). This is also standard in wxWidgets as of a few months ago.

Let me know if this works for you.

Best,
Ben
User avatar
Ben
Kirix Support Team
 
Posts: 522
Joined: Mon Dec 19, 2005 6:29 am

Postby disasm on Fri Nov 10, 2006 10:16 pm

This works great when creating a new tab in the background! Thanks!

However, it does nothing for the problem of a tab stealing focus when closing. But I have found that if I call pChildFrame->DoShow(false) before calling pChildFrame->Close() then the tab does not steal the focus (and repaint itself) right before being closed.
disasm
Registered User
 
Posts: 16
Joined: Tue Jan 10, 2006 8:56 pm

Return to wxAUI Questions, Thoughts & Feedback