Where to capture resizing ??? |
Post Reply |
Author | |
amitb
Groupie Joined: 13 September 2006 Status: Offline Points: 50 |
Post Options
Thanks(0)
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 ????? |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Catch WM_SIZE of Taskpanel.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
amitb
Groupie Joined: 13 September 2006 Status: Offline Points: 50 |
Post Options
Thanks(0)
|
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. |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
You have save layout of DockingPanes. See our samples - they show how.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
amitb
Groupie Joined: 13 September 2006 Status: Offline Points: 50 |
Post Options
Thanks(0)
|
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. |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Yes, after SetLayout call m_pDocPane is destroyed. Don't save pointers. Use FindPane method instead.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
amitb
Groupie Joined: 13 September 2006 Status: Offline Points: 50 |
Post Options
Thanks(0)
|
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 ??? |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
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 |
|
amitb
Groupie Joined: 13 September 2006 Status: Offline Points: 50 |
Post Options
Thanks(0)
|
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. |
|
amitb
Groupie Joined: 13 September 2006 Status: Offline Points: 50 |
Post Options
Thanks(0)
|
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. |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
ok :)
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
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 |