• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 362
  • Last Modified:

Want to make C++ workspace window

I am a engine type person in software development, I've done virtually nothing with creating interface stuff, other then buttons, dialogs, and such.  

What I like to do is to create the c++ workspace window with all the exact charateristics. i.e. (tabs,treeview, and such) again EXACTLY like the workspace window in C++.  The only thing that I will change is:

1.) instead of Classview I will put input, and for File view I will put output and change the respective icons on the tabs (I only need two tabs currently, may add one later), it will behave just like in Viusual C++ when you turn it on or off.

I have a window that was created and I fixed.  It has a splitter in it.  So now, what I need is to create this new workspace window and then have the system adjust both windows (I think its that RecalLayout funtion)

if you open viusal c then just have the workspace button pressed with a c++ file up in the editor, that is what I want except in my case, the c++ file will have a splitter through it)

OK currently I have a class called CChildFrame (below)

// class forwards.
class CInputView;
class COutputView;

class CChildFrame : public CMDIChildWnd

// Attributes
     CCNCDoc                    *m_pDoc;
     CTreeView                m_wndWorkspace;//this was a guess
     CInputView                    *m_pInputView;
     COutputView                    *m_pOutputView;
     CImageList                    m_TabImages;
//     CTr                         *pWnd;

     // Splitter stuff
     CSplitterWnd          m_wndSplitter;
     CFrameWnd                    *m_pDrawingFrame;
     CFrameWnd                    *m_pDetailsFrame;
     BOOL                         m_bDetails;

I assume I will create the new window in the function below:

int CChildFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
 (* assume you create the workspace window here*?????????)

Here is where the splitter window gets created (and works fine):

BOOL CChildFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
     // Create the splitter window with two rows
     if (!m_wndSplitter.CreateStatic(this, 2, 1))
          TRACE0("Failed to create splitter window\n");
          return FALSE;

     // Top splitter window
     if (!m_wndSplitter.CreateView(0,0,RUNTIME_CLASS(CCNCNestView),
          CSize(0, 250), pContext))
          return -1;

     // Bottom splitter window
     if (!m_wndSplitter.CreateView(1,0,RUNTIME_CLASS(CJobSettingsView),
          CSize(0, 0), pContext))
          return -1;
// Set pointers to the two splitter pane frame windows
     m_pDrawingFrame = (CFrameWnd*)  m_wndSplitter.GetPane(0,0);
     m_pDetailsFrame = (CFrameWnd*)m_wndSplitter.GetPane(1,0);


I have two classses ready that are called:
CInputView and COutputView

This is about where I'm at.....

wheels spinning and nowhere to go.  ready to learn!
  • 2
1 Solution
I think that VC++'s workspace window is a floating toolbar. I doubt if it uses formal views (CView-derived objects).  If I were to try to emulate it, I'd set up a CPropertySheet-derived window inside of a toolbar.  There would be some interesting challenges, including the need to resize the controls.

If all you want is a splitter with a pair of tabs on the left side, then there are several Property sheet techniques discussed here:


that might do the trick.  You can make the tabs appear on the bottom by setting the TCS_BOTTOM style in the associated Tab Control. See CPropertySheet::GetTabControl()

-- Dan

ericcncAuthor Commented:
not quite what I want

They look good but i want to have it dock to either left or right side.  I was thinking about it and I need a toolbar type window with property sheets and tree control in the property sheets. kind of a all in one thing....

I was researching and so far I came up with this:

I need to derive something from this class CControlBar
CMyClass : public CControlBar (that gets me my docking) then I need to figure out how to create a view or toolbar or whatever the hell that thing is and ensure that the above works, which I have no experience in except for stab in the dark methodology........

The points issue is not a problem, just my lack of understanding what to do, seeing that I'm not that familar with creating stuff and then figuring which classes give me what I want.  
Take a look at the following article. It has some very good source code to download and use.

ericcncAuthor Commented:
Good reference
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now