Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - How to create a dockable form?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to create a dockable form?

 Post Reply Post Reply
Author
Message
th.sedlaczek View Drop Down
Newbie
Newbie
Avatar

Joined: 19 October 2004
Location: United Kingdom
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote th.sedlaczek Quote  Post ReplyReply Direct Link To This Post Topic: How to create a dockable form?
    Posted: 19 October 2004 at 4:32am

Hi all,

I want to create a dockable form like CFormView or CDialogBar. I have tried to create a CDialogView inside a CXTDockWindow derived class, but the dialogbar does not apear in the docking window. Looking in Spy++ tells the dialog has been created and WS_VISIBLE flag is set, but it is not on the sreen.

I used:- m_dlgDialogBar.Create(this, IDD_MYDIALOG, CBRS_LEFT | CBRS_TOOLTIPS, 59605);

What I have to do to get my dialog inside the docking window? Has someone sample code?

Best regards from sunny south Wales!

Thomas

Back to Top
xred View Drop Down
Groupie
Groupie
Avatar

Joined: 24 August 2004
Location: China
Status: Offline
Points: 28
Post Options Post Options   Thanks (0) Thanks(0)   Quote xred Quote  Post ReplyReply Direct Link To This Post Posted: 19 October 2004 at 9:20am

First,you should insert a dialog ,then set the dialog's style to "child",then add a class(base class:CFormView),for example CMyDialogView!

Second,attach the FormView to your dockpane!

LRESULT CMainFrame::OnDockingPaneNotify(WPARAM wParam, LPARAM lParam)
{
 if (wParam == XTP_DPN_SHOWWINDOW)//如果pane是显 1034;状态的话
  {
   // get a pointer to the docking pane being shown.
   CXTPDockingPane* pPane = (CXTPDockingPane*)lParam;//获取lParam
   if (!pPane->IsValid())
   {
    switch( pPane->GetID() )
    {
         case 1:
        {
               pPane->AttachView(this,RUNTIME_CLASS(CMyDialogViewl),0);
        }
        break;
    }
   }
  
   return TRUE; // handled
  }
  return FALSE;
}
 

 

Back to Top
th.sedlaczek View Drop Down
Newbie
Newbie
Avatar

Joined: 19 October 2004
Location: United Kingdom
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote th.sedlaczek Quote  Post ReplyReply Direct Link To This Post Posted: 19 October 2004 at 9:57am

Hi,

Thank you, but I have just Xtreme Toolkit Standart edition and it seams to me that CXTPDockingPane class ist not included there.

Also there is no AttachView method in CXTDockWindow class, but I have just found something similar called SetChild method. I will try this out!

But thank you anyway for your help!!!

Regards,

Thomas

Back to Top
th.sedlaczek View Drop Down
Newbie
Newbie
Avatar

Joined: 19 October 2004
Location: United Kingdom
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote th.sedlaczek Quote  Post ReplyReply Direct Link To This Post Posted: 19 October 2004 at 12:00pm

Okay I have it!

It was working from the beginning and Spy++ was right:- It was visible! I simple didn't see it because my dialog was outside the docking frame area and therefore unvisible. Some how I was expecting it maped to the client area because of the create method which takes a pointer to the parent as argument. Sometimes it is soooooooo simple that you can not see it!

Greetings to China

Thomas

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