Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - CXTPDockingPane - some questions
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPDockingPane - some questions

 Post Reply Post Reply
Author
Message
dmetzler View Drop Down
Newbie
Newbie


Joined: 09 February 2004
Location: United States
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote dmetzler Quote  Post ReplyReply Direct Link To This Post Topic: CXTPDockingPane - some questions
    Posted: 09 February 2004 at 10:31pm

I am using Xtreme Toolkit Pro and have some questions about the CXTPDockingPane.  I have looked at the XTP sample code (Advanced, DynamcPanes), but cannot find specifically what I need.

1) I want to create a dynamic layout of a CXTPDockingPane by creating controls using CreateWindow().  I am doing this now using a modified DynamicPanes example, but my child controls do not seem to be getting attached to the correct window.  Can I create my child control windows before the CXTPDockingPane::Attach() is called?

2) If I want to resize my controls in the pane, in which CWnd (or CView) class would I put my OnSize() handler?

3) Can I control the minimum control size using WM_GETMINMAXINFO for a CXTPDockingPane?

Thanks,

Don Metzler

SISCOM Media, Inc.

 

Back to Top
vladsch View Drop Down
Newbie
Newbie


Joined: 04 February 2004
Location: Canada
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote vladsch Quote  Post ReplyReply Direct Link To This Post Posted: 10 February 2004 at 11:14am

Hi Don:

I attached a custom pane class based on CWnd, it creates a single edit control in the OnCreate handler. It also resizes the edit control to fit the size of the pane in OnSize().

The usual pane stuff: in OnDockingPaneNotify you must add a case clause for the id of the pane and create it. I am using DockPaneWnd.h template class created by the XTreme AppWizzard to add a member to my CMainFrame:  CDockPaneWnd<CCustomPane> m_wndCustomPane so that the default pane messages are handled.

Z87_CustomPane.zip

Hope this helps.

Back to Top
dmetzler View Drop Down
Newbie
Newbie


Joined: 09 February 2004
Location: United States
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote dmetzler Quote  Post ReplyReply Direct Link To This Post Posted: 10 February 2004 at 12:29pm

Thank you very much!  I will take a look at it.

Don

Back to Top
dmetzler View Drop Down
Newbie
Newbie


Joined: 09 February 2004
Location: United States
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote dmetzler Quote  Post ReplyReply Direct Link To This Post Posted: 13 February 2004 at 10:16am

In your post above, you show:

CDockPaneWnd<CCustomPane> m_wndCustomPane

The CCustomPane is the class you included in the .zip file.  What does the CDockPaneWnd refer to?  Is this an existing XTP class, and if so, what is the correct name of this class?

Thanks,

Don

Back to Top
vladsch View Drop Down
Newbie
Newbie


Joined: 04 February 2004
Location: Canada
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote vladsch Quote  Post ReplyReply Direct Link To This Post Posted: 13 February 2004 at 12:35pm

It is in the DockPaneWnd.h file that the AppWizzard creates. Here is what it contains:

// DockPaneWnd.h : main header file for the SAMPLEAPP application
//

#if !defined(__DOCKPANEWND_H__)
#define __DOCKPANEWND_H__

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

template<class BASE_CLASS>
        class CDockPaneWnd : public BASE_CLASS
{
protected:

    virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
    {
        switch (message)
        {
             case WM_CREATE:
             {
                 if (BASE_CLASS::WindowProc(message, wParam, lParam) == -1)
                           return -1;

                 SetFont(CXTPPaintManager::GetRegularFont());

                 return 0;
             }

             case WM_NCPAINT:
             {
                 CWindowDC dc(this);

                 CRect rc;
                 GetWindowRect(&rc);

                 int cx = rc.Width();
                 int cy = rc.Height();

                 const COLORREF clrFrame =  GetXtremeColor(XPCOLOR_3DSHADOW);
                 dc.Draw3dRect(0, 0, cx, cy, clrFrame, clrFrame);

                 return TRUE;
             }

             case WM_NCCALCSIZE:
             {
                 NCCALCSIZE_PARAMS FAR* lpncsp = (NCCALCSIZE_PARAMS FAR*)lParam;

                 // adjust non-client area for border space
                 lpncsp->rgrc[0].left   += 1;
                 lpncsp->rgrc[0].top    += 1;
                 lpncsp->rgrc[0].right  -= 1;
                 lpncsp->rgrc[0].bottom -= 1;

                 return TRUE;
             }
        }

        return BASE_CLASS::WindowProc(message, wParam, lParam);
    }
};


//////////////////////////////////////////////////////////// /////////////////

//{{AFX_INSERT_LOCATION}}
    // Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(__DOCKPANEWND_H__)

Back to Top
dmetzler View Drop Down
Newbie
Newbie


Joined: 09 February 2004
Location: United States
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote dmetzler Quote  Post ReplyReply Direct Link To This Post Posted: 17 February 2004 at 2:24pm

One other question - how do you create the instance of the m_wndCustomPane object:

Does this window have the WS_CHILD style, or WS_POPUP (and if a WS_CHILD, what is the parent HWND)?

Thanks,

Don

Back to Top
vladsch View Drop Down
Newbie
Newbie


Joined: 04 February 2004
Location: Canada
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote vladsch Quote  Post ReplyReply Direct Link To This Post Posted: 17 February 2004 at 2:29pm

In CMainFrame::OnDockingPaneNotify

              case IDR_PANE_CUSTOM :

                     if (m_wndCustomPane.GetSafeHwnd() == 0)
                     {
                          m_wndCustomPane.Create(NULL, NULL, WS_CHILD|WS_CLIPCHILDREN|WS_CLIPSIBLINGS, CRect(0,0,0,0), this, 0);
                     }
                     pPane->Attach(&m_wndCustomPane);
                     break;

Back to Top
dmetzler View Drop Down
Newbie
Newbie


Joined: 09 February 2004
Location: United States
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote dmetzler Quote  Post ReplyReply Direct Link To This Post Posted: 17 February 2004 at 4:14pm

thank you - that did it

Don

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