Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Set pane size
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Set pane size

 Post Reply Post Reply
Author
Message
yoavo View Drop Down
Senior Member
Senior Member


Joined: 29 February 2004
Location: Israel
Status: Offline
Points: 140
Post Options Post Options   Thanks (0) Thanks(0)   Quote yoavo Quote  Post ReplyReply Direct Link To This Post Topic: Set pane size
    Posted: 27 June 2006 at 8:55am
I have 2 panes docked to the left, one on top of the other (they have the same height).
How can I change programaticaly their height ?
 
Yoav.
Back to Top
SuperMario View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 27 June 2006 at 10:12am
Maybe something like this, you set the min and max height to the same size, then save the splitter positions, then chnage the min\max height\width back to what you want the user to be able to resize:

pPane->SetMinTrackSize(CSize(150, 150));
pPane->SetMaxTrackSize(CSize(150, 150));

GetDockingPaneManager()->NormalizeSplitters();

pPane->SetMinTrackSize(CSize(50,50));
pPane->SetMaxTrackSize(CSize(32000,20));
Back to Top
yoavo View Drop Down
Senior Member
Senior Member


Joined: 29 February 2004
Location: Israel
Status: Offline
Points: 140
Post Options Post Options   Thanks (0) Thanks(0)   Quote yoavo Quote  Post ReplyReply Direct Link To This Post Posted: 28 June 2006 at 12:36am
it didnt solve the problem.
Isn't there a method which allows me to change the size of a docked pane (as in FloatPane) ?
Back to Top
SuperMario View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 28 June 2006 at 9:42am
You can see the PaneSample for more on how to do this.

Look at this function:

void CMainFrame::OnMinMaxSamlpe()
{
    m_bMinMaxSample = !m_bMinMaxSample;

    if (m_bMinMaxSample)
    {
        CXTPDockingPane* pPane = m_paneManager.FindPane(IDR_PANE1);
        ASSERT(pPane);
        pPane->SetMinTrackSize(CSize(100, 100));
        pPane->SetMaxTrackSize(CSize(150, 150));

        pPane = m_paneManager.FindPane(IDR_PANE2);
        ASSERT(pPane);
        pPane->SetMinTrackSize(CSize(130, 130));
        pPane->SetMaxTrackSize(CSize(130, 130));
    }
    else
    {
        CXTPDockingPane* pPane = m_paneManager.FindPane(IDR_PANE1);
        ASSERT(pPane);
        pPane->SetMinTrackSize(CSize(0, 0));
        pPane->SetMaxTrackSize(CSize(32000, 32000));

        pPane = m_paneManager.FindPane(IDR_PANE2);
        ASSERT(pPane);
        pPane->SetMinTrackSize(CSize(0, 0));
        pPane->SetMaxTrackSize(CSize(32000, 32000));
    }

    for (int i = 0; i < sizeof(m_wndPanes) / sizeof(m_wndPanes[0]); i++)
    {
        if (m_wndPanes.m_hWnd)
        {
            m_wndPanes.OnSize(0, 0, 0);
            m_wndPanes.RedrawWindow();

        }
    }
    GetDockingPaneManager()->RedrawPanes();
}
Back to Top
yoavo View Drop Down
Senior Member
Senior Member


Joined: 29 February 2004
Location: Israel
Status: Offline
Points: 140
Post Options Post Options   Thanks (0) Thanks(0)   Quote yoavo Quote  Post ReplyReply Direct Link To This Post Posted: 28 June 2006 at 10:31am
but when you do it this way, the splitter between the panes does not working anymore...
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.031 seconds.