Solved

Updating the Controls of a Toolbar with Document Data

Posted on 2004-04-29
5
200 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

746 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