Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Docking Pane
  New Posts New Posts RSS Feed - Refresh problem with in CFormView
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Refresh problem with in CFormView

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


Joined: 21 April 2007
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote edwardlj Quote  Post ReplyReply Direct Link To This Post Topic: Refresh problem with in CFormView
    Posted: 21 April 2007 at 12:18am
Hi.

I use a DockingPane in MDI application. and the view is a CFormView.
 
It is ok to create the pane. But when I hide the pane and activate it again by click its icon, the refresh get problem( It seems the formview does not refresh at all).

I change the CFormView to CView and it works. 

 The code is as following:

BOOL CUserFrame::PreCreateWindow(CREATESTRUCT& cs)
{
    if( !CMDIChildWnd::PreCreateWindow(cs) )
        return FALSE;
    cs.style   |= WS_CLIPCHILDREN|WS_CLIPSIBLINGS|WS_CHILD;
    return TRUE;
}
int CUserFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
    if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1)
        return -1;

  SetMenu(NULL)    ;

    // control bars objects have been created and docked.
    m_paneManager.InstallDockingPanes(this);

    // Create docking panes.
    m_paneManager.CreatePane(
        IDR_PANE_PROPERTIES, CRect(0, 0,210, 120), xtpPaneDockLeft);

    int nID = IDR_PANE_PROPERTIES;
    m_paneManager.SetIcons(IDB_BITMAP_ICONS, &nID, 1);

    m_paneManager.SetTheme(m_themeCurrent);

  return 0;
}
LRESULT CUserFrame::OnDockingPaneNotify(WPARAM wParam, LPARAM lParam)
{
    if (wParam == XTP_DPN_SHOWWINDOW)
    {
        CXTPDockingPane* pPane = (CXTPDockingPane*)lParam;

        if (!pPane->IsValid())
        {
            ASSERT (pPane->GetID() == IDR_PANE_PROPERTIES);

            if (!m_wndPropertyGrid.m_hWnd)
            {
                m_wndPropertyGrid.Create(CRect(0, 0, 0, 0), this, 1000);
                m_wndPropertyGrid.SetOwner(this);

                CFont font;
                font.CreatePointFont(180, _T("Arial"));

                LOGFONT lf;
                font.GetLogFont( &lf );

                CXTPPropertyGridItem* pSettings  = m_wndPropertyGrid.AddCategory(_T("Settings"));
                pSettings->AddChildItem(new CXTPPropertyGridItem(_T("Text"), _T("www.codejock.com")));
                pSettings->AddChildItem(new CXTPPropertyGridItemFont(_T("Font"), lf));
                pSettings->AddChildItem(new CXTPPropertyGridItemColor(_T("Color"), RGB(0,0, 255)));

                pSettings->Expand();

            }
            pPane->Attach(&m_wndPropertyGrid);
        }

        return TRUE;
    }

  return FALSE;
}


Can anybody help me, how to solute this problem?
 
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.172 seconds.