wxStaticText 能否实现一行一行的滚动?

这是wxWidgets论坛的中文版本。在这里,您可以用您的母语汉语讨论上面任一子论坛所涉及的所有关于wxWidgets的话题。欢迎大家参与到对有价值的帖子的中英互译工作中来!
Post Reply
zshxiong
In need of some credit
In need of some credit
Posts: 7
Joined: Wed Oct 22, 2008 1:43 pm

wxStaticText 能否实现一行一行的滚动?

Post by zshxiong » Mon Dec 15, 2008 12:27 pm

如题,求高手解答,不胜感激!本人初学,很多不明白。

Utensil
Moderator
Moderator
Posts: 423
Joined: Sun Feb 03, 2008 11:38 am
Location: China

Post by Utensil » Tue Dec 16, 2008 5:21 am

需要有滚动条吗?那么建议你还是使用只读的wxTextCtrl。

如果还是想用wxStaticText,而且想要动画滚动或者是响应鼠标滚轮事件的滚动,可以自己编写相应的处理函数。

-Utensil
In fascination of creating worlds by words, and in pursuit of words behind the world.

On Github: http://utensil.github.com
Technical Blog in Chinese: http://utensil.iteye.com/

kingkamg
I live to help wx-kind
I live to help wx-kind
Posts: 187
Joined: Tue Apr 08, 2008 1:45 pm

Post by kingkamg » Wed Dec 17, 2008 6:08 am

可以,自己继承,重载就是啦 :D wxStaticText继承于wxWindow,而wxWindow本身就支持滚动功能,所以看下wxStaticText的实现代码啦,当然你也可以直接继承wxScrolledWindow,写一个类似wxStaticText的控件啦,也不是很难啦

Post Reply