Opened 7 years ago

Closed 18 months ago

Last modified 18 months ago

#4024 closed defect (outdated)

wxTreeCtrl with single selection, selects more then 1 item

Reported by: g00fy Owned by:
Priority: normal Milestone:
Component: wxMSW Version:
Keywords: wxTreeCtrl Cc: g00fy
Blocked By: Blocking:
Patch: no

Description

wxTreeCtrl -> just the default sample.

Please apply the attached patch.

VS 2005/1
Win2K/4
CVS

I think this is an MSW bug, because the API-calls return all success (like they should do, but they don't do it).

Now what don't they do?

The attached patch will select the rootitem when creating the tree. Upon selchange, it will expand the selected item.

This works nice for the rootitem, but if you select another item, you notice that the selection of the rootitem is not moved.

Also when you do GetSelections(), you get "2" as a result. Very weird indeed under a tree with the wxTR_MULTIPLE NOT set...

Solving this can be done with selecting the rootitem again, and selecting the other element...

Greetz,
Steven

Attachments (3)

treetest.cpp.patch download (1.1 KB) - added by g00fy 7 years ago.
treetest.cpp.test_29svn.patch download (1.1 KB) - added by catalin 18 months ago.
treetest.cpp.improvments.patch download (2.0 KB) - added by catalin 18 months ago.

Download all attachments as: .zip

Change History (8)

Changed 7 years ago by g00fy

comment:1 Changed 7 years ago by g00fy

another thing is if you do UnselectAll() followed by a select( <item> ); it will not remove any selection, but just select the new one...
Even if you add wxYield() between the calls.

Hope this helps for finding a solution :)

comment:2 Changed 6 years ago by wojdyr

  • Component set to wxMSW
  • Keywords wxTreeCtrl added

Changed 18 months ago by catalin

Changed 18 months ago by catalin

comment:3 Changed 18 months ago by catalin

The reported behaviour does not happen in 2.9svn. Neither the one in comment:1.

There are a couple of small improvements to the sample in the last patch.

comment:4 Changed 18 months ago by vadz

  • Resolution set to outdated
  • Status changed from new to closed

comment:5 Changed 18 months ago by VZ

(In [73479]) Don't show log menu tiems in the tree control sample when !wxUSE_LOG.

No real changes, just correct the "#if wxUSE_LOG" placement.

See #4024.

Note: See TracTickets for help on using tickets.