Implement a "Workspace" document like DevStudio 
Author Message
 Implement a "Workspace" document like DevStudio

I'm trying to implement a workspace-like document as DevStudio does for
having a file list and project settings.  I've been able to do a pretty good
job of it using a project document with a view that I hide.  I do this by
only creating the document as follows:

projTemplate->OpenDocumentFile(NULL, FALSE /*don't show the view*/);

Of course, since there is no view, I had to had menu items for opening,
saving, and closing a project and call the appropriate CDocument members to
get it to do so.  I feel like I'm violating something with the Doc/View
architecture, but I haven't found a way around it.

The other problem is that a nice feedback for the user is to see the project
name in the window caption like DevStudio does for a workspace.  Since my
view is never seen, this isn't done automatically.  My first try to fix this
problem was to use SetWindowText in CMainFrame when I open a project, and
this works great, unless I open another document type (this program has a
generic text doc/view).  Then, when that document is closed, the caption as
reverted to just the application name.  I delved into MFC and found that, if
no view is active, CFrameWnd::m_strTitle is used as the caption.

So, I've found that I can assign a new name to CMainFrame::m_strTitle to get
the effect I want, but now I really feel like I'm playing with bad mojo.  Is
there a better way I can be doing this?  It would be nice to do as DevStudio
and have a format like "ProjectName ApplicationName - FileName".

Allow me to describe briefly my application so you can see the context of
what I am trying to do.  It is a MDI data acquisition program.  The intent
is that the user loads a data acquisition profile.  Stored in the profile
should be data acquisition parameters and a list of files associated with
the project.  The files in the project are shown in a docking window with a
tree control, just like DevStudio (thanks to whomever wrote CSizingBarCtrl
at CodeProject).  No view is associated with the project.  The user can open
other files by double clicking on them in the tree control and they are
opened in a CEditDoc/View for looking at.  Only one profile can be open at a
time, so in that sense, my program is a SDI app, but they must also be able
to look at multiple files (text) at once, so it must be an MDI app.

Thanks in advance for any help.

Dan Nash

Sat, 26 Mar 2005 23:23:27 GMT  
 [ 1 post ] 

 Relevant Pages 

1. DevStudio "Merging Keywords"

2. Toolbarbutton "LINK-ONLY" in DevStudio

3. question about "ClassView" in Workspace window

4. implementing "ls eli*"

5. implementing "complete" comparison

6. Implement a "var.Add(...)"?

7. implementing "trace" in c

8. Question on implementing "repeat...until keypress"?

9. Rules for "implements" in VB

10. "Implement Connection Point..." option is missing

11. implement a "kill" with signals

12. How to implement "autometic statement completion"?


Powered by phpBB® Forum Software