Print Page | Close Window

Change Pane Size Dynamically

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=277
Printed Date: 28 March 2024 at 7:37pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Change Pane Size Dynamically
Posted By: thodgson
Subject: Change Pane Size Dynamically
Date 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




Replies:
Posted By: dkf8117
Date Posted: 24 February 2004 at 10:48am
Ever find a solution to this?


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




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