Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » Align image on a CWxtBarButton Collapse All
Subject Author Date
Chris Mason Feb 18, 2016 - 10:09 AM

Hi
We have recently upgraded our MFC Profuis libs from 230 to 320. On the whole quite pain free given the
time scale between our upgrades.

We have a control bar derived from CExtControlBar. On that bar there are some buttons derived from CExtBarButton
that each display its own image.

In the Prouis230 version the images display centrally as intended. In Profuis320, our upgraded libs, the images
are all left aligned.

Is there an additional call or constructor param I need to set to get it to center the image?

Help?

Please advise,

DFB.

Chris Mason Feb 23, 2016 - 6:48 AM

For anyone else the following resolved my issue.

Where we override PaintCompound the CExtPaintManager::PAINTPUSHBUTTONDATA _ppbd is setup.
Immediately after it’s setup add:

_ppbd.m_nIconAlignment = CExtPaintManager::__ALIGN_HORIZ_CENTER | CExtPaintManager::__ALIGN_VERT_TOP;

That’ll set any icons/images drawn on the objects to be alignined above any text and central.

I was initially attempting to use SetIconAlignment a member on each object but with no success.

Thanks Art.

Chris Mason Feb 18, 2016 - 10:11 AM

Whoops! Subject line should read ’Align image on a CExtBarButton’.