CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9
  1. #1
    Join Date
    May 2003
    Location
    Jodhpur -> Rajasthan -> INDIA
    Posts
    453

    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
    Attached Images Attached Images  
    Last edited by d0153030; July 2nd, 2005 at 10:01 PM. Reason: addition of image
    Leave Your Mark Wherever You Go
    http://www.danasoft.com/sig/d0153030Sig.jpg

  2. #2
    Join Date
    May 2003
    Location
    Jodhpur -> Rajasthan -> INDIA
    Posts
    453

    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
    Leave Your Mark Wherever You Go
    http://www.danasoft.com/sig/d0153030Sig.jpg

  3. #3
    Join Date
    May 2003
    Location
    Jodhpur -> Rajasthan -> INDIA
    Posts
    453

    Re: multiple views and textbox on one screen

    Any suggestions??
    Leave Your Mark Wherever You Go
    http://www.danasoft.com/sig/d0153030Sig.jpg

  4. #4
    Join Date
    Nov 2001
    Location
    Kerala,India
    Posts
    650

    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/

  5. #5
    Join Date
    Feb 2000
    Location
    Indore, India
    Posts
    1,046

    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.

  6. #6
    Join Date
    May 2003
    Location
    Jodhpur -> Rajasthan -> INDIA
    Posts
    453

    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?

    Sandeep
    Last edited by d0153030; July 9th, 2005 at 06:57 PM.
    Leave Your Mark Wherever You Go
    http://www.danasoft.com/sig/d0153030Sig.jpg

  7. #7
    Join Date
    May 2003
    Location
    Jodhpur -> Rajasthan -> INDIA
    Posts
    453

    Re: multiple views and textbox on one screen

    How to do this? Any Suggestions

  8. #8
    Join Date
    Feb 2000
    Location
    Indore, India
    Posts
    1,046

    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.

  9. #9
    Join Date
    May 2003
    Location
    Jodhpur -> Rajasthan -> INDIA
    Posts
    453

    Re: multiple views and textbox on one screen

    Thanks Praveen

    Your suggestion worked. I am rating....
    Leave Your Mark Wherever You Go
    http://www.danasoft.com/sig/d0153030Sig.jpg

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured