Print Page | Close Window

Create New Tab Without Activating It

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=4610
Printed Date: 10 November 2025 at 8:18pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Create New Tab Without Activating It
Posted By: chimera
Subject: Create New Tab Without Activating It
Date 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?



Replies:
Posted By: Oleg
Date 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


Posted By: chimera
Date Posted: 18 July 2006 at 5:15pm
Very cool! Thank you!



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net