views:

240

answers:

2

We have a touch screen, and the toolbar is too small to hit with my meaty fingers. Is there an easy way I can have an option to make the toolbar buttons bigger and easier to hit?

So far I've attempted a few things:

m_toolbar.SetSizes( CSize(64,64), CSize(50,50) );
m_toolbar.SetSizes( CSize(64,64), CSize(50,50) );
m_toolbar.GetToolBarCtrl().SetButtonWidth( 64, 64 );
m_toolbar.GetToolBarCtrl().SetButtonSize( CSize(64, 64) );

None of these approaches stretches the images as well. The buttons get larger, and are fully functional, but the images do not overlap the buttons the way they normally would. I would prefer to keep a single image list for the icons, and have the images stretched to fit.

+1  A: 

At toolbar creation time, create an empty CImageList with size 64x64 (let's call it large). Load the original image list from resources (we call it small).

Iterate over each image in small and copy/resize it to large. Then assign large to your toolbar. Somewhat cumbersome bui should work.

HTH,

Serge - appTranslator
+1  A: 

As far as I know there is no way to make images resize with the size of the buttons. MFC applications use bmp and not vectorial images.

So you will have to supply a bmp images with the disired sizes.

You can use a CImageList and SetImageList to set the images but then you will have to
initialize images there with the disired size also.

Javier De Pedro