Solved

Unique titles for views

Posted on 1998-06-19
3
180 Views
Last Modified: 2013-11-20
I have several views open on the same document. MFC labels them document:1, document:2 and so on, and changing the document title changes the title of every view. I would like to use a unique title for each view. How can I do that?
0
Comment
Question by:viskju1
3 Comments
 
LVL 2

Accepted Solution

by:
Belgarat earned 100 total points
Comment Utility
Override virtual member function `void OnUpdateFrameTitle(BOOL bAddToTitle)' defined in CFrameWnd.
The function is called when another frame for the document is opened.
The default implementation generates a text from m_strTitle member, document's name and window's number (in nonvirtual function UpdateFrameTitleForDocument).
You can override the default so that you will not call the inherited function and supply title entirely on your own.
If you're happy with the tittle the frame window get in call to the Create() member function, exclude FWS_ADDTOTITLE flag from the frame window's style - this prevents combining the frame title with the document name.
0
 

Expert Comment

by:YKunisky
Comment Utility
I 'd have the same problem.

Try to use  CDocument::SetTytle() in every View.


void CYourView::OnInitialUpdate()
{
      CView::OnInitialUpdate();
      
      .........
      GetDocument()->SetTitle("Your name");
                .....
}

0
 

Author Comment

by:viskju1
Comment Utility
Got it, thank you very much! (Actually I had to override OnUpdateFrameTitle in CMDIChildWnd.)

(- I have tried GetDocument()->SetTitle("Your name") earlier too, but it seems to change the title in all views at once.)
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Need to retreive data from .TFS file exported by DVR 8 166
FizzBuzz challenge 9 71
changeXy challenge 13 56
Sed question 2 45
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now