Print Page | Close Window

How to change pane size from code

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=8239
Printed Date: 04 July 2025 at 12:08am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to change pane size from code
Posted By: mgampi
Subject: How to change pane size from code
Date Posted: 30 September 2007 at 6:10pm
Hi;
I just try to change the size of docking panes by code. I searched the forum and found thread http://forum.codejock.com/forum_posts.asp?TID=5712 - http://forum.codejock.com/forum_posts.asp?TID=5712  but this does not work in my case .
The size is not changed.
Any suggestions are very welcome


-------------
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022



Replies:
Posted By: Oleg
Date Posted: 01 October 2007 at 6:05am
Hi,
 
Call m_paneManager.NormalizeSplitters();  after you change min/max size.


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


Posted By: mgampi
Date Posted: 01 October 2007 at 7:53am
Hi Oleg,
I implemented my Size function like this:
 
pPane->SetMinTrackSize(CSize(nWidth, 0));
pPane->SetMaxTrackSize(CSize(nWidth, 32767));
pPaneManager_->RecalcFrameLayout(pPane);
pPaneManager_->NormalizeSplitters();
pPane->SetMinTrackSize(CSize(32, 0));
pPane->SetMaxTrackSize(CSize(32767, 32767));
 
But it does not work. The pane still has the size as provided by the CreatePane() call.
I only want to change the width of the pane, so the parameter nWidth is provided as a function parameter.
The function should size the pane to nWidth pixels and after sizing to nWidth allow a real minimum size of 32 pixels - max width is somehow unlimited...


-------------
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022


Posted By: Oleg
Date Posted: 01 October 2007 at 8:48am
Hello,
 
Now code looks ok.
 
I tried it in our DockingPane sample:
 
void CMainFrame::OnShowPane(UINT nID)
{
 //m_paneManager.ShowPane(nID);
 CXTPDockingPane* pPane = m_paneManager.FindPane(nID);
 int nWidth = 200;
 pPane->SetMinTrackSize(CSize(nWidth, 0));
 pPane->SetMaxTrackSize(CSize(nWidth, 32767));
 m_paneManager.RecalcFrameLayout(pPane);
 m_paneManager.NormalizeSplitters();
 pPane->SetMinTrackSize(CSize(32, 0));
 pPane->SetMaxTrackSize(CSize(32767, 32767));
}
 
and all work as expected. Problem can be only with Floating panes.


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


Posted By: mgampi
Date Posted: 01 October 2007 at 5:14pm
Hi Oleg;
I do not have floating panes. The only issue to mention is that the PaneManager is a memeber of a CView derived class and the pane is docked to the right side of the view without any possibility to be undocked/moved. The pane has no caption/titlebar.
Could this be the reason why the pane won't get sized? Also the call to the SetSize() function is executed in CView::OnInitialUpdate() right after opening the document.


-------------
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022


Posted By: Oleg
Date Posted: 02 October 2007 at 1:07am
Hi,
Difficult to say what happen in this case without code.
 
Actually you can easy use simple CSplitterWnd class instead DockingPanes for your case.


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


Posted By: scottp
Date Posted: 02 October 2007 at 7:47am
I have been trying to do this with floating frames with no success. Ideally I would like to set the size of the pane, and then show the pane (which will restore it to floating).  Unfortunately FloatPane does not seem to work as the pane is already loaded (by default closed) by the layout and it issues an assert.

Is there a way to set the size for floating frames, ideally the size of the pane client not the window size?


Posted By: znakeeye
Date Posted: 30 March 2008 at 1:12pm
Any news regarding this? (See http://forum.codejock.com/forum_posts.asp?TID=10005&KW=floating - http://forum.codejock.com/forum_posts.asp?TID=10005&KW=floating )



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