doc/view app with treeview on the left, how?
-
i created new mfc application with multi doc/view. now, i would like to have also treeview in the main dialog. i would put it on the left of it. how to do that? any ideas?
I dont have the exact idea... what all changes are to be made, but just for a help you can construct a new doc/view project with splitter window and checkout the OnCreate event of the frame thats where the splitters are created.
MSN Messenger. prakashnadar@msn.com Tip of the day of visual C++ IDE. "We use it before you do! Visual C++ was developed using Visual C++"
-
I dont have the exact idea... what all changes are to be made, but just for a help you can construct a new doc/view project with splitter window and checkout the OnCreate event of the frame thats where the splitters are created.
MSN Messenger. prakashnadar@msn.com Tip of the day of visual C++ IDE. "We use it before you do! Visual C++ was developed using Visual C++"
Option 1 Follow the excellent instructions from "Paul R Thompson" Pauls Splitter Gear Download and copy MFC SplitterWnd Sample Option 2 Copy this. [1] Create new project (sdi) Add this to MainFrm.h CSplitterWnd split; BOOL m_bInitSplit; Initialise m_bInitSplit to FALSE in MainFrm.h constructor. Override OnCreateClient in CMainFrame (alt+enter in VC 6.0 mode or ctrl-alt-x-click in BS .NET mode) Add this CRect cr; GetClientRect( &cr); if ( !split.CreateStatic( this,1,2) ) { MessageBox( "Error setting up splitter frames!", "Init Error!", MB_OK | MB_ICONERROR ); return FALSE; } /* Note CTreeStuff is not defined yet. See later */ if ( !split.CreateView( 0, 0, RUNTIME_CLASS(CTreeStuff), CSize(200,50), pContext ) ) { MessageBox( "Error setting up splitter frames!", "Init Error!", MB_OK | MB_ICONERROR ); return FALSE; } /* you will have to change this to your RUNTIME_CLAS CView derived class */ if ( !split.CreateView( 0, 1, RUNTIME_CLASS(CtmpView), CSize(cr.Width(),cr.Height()), pContext ) ) { MessageBox( "Error setting up splitter frames!", "Init Error!", MB_OK | MB_ICONERROR ); return FALSE; } m_bInitSplit = TRUE; ensure that you replace return CFrameWnd::OnCreateClient(lpcs, pContext); with this return TRUE; Add a MFC class CTreeStuff deriving from CFormView Drag a CTreeCtrl and plonk it your form view. Add stuff to your tree control. Regards, axe
-
Option 1 Follow the excellent instructions from "Paul R Thompson" Pauls Splitter Gear Download and copy MFC SplitterWnd Sample Option 2 Copy this. [1] Create new project (sdi) Add this to MainFrm.h CSplitterWnd split; BOOL m_bInitSplit; Initialise m_bInitSplit to FALSE in MainFrm.h constructor. Override OnCreateClient in CMainFrame (alt+enter in VC 6.0 mode or ctrl-alt-x-click in BS .NET mode) Add this CRect cr; GetClientRect( &cr); if ( !split.CreateStatic( this,1,2) ) { MessageBox( "Error setting up splitter frames!", "Init Error!", MB_OK | MB_ICONERROR ); return FALSE; } /* Note CTreeStuff is not defined yet. See later */ if ( !split.CreateView( 0, 0, RUNTIME_CLASS(CTreeStuff), CSize(200,50), pContext ) ) { MessageBox( "Error setting up splitter frames!", "Init Error!", MB_OK | MB_ICONERROR ); return FALSE; } /* you will have to change this to your RUNTIME_CLAS CView derived class */ if ( !split.CreateView( 0, 1, RUNTIME_CLASS(CtmpView), CSize(cr.Width(),cr.Height()), pContext ) ) { MessageBox( "Error setting up splitter frames!", "Init Error!", MB_OK | MB_ICONERROR ); return FALSE; } m_bInitSplit = TRUE; ensure that you replace return CFrameWnd::OnCreateClient(lpcs, pContext); with this return TRUE; Add a MFC class CTreeStuff deriving from CFormView Drag a CTreeCtrl and plonk it your form view. Add stuff to your tree control. Regards, axe
Solution is good, but really this wont go to the inbox of the original poster. :-)
MSN Messenger. prakashnadar@msn.com Tip of the day of visual C++ IDE. "We use it before you do! Visual C++ was developed using Visual C++"
-
Solution is good, but really this wont go to the inbox of the original poster. :-)
MSN Messenger. prakashnadar@msn.com Tip of the day of visual C++ IDE. "We use it before you do! Visual C++ was developed using Visual C++"
-
lordgreg is the person who needs the help... so when you reply to me he will not be notified about the solution that you have posted. Thats what i meant to say.
MSN Messenger. prakashnadar@msn.com Tip of the day of visual C++ IDE. "We use it before you do! Visual C++ was developed using Visual C++"
-
i created new mfc application with multi doc/view. now, i would like to have also treeview in the main dialog. i would put it on the left of it. how to do that? any ideas?
Check back on code project for answer to your question. http://www.codeproject.com/script/comments/forums.asp?forumid=1647&df=100&app=50&fr=101