?
Solved

Updating the Controls of a Toolbar with Document Data

Posted on 2004-04-29
5
Medium Priority
?
207 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
[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
5 Comments
 
LVL 12

Accepted Solution

by:
migel earned 1000 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 1000 total points
ID: 10957847
0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

777 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