1 Attachment(s)
multiple views and textbox on one screen
Hello
I want suggestion from you in order to design multiple view application which will in one screen only. I am attaching image along with this query.
View1 is tha main view. Most of the drawing will be done in this view.
Textbox will be used to enter text commands like in Autocad.
As the text command is entered in textbox and Enter button is pressed, the text command content must go to second view and to be displayed as list.
Both first and second view should have scroll bar.
And content of both view should be printable.
HOW to do this? Shall i keep textbox in this scheme or just to use two views only. And if either of one then how to do that?
Sandeep
Re: multiple views and textbox on one screen
Any suggestions for this?
I just want like AutoCad interface.
APart from this I am not sure that how to take input in view as it is done in AutoCAD in bottom scroll pane.
AIm is to get input from user in textbox and add entry to view1 and also to send message to View2, so that view of 1 can be changed( i.e. some thing can be drawn in View1 and message added to View2)
At any moment if one want to print content of view1 and view2 than that also can be made possible.
Just give me idea how should i proceed.
Thanking You in advance
Re: multiple views and textbox on one screen
Re: multiple views and textbox on one screen
I think your basic aim is for an application with splitter view. you can get sample codes on spliter view from this site it slef
try this link http://www.codeguru.com/Cpp/W-D/doc_view/
Re: multiple views and textbox on one screen
Hello,
Depending on your requirement, this can be done in either of the two methods.
If you want the graphic and command list window static and is not sizable: Create an normal application and create CFirstWnd (derived from CStatic), CSecondWnd (derived from CListCtrl) and CThirdWnd (derived from CEdit) objects in OnCreate function (of WM_CREATE message) of current view. Remember to size the three windows in OnSize function (of WM_SIZE message) of the view so that they fully occupy the entire client area of view.
If you want the windows as sizable, it is better to create splitter windows as suggested by Vinod. Create the first view of the splitter as of type CView, second of type CListView and third of type CEditView. You may have to set the styles to suit your finer requirements.
Hope this helps.
Regards.
Pravin.
04-07-2005.
Re: multiple views and textbox on one screen
How to assign seperate views to different splitted portions?
Thanks Vinod and Praveen for your reply. Well I am now able to get three seperate views on my SDI, so the first part of job is done.
I want three views in three panes:
1.0 CMyView
2.0 CListView
3.0 CEditView
Well CMyView and CEditView works fine in RUNTIME_CLASS, but when i try to use CListView or CTreeView then there comes problem.
What can be the problem? And how to solve it.
Code:
// The views for each pane must be created
if ( !m_mainSplitter.CreateView( 0, 0, RUNTIME_CLASS(CSplitterView),
CSize(cr.Width(), (cr.Height()*3)/4), pContext ) )
{
MessageBox( "Error setting up splitter view", "ERROR", MB_OK | MB_ICONERROR );
return FALSE;
}
if ( !m_mainSplitter.CreateView( 1, 0, RUNTIME_CLASS(CListView),
CSize(cr.Width(), cr.Height()/5), pContext ) )
{
MessageBox( "Error setting up splitter view", "ERROR", MB_OK | MB_ICONERROR );
return FALSE;
}
if ( !m_mainSplitter.CreateView( 2, 0, RUNTIME_CLASS(CEditView),
CSize(cr.Width(), cr.Height()/20), pContext ) )
{
MessageBox( "Error setting up splitter view", "ERROR", MB_OK | MB_ICONERROR );
return FALSE;
}
However if i replace CListView with CEditView then there is no problem
I am using Visual Studio.NET 2003
Error while using CListView or CTreeView is that it mentions
CListView is not a class or namespace
If I use CEditView then how can i restrict just to take one line input like in textbox.
Well my sole purpose is to get data entry from CEditView. Is it possible to use CListView to get Data Entry,, just as in AUTO- CAD
Then there will be no need of CEditView and only CMyView and CListView will work...
WHat to do? :confused:
Sandeep
Re: multiple views and textbox on one screen
How to do this? Any Suggestions
Re: multiple views and textbox on one screen
Sorry. I forgot to mention that you have to include the header file afxcview.h when you use CListView and CTreeView as one of your panes.
Rate this post if my suggestion is helpful.
Pravin.
09:30 / 11-07-2005.
Re: multiple views and textbox on one screen
Thanks Praveen
Your suggestion worked. I am rating....