|
|
Home » U++ Library support » TreeCtrl » Bug changing text after node insertion
|
|
|
|
|
Re: Bug changing text after node insertion [message #16958 is a reply to message #16954] |
Wed, 23 July 2008 10:53   |
mrjt
Messages: 705 Registered: March 2007 Location: London
|
Contributor |
|
|
luzr wrote on Wed, 23 July 2008 09:10 |
Partial solution is to not use Option's Label (leave it empty) and put its text to Node's Value (haha, back at it again . Then clicking the option box will toggle the option, clicking the text will do selections.
|
You have to do it like this anyway, otherwise the Option obscures the highlight rect.
Quote: | I am afraid this might not be consistent with interface behaviour e.g. in case there are EditFields in the TreeCtrl...
|
To be honest I think it makes as much sense as anything else in that situation, and it will only change behaviour when using multiselect and ctrls.
The existing way, where the current selection is cleared whenever a ctrl gets focus is broken. For instance, currently the selection is cleared if focus changes to another window then back again.
Quote: |
What makes me wonder, BTW, is how the Option gets the focus?!
|
The sequence is:
LeftDown
DoClick
SetCursorLine
SetWantFocus on the ctrl
ChildGotFocus
SetCursorLine
SelectOne (obviously clears any other selected items)
Perhaps a better solution would be to stop the first CursorLine being called when using CTRL-key and multiselect, but the behaviour is definitely wrong.
|
|
|
|
|
Re: Bug changing text after node insertion [message #17006 is a reply to message #16963] |
Thu, 24 July 2008 22:44   |
cbpporter
Messages: 1427 Registered: September 2007
|
Ultimate Contributor |
|
|
cbpporter wrote on Wed, 23 July 2008 14:45 |
I'll leave it as it is for now, because there are other strange behaviors that I didn't find a reason for yet. Getting the changed checked status of a item in the OptionTree that is not checked doesn't seem to work only after it has been changed. I'll investigate these and if they'll look like a bug, I'll post about them. I hope they are just some mistake of mine.
|
False alarm, it was my fault. My old friend: initialized class members... I wish C++ would warn me about this one. Or maybe we could add it later to the new C++ parser.
cbpporter wrote on Wed, 23 July 2008 14:45 |
I'm not going back to that again .
|
Well I did and after a lot of work I pretty much got what I wanted. There are still some display issues, like strange background color and unaligned focus rect, but I can fix those. Still, this is almost the most (unnecessarily) complicated part of the whole program .
But for it to work as expected, one of the previous fixes must be reverted:
TreeCtrl::Node::Node(const Image& img, Ctrl& ctrl, int cx, int cy)
{
Init();
SetCtrl(ctrl);
image = img;
size = Null;
if(cx > 0)
size.cx = cx;
if(cy > 0)
size.cy = cy;
}
With this fix, there is that huge cap between Option (which now has no text) and text displayed by tree. If we undo it, they will be side by side again.
|
|
|
Re: Bug changing text after node insertion [message #19010 is a reply to message #17006] |
Wed, 05 November 2008 10:07   |
 |
mirek
Messages: 14257 Registered: November 2005
|
Ultimate Member |
|
|
cbpporter wrote on Thu, 24 July 2008 16:44 |
False alarm, it was my fault. My old friend: initialized class members...
|
Hehe, I always do the same mistake too.
In fact, I really would not be sorry if C++ default initialized to 0...
Quote: |
TreeCtrl::Node::Node(const Image& img, Ctrl& ctrl, int cx, int cy)
{
Init();
SetCtrl(ctrl);
image = img;
size = Null;
if(cx > 0)
size.cx = cx;
if(cy > 0)
size.cy = cy;
}
If we undo it, they will be side by side again.
|
Ehm, and what is the correct version then? 
Mirek
|
|
|
|
|
|
Goto Forum:
Current Time: Sun May 11 14:24:10 CEST 2025
Total time taken to generate the page: 0.01223 seconds
|
|
|