Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Docking Pane
  New Posts New Posts RSS Feed - How to change pane size from code
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to change pane size from code

 Post Reply Post Reply
Author
Message
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Topic: How to change pane size from code
    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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 01 October 2007 at 6:05am
Hi,
 
Call m_paneManager.NormalizeSplitters();  after you change min/max size.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
scottp View Drop Down
Groupie
Groupie


Joined: 16 October 2006
Status: Offline
Points: 59
Post Options Post Options   Thanks (0) Thanks(0)   Quote scottp Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Posted: 30 March 2008 at 1:12pm
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.188 seconds.