Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Docking Pane
  New Posts New Posts RSS Feed - No Resource Buttons on Dialog Based Pane?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

No Resource Buttons on Dialog Based Pane?

 Post Reply Post Reply
Author
Message
kent_t View Drop Down
Groupie
Groupie


Joined: 15 July 2008
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote kent_t Quote  Post ReplyReply Direct Link To This Post Topic: No Resource Buttons on Dialog Based Pane?
    Posted: 25 September 2008 at 5:15pm
Okay, frustration is now setting in.

Based upon the Docking Pane examples and posts in this forum, I have come up with the code below.  I’ve left out the hundreds of lines of code that have been written and erased.

I’m trying to use a CDialog as a pane. I have placed normal Windows command buttons and static labels on this borderless dialog with the windows resource editor.

The code compiles and runs, but I get a BLANK pane. No buttons. Frankly, I don’t know what the blank thing is. The constructor does run for my dialog.



int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
    (other code removed for brevity)

    mPaneManager.InstallDockingPanes(this);
    mPaneManager.SetFloatingFrameCaption(_T("Panes"));
    mPaneManager.SetStickyFloatingFrames(TRUE);
    mPaneManager.SetThemedFloatingFrames(TRUE);

    mPaneManager.SetAlphaDockingContext(TRUE);
    mPaneManager.SetShowDockingContextStickers(TRUE);

    mPaneManager.SetSideDockingMargin(CRect(2, 2, 2, 2));
    mPaneManager.EnableSideDocking();
    mPaneManager.EnableKeyboardNavigate();

    CXTPDockingPane* pPane = mPaneManager.CreatePane( IDD_PANE_DLG, CRect( 0,0,200,500), xtpPaneDockLeft );
}

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() )
        {
            PaneDlg PDLG;
            PDLG.Create( IDD_PANE_DLG );
            pPane->Attach( &PDLG );
        }
    }
    return TRUE;
}



I've also tried "newing" the dialog and that also does not work. I've tried putting the pointer in global scope, etc., etc.

If I have to hand-create the resources in code and add them to the dialog in code I will be very disappointed. (That's an understatement.)

Smucker has already said Dialogs do not really work. I was hoping otherwise. Please tell me now if I am wasting my time with dialogs. I want to use dialogs so I can easily change the resources through the VC resource editor, and not have to hand code adding buttons and such.


Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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 2008 at 2:59am
Hi,
Obviously you need Put PaneDlg PDLG; line to members of CMainFrame.
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.