[ wxwindows-Bugs-1637760 ] wxTreeCtrl::GetNextVisible() assert
SourceForge.net
noreply at sourceforge.net
Sun Feb 10 07:12:50 PST 2008
Bugs item #1637760, was opened at 2007-01-17 06:22
Message generated for change (Comment added) made by sf-robot
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1637760&group_id=9863
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: wxMSW specific
Group: Must fix
>Status: Closed
Resolution: None
Priority: 5
Private: No
Submitted By: rubi13133 (rubi13133)
Assigned to: Nobody/Anonymous (nobody)
Summary: wxTreeCtrl::GetNextVisible() assert
Initial Comment:
by it's behaviour, GetNextVisible() asserts when a non-visible item is passed to it. It does its check using IsVisible that Sends TVM_GETITEMRECT to see if an item is visible before calling TreeView_GetNextVisible().
if the item is not visible it asserts.
THAT's a BUG. because: TVM_GETITEMRECT returns false when an item is even partialy visible, and TreeView_GetNextVisible() wont fail on such item.
Why is it important? because when customizing the tree GetNextVisible is important, I had to go around and use TreeView_GetNextVisible() myself, and that's not wxWidgets.
Why is the IsVisible assert so important anyway?
----------------------------------------------------------------------
>Comment By: SourceForge Robot (sf-robot)
Date: 2008-02-10 07:12
Message:
Logged In: YES
user_id=1312539
Originator: NO
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).
----------------------------------------------------------------------
Comment By: Vadim Zeitlin (vadz)
Date: 2008-01-26 15:04
Message:
Logged In: YES
user_id=71618
Originator: NO
Sorry for taking so much time to get back to this but unfortunately I'm
none the wiser after looking at your changes (BTW, it wouldn't have taken
me a year to find the time to look at them if you had provided them as
patches as explained here http://www.wxwidgets.org/technote/patches.htm
instead of a RAR file). The sample on its own doesn't show any problems
here. And I don't understand why should the changes to src/msw/treectrl.cpp
itself be applied if the current code works perfectly fine.
If you have a patch to the sample showing the problem I can test it again
but otherwise I really don't think I can do anything about the problem
which I don't see and can't understand.
----------------------------------------------------------------------
Comment By: rubi13133 (rubi13133)
Date: 2007-01-22 04:06
Message:
Logged In: YES
user_id=1325833
Originator: YES
Hi I created a test to prove my point.
I actually took treetest.cpp from the treectrl sample and modified it, so
the only thing needed for u to do is to replace treetest.cpp / treectrl.cpp
with the ones I will supply to you.
dont forget that treectrl is also found in base project, so you will need
to temporarily remove it from there and rebuild with this one.
I marked every change with @@@.
asserts where inserted in:
GET_XY_LPARAM() bug: treectrl.cpp line 2067
GetNextVisible() : treectrl.cpp line 1395
1. in order to see GetNextVisible failure, Press "Style" menu first item
"Test Last Visible Item".
you may need to try a few times because it doesn't always happen on the
first attempt.
2. in order to see the other bug, simply expand some leafs, it will
eventually show. I strengthed the assert not to show on WHEEL messages,
that are expected.
thats it
File Added: treectrl.rar
----------------------------------------------------------------------
Comment By: rubi13133 (rubi13133)
Date: 2007-01-20 09:07
Message:
Logged In: YES
user_id=1325833
Originator: YES
I am going to make some test and return with a sample..
----------------------------------------------------------------------
Comment By: Vadim Zeitlin (vadz)
Date: 2007-01-20 06:29
Message:
Logged In: YES
user_id=71618
Originator: NO
Again, I'm sorry but I simply can't reproduce this at all. If you run
unmodified treectrl sample you can see the indication of whether the
root/last item (Folder child 5) is currently visible in the second status
bar pane. Here it says "visible" even if "Folder 5" is only (very) partly
visible. Does it work differently for you?
----------------------------------------------------------------------
Comment By: rubi13133 (rubi13133)
Date: 2007-01-19 01:01
Message:
Logged In: YES
user_id=1325833
Originator: YES
Hi
To reproduce the bug, call GetNextVisible() on the last item visible (on
screen, not last item in tree) when it's partially visible. TVM_GETITEMRECT
will return false inside GetNextVisible() what will raise the wxASSERT().
It's an incorrect assert, because, if it wasn't there the
TreeView_GetNextVisible() would work.
It's a serious bug, because it renders GetNextVisible() useless and
unreliable.
As to bug #1621489 I opened and I didn't manage to report back to the last
question you asked..
You asked, which message generates the assert (assuming it's only
happening with WM_MOUSEWHEEL), well it's WM_MOUSEMOVE (0x0200), and the
line:
int x = GET_X_LPARAM(lParam),
int y = GET_Y_LPARAM(lParam);
should be replaced with
POINT point;
::GetCursorPos( &point );
::MapWindowPoints( NULL, GetHwnd(), &point, 1 );
or else, some misterious bug begin to appear :)
----------------------------------------------------------------------
Comment By: Vadim Zeitlin (vadz)
Date: 2007-01-18 14:00
Message:
Logged In: YES
user_id=71618
Originator: NO
If I understand correctly, the bug is the fact that "TVM_GETITEMRECT
returns false when an item is even partialy visible". However it's not
clear to me how can I reproduce this?
Thanks!
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1637760&group_id=9863
More information about the wx-dev
mailing list