Home » U++ Library support » TreeCtrl » Optional highlighting of focused node's control along with value
Optional highlighting of focused node's control along with value [message #19487] |
Mon, 08 December 2008 05:17 |
Novo
Messages: 1361 Registered: December 2006
|
Ultimate Contributor |
|
|
I'd like to suggest adding another option to the TreeCtrl to allow optional highlighting of focused node's control along with value.
This is useful in situation when one wants to use RichTextCtrl with support of links as a node of TreeCtrl.
That can be useful for TreeCtrl-based widgets like OptionTree, which doesn't let you highlight selected node, I believe.
That can be done by changing one line (line 983) in TreeCtrl::Paint from
w.DrawRect(x, y, vsz.cx + 2 * m.margin, msz.cy, bg);
to
w.DrawRect(x - m.GetCtrlSize().cx, y, m.GetCtrlSize().cx + vsz.cx + 2 * m.margin, msz.cy, bg);
and adding of an appropriate flag and a set-method.
Regards,
Novo
|
|
|
Re: Optional highlighting of focused node's control along with value [message #19523 is a reply to message #19487] |
Thu, 11 December 2008 05:47 |
Novo
Messages: 1361 Registered: December 2006
|
Ultimate Contributor |
|
|
Actually, a few more lines of code should be added ...
} else if(x - m.GetCtrlSize().cx < sz.cx) {
const Display *d = GetStyle(i, fg, bg, st);
w.DrawRect(x - m.GetCtrlSize().cx, y, m.GetCtrlSize().cx + vsz.cx + 2 * m.margin, msz.cy, bg);
}
Regards,
Novo
|
|
|
|
|
Goto Forum:
Current Time: Wed Jun 05 07:00:09 CEST 2024
Total time taken to generate the page: 0.02781 seconds
|