![]() |
OLE Inplace Menu doesn't work for MDI applications |
Post Reply ![]() |
Author | |
Sergio ![]() Senior Member ![]() ![]() Joined: 18 September 2006 Status: Offline Points: 216 |
![]() ![]() ![]() ![]() ![]() Posted: 17 November 2006 at 10:38am |
Hello,
Your sample MFC (Codejock TookKit Pro Version 10.3.1) Command Bars Samples - Smart Layout, doesn't work with OLE Inplace editing.
To produce this bug : Launch your sample and drag'n'drop a MS Word .DOC document inside of the text editor. Now double-clic on the newly inserted OLE element, you won't see the OLE menu of MS Word.
Your sample User Interface Samples - Office 2003 GUI works fine.
The main difference between these two applications is that the first one is a MDI based frame and the second one is a SDI.
Could you please help us to solve this issue, as we have the same problem in our application. What should we change to make it working ?
Thank you in advance !
Regards,
|
|
Sergio
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hello,
See code of void CDrawItem::ActiveStateChanged(BOOL bActive)
in DrawClient sample.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Sergio ![]() Senior Member ![]() ![]() Joined: 18 September 2006 Status: Offline Points: 216 |
![]() ![]() ![]() ![]() ![]() |
Thank you for your prompt answer, I'm currently looking at the DrawClient sample and changing my code.
You sample has a little bug when doing a Print Preview (using the OLE main menu), after having entered and exited a few times from the In Place editing.
Here is a Print Screen :
Some buttons in the Main Menu are repeated.
Regards,
|
|
Sergio
|
|
![]() |
|
Sergio ![]() Senior Member ![]() ![]() Joined: 18 September 2006 Status: Offline Points: 216 |
![]() ![]() ![]() ![]() ![]() |
The problem of duplicates doesn't occur in my code, it's okay, it occurs only in your sample. We have integrated the code of your sample, the OLE menu works now fine. But after leaving the In Place edit mode, our custom docking panes (a CWnd* Attached to a CXTPDockingPane through the method pDockPane->Attach(pMyWnd)) are empty. The attached window seems to have been destroyed, the docking panes are empty.
Could you help us ?
|
|
Sergio
|
|
![]() |
|
Sergio ![]() Senior Member ![]() ![]() Joined: 18 September 2006 Status: Offline Points: 216 |
![]() ![]() ![]() ![]() ![]() |
Try it, just paste the following code to the end of the method CMainFrame::OnCreate(...) of your Draw Client sample : CXTPDockingPane* pPaneLog = m_paneManager.CreatePane( 10, CRect( 0, 0, 200, 200 ), xtpPaneDockBottom ); static CEdit edit;
edit.Create( WS_CHILD | WS_VISIBLE, CRect(0,0,1,1), this, 100 );edit.SetWindowText( _T("Text Edit Contents !") ); pPaneLog->Attach( &edit ); pPaneLog->SetTitle( _T("Hello World") ); m_paneManager.ToggleDocking( pPaneLog ); Now, launch the sample, and insert an OLE item, start editing In Place, and leave editing. You will see that the undocked pane is now empty !!!
Please help us !
|
|
Sergio
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hello,
You must call Attach in OnDockingPaneNotify method.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Sergio ![]() Senior Member ![]() ![]() Joined: 18 September 2006 Status: Offline Points: 216 |
![]() ![]() ![]() ![]() ![]() |
Hello,
This way is not really suitable for us, as not only the contents of the docking pane is destroyed, but also the docking pane itself and it is recreated using a different pointer.
The big problem is that after ending editing In Place, the layout is not restored as it was before, because all the controls have been recreated and the scrollbars, the focus, expanded tabs in tree controls, etc. are not as they were before.
Moreover we store a pointer to the docking pane in the OnCreate(...) method of the MainFrame and it is destroyed/changed by Codejock. The docking panes aren't all recreated at the same time (because the creation is made after selecting an hidden docking pane), this causing memory access violation.
Why don't you simply detach your docking panes or change parent ? Our docking panes contain logs that are continuously updated.
|
|
Sergio
|
|
![]() |
|
Sergio ![]() Senior Member ![]() ![]() Joined: 18 September 2006 Status: Offline Points: 216 |
![]() ![]() ![]() ![]() ![]() |
Hello Oleg,
Finally, we managed it differently. Now it works fine, the contents controls seems to keep their state, it's just the pointer to the docking pane that's change.
We have made a method that update all the pointers :
void C...MainFrame::UpdateDockingPanesPointers(){
m_pDockingPaneFolderTreeCtrl = m_paneManager.FindPane( IDC_FOLDERS_TREE ); m_pDockingPaneFolderContentLog = m_paneManager.FindPane( IDC_LOG ); m_pDockingPaneFolderContentFolder = m_paneManager.FindPane( IDC_FOLDER ); m_pDockingPaneFolderContentSearch = m_paneManager.FindPane( IDC_SEARCH ); m_pDockingPaneFolderContentFinancial = m_paneManager.FindPane( IDC_FINANCIAL_LOG ); } Thank you for your help, you can mark this topic as closed.
Best Regards,
|
|
Sergio
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
Don't forget that after each Load call m_pDockingPaneXXX will be not valid also.
Instead saving pointers as member, I recommend just use FindPane when you need to get pointer.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Sergio ![]() Senior Member ![]() ![]() Joined: 18 September 2006 Status: Offline Points: 216 |
![]() ![]() ![]() ![]() ![]() |
I have removed all my m_pDock.... pointers, and converted them into GetDock...() methods.
Now it's all working fine in all cases !
Thanks !
![]() Best Regards,
|
|
Sergio
|
|
![]() |
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 |