Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Docking Pane
  New Posts New Posts RSS Feed - Where to capture resizing ???
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Where to capture resizing ???

 Post Reply Post Reply
Author
Message
amitb View Drop Down
Groupie
Groupie
Avatar

Joined: 13 September 2006
Status: Offline
Points: 50
Post Options Post Options   Thanks (0) Thanks(0)   Quote amitb Quote  Post ReplyReply Direct Link To This Post Topic: Where to capture resizing ???
    Posted: 20 November 2007 at 4:19am
Hello,

I am putting a CXTDockingPane on a CMyDockBar(derived from CXTDockingPaneManager)

After this i am putting a Taskpanel on this Docking pane.

Now when user resizes the pane, i want to handle it.
Which Handler should i be using and for which class ?????

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: 20 November 2007 at 7:07am
Catch WM_SIZE of Taskpanel.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
amitb View Drop Down
Groupie
Groupie
Avatar

Joined: 13 September 2006
Status: Offline
Points: 50
Post Options Post Options   Thanks (0) Thanks(0)   Quote amitb Quote  Post ReplyReply Direct Link To This Post Posted: 20 November 2007 at 11:18pm
Thanks Oleg,

Can i store the size of this taskpanel in registry, so that when my application will restart user will see the last size he set.
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: 21 November 2007 at 9:05am
Hi,
You have save layout of DockingPanes. See our samples - they show how.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
amitb View Drop Down
Groupie
Groupie
Avatar

Joined: 13 September 2006
Status: Offline
Points: 50
Post Options Post Options   Thanks (0) Thanks(0)   Quote amitb Quote  Post ReplyReply Direct Link To This Post Posted: 22 November 2007 at 6:32am
Thanks,
I checked the example of how to save the layout.

Now i am geting into another problem
I have class:
class CDockBar : public CXTPDockingPaneManager
{
public:
    CmcTaskPanel    m_wndTaskPanel;
    CXTPDockingPane* m_pDocPane;
    CXTPDockingPaneLayout* m_pCmcLayout;

}

Now in the create function of CDockBar :
I create the taskpanel.
I create the pane
and i attach the taskpane to this pane.

Now when i do this:
    m_pCmcLayout = this->CreateLayout();
    if (m_pCmcLayout->Load(_T("AmitLayout")))
    {
        this->SetLayout(m_pCmcLayout);
    }
    else
    {
        this->GetLayout(m_pCmcLayout);
    }
When before it executes the call to SetLayout, the m_pDocPane shows its class in the Add-Watch of VC6 as {CXTPDockingPane}.
But as soon as the SetLayout calls is executed, the m_pDocPane shows its class in add watch as {CXTPTabManager::CNavigateButtonArrowRight}.
Why the class changes ???


Due to this my application crashes later when i call m_pDocPane->Select(); // In the GetDockingPaneManager() it shows the value of m_pLayout as NULL.
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: 23 November 2007 at 1:43am
Yes, after SetLayout call m_pDocPane is destroyed. Don't save pointers. Use FindPane method instead.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
amitb View Drop Down
Groupie
Groupie
Avatar

Joined: 13 September 2006
Status: Offline
Points: 50
Post Options Post Options   Thanks (0) Thanks(0)   Quote amitb Quote  Post ReplyReply Direct Link To This Post Posted: 26 November 2007 at 5:20am
Hello Oleg,
Using FindPane() Worked fine for me :) Thanks...

Though the problem of the pointer is solved, i am not able to restore the size when i open the application next time.

This is what i am doing. Please tell me if the steps are correct.

In OnCreate()::::

    if (!m_wndTaskPanel.GetSafeHwnd())
    {
        if (!m_wndTaskPanel.Create(WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CLIPCHILDREN, CRect(0, 0, 0, 0), /*this*/ pWnd, 0))
            return FALSE;
       
        m_wndTaskPanel.SetOwner(pWnd);//this);
       
        m_wndTaskPanel.SetTheme(xtpTaskPanelThemeNativeWinXP);//xtpTaskPanelThemeShortcutBarOffice2003);
        m_wndTaskPanel.SetHotTrackStyle(xtpTaskPanelHighlightImage/*xtpTaskPanelHighlightItem*/);
        m_wndTaskPanel.SetSelectItemOnFocus(TRUE);
        //m_wndTaskPanel.SetSingleSelection();
        m_wndTaskPanel.SetItemLayout(xtpTaskItemLayoutImagesWithText);//xtpTaskItemLayoutImagesWithTextBelow);
        m_wndTaskPanel.AllowDrag(FALSE);   
        m_wndTaskPanel.SetBehaviour(xtpTaskPanelBehaviourList);   
    }

    this->InstallDockingPanes(pWnd);
    this->SetTheme(xtpPaneThemeNativeWinXP/*xtpPaneThemeShortcutBar2003*/);



    m_pDocPane = this->CreatePane(ID_PANE, CRect(0, 0, 150, 150), xtpPaneDockLeft);
    m_pDocPane->SetOptions(xtpPaneNoCloseable | xtpPaneNoHideable | xtpPaneNoFloatable | xtpPaneNoDockable | xtpPaneNoCaption);


    m_pDocPane->Attach(&m_wndTaskPanel);

    m_pCmcLayout = this->CreateLayout();
    if (m_pCmcLayout->Load(_T("AmitLayout")))
    {
        this->SetLayout(m_pCmcLayout);
    }
    else
    {
        this->GetLayout(m_pCmcLayout);
    }
************
Also in the destructor of my class i am doing this:
    m_pCmcLayout->Save(_T("AmitLayout"));
    delete m_pCmcLayout;

Still i am not able to restore the Taskpanel + Pane with the new size....

What is going wrong here ???

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: 26 November 2007 at 10:02am

Again you don't need to save pointer to m_pCmcLayout:

 
to save
 
 CXTPDockingPaneLayout layoutNormal(&m_paneManager);
 m_paneManager.GetLayout(&layoutNormal);
 layoutNormal.Save(_T("NormalLayout"));
to load:
 
  // Load the previous state for docking panes.
 CXTPDockingPaneLayout layoutNormal(&m_paneManager);
 if (layoutNormal.Load(_T("NormalLayout")))
 {
  m_paneManager.SetLayout(&layoutNormal);
 }
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
amitb View Drop Down
Groupie
Groupie
Avatar

Joined: 13 September 2006
Status: Offline
Points: 50
Post Options Post Options   Thanks (0) Thanks(0)   Quote amitb Quote  Post ReplyReply Direct Link To This Post Posted: 27 November 2007 at 1:44am
Thanks. I did is without saving as pointer and it works fine.

However, my taskpanel is getting created by the same size.

since before i load the layout  i have a call which is:

m_wndTaskPanel.Create(WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CLIPCHILDREN, CRect(0, 0, 0, 0), /*this*/ pWnd, 0))

this->CreatePane(ID_PANE, CRect(0, 0, 150, 150), xtpPaneDockLeft);
m_pDocPane->Attach(&m_wndTaskPanel);


so due to this the task panel is always getting set to 150,150.

Back to Top
amitb View Drop Down
Groupie
Groupie
Avatar

Joined: 13 September 2006
Status: Offline
Points: 50
Post Options Post Options   Thanks (0) Thanks(0)   Quote amitb Quote  Post ReplyReply Direct Link To This Post Posted: 27 November 2007 at 1:59am
Issue Resolved.

I was creating the pane each time, when actually i should not have created it once the layout was stored in registry.

FindPane() worked.
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: 27 November 2007 at 4:56am
ok :)
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
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.266 seconds.