• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 210
  • Last Modified:

Updating the Controls of a Toolbar with Document Data

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
RG_Basser
Asked:
RG_Basser
2 Solutions
 
migelCommented:
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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now