Print Page | Close Window

No Resource Buttons on Dialog Based Pane?

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=12258
Printed Date: 13 May 2025 at 10:19am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: No Resource Buttons on Dialog Based Pane?
Posted By: kent_t
Subject: No Resource Buttons on Dialog Based Pane?
Date Posted: 25 September 2008 at 5:15pm
file:///C:%5CDOCUME%7E1%5CKTHOMP%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml - 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.





Replies:
Posted By: Oleg
Date 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



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