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 » Problem displaying labels under ubuntu 7.10
Re: Problem displaying labels under ubuntu 7.10 [message #15180 is a reply to message #15178] Mon, 07 April 2008 19:24 Go to previous messageGo to previous message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
I believe the problem is probably linked to the changes suggested here but I'm not sure why it would only affect Ubuntu.

I think the problem might be the change to TreeCtrl::Item::GetValueSize. Unfortunately I can't test this on Ubuntu at the mo, but if you want a quick fix I can suggest 2 changes that might fix it:
Size   TreeCtrl::Item::GetValueSize() const
{
	return display ? display->GetStdSize(value) : StdDisplay().GetStdSize(value);
}

Size   TreeCtrl::Item::GetCtrlSize() const
{
	return IsNull(size) ? (ctrl ? ctrl->GetStdSize() : Size(0, 0)) : size;
}

Size   TreeCtrl::Item::GetSize() const
{
	Size sz = GetValueSize();
	Size csz = GetCtrlSize();
	sz += Size(2 * margin, 2 * margin);
	Size isz = image.GetSize();
	sz.cx += isz.cx;
	sz.cy = max(sz.cy, isz.cy);
	sz.cx += csz.cx;
	sz.cy = max(sz.cy, csz.cy);
	return sz;
}

and then in TreeCtrl::Paint you need to add:
			if(m.ctrl)
				x += m.GetCtrlSize().cx;

after the 'dword st;' line (near the end).

The problem with TreeCtrl is that everyone seems to find new and interesting ways of breaking it and the fixes always break something else Smile. So I can't guarantee that these changes will work for everyone but it works for both reference examples, your example and the one from the thread linked above.

James

[Updated on: Wed, 09 April 2008 09:57]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: problem in Refreshing at end of tree
Next Topic: Cursor doesn't refresh
Goto Forum:
  


Current Time: Mon Jun 17 05:39:38 CEST 2024

Total time taken to generate the page: 0.02303 seconds