功能区栏上的CCmdUI :: SetText() [英] CCmdUI::SetText() on a ribbon bar

查看:98
本文介绍了功能区栏上的CCmdUI :: SetText()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用CCmdUI :: SetText 在我的ON_UPDATE_COMMAND_UI  (小)MFC功能区按钮的处理程序。 (在VS2013中)
$


问题是当按钮文本变短时,为其分配的空间会减少。但是当文本变长时,空间不会增加。 而不是文本被截断。



以下是我的按钮的顺序图像(面板上的最低点)。 从"注意间距100%"开始。至83%并返回100%被截断。   有什么简单的方法可以避免这种情况吗?




David Webber莫扎特音乐记谱软件的作者http://www.mozart.co.uk

解决方案

好的我找到了一个 方法 - 在询问问题之后是不是总是那样?



我没有将文字设置为"Note spacing xxx%",而是将其设置为"Note spacing xxx%     " 添加一些空格。   我知道它总是在60%到150%之间,所以只要60%加上
空间就可以留出足够的150%的空间,那么我很好。


<但是这是一个有大写字母K的kludge。   肯定有正确的方法吗?



  


I am using CCmdUI::SetText  in my ON_UPDATE_COMMAND_UI  handler for a (small) MFC ribbon bar button. (In VS2013)

The problem is that when the button text gets shorter, the space allocated for it decreases. But when the text gets longer, the space doesn't increase.  Instead the text is truncated.

Here are sequential images of my button (the lowest on the panel).  Going from "Note spacing 100%." to 83% and back to 100% which is truncated.    Is there any simple way to avoid this?


David Webber Author of Mozart music notation software http://www.mozart.co.uk

解决方案

Ok I've found a method - isn't it always the way just after the question is asked?

Instead of setting the text to "Note spacing xxx%", I set it to "Note spacing xxx%     "  with a few appended spaces.    I know it is always going to be between 60% and 150% so as long as 60% plus spaces leaves plenty of room for 150%, then I'm OK.

But this is a kludge with a capital K.    There must surely be a proper way??

  


这篇关于功能区栏上的CCmdUI :: SetText()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆