Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Bug in TabClientWnd in 10.4
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Bug in TabClientWnd in 10.4

 Post Reply Post Reply
Author
Message
danpetitt View Drop Down
Senior Member
Senior Member


Joined: 17 July 2005
Location: United Kingdom
Status: Offline
Points: 109
Post Options Post Options   Thanks (0) Thanks(0)   Quote danpetitt Quote  Post ReplyReply Direct Link To This Post Topic: Bug in TabClientWnd in 10.4
    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.
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: 08 January 2007 at 4:31pm
Hi,
Comment also code in int CChildFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
danpetitt View Drop Down
Senior Member
Senior Member


Joined: 17 July 2005
Location: United Kingdom
Status: Offline
Points: 109
Post Options Post Options   Thanks (0) Thanks(0)   Quote danpetitt Quote  Post ReplyReply Direct Link To This Post 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?
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: 09 January 2007 at 10:28am

Hi,

Show me code you have now to switch it.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
danpetitt View Drop Down
Senior Member
Senior Member


Joined: 17 July 2005
Location: United Kingdom
Status: Offline
Points: 109
Post Options Post Options   Thanks (0) Thanks(0)   Quote danpetitt Quote  Post ReplyReply Direct Link To This Post 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;
}

Back to Top
danpetitt View Drop Down
Senior Member
Senior Member


Joined: 17 July 2005
Location: United Kingdom
Status: Offline
Points: 109
Post Options Post Options   Thanks (0) Thanks(0)   Quote danpetitt Quote  Post ReplyReply Direct Link To This Post Posted: 10 January 2007 at 9:09am
Any ideas how to solve 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: 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
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.046 seconds.