Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - MDITabWindow Example and toolbars
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

MDITabWindow Example and toolbars

 Post Reply Post Reply
Author
Message
Tomas View Drop Down
Newbie
Newbie
Avatar

Joined: 21 July 2006
Status: Offline
Points: 21
Post Options Post Options   Thanks (0) Thanks(0)   Quote Tomas Quote  Post ReplyReply Direct Link To This Post Topic: MDITabWindow Example and toolbars
    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

 


Back to Top
Tomas View Drop Down
Newbie
Newbie
Avatar

Joined: 21 July 2006
Status: Offline
Points: 21
Post Options Post Options   Thanks (0) Thanks(0)   Quote Tomas Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
Tomas View Drop Down
Newbie
Newbie
Avatar

Joined: 21 July 2006
Status: Offline
Points: 21
Post Options Post Options   Thanks (0) Thanks(0)   Quote Tomas Quote  Post ReplyReply Direct Link To This Post 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?


Back to Top
Oleg View Drop Down
Senior Member
Senior Member


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: 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
Back to Top
Tomas View Drop Down
Newbie
Newbie
Avatar

Joined: 21 July 2006
Status: Offline
Points: 21
Post Options Post Options   Thanks (0) Thanks(0)   Quote Tomas Quote  Post ReplyReply Direct Link To This Post 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


Back to Top
Tomas View Drop Down
Newbie
Newbie
Avatar

Joined: 21 July 2006
Status: Offline
Points: 21
Post Options Post Options   Thanks (0) Thanks(0)   Quote Tomas Quote  Post ReplyReply Direct Link To This Post 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


Back to Top
Oleg View Drop Down
Senior Member
Senior Member


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: 16 August 2006 at 11:34am
Hi,
View must have id = AFX_IDW_PANE_FIRST.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Tomas View Drop Down
Newbie
Newbie
Avatar

Joined: 21 July 2006
Status: Offline
Points: 21
Post Options Post Options   Thanks (0) Thanks(0)   Quote Tomas Quote  Post ReplyReply Direct Link To This Post 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.



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