Solved

Creating Toolbar Wrapper Class

Posted on 1997-07-29
2
555 Views
Last Modified: 2013-11-20
I was reading a great article on the MSDN cd's about the new toolbar. And I decided to
create my own wrapper class around it.

The interface to this CWnd derived class would be something like

Create
SetImageList
SetDisabledImageList
SetHotImageList
AddButton
DelButton
SetButton
.
.


First of all, the only way I succeeded in creating a toolbar with buttons, was using the
api(?):

      CreateToolbarEx

Which takes bitmap/buttons as argument - not as flexible as I would like.


So my question is this:

Having a handle to a toolbar, created with CWnd()->Create(...), is it possible to add
buttons dynamically?
How is this done? What sort of initializing should be done??? A small piece of code would be
great, but not essential...

0
Comment
Question by:mtoft
2 Comments
 
LVL 4

Accepted Solution

by:
mbhakta earned 50 total points
ID: 1302894
Why are you taking all this trouble ?

CToolBarCtrl is the MFC wrapper for the new Win32 Toolbar. It covers all the things you would need to create a toolbar. You can derive your wrapper class from the CToolBarCtrl if you want something more. In the CToolbarCtrl there is a method called AddButtons() which allows you to add buttons dynamically.
0
 
LVL 2

Author Comment

by:mtoft
ID: 1302895
Sorry about the delay...
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: 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. …
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

679 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