Sunday, March 28, 2010

InfoStaticTextWidget...

Hello everyone,

I have ''InfoStaticTextWidget'' in a palette contains some text,?I'd like to switch the text color to a color other than black on runtime, can someone hint me what would be the best way to do this?

Regards,

Mor

InfoStaticTextWidget...

1) I'd first try the MenuStaticTextWidget, it has an UIColorSpec.

2) If that looks weird, I'd try to AddIn such an UIColorSpec ( IID_IUICOLORSPEC, kUIColorSpecImpl ) or alternatively (IID_ICOLORDATA, kColorDataImpl) to your boss class that is based on InfoStaticText boss. Eventually the specified color is ignored, but you could be lucky and the default black is only a fallback case.

3) If all that fails, I'd look for a custom control view - e.g. any SDK example that extends on CControlView.

Ah, the SDK has CStaticTextView.h, with its protected method GetTextColor already prepared. Improves likelyhood of 2) and otherwise makes implementation of 3) trivial.

Dirk

No comments:

Post a Comment