Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to next message
Novo is currently offline  Novo
Messages: 1358
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 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1358
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
Re: Optional highlighting of focused node's control along with value [message #19575 is a reply to message #19487] Thu, 18 December 2008 11:18 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Sorry for the delay (end of year, christmas and everything... Smile

Good idea. Implemented as TreeCtrl::HighlightCtrl

Mirek
Re: Optional highlighting of focused node's control along with value [message #19585 is a reply to message #19575] Sat, 20 December 2008 19:01 Go to previous message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
luzr wrote on Thu, 18 December 2008 05:18

Sorry for the delay (end of year, christmas and everything... Smile

Good idea. Implemented as TreeCtrl::HighlightCtrl

Mirek


Thanks a lot !!!


Regards,
Novo
Previous Topic: Clear() and external controls as nodes
Next Topic: Drag & Drop , Sort, GetValue( x )
Goto Forum:
  


Current Time: Thu Apr 25 15:23:55 CEST 2024

Total time taken to generate the page: 0.03116 seconds