-
September 14th, 2013, 08:59 PM
#1
Frozen grid in CView of SDI splitter
I have been working with both Chris Mander's MFC grid and the Ultimate Grid.
See for details:
The Ultimate Grid Beginner's Guide By The Ultimate Toolbox, 25 Aug 2007
http://www.codeproject.com/Articles/...rid_in_a_CView
MFC Grid control 2.27 By Chris Maunder, 6 May 2010
http://www.codeproject.com/Articles/...d-control-2-27
Both of these grid controls work nicely in a SDI CView windows. But when I create a split window using CSplitterWnd and the following code in an attempt to create a split window with a CListView and and a CView using this code:
Code:
// in CMainFrame.h
// Attributes
public:
CSplitterWnd m_wndSplitter;
//..
// in CMainFrame.cpp
//..
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
CSize size(0, 0);
// create a splitter with 2 columns
if (!m_wndSplitter.CreateStatic(this, 1, 2))
{
TRACE0("Failed to CreateStaticSplitter\n");
return FALSE;
}
// add the first splitter pane - the view in column 0 row 0
if (!m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CSelector), CSize(100, 100), pContext))
{
TRACE0("Failed to create CSelector pane\n");
return FALSE;
}
// add the second splitter pane - the view in column 1 row 0
if (!m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CUltSplitView), size, pContext))
{
TRACE0("Failed to create CUltSplitView pane\n");
return FALSE;
}
m_wndSplitter.SetActivePane(0, 0);
m_wndSplitter.EnableWindow(FALSE);
return TRUE;
}// OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
the grid in the CView window appears but is frozen in both instances.
I suspect there is some notification necessary to for the grid to send and receive messages from the split CView window, but I cannot figure out how to implement this notification.
Unfortunately, even a demo application would be too large to append, but for anyone that is interested, the split method is encapsulated in the code I've presented here and the implementation of both grid controls is well explained in the links provided.
Any help or suggestions would be greatly appreciated.
mpliam
-
September 15th, 2013, 05:23 AM
#2
Re: Frozen grid in CView of SDI splitter
Did you try to ask the authors of these class about the possible problems in MDI applications?
Victor Nijegorodov
-
September 15th, 2013, 07:35 PM
#3
Re: Frozen grid in CView of SDI splitter
Yes, I have posted the problem on both sites - thanks for suggesting that. I believe this is something of a general question relating to CView s in CWndSplitter split windows. There must be some notification code that I'm missing since the problem occurs only in the split CView window and not in the SDI CView.
mpliam
-
September 16th, 2013, 02:55 AM
#4
Re: Frozen grid in CView of SDI splitter
Well, I never had any problems with CView derived classes in splitters. Neither in SDI nor in MDI. Althouh I never used any type of grid views.
If you create a standard MDI of "Windows Explorer" type (splittered tree and list view) - will this problem with the freezing persist?
Victor Nijegorodov
-
September 16th, 2013, 03:03 AM
#5
Re: Frozen grid in CView of SDI splitter
Originally Posted by Mike Pliam
Yes, I have posted the problem on both sites - thanks for suggesting that. I believe this is something of a general question relating to CView s in CWndSplitter split windows. There must be some notification code that I'm missing since the problem occurs only in the split CView window and not in the SDI CView.
There's nothing about missing a notification code. This is the reason of your trouble:
Code:
m_wndSplitter.EnableWindow(FALSE);
I don't know what made you do that, but this is exactly where you're wrong.
Best regards,
Igor
-
September 16th, 2013, 03:08 AM
#6
Re: Frozen grid in CView of SDI splitter
Originally Posted by Igor Vartanov
There's nothing about missing a notification code. This is the reason of your trouble:
Code:
m_wndSplitter.EnableWindow(FALSE);
I don't know what made you do that, but this is exactly where you're wrong.
Good catch, Igor!
LOL! How could I misslook this line? Because of the presense of the vertical scrollbar?
Victor Nijegorodov
-
September 16th, 2013, 12:05 PM
#7
Re: Frozen grid in CView of SDI splitter
Of course. How stupid of me. Thank you.
mpliam
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|