Print Page | Close Window

Bug in TabClientWnd in 10.4

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=6033
Printed Date: 12 November 2025 at 3:25am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Bug in TabClientWnd in 10.4
Posted By: danpetitt
Subject: Bug in TabClientWnd in 10.4
Date Posted: 08 January 2007 at 10:33am
You can no longer turn off tabs in 10.4. You used to be able to detach the mTIClientWnd and the documents still appeared maximised and everything was okay. Now you cant.
 
For example in VisualStudio sample comment out following lines in MainFrm.cpp:

 VERIFY(m_MTIClientWnd.Attach(this, TRUE));
 m_MTIClientWnd.EnableToolTips();
 m_MTIClientWnd.GetPaintManager()->m_bShowIcons = FALSE;
 m_MTIClientWnd.SetNewTabPosition(xtpWorkspaceNewTabLeftMost);
 m_MTIClientWnd.SetFlags(xtpWorkspaceHideArrowsAlways | xtpWorkspaceShowActiveFiles);
 
And run it. The docs are in non-maximised state but cant be moved or maximised.



Replies:
Posted By: Oleg
Date Posted: 08 January 2007 at 4:31pm
Hi,
Comment also code in int CChildFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: danpetitt
Date Posted: 09 January 2007 at 6:12am
That works a bit better, but if I do this whilst the program is running (i.e. through an Options page) then it doesnt work very nicely at all ... can you give me the steps I should do to achieve this.
 
Currently I 'detach' the MTIClientWnd if its off, and 'attach' it if its on, and I have wrapped up the code on ChildFrm::OnCreate around a check for the tabs enabled flag.
 
What else do i need to do?


Posted By: Oleg
Date Posted: 09 January 2007 at 10:28am

Hi,

Show me code you have now to switch it.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: danpetitt
Date Posted: 09 January 2007 at 10:36am

void CMainFrame:OnChangeWorkspaceOption()
{
 if( m_bShowTabs )
 {
  VERIFY( m_MTIClientWnd.Attach( this, TRUE ) );
  m_MTIClientWnd.EnableToolTips();
  m_MTIClientWnd.GetPaintManager()->m_bShowIcons = TRUE;
 }
 else
 {
  m_MTIClientWnd.Detach();
 }
}
 
and...

int CChildFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
 if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1)
  return -1;

 if( theApp.GetMainFrame()->m_bShowTabs )
 {
  XTPImageManager()->SetMaskColor( RGB(0xC0, 0xC0, 0xC0) );
  VERIFY( m_wndDocumentViewToolBar.CreateToolBar( WS_TABSTOP|WS_VISIBLE|WS_CHILD|CBRS_TOOLTIPS, this ) );
  VERIFY( m_wndDocumentViewToolBar.LoadToolBar( IDR_SGENIETYPE ) );

  CMenu* pMenu = GetSystemMenu(FALSE);
  pMenu->RemoveMenu(SC_RESTORE, MF_BYCOMMAND);
  pMenu->RemoveMenu(SC_MINIMIZE, MF_BYCOMMAND);
  pMenu->RemoveMenu(SC_MAXIMIZE, MF_BYCOMMAND);
  pMenu->RemoveMenu(SC_MOVE, MF_BYCOMMAND);
  pMenu->RemoveMenu(SC_SIZE, MF_BYCOMMAND);
 }

 return 0;
}



Posted By: danpetitt
Date Posted: 10 January 2007 at 9:09am
Any ideas how to solve this?


Posted By: Oleg
Date Posted: 10 January 2007 at 9:41am
Hi, problem that if you use Enablegroups option (think it was FALSE in previour releases and was reason why it worked) TabClient automatically remove caption if child windows. SO you have switch it back:
 
 
if (m_MTIClientWnd.GetSafeHwnd())
{
m_MTIClientWnd.Detach();

HWND hWnd = ::GetWindow(m_hWndMDIClient, GW_CHILD);
while (hWnd)
{
CWnd::ModifyStyle(hWnd, 0, WS_CAPTION, SWP_FRAMECHANGED);
hWnd = ::GetWindow(hWnd, GW_HWNDNEXT);
}
MDICascade();
}
else
{
HWND hWnd = ::GetWindow(m_hWndMDIClient, GW_CHILD);
while (hWnd)
{
CWnd::ModifyStyle(hWnd, WS_CAPTION, 0, SWP_FRAMECHANGED);
hWnd = ::GetWindow(hWnd, GW_HWNDNEXT);
}
m_MTIClientWnd.Attach(this, TRUE);
}

RecalcLayout();
::RedrawWindow(m_MTIClientWnd, 0, 0, RDW_INVALIDATE|RDW_UPDATENOW|RDW_ALLCHILDREN);  


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



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