Solved

Unique titles for views

Posted on 1998-06-19
3
237 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 2

Accepted Solution

by:
Belgarat earned 100 total points
ID: 1318214
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
ID: 1318215
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
ID: 1318216
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

717 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