Solved

Want to make C++ workspace window

Posted on 2002-03-21
4
328 Views
Last Modified: 2013-11-20
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
{
     DECLARE_DYNCREATE(CChildFrame)
public:
     CChildFrame();

// Attributes
public:
     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))
     {
          m_wndSplitter.DestroyWindow();
          return -1;
     }

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


}

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!
0
Comment
Question by:ericcnc
  • 2
4 Comments
 
LVL 49

Expert Comment

by:DanRollins
ID: 6888158
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:

  http://www.codeguru.com/propertysheet/index.shtml

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

0
 

Author Comment

by:ericcnc
ID: 6890073
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.  
0
 

Accepted Solution

by:
AndyReed earned 100 total points
ID: 6896589
Take a look at the following article. It has some very good source code to download and use.
http://www.thecodeproject.com/docking/sizecbar.asp

Andy.
0
 

Author Comment

by:ericcnc
ID: 6897807
Good reference
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now