![]() |
Button caption word wraps |
Post Reply ![]() |
Author | |
lheier ![]() Newbie ![]() Joined: 09 January 2007 Location: United States Status: Offline Points: 7 |
![]() ![]() ![]() ![]() ![]() 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.
|
|
![]() |
|
akur ![]() Senior Member ![]() Joined: 16 May 2006 Status: Offline Points: 139 |
![]() ![]() ![]() ![]() ![]() |
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. |
|
![]() |
|
akur ![]() Senior Member ![]() Joined: 16 May 2006 Status: Offline Points: 139 |
![]() ![]() ![]() ![]() ![]() |
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! |
|
![]() |
|
lheier ![]() Newbie ![]() Joined: 09 January 2007 Location: United States Status: Offline Points: 7 |
![]() ![]() ![]() ![]() ![]() |
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."
|
|
![]() |
|
akur ![]() Senior Member ![]() Joined: 16 May 2006 Status: Offline Points: 139 |
![]() ![]() ![]() ![]() ![]() |
Thank you for the information. Maybe I can also make use of such a flag when it will be added in the future.
|
|
![]() |
|
lheier ![]() Newbie ![]() Joined: 09 January 2007 Location: United States Status: Offline Points: 7 |
![]() ![]() ![]() ![]() ![]() |
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*.
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |