Print Page | Close Window

Button caption word wraps

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=6137
Printed Date: 06 October 2024 at 10:30am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Button caption word wraps
Posted By: lheier
Subject: Button caption word wraps
Date Posted: 16 January 2007 at 11:21am
Does anyone know how to stop the captions of toolbar buttons from word wrapping?  My toolbar has plenty of space.
 
 
I took the space out of the caption for Button Three just to show there is room for the entire caption. 
 
I'm using the xtpThemeRibbon theme on my CXTPCommandBars.  The buttons are all xtpControlSplitButtonPopup controls with style xtpButtonIconAndCaptionBelow.  I'm using XTP version 10.4.



Replies:
Posted By: akur
Date Posted: 19 January 2007 at 7:22am
Hi,

you can try and create your own class derived from CXTPControlButton, override its GetSize() method and make your toolbars use this special button type of yours.



Posted By: akur
Date Posted: 19 January 2007 at 7:29am
Or another possibility would be to write your own version of

CXTPPaintManager::SplitString(const CString& str, CString& strFirstRow, CString& strSecondRow);

which normally splits your toolbar button text into two rows. Your version would simply _not_ split 'str' at all. Instead, it would just copy the entire 'str' into 'strFirstRow', leaving 'strSecondRow' empty.

However, SplitString() is not virtual unfortunately, so you might need to directly change XTP's code and rebuild the library.

Good luck!


Posted By: lheier
Date Posted: 26 January 2007 at 11:08am
Thanks for your suggestions, akur.  I submitted this to Codejock as a support issue to see if there was an easier way to do this or if they would consider exposing this as a flag or property.  Here was the response I got from Oleg: "There is no another method now. We will add some flag for next major release."


Posted By: akur
Date Posted: 01 February 2007 at 1:07am
Thank you for the information. Maybe I can also make use of such a flag when it will be added in the future.


Posted By: lheier
Date Posted: 27 April 2007 at 11:01am

As Oleg promised, a flag was added in 11.1 for turning off word wrapping:

tab1->GetPaintManager()->m_bWrapCaptionBelowText = FALSE;
 
where tab1 is a CXTPControlPopup*.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net