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
Solved

Updating the Controls of a Toolbar with Document Data

Posted on 2004-04-29
5
202 Views
Last Modified: 2013-11-20
Hello,
I've written a mdi app with three views, one of them being of CFormView() style. This View contains mainly spin Controls with attached CEdit Controls which control the behavior of the contents of the other views. And viceversa interaction with the other views can change the contents of the controls. Now I decided to move the controls of the formview into a Toolbar. The generation of the Toolbar isn't the problem (I derived a class of CToolBar and included an OnCreate() function).

But how can I update the contents of my Toolbar controls dependent on my data of the document (like UpdateAllViews() did before with my CFormView View)? And the other way? How can I perform action by pressing a spin control in my toolbar so that data of the document and all Views is updated?

Thanks for help!
0
Comment
Question by:RG_Basser
5 Comments
 
LVL 12

Accepted Solution

by:
migel earned 250 total points
ID: 10952248
Hi!
You can insert View into the toolbar and create controls in it so standard MFC document/view mechanic can work.
Or you can provide toolbar object access throug MainFrame (say CMyToolBar& CMainFrame::GetToolBar()) so your document can always access to the toolbar controls. In toolbar you can access to the active document through GetActiveDocument() CFrameWnd member function.
0
 
LVL 7

Assisted Solution

by:vijay_visana
vijay_visana earned 250 total points
ID: 10957847
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

Suggested Solutions

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

808 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