Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - How to use CXTPTabClientWnd correctly!
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to use CXTPTabClientWnd correctly!

 Post Reply Post Reply
Author
Message
xred View Drop Down
Groupie
Groupie
Avatar

Joined: 24 August 2004
Location: China
Status: Offline
Points: 28
Post Options Post Options   Thanks (0) Thanks(0)   Quote xred Quote  Post ReplyReply Direct Link To This Post Topic: How to use CXTPTabClientWnd correctly!
    Posted: 25 September 2004 at 12:53am

I found  some examples work very well,but my not!

////////////////////////////
 CXTPTabClientWnd m_MTIClientWnd;
///////////////////////////
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
 ....

 VERIFY(m_MTIClientWnd.Attach(this));
 
 ....

}
///////////////////////////

Thanks in advance!

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: 25 September 2004 at 2:19pm

You can create child like this:

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( !CMDIChildWnd::PreCreateWindow(cs) )
  return FALSE;

 return TRUE;
}

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
xred View Drop Down
Groupie
Groupie
Avatar

Joined: 24 August 2004
Location: China
Status: Offline
Points: 28
Post Options Post Options   Thanks (0) Thanks(0)   Quote xred Quote  Post ReplyReply Direct Link To This Post Posted: 26 September 2004 at 5:29am

Hi,Oleg I have to say that it doesn't work!

However some examples such as GUI_Visualstudio7 don't include these lines ,but it works very well!

Why?



Edited by xred
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: 26 September 2004 at 10:59am

 Additional add

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

to make it Maximized by default.

 

In  GUI_Visualstudio7  .Attach called with bEnableGroups = TRUE

VERIFY(m_MTIClientWnd.Attach(this, TRUE));


 

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
xred View Drop Down
Groupie
Groupie
Avatar

Joined: 24 August 2004
Location: China
Status: Offline
Points: 28
Post Options Post Options   Thanks (0) Thanks(0)   Quote xred Quote  Post ReplyReply Direct Link To This Post Posted: 27 September 2004 at 5:00am

Oleg ,It still cant't work!I'm in despair,I hit my keyboard, so my keyboard's space key has been broken yet!
However I found out some examples include this function ,and it seems to work!But there is flicker none the less,
and the flicker beacame lightly only!

//////////////////////////////////////////////////////////// //////////////
LRESULT CChildFrame::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
 if (message == WM_NCPAINT)
 {
  // prevent caption blinking
  return TRUE;
 } 
 return CMDIChildWnd::WindowProc(message, wParam, lParam);
}
//////////////////////////////////////////////////////////// //////////////

I can't understand why GUI_VisualStudio7 didn't include any special line and It works so perfectly!
Is there a method to solve this problem?

//////////////////////////////////////////////////////////// /////////////
In my program:
CMainFrame:
 CXTPTabClientWnd m_MTIClientWnd;
 int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
 {
  ...
  VERIFY(m_MTIClientWnd.Attach(this));
  ...
 }
CChildFrame:
 BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
 {
  if( !CMDIChildWnd::PreCreateWindow(cs) )
   return FALSE;

  return TRUE;
 }
 void CChildFrame::ActivateFrame(int nCmdShow)
 {

  nCmdShow = SW_SHOWMAXIMIZED;
  CMDIChildWnd::ActivateFrame(nCmdShow);
 }
 LRESULT CChildFrame::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
 {
  if (message == WM_NCPAINT)
  {
   // prevent caption blinking
   return TRUE;
  } 
  return CMDIChildWnd::WindowProc(message, wParam, lParam);
 }

Thank you again,Oleg!



Edited by xred
Back to Top
SuperMario View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 27 September 2004 at 11:20am
In previous post, Oleg mentioned that the VS 7 sample used this:

    VERIFY(m_MTIClientWnd.Attach(this, TRUE));

I see in your code that you are do this:
    VERIFY(m_MTIClientWnd.Attach(this));

I tried both version in the VS 7 sample and removing "TRUE" produced results similar to the problem you are having.

Hope this help
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: 27 September 2004 at 11:59pm

add

cs.x =
 cs.y = 0;
 
 cs.cx =
 cs.cy = 32767;

to PrecreateWindow

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.047 seconds.