ericcnc
asked on
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
{
DECLARE_DYNCREATE(CChildFr ame)
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(LPCR EATESTRUCT lpCreateStruct)
{
(* assume you create the workspace window here*?????????)
}
Here is where the splitter window gets created (and works fine):
BOOL CChildFrame::OnCreateClien t(LPCREATE STRUCT lpcs, CCreateContext* pContext)
{
// Create the splitter window with two rows
if (!m_wndSplitter.CreateStat ic(this, 2, 1))
{
TRACE0("Failed to create splitter window\n");
return FALSE;
}
// Top splitter window
if (!m_wndSplitter.CreateView (0,0,RUNTI ME_CLASS(C CNCNestVie w),
CSize(0, 250), pContext))
{
m_wndSplitter.DestroyWindo w();
return -1;
}
// Bottom splitter window
if (!m_wndSplitter.CreateView (1,0,RUNTI ME_CLASS(C JobSetting sView),
CSize(0, 0), pContext))
{
m_wndSplitter.DestroyWindo w();
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!
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(CChildFr
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(LPCR
{
(* assume you create the workspace window here*?????????)
}
Here is where the splitter window gets created (and works fine):
BOOL CChildFrame::OnCreateClien
{
// Create the splitter window with two rows
if (!m_wndSplitter.CreateStat
{
TRACE0("Failed to create splitter window\n");
return FALSE;
}
// Top splitter window
if (!m_wndSplitter.CreateView
CSize(0, 250), pContext))
{
m_wndSplitter.DestroyWindo
return -1;
}
// Bottom splitter window
if (!m_wndSplitter.CreateView
CSize(0, 0), pContext))
{
m_wndSplitter.DestroyWindo
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.
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!
ASKER
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.
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Good reference
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::GetTabCont
-- Dan