![]() |
How to change pane size from code |
Post Reply ![]() |
Author | |
mgampi ![]() Senior Member ![]() ![]() Joined: 14 July 2003 Status: Offline Points: 1201 |
![]() ![]() ![]() ![]() ![]() 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 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 |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
Call m_paneManager.NormalizeSplitters(); after you change min/max size.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
mgampi ![]() Senior Member ![]() ![]() Joined: 14 July 2003 Status: Offline Points: 1201 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
mgampi ![]() Senior Member ![]() ![]() Joined: 14 July 2003 Status: Offline Points: 1201 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
scottp ![]() Groupie ![]() Joined: 16 October 2006 Status: Offline Points: 59 |
![]() ![]() ![]() ![]() ![]() |
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? |
|
![]() |
|
znakeeye ![]() Senior Member ![]() ![]() Joined: 26 July 2006 Status: Offline Points: 1672 |
![]() ![]() ![]() ![]() ![]() |
Any news regarding this? (See http://forum.codejock.com/forum_posts.asp?TID=10005&KW=floating)
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |