Professional UI Solutions
Site Map   /  Register


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 text in CExtButton Collapse All
Subject Author Date
R Toellner Oct 25, 2006 - 2:58 AM


I’m using Prof-UIS 2.54 and I want to display a PNG on a CExtButton and have some text centered below the image.
I loaded the Image with:

CExtSkinBitmap bitmap;
const CString strFile = "browser.png";

if ( bitmap.LoadPNG_File( strFile, false, false) )
CExtCmdIcon icon;
icon.m_bmpNormal = bitmap;
this->m_BtnExt.m_icon = icon;

In the resource editor, the text alignment of the button is set to center bottom. When my app starts, Prof-UIS initially sets the alignment to center top. When I load the PNG the text if aligned right to the image on the top side. I tried to re-align the text with

m_BtnExt.SetAlign(CExtPaintManager::__ALIGN_HORIZ_CENTER |
CExtPaintManager::__ALIGN_VERT_BOTTOM );    

but this doesn’t seem to have any effect.

Technical Support Mar 4, 2009 - 12:51 PM

The CExtRibbonBar and CExtRibbonPage controls are very extended versions of the CExtToolControlBar control. All these controls are using the CExtBarButton-based objects as implementation of their buttons. But the ribbon controls are very special. Their buttons support variable size during layout alignments inside the ribbon button groups. That is why toolbar buttons inside ribbon control use absolutely special layout measuring code and painting code. You need to code your own ribbon node and ribbon button classes for your task. Here is we discussed this task:

Technical Support Jun 21, 2007 - 10:52 AM

We implemented this feature a couple of days ago. So you can wait until the next minor release or, if you have a subscription, download the updated source code via ftp.

Bart Kampers Mar 4, 2009 - 8:28 AM

I use version 2.84. I implemented a button like described above but the text alwasy sits right to the icon. Even if I use __ALIGN_HORIZ_LEFT.

Technical Support Oct 26, 2006 - 6:01 AM

Thank you for reporting the bug. We are working on the fix and will notify you as soon as we fix problem.