Print Page | Close Window

MDITabWindow Example and toolbars

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=4761
Printed Date: 11 November 2025 at 12:36am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: MDITabWindow Example and toolbars
Posted By: Tomas
Subject: MDITabWindow Example and toolbars
Date Posted: 08 August 2006 at 2:12pm

I was looking at the MDITabWindow example that you guys have. I really like the behavior of what you can do with the windows, brilliant in my opinion. But for my case it raises a big problem which I am unsure how to answer.


All my child windows have their own custom ribbon toolbar, etc. But these things get created in the frame window OnCreate function. The example however have two kinds of frames that gets created depending of the state of the window (the MDI child window frame and the dockable window frame.) I really think it will be a bad idea to duplicate the code found on the OnCreate function for both cases.

 
Currently the dockable frame parent is a (CXTPFrameWnd) and the MDI child window parent is a (CXTPFrameWndBase<CMDIChildWnd>) (I updated the hirarchy of both classes to allow the ribbon bar). Is there a way to keep the same behavier but use only one kind of frame? If not, what solution would you recommend to improve my situation?

 
Thanks,
Tomas

 





Replies:
Posted By: Tomas
Date Posted: 09 August 2006 at 2:07pm

I have been trying to figure out what should I do, I am frozen. I don’t want to destroy the controls and recreate them since that may change their states.

I think the thing to do will be having a second frame inside the other frames but I wasn’t successful at making that happen.

  ANY HELP WILL BE GREATLY APRECIATED.

Tomas



Posted By: Tomas
Date Posted: 10 August 2006 at 11:17am

I realize that what I need to do is to convert the CMDIChildWndEx from dockable to undockable such the toolbars and such wont get destroy. I belief this is how the example should have work in the first place. Any help about how should I go about doing this?




Posted By: Oleg
Date Posted: 14 August 2006 at 8:54am
Hi,
Seems you have to add Frame to View and resize it in OnSize handler.


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


Posted By: Tomas
Date Posted: 14 August 2006 at 9:31am
Originally posted by oleg oleg wrote:

Hi,
Seems you have to add Frame to View and resize it in OnSize handler.


Thanks so much for answering as this is driving me crazy.
You mean to add a child frame to the view of the Helloworld for instance?
How I would go about doing that? Because I want to still have my doc/Frame/View still work as normal.

Sorry I am a bit confused...
Tomas




Posted By: Tomas
Date Posted: 15 August 2006 at 4:56pm
Originally posted by oleg oleg wrote:

Hi,
Seems you have to add Frame to View and resize it in OnSize handler.

I did what you subjected. Now the tool bars don’t get destroyed but I have two problems.

a) When I drag a toolbar they don’t draw properly.
b) The View doesn’t seem to respect/know that there are toolbars so it thinks its client area starts at the very top of the frame.

I think both problems are related. Here is where I create the new frame/view. Can you see what I am doing wrong?



void CMagicalView::OnInitialUpdate( void )
{
    CDocument* pDocument = GetDocument();

    if (!pDocument)
        return;

    CString strTitle = pDocument->GetTitle();

    m_pFrameNew = new CRealFrame2000;
    CCreateContext context;
    context.m_pCurrentDoc = pDocument;

    m_pFrameNew->Create(NULL, NULL, WS_CHILD, CRect(0, 0, 0, 0), this, NULL, 0, &context);
    m_pFrameNew->ModifyStyleEx(WS_EX_CLIENTEDGE, 0);

    //
    // Create the view
    //
    CView* pView = new CHelloView;
    pView->Create(NULL,NULL, WS_CHILD, CRect(0,0,0,0), m_pFrameNew, 0, &context );
    pView->ModifyStyleEx(WS_EX_CLIENTEDGE, 0);

    //
    // Set the active view
    //
    m_pFrameNew->SetActiveView(pView,FALSE);
}


Thanks
Tomas




Posted By: Oleg
Date Posted: 16 August 2006 at 11:34am
Hi,
View must have id = AFX_IDW_PANE_FIRST.


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


Posted By: Tomas
Date Posted: 17 August 2006 at 1:04pm
I have it all working great now. I just have one feature I would like to request and it is the ability for tabs to exits in the ribbon so that I can switch my child windows from there rather than wasting an additional line.






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