Print Page | Close Window

Pane Data & Layouts

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Docking Pane
Forum Description: Topics Related to Codejock Docking Pane
URL: http://forum.codejock.com/forum_posts.asp?TID=7628
Printed Date: 12 December 2024 at 2:41pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Pane Data & Layouts
Posted By: mrmathis
Subject: Pane Data & Layouts
Date Posted: 19 July 2007 at 10:40am
I am using the CXTPDockingPane::GetPaneData/SetPaneData APIs to cache a pointer on each of my panes.  I use the pointers during various operations and transitions in my app to help me get the right data in the windows attached to the panes. I recently started using CXTPDockingPaneLayout to save and restore my docking pane arrangement during some of my app's transitions.  This might be in a single session, or in subsequent invocations of my app.  I had a few surprises.

First, the panes themselves are actually destroyed and recreated when a layout is applied, with the attached child windows transferring to the new pane.  I had assumed that the panes would simply reposition.  My question is whether this will cause any undue "flashing" on the screen if, for example, a pane or three doesn't really have to move around from one layout to another?

My biggest problem, though, is that the layout stores the pane's m_dwData value to the registry under the name "Tag" and restores that value when the layout is applied.  Since that value is a pointer for me, that doesn't work out too well, especially in separate sessions.  To be clear, here is what I see:  I create some panes as my app initializes, caching my pointers to dynamically determined data.  Later I load and apply a layout, and my cached pointers are overwritten with the value stored in the layout.  The next time I attempted to de-reference the pointer, I crash.

Is there any (easy) way to avoid or override this behavior?  I would really rather not get in the middle of all the Clone and Copy calls bouncing around in this operation.

--Mike



-------------
--Mike



Replies:
Posted By: Oleg
Date Posted: 20 July 2007 at 2:52am
Hi,
Just don't use it this way.
Create some internal CMap to map id to you pointer.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: mrmathis
Date Posted: 20 July 2007 at 9:56am
Well, I did find a way to cache my data elsewhere in my app, but I would appreciate some background into why Codejock works this way.  Am I using the pane data in some way other than it is intended?  What is the intended purpose of this data?  I have used, for example, the similar item-data concept on generic Win32 tree controls items for many years as a convenient place to cache pointers.

Also, what about the flashing?  I do see all panes flash if I successively apply layouts that, say, differ only by a single window position.



-------------
--Mike



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net