Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. doc/view app with treeview on the left, how?

doc/view app with treeview on the left, how?

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorialquestion
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    lordgreg
    wrote on last edited by
    #1

    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?

    P A 2 Replies Last reply
    0
    • L lordgreg

      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?

      P Offline
      P Offline
      Prakash Nadar
      wrote on last edited by
      #2

      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++"

      A 1 Reply Last reply
      0
      • P Prakash Nadar

        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++"

        A Offline
        A Offline
        axid3j1al
        wrote on last edited by
        #3

        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

        P 1 Reply Last reply
        0
        • A axid3j1al

          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

          P Offline
          P Offline
          Prakash Nadar
          wrote on last edited by
          #4

          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++"

          A 1 Reply Last reply
          0
          • P Prakash Nadar

            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++"

            A Offline
            A Offline
            axid3j1al
            wrote on last edited by
            #5

            I am missing your point.

            P 1 Reply Last reply
            0
            • A axid3j1al

              I am missing your point.

              P Offline
              P Offline
              Prakash Nadar
              wrote on last edited by
              #6

              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++"

              1 Reply Last reply
              0
              • L lordgreg

                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?

                A Offline
                A Offline
                axid3j1al
                wrote on last edited by
                #7

                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

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups