Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Docking Frames, FormViews, Initialization Sequence
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Docking Frames, FormViews, Initialization Sequence

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


Joined: 26 June 2007
Status: Offline
Points: 253
Post Options Post Options   Thanks (0) Thanks(0)   Quote MacW Quote  Post ReplyReply Direct Link To This Post Topic: Docking Frames, FormViews, Initialization Sequence
    Posted: 02 July 2007 at 10:55am
Hi,

I have a docking pane which contains an embedded FormView. The form view depends on OnIntitialUpdate being called once, and only once.

Normally, the MFC calls OnInitalUpdate when InitialUpdateFrame of the frame window is called. When my app runs for the first time, or the state of the docking pane is visible at that time, this works fine.

But when the user closes the pane, and then exists the application, the docking pane framework stores the pane as hidden. And will restore it that way later, delaying the OnDockingPaneNotify until the user makes the pane visible.

When the user now opens the application with the pane hidden, the form view will not be created at first. Hence the OnInitialUpdate message sent by the main frame during its creation will not reach the form view.

And when the user later makes the pane visible, the form view will be created but OnInitialUpdate will not be called.

Is there a standard way to handle this in XTP?
I could create the form view always in OnCreate in the main frame, and later just attach it to the pane.  Or I could introduce some flags to keep track of all this.

But it seems that this is a standard situation (window creation delayed by the docking framework) so there is perhaps something I'm missing.

I've checked the XTP documentation but it does not contain information about anything that's going on in the framework, just the developer's code comments which of course does not contain any conceptual or global overview info.

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: 03 July 2007 at 1:45am
Hello,
 
Actually CXTPDockingPane have to send this message manually if window was created later. Can you please set breakpoint in CXTPDockingPane::Attach method and check that
pWnd->SendMessageToDescendants(WM_INITIALUPDATE, 0, 0, TRUE, TRUE);
line was executed.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
MacW View Drop Down
Senior Member
Senior Member


Joined: 26 June 2007
Status: Offline
Points: 253
Post Options Post Options   Thanks (0) Thanks(0)   Quote MacW Quote  Post ReplyReply Direct Link To This Post Posted: 03 July 2007 at 2:29pm
Hi,

yes this code is executed. But Attach is called with a pointer to the window to attach (in my case, the form view instance):


CSomeForm* psomeform;

case IDR_PANE_SOMETHING: {
    CSomeForm pform = new CSomeForm();
    -..
}
pPane->Attach(psomeform);


and inside CXTPDockingPane::Attach (pWnd), with pWnd = the new form view to attach:


pWnd->SendMessageToDescendants(WM_INITIALUPDATE, 0, 0, TRUE, TRUE);


This will send messages only to the descendant windows of the form view, but not the formview itself as it seems?!

When I do a pWnd->SendMessage(WM_INITIALUPDATE, 0, 0) in addition to the SendMessageToDescendants already in place, the OnInitialUpdate of the form is called too.



Back to Top
MacW View Drop Down
Senior Member
Senior Member


Joined: 26 June 2007
Status: Offline
Points: 253
Post Options Post Options   Thanks (0) Thanks(0)   Quote MacW Quote  Post ReplyReply Direct Link To This Post Posted: 03 July 2007 at 2:30pm
CSomeForm pform = new CSomeForm();
must read

psomeform = new CSomeForm();


of course.
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: 03 July 2007 at 3:37pm
:(
 
You right.... thanks  we will fix it.
actually for CView derived classes I'd recommend you use AttachView method - it will create both CView and CFrameWnd.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
MacW View Drop Down
Senior Member
Senior Member


Joined: 26 June 2007
Status: Offline
Points: 253
Post Options Post Options   Thanks (0) Thanks(0)   Quote MacW Quote  Post ReplyReply Direct Link To This Post Posted: 04 July 2007 at 10:39am
Thanks, I'll check that method.
And looking forward to the bug fix. I can then remove my work-around again.

Some comments from my viewpoint as a XTP rookie:

I know that this has been mentioned here a lot, but your documentation really lacks information about how your classes relate, how to use them, what fits where, and just how to get something done. I know you know most of the classes and how they relate, but for starters like me, this is a jungle.

For example, the programmer who has written the documentation for the Attach method "Call this member to associate the pane with a user window." was for sure aware of the AttachView method. He should have added something like "If you want to attach a view, please use the AttachView method instead".

I did not consider the fact that there may be perhaps another attach method which would be better suited for views. How should I know?

Your toolkit is good and extensive, but with a useful documentation, it would be outstanding.

And much "cheaper", considering the TCO.  Searching samples instead of just looking up the how-to in the documentation is really expensive.

I would really like to see more documentation like in the User's Guide. Much more. Tons.

As far as I can tell, the tutorials have not changed in over a year. And the latest article / tutorial on your web site is from May 2006. Which is pretty old for such a fast expanding toolkit.

Yet, still, XTP is a very good toolkit, and works really well. If you just could find the time and funding to hire a tech writer to spend some time with the documentation, tutorials, how-to articles and related stuff. That would be great

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.064 seconds.