Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Docking Pane
  New Posts New Posts RSS Feed - Change Pane Size Dynamically
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Change Pane Size Dynamically

 Post Reply Post Reply
Author
Message
thodgson View Drop Down
Groupie
Groupie
Avatar

Joined: 11 August 2003
Status: Offline
Points: 78
Post Options Post Options   Thanks (0) Thanks(0)   Quote thodgson Quote  Post ReplyReply Direct Link To This Post Topic: Change Pane Size Dynamically
    Posted: 06 December 2003 at 1:18pm

Sorry if this is obvious, but I'm having trouble finding it:

How can I dynamically resize a pane once it is created and attached?

In my OnCreate method, I have:

m_pwndOutbar = m_paneManager.CreatePane(IDR_PANE_OUTBAR, CRect(0, 0, 130, 0), dockLeftOf, m_pwndTreeView );

In the above, the size is initially set.  I'd hate to have to destroy the pane and re-create it.

Tim

Back to Top
dkf8117 View Drop Down
Newbie
Newbie


Joined: 06 February 2004
Location: United States
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote dkf8117 Quote  Post ReplyReply Direct Link To This Post Posted: 24 February 2004 at 10:48am
Ever find a solution to this?
Back to Top
thodgson View Drop Down
Groupie
Groupie
Avatar

Joined: 11 August 2003
Status: Offline
Points: 78
Post Options Post Options   Thanks (0) Thanks(0)   Quote thodgson Quote  Post ReplyReply Direct Link To This Post Posted: 24 February 2004 at 12:20pm

I didn't find exactly what I was looking for, but I was able to create a workaround, which works well for us.

My approach was to create a layout, then save it to the registry if it doesn't already exist.  I was informed that layouts must be created in whole, then activated.  You cannot move panes around one at a time any way you like - which is what I really wanted. 

 

Anyway, in the following code sample, I have a window pane layout named "Visual Studio".  If it was already created and saved to the registry, it is loaded and the layout is "set" (available).  If it doesn't already exist, I create the layout, and save it to the registry. 

// Create or load the Visual Studio Layout

m_pLayoutVisualStudio = m_paneManager.CreateLayout();

if (m_pLayoutVisualStudio->Load(_T("VisualStudio")))

{

m_paneManager.SetLayout(m_pLayoutVisualStudio);

}

else

{

m_paneManager.DockPane(m_pwndTreeView, dockLeftOf);

m_paneManager.DockPane(m_pwndOutbar, dockLeftOf, m_pwndTreeView);

m_paneManager.DockPane(m_pwndPaneChartRealtime, dockBottomOf);

m_paneManager.DockPane(m_pwndPaneOutput, dockBottomOf);

m_paneManager.DockPane(m_pwndPaneLog, dockBottomOf);

m_paneManager.DockPane(m_pwndPaneChartResponseTime, dockBottomOf);

m_paneManager.AttachPane(m_pwndOutbar, m_pwndTreeView);

m_paneManager.AttachPane(m_pwndPaneOutput, m_pwndPaneChartRealtime);

m_paneManager.AttachPane(m_pwndPaneLog, m_pwndPaneChartRealtime);

m_paneManager.AttachPane(m_pwndPaneChartResponseTime, m_pwndPaneChartRealtime);

m_pwndTreeView->Select();

m_pwndPaneChartRealtime->Select();

m_paneManager.GetLayout(m_pLayoutVisualStudio);

m_pLayoutVisualStudio->Save(_T("VisualStudio"));

}

Whenever I want to show the Visual Studio layout, I just set the pane manager layout:

m_paneManager.SetLayout(m_pLayoutVisualStudio);

Conceivably, you could do this on the fly...

Tim Hodgson
ExclamationSoft (http://www.ExclamationSoft.com)
------------------------------------------------------------ ---
WebWatchBot - Your site is down, and so is your revenue
NetMailBot - Automate Email Processes
MailListBot - Send Email and more in VB and ASP
Smtp.NET - Send Email and more in .NET



Edited by thodgson
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.063 seconds.