Print Page | Close Window

CXTDockWindow

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Docking Pane
Forum Description: Topics Related to Codejock Docking Pane
URL: http://forum.codejock.com/forum_posts.asp?TID=6228
Printed Date: 12 December 2024 at 9:42am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTDockWindow
Posted By: denczek
Subject: CXTDockWindow
Date Posted: 25 January 2007 at 3:50pm
I am trying to implement the Xtreme DockingPane library into a project that was previously using only Xtreme Toolkit 4.1.  Several of the windows were derived from CXTDockWindow and now I'm not sure how to get these CXTDockWindow based classes to work with the DockingPane library (to support tear away tabs).
 
I have tried changing the base class of these windows to CXTControlBar, but without success.  Is this necessary?  If not, should I use CWnd as the base class or some other class? 
 
Any help or suggestions or sample code is greatly appreciated.
 
Thanks...

 




Replies:
Posted By: denczek
Date Posted: 25 January 2007 at 5:53pm
I changed the base classes from CXTDockWindow to CWnd and after deleting some registry keys (for the layout?), all of the windows are shown in docking panes.  The CWnd based GUI windows are not being updated though.  I can undock one of those docked panes, but the pane shows undocked and undocked.  It appears that a redraw is not occuring for some reason.
 
Any ideas?


Posted By: Oleg
Date Posted: 26 January 2007 at 1:42am

Hi,

 
Attach MainFrm.cpp to show what you do.


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


Posted By: denczek
Date Posted: 26 January 2007 at 12:30pm
I've attached the file for your review. 
 
Thanks again... https://forum.codejock.com/uploads/20070126_122933_MainFrm.zip - uploads/20070126_122933_MainFrm.zip


Posted By: Oleg
Date Posted: 26 January 2007 at 2:32pm
Problem in
LRESULT CMainFrame::OnDockingPaneNotify(WPARAM wParam, LPARAM lParam)
{
 if (wParam == XTP_DPN_SHOWWINDOW)
 {
  // get a pointer to the docking pane being shown.
  CXTPDockingPane* pPane = (CXTPDockingPane*)lParam;
  if (!pPane->IsValid())
  {
   CWnd* pWnd = NULL;
   int nPaneID = pPane->GetID();
   if (m_mapPanes.Lookup(nPaneID, pWnd))
   {
    pPane->Attach(pWnd);
   }
  }
 }
 return TRUE; // handled
}
 
 
Don't return TRUE always.  Change it to
 
 
LRESULT CMainFrame::OnDockingPaneNotify(WPARAM wParam, LPARAM lParam)
{
 if (wParam == XTP_DPN_SHOWWINDOW)
 {
  [code]
   return TRUE; // handled
}
  return FALSE;
}


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


Posted By: denczek
Date Posted: 26 January 2007 at 4:11pm
I made the change and unfortunately, no difference.  The 3 panes and associated windows created via the CreatePane method of my class where I am using the RUNTIME_CLASS macro, update and resize correctly.
 
The 3 panes created using the DockingPaneManager's CreatePane method still do not get updated correctly and are either not shown (transparent backgrounds) or they display and then do not get repainted when the pane is detached or resized.


Posted By: denczek
Date Posted: 26 January 2007 at 5:57pm
I also noticed that if I use class names in the Create call that the windows initially paint, but I am unable to update the windows.
 
For example, changing this:

m_pWndOutputPane = GetDockingPaneManager()->CreatePane(IDW_OUTPUTBAR, CRect(0, 0, 200, 120), dockBottomOf);

m_wndOutputBar.Create(NULL, "Output", WS_CHILD | WS_VISIBLE, CRect(0, 0, 200, 120), this, IDW_OUTPUTBAR, NULL);

m_pWndOutputPane->Attach(&m_wndOutputBar);

To this:

m_pWndOutputPane = GetDockingPaneManager()->CreatePane(IDW_OUTPUTBAR, CRect(0, 0, 200, 120), dockBottomOf);

m_wndOutputBar.Create("COutputBar", "Output", WS_CHILD | WS_VISIBLE, CRect(0, 0, 200, 120), this, IDW_OUTPUTBAR, NULL);

m_pWndOutputPane->Attach(&m_wndOutputBar);

 


Posted By: Oleg
Date Posted: 27 January 2007 at 2:45am
Hi,
Can you attach whole application to debug it?


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


Posted By: denczek
Date Posted: 29 January 2007 at 10:37am
Unfortunately I cannot attach the files for debugging.  There are too many dependencies on third party controls and libraries...


Posted By: denczek
Date Posted: 29 January 2007 at 3:33pm
For one of the problematic windows, if I change this:

m_wndOutputBar.Create(NULL, "Output", WS_CHILD | WS_VISIBLE, CRect(0, 0, 200, 120), this, IDW_OUTPUTBAR, NULL);

to this:

WNDCLASS wndcls;
memset(&wndcls, 0, sizeof(WNDCLASS));   
wndcls.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW;
wndcls.lpfnWndProc = ::DefWindowProc;
wndcls.hInstance = AfxGetInstanceHandle();
wndcls.hIcon = NULL;
wndcls.hCursor = NULL;
wndcls.hbrBackground = (HBRUSH) (COLOR_WINDOW + 1);
wndcls.lpszMenuName = NULL;
wndcls.lpszClassName = _T("COutputBar");
if(!AfxRegisterClass(&wndcls))
{
  TRACE("Class Registration Failed\n");
}
 
m_wndOutputBar.Create("COutputBar", "Output", WS_CHILD | WS_VISIBLE, CRect(0, 0, 200, 120), this, IDW_OUTPUTBAR, NULL);
 
Doing this, the window now gets painted, but none of the child windows get drawn.  The COutputBar class was originally derived from the CXTDockWindow class and was changed to derive from the CWnd base class. 
 
The COutputBar class we are using is the same class as that used in the GUI_VisualStudio6 example provided with the Xtreme Toolkit v4.1.
 
Thanks again...


Posted By: Oleg
Date Posted: 30 January 2007 at 2:34am

Hi,

Create with Wizard new project, copy you code regarding COutputBar and try to reproduce it. If you will attach sample here.
 
Without your code there is no way to say what you do wrong.


-------------
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