Document/View

I have a program for viewing point cloud data and I want to add a browse 
feature that would allow the user to select multiple data files at once.  
When in this mode the program would display the list of files that the user 
could either select, or chose a scan mode that would automatically scan 
through the list and display the data.  This would be implemented as either a 
CFormView, or a CView with a floating dialog for the file list and scan 
buttons.

My question is I am debating how to best implement the doc/view (or if I 
even should).  I can see three options:

1.  If I keep it as pure doc/view, then the doc would keep the file list and 
have to control CList, or dialog and timing controls for the scan feature - 
which seems beyond the intention of a document.

2.  I could have the document obtain the file list and pass the whole thing 
on to the view and have the view control everything, including opening and 
closing the files.  But this seems to defeat the purpose of doc/view in the 
first place.

3.  Skip doc/view and just do everything in the view.  

I am heavily leaning towards the third option because the first two seem to 
use doc/view just for the sake of using it, rather than any valid reason.  
But I want to see what you think or maybe there is another option I haven't 
thought of.

Thank You,

Jim
0
Utf
3/16/2010 7:44:01 PM
vc.mfc 33608 articles. 0 followers. Follow

5 Replies
757 Views

Similar Articles

[PageSpeed] 36

One of the perennial problems of doc/view for CFormView is that the data has two
realities: the controls of the CFormView (or th thhe Tree control of  CTreeView or the
list conctrol of a CListView) or the document.  Sometimes the right way to approach this
is to treat the data as "virtual", in that if the document actually needs the data, it
calls UpdateAllViews with a nonzero lHint and potentially non-NULL pHint that allow the
view to deliver the data to the document, or have the view that understands the request
call some exposed methods of the CDocument-derived class to send it the current
information.  In addition, the "scanng' problem of directories can be incredibly slow if
you look at every file in every directory, so sometimes the technique of "lazy evaluation"
is used, and a  subdirectory is not scanned until its node in the tree is expanded,
meaning that at any given instant not even the view has "complete" information available.

More below...
On Tue, 16 Mar 2010 12:44:01 -0700, JRGlide <JRGlide@discussions.microsoft.com> wrote:

>I have a program for viewing point cloud data and I want to add a browse 
>feature that would allow the user to select multiple data files at once.  
>When in this mode the program would display the list of files that the user 
>could either select, or chose a scan mode that would automatically scan 
>through the list and display the data.  This would be implemented as either a 
>CFormView, or a CView with a floating dialog for the file list and scan 
>buttons.
>
>My question is I am debating how to best implement the doc/view (or if I 
>even should).  I can see three options:
>
>1.  If I keep it as pure doc/view, then the doc would keep the file list and 
>have to control CList, or dialog and timing controls for the scan feature - 
>which seems beyond the intention of a document.
****
Actually, this is completely consistent with the notion of the "document", it is just not
the best approach because there are two copies of reality, and informing the view is
cumbersome (UpdateAllViews is important here!)
****
>
>2.  I could have the document obtain the file list and pass the whole thing 
>on to the view and have the view control everything, including opening and 
>closing the files.  But this seems to defeat the purpose of doc/view in the 
>first place.
****
This is the "virtual data" approach I mention above.  It is an unfortunate consequence of
the fact that the controls are what the user manipulates.  But you man make it be
consistent with doc/view philosophy by having the document shout out to all the views
(UpdateAllViews) "Anyone who has information of interest to me, I want it NOW!"
*****
>
>3.  Skip doc/view and just do everything in the view.  
***
Sometimes this is the simplest approach, but it is dangerous because you can lose track of
who is supposed to be managing the data.  Closing a view can have serious negative
consequences.  I prefer, in my own code, to avoid this approach and let the document be
the (virtual) repository of the information, even if it has to ask the user interface from
time to time just what is going on here.
****
>
>I am heavily leaning towards the third option because the first two seem to 
>use doc/view just for the sake of using it, rather than any valid reason.  
>But I want to see what you think or maybe there is another option I haven't 
>thought of.
*****
THis is basically a difficult design decision, and I've found that I favor the
logical-repository approach because it has fewer long-term maintenance consequences than
the other approaches; it works well, but can be a  bit clumsy, but provides a uniform
approach to the information management, which to me justifies the extra effort in
establishing the communication protocols between the document and the views.
			joe
****
>
>Thank You,
>
>Jim
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
Joseph
3/16/2010 8:52:38 PM
Right now the viewer is an SDI program so there is only one view, so I don't 
need to be concerned about multiple views.  Also, since this is only a viewer 
the program has no need to write data out.  Although that might change in the 
future if the user ever wants to save subsets of the data.

As for the scanning process, the user selects the files from a File Open 
Dialog that alows multiple selections.  These files are then displayed in a 
CListBox, so all the files are from one directory.

The user can either select the desired file for viewing, or scan the data 
similar to the scan feature on a car radio, where it displays each file a 
fixed amount of time as defined by a slider.  The reason we are doing this is 
that it allows us to easily view a large amount of test data, or play it back 
quickly, without having to do multiple file opens.  

I present this extra information in case it has a bearing on anyone's opinion.

Thanks,
Jim
0
Utf
3/16/2010 10:13:01 PM
For an application like this one you may want to either:

1. Use MDI so you could open and view more than one document at at time. 
Even though you are not saving the document the fact that you are reading 
"data" from somewhere to view is still relevant.

2. Allow users to open multiple copies of the program as an SDI program. 
That way when they want to view more than one document they can just open a 
separate version for each.

The multiple file open idea is interesting, but unless you have a way of 
indicating which file the data comes from it may get confusing...  just my 
opinion.

Tom

"JRGlide" <JRGlide@discussions.microsoft.com> wrote in message 
news:8EDF7C79-27BF-438E-9F69-A6D6801D0059@microsoft.com...
> Right now the viewer is an SDI program so there is only one view, so I 
> don't
> need to be concerned about multiple views.  Also, since this is only a 
> viewer
> the program has no need to write data out.  Although that might change in 
> the
> future if the user ever wants to save subsets of the data.
>
> As for the scanning process, the user selects the files from a File Open
> Dialog that alows multiple selections.  These files are then displayed in 
> a
> CListBox, so all the files are from one directory.
>
> The user can either select the desired file for viewing, or scan the data
> similar to the scan feature on a car radio, where it displays each file a
> fixed amount of time as defined by a slider.  The reason we are doing this 
> is
> that it allows us to easily view a large amount of test data, or play it 
> back
> quickly, without having to do multiple file opens.
>
> I present this extra information in case it has a bearing on anyone's 
> opinion.
>
> Thanks,
> Jim 

0
Tom
3/16/2010 11:38:04 PM
Tom,

The multiple files are displayed in a list box.  If the user wants to select 
a file they just click on it.  If they use the scan mode, as the data files 
are being displayed the filename is highlighted in the list box, so the user 
always knows which file is active.


"Tom Serface" wrote:

> For an application like this one you may want to either:
> 
> 1. Use MDI so you could open and view more than one document at at time. 
> Even though you are not saving the document the fact that you are reading 
> "data" from somewhere to view is still relevant.
> 
> 2. Allow users to open multiple copies of the program as an SDI program. 
> That way when they want to view more than one document they can just open a 
> separate version for each.
> 
> The multiple file open idea is interesting, but unless you have a way of 
> indicating which file the data comes from it may get confusing...  just my 
> opinion.
> 
> Tom
> 
> "JRGlide" <JRGlide@discussions.microsoft.com> wrote in message 
> news:8EDF7C79-27BF-438E-9F69-A6D6801D0059@microsoft.com...
> > Right now the viewer is an SDI program so there is only one view, so I 
> > don't
> > need to be concerned about multiple views.  Also, since this is only a 
> > viewer
> > the program has no need to write data out.  Although that might change in 
> > the
> > future if the user ever wants to save subsets of the data.
> >
> > As for the scanning process, the user selects the files from a File Open
> > Dialog that alows multiple selections.  These files are then displayed in 
> > a
> > CListBox, so all the files are from one directory.
> >
> > The user can either select the desired file for viewing, or scan the data
> > similar to the scan feature on a car radio, where it displays each file a
> > fixed amount of time as defined by a slider.  The reason we are doing this 
> > is
> > that it allows us to easily view a large amount of test data, or play it 
> > back
> > quickly, without having to do multiple file opens.
> >
> > I present this extra information in case it has a bearing on anyone's 
> > opinion.
> >
> > Thanks,
> > Jim 
> 
> .
> 
0
Utf
3/17/2010 2:54:01 PM
Sounds great!

Tom

"JRGlide" <JRGlide@discussions.microsoft.com> wrote in message 
news:D16F190E-3F25-4969-A1F0-E5C670F76734@microsoft.com...
> Tom,
>
> The multiple files are displayed in a list box.  If the user wants to 
> select
> a file they just click on it.  If they use the scan mode, as the data 
> files
> are being displayed the filename is highlighted in the list box, so the 
> user
> always knows which file is active.
>
>
> "Tom Serface" wrote:
>
>> For an application like this one you may want to either:
>>
>> 1. Use MDI so you could open and view more than one document at at time.
>> Even though you are not saving the document the fact that you are reading
>> "data" from somewhere to view is still relevant.
>>
>> 2. Allow users to open multiple copies of the program as an SDI program.
>> That way when they want to view more than one document they can just open 
>> a
>> separate version for each.
>>
>> The multiple file open idea is interesting, but unless you have a way of
>> indicating which file the data comes from it may get confusing...  just 
>> my
>> opinion.
>>
>> Tom
>>
>> "JRGlide" <JRGlide@discussions.microsoft.com> wrote in message
>> news:8EDF7C79-27BF-438E-9F69-A6D6801D0059@microsoft.com...
>> > Right now the viewer is an SDI program so there is only one view, so I
>> > don't
>> > need to be concerned about multiple views.  Also, since this is only a
>> > viewer
>> > the program has no need to write data out.  Although that might change 
>> > in
>> > the
>> > future if the user ever wants to save subsets of the data.
>> >
>> > As for the scanning process, the user selects the files from a File 
>> > Open
>> > Dialog that alows multiple selections.  These files are then displayed 
>> > in
>> > a
>> > CListBox, so all the files are from one directory.
>> >
>> > The user can either select the desired file for viewing, or scan the 
>> > data
>> > similar to the scan feature on a car radio, where it displays each file 
>> > a
>> > fixed amount of time as defined by a slider.  The reason we are doing 
>> > this
>> > is
>> > that it allows us to easily view a large amount of test data, or play 
>> > it
>> > back
>> > quickly, without having to do multiple file opens.
>> >
>> > I present this extra information in case it has a bearing on anyone's
>> > opinion.
>> >
>> > Thanks,
>> > Jim
>>
>> .
>> 
0
Tom
3/17/2010 6:52:23 PM
Reply:

Similar Artilces:

redirect my documents
This is a multi-part message in MIME format. ------=_NextPart_000_0075_01C60228.32B5F210 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello, How can I change the folder when my user want to insert an attachment?? = I would like to use an especific folder.. can I to do this?? thks, Jane ------=_NextPart_000_0075_01C60228.32B5F210 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> &l...

Fix my worksheet view
My current worksheet only uses Rows 1-35 and columns A-H. I want to be able to grey out or make all other rows or columns disappear so that you don't see them and when you scan down, you are not suddenly on row 345. I know I've seen this on other spreadsheets but I'm not sure even where to look in excel. Thanks!! Have a look in the vba help index for SCROLLAREA or just hide the unnecessary rows/columns. -- Don Guillett Microsoft MVP Excel SalesAid Software dguillett1@austin.rr.com "Tia" <Tia@discussions.microsoft.com> wrote in message news:EA31C618-6D62-...

Retrieve document that was closed as Document 1?
I had a three page Word document still titled as Document 1 that I accidently closed before remembering I wanted to keep the first page. I had not saved the document before closing so if I select a Word document again I will get Document 1 but it will be blank. Is there any way I can retrieve this document? Frank C. If you didn't save it there's nothing to recover. -- <>>< ><<> ><<> <>>< ><<> <>>< <>><<> Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web s...

Custom Views + hidden columns does seem to work
Hi there, I was hoping you could help with some custom views. I've figured out how to create custom views just fine and have created 6 of them. What I wanted to do next was create an identifier on the spreadsheet that would tell the user which view is currently being used (for both viewing and printing). I tried adding 6 rows at the top of the spreadsheet with the name of each view in one row. I would then hide 5 rows and keep row with the view I want identified visable. Then I would save the view. This works fine if I am only hidding and unhidding rows and columns. ...

Open documents in new window
I recently uninstalled an add-in (Office Tab), and since then all instances of Word 2007 (on XP SP3) open in the same window, rather than in new windows, which is my preference. I'm pretty sure I remember having to change it to the "open in new window" for the default setting a couple of years ago when I first started using 2007, but can't seem to find out how that is done. Any help would be greatly appreciated. David uncheck the Windows in Taskbar in the View dialog under office menu under the Microsoft Office Button. Hope this helps DeanH &quo...

Is Doc/View Architecture really needed?
Hi I wanted to try some codes last night and start a default MFC app. with Doc/view support. But it gives so much compiler and run-time error because of doc/view, i forgot what i want then began to correct the code. Do you really need Doc/view or do you use doc/view architecture in your projects? Or you begin with empty project? I want to learn when it is not necessary and when it is. Have you ever faced Doc/View archtecture become painful in your recent projects? I am looking for your opinions. Thanks. If you are going to have "data" and represent it on the "screen"...

Why do I get a blank page when trying to print Avery Document 516.
I have the labels ready to go. Using Microsoft Word. When I try to print the labels, I get a blank page. I tried two printers, HP and Brother. Same thing with both. Any suggestions? Check the font formatting. Make sure that it is not hidden. -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP, originally posted via msnews.microsoft.com "bburkesj" <bburkesj@discussions.microsoft.com> wrote in message news:B881C096-C3F6-475B-B00A-F75C2DED0D73@microsoft.c...

location of view form
Where can I specify an absolute location for the view form? I have set the porerty x,y to 0,0 but it displays about 1 inch out and 1inch down instead of the upper left corner. ...

Saving an Excel document after moving additional worksheets to it
I have a 'master' spreadsheet that I would like to add additional tabs to. I'm not having any problems moving the worksheets into the document but when I try to save the file its not happening. I have tried renaming the file, saving to a pen drive but nothing seems to be working. I seem to be able to save the first worksheet but then reopening and saving additional worksheets without success. Would anyone have any idea why I am unable to save the file.....thanks ...

Changing the Zoom to open a document in 100%
When I open a particular document on my computer it automatically shows it at 100% Zoom. However, my boss has a problem showing the document on his computer at less than 100%. He would like to change it so that he does not have to adjust it at 100% every time he opens the document. Can you tell me how this could be done? Do you really want the zoom changed to 100% or do you want it so that he can see the same columns as you see? If you want to set the zoom to 100%, you can do something like this in your auto_open (or workbook_open) code: Option Explicit Sub auto_open() Dim wks ...

open the document instead of the inquiry window
When adding a PO to a service call, we click the PO number and it opens the PO inquiry screen. We need it to open the actual PO/document screen so the addresses can be modified as needed, etc. Is there a setting somewhere in GP to allow this? ...

Microsoft Documentation
Hi, I came across this http://www.microsoft.com/downloads/details.aspx?familyid=64966E88-1377-4D1A-BE86-AB77014495F4&displaylang=en#top page which is the Technical Overview of DirectAccess. Is their like a central link that one can go to and find other technical overviews of other products which maybe of interest? Thanks "biren" <biren@discussions.microsoft.com> wrote in message news:75543666-0178-4559-9D60-01E16B1E3428@microsoft.com... > Hi, > > I came across this > > http://www.microsoft.com/downloads/details.aspx?familyid=64966...

Where is documentation of VBA Chart properties and methods?
Where can I find documentation listing all of the Excel VBA Chart properties and methods? An internet site, or a good book maybe? Thanks. Never mind. I realized that the Excel VBA help file was not installed. Sorry about the dumb questions. "Hmmm..." <blahbla@blahl.com> wrote in message news:1wDRa.106421$Io.9109532@newsread2.prod.itd.earthlink.net... > Where can I find documentation listing all of the Excel VBA Chart properties > and methods? An internet site, or a good book maybe? Thanks. > > ...

Move pages from document to document?
This is a multi-part message in MIME format. ------=_NextPart_000_0397_01C7D5D9.22350CB0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, I am relatively new to this software. I can't seem to find how to move a = page from one document to another. Any help appreciated. Shmuel ------=_NextPart_000_0397_01C7D5D9.22350CB0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <MET...

how to change list view item's height?
I want to change class CListCtrl 's feature. My requirements include: 1. checkboxs support 2. itme icon support 2. item height can be update. 3. different items has different height 4. the item's subitem can display in more lines just like this O subitem1 subitem2 subitem3 ----- subitem1 iocn| subitem2 ------ subitem3 ...... Take a look at this one and see if it can at least help you get started. http://www.codeproject.com/miscctrl/ReportProject.asp Tom "tather" <tather@gmail.com> wrote in message news:1177746886.550952....

Filter Default on the Opportunities Associated View?
Does anyone know how to change the filter default on the Opportunities Associated View? Within Accounts, it defaults to "Open"... and I would like to change the default to "All". Any ideas? Don't know if you've already solved this but here's the answer: Go to "Settings" and then "Customization" and then "Customize Entities". Doubleclick the entity you want to change eg. "Opportunities" Then click "Forms and Views" on the left and click the view you want to be the default so that the row is selected. Cli...

My documents
Hello all, Vaguely I remember the is a global (windows) variable which points to the 'My Documents' path. Because users may change the default path C:\My Documents, I can not use that path to save a file from Access. Can someone help me out. Thx, Ludovic Open a command prompt, and type: set Use Environ() in your code. -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Vsn" <vsn at hotmail> wrote in message news:eqcTzkZ1HHA.5992@TK2M...

How to dsiplay Word Document inside a control in WinForms Applicat
Can I display word document in Windows Form Panel Control or any other control ? Here objective is not display word document as seperate application but show the word document inside the windows Form. Thanks, --Israr Hi, I think we can do this using OLE control(VB). Thanks, Senthil. S -- senthilkumarabi ...

Move a document from an offline printer queue to an online queue?
Running under Vista Home Premium SP2. I have three printers installed: One online that I want to use, one offline that I use only occasionally, and one at my dad's house that I use when I use my PC on his network. The online printer is the default, of course. I'm not sure how I did it, but I have a few documents that went to the wrong printer queues. Assume for the sake of argument that I can't reprint those documents. Is there a way I can transfer them from the wrong queues to the online printer? I'm smart enough not to consciously select a different prin...

Shared workbook
Hi We have a workbook consists of various worksheets that is shared and updated by all members of the department. The problem is, everytime a member other than the original author of the workbook opens it, it always open in the first worksheet at the time the file was created. It never gets to open in the current active worksheet when you open the file. Did we miss anything Any help is greatly appreciated Maria Hi Maria, <<We have a workbook consists of various worksheets that is shared and updated by all members of the department. The problem is, everytime a member other than the ...

How to change document template
How it is possible to change internal documentation template for "reports" in UML software section??? I want to add there me own template ...

scanning handwriten document into editable digital document
Just like voicve recognition software that converts voice text into editable digital document, searching for software that will do some akin, but instead of being voice data its handwritten document to be scanned into editable text document. Juan E. Jimenez itsi@prtc.net San Juan, Puerto Rico ...

Chart View
Is it possible to have several charts on one sheet and have the chart be viewed like thumbnail view (or just a smaller version of the chart) and all you have to do is click on the chart you want to open up or zoom in and it will make the chart legible. That's an interesting idea. Here's one way I just tested and like because it involves no programming. Create a chart of interest. Put it on a worksheet. Enlarge it so that it is the 'zoomed in' version. Select the cells beneath the chart. Copy. Switch to the worksheet that will serve as the index. Select Edit | ...

Adding fields in Resource Assignment View
In 2007, sp2, I added the duration field to a Resource Assignment view. Now when I go to this view, I get a IE box that tells me PWA cannot access project server. after accepting the dialog box, the view gives me no information. I tried creating a new view. It work correctly until I add the duration field. Then the same error box. If I remove the duration field from the view, it works correctly again. I'm looking at a resource that has 3 projects and several task, all show up when duration field is not in the view. Do I need to perform some addition steps to overcome this? Is...

how to send documents from document imaging to word?
I would like to scan a document into Word to use as template. I scan it into Document Imaging, run OCR and then in tools I select "send to word". it goes to Word, but the scale of the document is too big and can't be used. What settings am I missing so that document looks the same as it does in Document Imaging. ...