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   |
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 . 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
|
|
|
Goto Forum:
Current Time: Fri Jul 18 16:26:58 CEST 2025
Total time taken to generate the page: 0.03691 seconds
|