Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Button caption word wraps
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Button caption word wraps

 Post Reply Post Reply
Author
Message
lheier View Drop Down
Newbie
Newbie


Joined: 09 January 2007
Location: United States
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote lheier Quote  Post ReplyReply Direct Link To This Post Topic: Button caption word wraps
    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.
Back to Top
akur View Drop Down
Senior Member
Senior Member


Joined: 16 May 2006
Status: Offline
Points: 139
Post Options Post Options   Thanks (0) Thanks(0)   Quote akur Quote  Post ReplyReply Direct Link To This Post 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.

Back to Top
akur View Drop Down
Senior Member
Senior Member


Joined: 16 May 2006
Status: Offline
Points: 139
Post Options Post Options   Thanks (0) Thanks(0)   Quote akur Quote  Post ReplyReply Direct Link To This Post 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!
Back to Top
lheier View Drop Down
Newbie
Newbie


Joined: 09 January 2007
Location: United States
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote lheier Quote  Post ReplyReply Direct Link To This Post 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."
Back to Top
akur View Drop Down
Senior Member
Senior Member


Joined: 16 May 2006
Status: Offline
Points: 139
Post Options Post Options   Thanks (0) Thanks(0)   Quote akur Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
lheier View Drop Down
Newbie
Newbie


Joined: 09 January 2007
Location: United States
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote lheier Quote  Post ReplyReply Direct Link To This Post 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*.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.