Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Create New Tab Without Activating It
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Create New Tab Without Activating It

 Post Reply Post Reply
Author
Message
chimera View Drop Down
Newbie
Newbie


Joined: 18 July 2006
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote chimera Quote  Post ReplyReply Direct Link To This Post Topic: Create New Tab Without Activating It
    Posted: 18 July 2006 at 4:32pm
I'm using CXTPTabClientWnd in a CXTPMDIFrameWnd derived class.
 
I would like to create a new tab, without activing it as the active view. Similar to FireFox (when you right click a link and select "Open Link in New Tab").
 
Right now I do this:
 
void CMyMainFrame::OnFileNewTab() 
{
 CDocument * pDoc = theApp.m_pDocTemplate->OpenDocumentFile( NULL );
 if( pDoc )
 {
  POSITION pos = pDoc->GetFirstViewPosition();
  if( pos != NULL )
  {
   CMyMainView * pView = (CMyMainView *)(pDoc->GetNextView(pos));
   if( pView )
   {
    pView->GetDocument()->m_strTitle = NEW_DOCUMENT_TITLE;
   }
  }  
 }
}
 
However that doesn't work, it just opens a new tab and sets it active as the current view. I just want to open it and NOT set it active as current view.
 
Any ideas for how I can do this?
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 18 July 2006 at 4:46pm
Hi,
 
Here sample
 
void CChildFrame::ActivateFrame(int nCmdShow)
{
 if (!m_bActivate)
 {
  nCmdShow = SW_SHOWNOACTIVATE;
  m_bActivate = TRUE;
 }
  
 CMDIChildWnd::ActivateFrame(nCmdShow);
}
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
chimera View Drop Down
Newbie
Newbie


Joined: 18 July 2006
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote chimera Quote  Post ReplyReply Direct Link To This Post Posted: 18 July 2006 at 5:15pm
Very cool! Thank you!
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.031 seconds.