Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Docking Pane
  New Posts New Posts RSS Feed - Tabbed MDI flicker
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Tabbed MDI flicker

 Post Reply Post Reply
Author
Message
spiderM9 View Drop Down
Newbie
Newbie
Avatar

Joined: 21 October 2003
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote spiderM9 Quote  Post ReplyReply Direct Link To This Post Topic: Tabbed MDI flicker
    Posted: 21 October 2003 at 5:34pm

I was running the demo MDITabDemo (also occurs on other demo programs that support the tabbed MDI style) and noticed that eery time a tab for an unexposed window is clicked, there is a very brief flicker where an MDI child window shows itself in the "Restored" state just prior to maximizing and showing in the "Tabbed" state.

I also noticed that the Tabbed MDI seems to be implemented by piggybacking on top of regular MDI, such that the child windows can be "Restored" to what is basically regular MDI mode with the tab bar serving as a mechanism to front windows.  This is not the behavior of Tabbed MDI in Visual Studio.  Is it possible to eliminate this feature (and along with it eliminating both the MDI child menu additions to the main frame menu) and will doing so eliminate the flicker, or would I need to implement my own Tabbed MDI (basically doing so in SDI mode I imagine)?

 

Back to Top
kstowell View Drop Down
Admin Group
Admin Group


Joined: 25 January 2003
Location: MIchigan, USA
Status: Offline
Points: 496
Post Options Post Options   Thanks (0) Thanks(0)   Quote kstowell Quote  Post ReplyReply Direct Link To This Post Posted: 28 October 2003 at 4:40pm

Hello,

Add the following code to your CChildFrame class to eliminate the flicker you see when switching MDI tabs:

BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
   
// make sure view is maximum size to eliminate
   
// flicker when switching tabs.
   
cs.x =
   
cs.y = 0;
   
   
cs.cx =
   
cs.cy = 32767;

    // TODO: Modify the Window class or styles here by modifying
   
// the CREATESTRUCT cs
   
if( !CXTMDIChildWnd::PreCreateWindow(cs) )
       
return FALSE;

   
cs.style |= WS_CLIPCHILDREN;
   
cs.style = WS_CHILD | WS_OVERLAPPED | WS_CAPTION WS_SYSMENU
       
| FWS_ADDTOTITLE | WS_THICKFRAME | WS_MINIMIZEBOX WS_MAXIMIZEBOX;

    return TRUE;
}

void CChildFrame::ActivateFrame(int nCmdShow)
{
   
// first window should be maximized
   
if (GetParent()->GetWindow(GW_CHILD) == this)
   
{
       
nCmdShow = SW_SHOWMAXIMIZED;
   
}

    CXTMDIChildWnd::ActivateFrame(nCmdShow);
}

Let me know if this helps.

Kind regards,
Codejock Support



Edited by Administrator
Back to Top
tymberwyld View Drop Down
Newbie
Newbie


Joined: 30 August 2005
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote tymberwyld Quote  Post ReplyReply Direct Link To This Post Posted: 30 August 2005 at 9:14am
Hi, can anyone convert this to C#?  I'm not familiar with the C++ Forms structure and so it's kind of difficult to see what's going on here.  I understand the CreateParams structure, but the ActiveFrame() method is throwing me.

Thanks for any help!
Back to Top
g_j_a_i_n View Drop Down
Groupie
Groupie
Avatar

Joined: 27 August 2005
Status: Offline
Points: 91
Post Options Post Options   Thanks (0) Thanks(0)   Quote g_j_a_i_n Quote  Post ReplyReply Direct Link To This Post Posted: 30 March 2006 at 11:25pm


Thanks support. That code really helped.

If any one of you wants to hide the maximize & minimize buttons, you can use the following code

CXTPCommandBar* pMenuBar = pCommandBars->SetMenu("Menu Bar", IDR_MAINFRAME);
pMenuBar->SetFlags(xtpFlagHideMinimizeBox | xtpFlagHideMaximizeBox);
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.148 seconds.