|
yes this could be useful to add - when I created this class (for a 16bit project ~ '95)I wasn't using CFormViews as the views in the splitters and thus I never noticed it was required - or maybe it is new to the 32 bit environment.
Stupidity dies.
The end of future offspring.
Evolution wins.
- A Darwin Awards Haiku
|
|
|
|
|
Hi,
I've got some trouble with ReplaceView, and it's hard to describe here, but i'll try.
I use 2 splitter to create 2 rows, and the first row has two columns. To create first row, i use CFrameWnd which has SplitterWnd.
But when i try to ReplaceView with this splitter (in CFrameWnd), it failed. i don't know exactly what happens, but maybe the CDocument failed (when document add view - that's is my debug).
So, what happens ???
Do i create splitter right ? ( 2 col, 1 row splitter)
Help me, please. I give up !!!
Thanks,
nvhoang
|
|
|
|
|
sorry I haven't been receving emails from this article due to a change of email address - and I forgot to update codeproject.
do you still require assistance?
Stupidity dies.
The end of future offspring.
Evolution wins.
- A Darwin Awards Haiku
|
|
|
|
|
so that CFormView can do some OnInitialUpdate job
|
|
|
|
|
It would be a lot of value to me if I could set a position past which the splitter bar cannot be moved. Seems like you need
to add a function to set the ClientRect region in which the
splitter bar can operate.
Thanks in advance for any help...
|
|
|
|
|
Do the following in your WM_MOUSEMOVE message handler of CSplitterWnd derived class.
I am assuming you have 2 panes and want to maintain minimum size for top pane. You can easily customise it to your needs.
void CMySplitterWnd::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
if( nFlags == MK_LBUTTON)
{
if (point.y <= MINHEIGHT) point.y = MINHEIGHT;
CSplitterWnd::OnMouseMove(nFlags, point);
}
else
CSplitterWnd::OnMouseMove(nFlags, point);
}
regards,
Aman
|
|
|
|
|
Thank you very much for your class!
It was very helpful to me.
|
|
|
|
|
Hi, I would like to use HS et VS Scroll bar with your Spitter windows class, but i dont know how to do it. Can you help me plz?
Tx
Seb
|
|
|
|
|
I'm very happy to know that people like u live on earth...
Tx for all.
Your tutorial was very usefull.
|
|
|
|
|
This is almost exactly like a Microsoft sample (http://support.microsoft.com/support/kb/articles/Q199/5/15.ASP) and you are missing calling the OnInitialUpdate on the newly created view.
|
|
|
|
|
|
I wrote one line at the end of function ReplaceView
pNewView->OnInitialUpdate();
Please pardon my weak English!
|
|
|
|
|
strange thing is - I have that in my code at home - which I put in for someone and I haven't posted it here as I lost my password to the account that posted this when my NT2000 upgrade from NT blew up - I also changed ISPs too - wierd
Holy Handgrenade of Antioch instructions
|
|
|
|
|
I am trying to use the SetBitmap function for a static picture control inside a dialog after it is being used as a replacement. When it gets to the line where SetBitmap is being called, I get an assertion failed error. The code works fine if the view is dialog is already viewable.
|
|
|
|
|
|
Hi!
I have just started to develop in VC++ and I would like to ask you the following:
What if I want to have on the left pane three views similteniously: a treeview, an edit view and a dialog view
Thank you
|
|
|
|
|
what you will need is 3 splitter wnds
1 for the vertical splitter and 2 for the horizontal splitters
create the Vertical splitter first
create an horizontal splitetr and place it in the right pane of the vertical splitter.
create another horizontal splitter and place it in the bottom of the vertical splitter
now create your views 1 for the vertical splitter left pane, 1 for the 1st horizontal top pane and 1 each for the 2nd vertical splitters panes
the basic MFC project with Windows Explorer style should help work out how to do thi
|
|
|
|
|
Thanks for the source of the Splitter!
I am trying to combine it in a large existing project, and I noticed that for some reason, in my project if I let your splitter call the
((CView *) GetPane(row,col))->DestroyWindow();
My whole application terminates, and if I remove this line, then I can't place a window in an already existing pane. Would there be a way to swap the windows w/o destroying them somehow?
|
|
|
|
|
Sorry for not answering sooner I wasn't notiifed that you had posted - may be I'll have to look into it - you may have to make you own implementation of ReplaceVie
|
|
|
|
|
Dynamically replacing a view in a pane (2*2 static splitter)
does not work with CTreeView's. I have (MDI Document/View) 4 View Classes and 1 Document. 1.CGrView, 2.CMy1TreeView, 3.CMy2TreeView,4.CMy3TreeView initially displayed in 4 panes. Static Splitter windows are created in ChildFrm.cpp. CUsefulSplitterWnd derived class is added with ReplaceView fn. Using this CGrView (graphics) can be displayed in any of the panes replacing the existing (tree) views. But when
any of the tree views is to be displayed in any of the other panes, the pane becomes white and nothing is displayed. Base class CTreeView is used. Please let me know by email (sunilkmt@bom8.vsnl.net.in)where I may be making a mistake.
|
|
|
|
|
Hi
I suspect you are initialising your views in OnInitialUpdate(...).
Once you have called ReplaceView(...) you then need to call the views OnInitialUpdate(...) method.
|
|
|
|