History log of /haiku/src/kits/interface/OutlineListView.cpp
Revision Date Author Comments
# 621200eb 28-Jan-2024 Máximo Castañeda <antiswen@yahoo.es>

BOutlineListView: fix ItemUnderAt and accept NULL as superitem

ItemUnderAt was returning items that were not under the superitem (this
was fixed for EachItemUnder in hrev52210).
Make a NULL superitem mean the parent of the topmost items. Despite not
being explicitly documented in the BeBook, that's how BeOS works, the
MenuWorld test app uses it and, well, it's handy.

Change-Id: I2551e8ce874a6238c5e5fb1eb742e68e62d3928a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7359
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>


# dc3f8c63 01-May-2023 Freaxed <andrea.anzani@gmail.com>

BOutlineListView: fixed compression causing inconsistent selection update

When compressing an item containing a selected item, the selection is wrongly moved to the parent as the selection code is not
called. This is causing no visual change in the selected item. Morehover the next user click will always invoke the (wrongly) selected parent.

This can be easily reproduced in the FileTypes application:
* expand the application item and select an application
* compress the application item
* expand the audio item and select and audio item
* the invokation is performed on the application item and not on the selected audio item.

This fix takes into consideration both single and multiple selection mode.

Change-Id: Icf7c63e6d44f039a8bdf3bb7d343d7aed6b7ac7d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6402
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>


# 40e5560a 23-Mar-2023 Freaxed <andrea.anzani@gmail.com>

BOutlineListView: fixed expansion causing items to disappear

On a multi-level list view, when expanding an item containing other collapsed lists, the last items disappear due to a wrong element counting.

Change-Id: I2313ad8efb23e8db54cd3563687bf0c2a775a12a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6259
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Automation <automation@haiku-os.org>
Reviewed-by: Stefano Ceccherini <stefano.ceccherini@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>


# c47cb94a 03-Jun-2020 X512 <danger_mail@list.ru>

BOutlineListView: fix keyboard navigation

* On left arrow key select parent item when selected item is collapsed.
* Scroll to selected item when expanding/collapsing.

Change-Id: Ia404abb970376d4168efd8bba4d8817712a885a6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2873
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# e5d533fd 11-Sep-2019 Mikael Konradsson <mikael.konradsson@outlook.com>

OutLineListView: adjust color of expander arrow when using dark color scheme

Change-Id: I7de7a460111556b7f40565ed0a6110c1f7660a25
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1847
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# 2f3e1117 13-Jan-2018 Sean Healy <jalopeura@users.noreply.github.com>

BOutlineListView::EachItemUnder gets too many items

EachItemUnder selects items that are not in fact under the superitem
passed to the method.

ticket: #13730
Change-Id: I12a2e29204e1b9bbecd5704e60a02e3613a7f4fd
Reviewed-on: https://review.haiku-os.org/52
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# 34ac7f7a 08-Apr-2017 Adrien Destugues <pulkomandy@pulkomandy.tk>

BListView: manage horizontal scrollbar

BListView automatically sets the vertical scrollbar range already. Do
the same for the horizontal scrollbar.

Also fix BOutlineListView to compute the preferred size taking into
account the items outline levels (it needs a little more space).

This fixes the horizontal scrollbars in Locale preferences, second part
of #6747.


# 265f2996 11-Dec-2014 Adrien Destugues <pulkomandy@gmail.com>

ListView: move the color setting code to DrawItem

... so it can also be used by OutlineListView.

Fixes #11598.


# 539dc1bc 02-Dec-2014 John Scipione <jscipione@gmail.com>

A bunch of style fixes

No functional changes intended


# 42272d23 26-Nov-2014 Adrien Destugues <pulkomandy@gmail.com>

OutlineListView: yet another list/fullList mismatch.

Fixes #5817.


# 1f424632 11-Jun-2014 John Scipione <jscipione@gmail.com>

Style fixes to IK, focus on docs


# 1e1afb39 11-Dec-2013 John Scipione <jscipione@gmail.com>

Updates to BOutlineListView for docs

mostly param naming.

No functional change intended.


# a56ddb2b 02-May-2013 John Scipione <jscipione@gmail.com>

BOutlineListView: Refactor to eliminate repeat vars

The latch width, height and indent width are now all set in one
place in LatchRect() and then LatchRect() is used in multiple places.


# c19cb4dd 01-May-2013 John Scipione <jscipione@gmail.com>

Update BOutlineListView arrows to new style

...from BControlLook, and while I'm at it, use font-relative spacing dimensions.


# eee4243d 20-Oct-2011 Alex Wilson <yourpalal2@gmail.com>

De-virtualize BView::InvalidateLayout() and introduce LayoutInvalidated() hook, like BLayout.


# f3c8afe8 31-Jan-2010 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

Fix a bug in OutlineListView::ItemUnderAt that made it pick totally wrong items when some things in the list were collapsed.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35361 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e917a240 31-Jan-2010 Rene Gollent <anevilyak@gmail.com>

Fix some selection-related problems in BOutlineListView as well as
broken behavior in _RemoveItem that could potentially result in the wrong
list items being removed/deleted depending on the expanded/collapsed state
of higher items in the list.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35360 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c544ccf5 25-Oct-2009 Axel Dörfler <axeld@pinc-software.de>

* Expand(), and Collapse() aren't supposed to do the work themselves.
* Instead, they should call the protected virtual ExpandOrCollapse(), this makes
one of my apps work again under Haiku (where the list view contents are
filled on demand).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33760 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 08a35638 17-Jun-2009 Axel Dörfler <axeld@pinc-software.de>

* Added layout-friendly constructor.
* Reordered functions to match the order in the header (and vice versa).
* Removed unused private functions.
* Updated the header to follow our coding style.
* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31088 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 23079ac1 20-Apr-2009 Philippe Saint-Pierre <stpere@gmail.com>

Modified the DrawLatch routine to make the latch vertically centered.

* It's particularly notice-able with big fonts.
* I did put the latch's width and height in constants.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30284 a95241bf-73f2-0310-859d-f6bbb57e9c96


# dd0e375f 13-Apr-2009 Rene Gollent <anevilyak@gmail.com>

Fix build break I introduced in previous commit. Add some extra behavior for OutlineListView's right arrow: if the item has children and is expanded, right arrow now jumps to the first child.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30150 a95241bf-73f2-0310-859d-f6bbb57e9c96


# fcdaa0c7 11-Apr-2009 Rene Gollent <anevilyak@gmail.com>

If an item does not have an expand/collapse latch, let the left arrow jump to its parent (if any). Implements ticket #3725.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30130 a95241bf-73f2-0310-859d-f6bbb57e9c96


# cd03af05 07-Apr-2009 Rene Gollent <anevilyak@gmail.com>

Various cleanups to how the selection indices are maintained when part of the selection is occluded by a collapse operation, which could cause a crash in some instances. This fixes ticket #3711.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30015 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3c179024 29-Oct-2008 Jérôme Duval <korli@users.berlios.de>

missing tabs


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28372 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 39fbf550 15-Oct-2008 Oliver Tappe <zooey@hirschkaefer.de>

bonefish + zooey:
* Fixed a general problem with respect to overriding of the reserved
virtual function slots: instead of statically invoking the method
that corresponds to the reserved slot on the class that contains the
slot, we now invoke the virtual Perform() method. Perform() then dispatches
the method invocation to the "proper" class, i.e. the highest class in the
hierarchy that actually implements the requested method.
This fixes a crash in apps that use liblayout's MSlider class and
should fix one or other spurious bug with old apps or libraries, too.
* added new header folder 'binary_compatibility' that contains files that
define the method codes and data structures required by Perform()
* looked for and implemented all used reserved virtual slot functions to
invoke Perform() where necessary or to pass on the method call statically
(for slots that were already maintained by Be)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28124 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ba18b05b 06-Jul-2008 Karsten Heimrich <host.haiku@gmx.de>

* Fixed broken archive functionality, before we would not archive subitems
and store the archived items in the wrong message field. Verified on R5.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26278 a95241bf-73f2-0310-859d-f6bbb57e9c96


# fa366cbe 29-Jun-2008 Rene Gollent <anevilyak@gmail.com>

Accidentally broke CountItemsUnder() for invalid items with previous commit. This fixes
VLC, which for some reason calls CountItemsUnder(NULL) quite a few times on startup.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26167 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 84d75fa4 27-Jun-2008 Rene Gollent <anevilyak@gmail.com>

Rewrote SwapItems() so as to not fail in various cases.
Fixed logic error in CountItemsUnder() that would sometimes
return the wrong count. This would result in issues such as
Vision's network reordering failing to reorder down due to
retrieving the wrong item based on the count.

This fixes ticket #2447.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26149 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ef83ae3e 07-Jun-2008 Rene Gollent <anevilyak@gmail.com>

Remove BOutlineListView's home-brew quicksort implementation in favor of a comparator that hooks into the STL's sort algorithm as suggested by Ingo. Tested and seems to work nicely.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25848 a95241bf-73f2-0310-859d-f6bbb57e9c96


# bf319ba3 06-Jun-2008 Rene Gollent <anevilyak@gmail.com>

Remove stray debug output.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25832 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e90b17a8 06-Jun-2008 Rene Gollent <anevilyak@gmail.com>

Fix logic bug in quick sort routine. This would result in infinite recursion such as that in bug #2343.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25831 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 396b8a0d 27-Feb-2008 Rene Gollent <anevilyak@gmail.com>

Rescan the selection range after doing a swap.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24164 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 07d18276 27-Feb-2008 Rene Gollent <anevilyak@gmail.com>

Implement BOutlineListView's derivative of SwapItems(). This makes things like Vision's network reordering shortcuts
work correctly.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24158 a95241bf-73f2-0310-859d-f6bbb57e9c96


# fef39304 24-Feb-2008 Stephan Aßmus <superstippi@gmx.de>

patch by Rene Gollent:
* BListItems now store the top offset of the frame within the parent BListView.
* This allows binary searching the clicked item.
* ItemFrame() is now a cheap call.
* Fixed several bugs in the sorting code of BOutlineListView which lead to
crashes of client applications.
* Implemented previously unimplemented functions in BOutlineListView.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24092 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 09c3a92d 05-Apr-2007 Axel Dörfler <axeld@pinc-software.de>

Now handles two cases of incorrectly built trees gracefully (instead of crashing).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20574 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b754aa3d 05-Apr-2007 Axel Dörfler <axeld@pinc-software.de>

RemoveItems() implementation was missing; more or less copied the one from BListView
(which is slow, but works).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20573 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b66c6231 13-Jun-2006 Axel Dörfler <axeld@pinc-software.de>

* AddItem() versions did not work correctly at all: maximum insertion index
was limited by the visible list count, it did not care if the insertion
failed, it didn't maintain the BListItem::fHasSubitems field, neither
fVisible, and it didn't invalidate the latch of the parent, if needed.
* The "add item at end" also did not care if the item should be added to the
visible list, too, it always did.
* AddUnder() would have crashed with a NULL superitem.
* _RemoveItem() now updates the fHasSubitems field as well.
* _SuperitemForIndex() can now return the index of the superitem as well.
* SortItemsUnder() did not check if the "underItem" if the items should be
added to the visible list or not, it also just did.
* SortItemsUnder() now invalidates the part of the visible list that may
have been changed.
* This fixed bug #662, and possibly #663, too (at least I could never
reproduce it).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17812 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 227bf1b6 03-Apr-2006 Axel Dörfler <axeld@pinc-software.de>

Fixed wrong selection updating when adding items - this fixes bug #279.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16993 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 000d23ff 08-Mar-2006 Axel Dörfler <axeld@pinc-software.de>

* Removing items from the BOutlineListView should longer crash the application.
* Also, the selection should be updated correctly when items are removed.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16652 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7c74b12b 11-Feb-2006 Axel Dörfler <axeld@pinc-software.de>

* Implemented BOutlineListView::FullListSortItems() and SortItemsUnder() - dunno
what Be's implementation did wrong but instead of taking almost 30 seconds to
sort the MIME type database (roughly 1100 entries, and yes, that's why the
original FileTypes is that slow when it has to show the internal types), this
one needs only 4 ms for the same task (that's an amply 7500x speedup).
* Implemented some more missing functions - it's by no means complete yet, though.
* Rewrote OutlineListView.h, ListItem.h, and StringItem.h.
* Fixed some minor bugs, but there are probably a lot more.
* Major cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16349 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 034104bc 14-Nov-2005 Stephan Aßmus <superstippi@gmx.de>

* fix invalidation of changed items
* fix deselecting items
* fix selection with the mouse and also holding down modifiers
* fix some more stuff I have already forgotten
* applied coding style in most places
* renamed private functions to be consistent

needs more work though, some stuff can definitely be
removed, some needs to be added


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14932 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8083ceba 08-Jun-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Fixed warning

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13027 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 585fe26c 18-May-2005 DarkWyrm <darkwyrm@gmail.com>

Added OutlineListView to build and fixed an include problem


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12707 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 007ed8c5 16-Jun-2003 Marc Flerackers <mflerackers@nowhere.fake>

Compilation fixes and BOutlineListView


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3538 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 265f2996271f355c491ab20113dcacd02535d91a 11-Dec-2014 Adrien Destugues <pulkomandy@gmail.com>

ListView: move the color setting code to DrawItem

... so it can also be used by OutlineListView.

Fixes #11598.


# 539dc1bc53a60fc507d1d5b82e872030f0b06e2f 02-Dec-2014 John Scipione <jscipione@gmail.com>

A bunch of style fixes

No functional changes intended


# 42272d23426442e0463c33d26d0f90ac11e94608 26-Nov-2014 Adrien Destugues <pulkomandy@gmail.com>

OutlineListView: yet another list/fullList mismatch.

Fixes #5817.


# 1f424632be5dcad5b81a23080eb205ab6471cd7b 11-Jun-2014 John Scipione <jscipione@gmail.com>

Style fixes to IK, focus on docs


# 1e1afb393991969921862ca098af8c436659a45e 11-Dec-2013 John Scipione <jscipione@gmail.com>

Updates to BOutlineListView for docs

mostly param naming.

No functional change intended.


# a56ddb2bea435780f45f7da9224c58934bc03dfa 02-May-2013 John Scipione <jscipione@gmail.com>

BOutlineListView: Refactor to eliminate repeat vars

The latch width, height and indent width are now all set in one
place in LatchRect() and then LatchRect() is used in multiple places.


# c19cb4ddc6456b53da867b06395c58d7dc1efa77 01-May-2013 John Scipione <jscipione@gmail.com>

Update BOutlineListView arrows to new style

...from BControlLook, and while I'm at it, use font-relative spacing dimensions.


# eee4243d35225a35d0964ebebe94490eaca14261 20-Oct-2011 Alex Wilson <yourpalal2@gmail.com>

De-virtualize BView::InvalidateLayout() and introduce LayoutInvalidated() hook, like BLayout.


# f3c8afe886b559d13d2fb4a5895d139e14c0adf7 31-Jan-2010 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

Fix a bug in OutlineListView::ItemUnderAt that made it pick totally wrong items when some things in the list were collapsed.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35361 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e917a2404dee2e7e9839e3dbc6910759526061b7 31-Jan-2010 Rene Gollent <anevilyak@gmail.com>

Fix some selection-related problems in BOutlineListView as well as
broken behavior in _RemoveItem that could potentially result in the wrong
list items being removed/deleted depending on the expanded/collapsed state
of higher items in the list.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35360 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c544ccf58dcc5192d3fb7625ec615aeaf3ec572a 25-Oct-2009 Axel Dörfler <axeld@pinc-software.de>

* Expand(), and Collapse() aren't supposed to do the work themselves.
* Instead, they should call the protected virtual ExpandOrCollapse(), this makes
one of my apps work again under Haiku (where the list view contents are
filled on demand).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33760 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 08a3563801c70c9219f6ea3b5cd92000ec15b1b1 17-Jun-2009 Axel Dörfler <axeld@pinc-software.de>

* Added layout-friendly constructor.
* Reordered functions to match the order in the header (and vice versa).
* Removed unused private functions.
* Updated the header to follow our coding style.
* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31088 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 23079ac1264070ea8711dc31180a618bc73a07bf 20-Apr-2009 Philippe Saint-Pierre <stpere@gmail.com>

Modified the DrawLatch routine to make the latch vertically centered.

* It's particularly notice-able with big fonts.
* I did put the latch's width and height in constants.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30284 a95241bf-73f2-0310-859d-f6bbb57e9c96


# dd0e375f416d6848492d1d0dc5d56cf3a6b63997 13-Apr-2009 Rene Gollent <anevilyak@gmail.com>

Fix build break I introduced in previous commit. Add some extra behavior for OutlineListView's right arrow: if the item has children and is expanded, right arrow now jumps to the first child.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30150 a95241bf-73f2-0310-859d-f6bbb57e9c96


# fcdaa0c79d560d4cba2b3152e1a1ef9addb01a5b 11-Apr-2009 Rene Gollent <anevilyak@gmail.com>

If an item does not have an expand/collapse latch, let the left arrow jump to its parent (if any). Implements ticket #3725.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30130 a95241bf-73f2-0310-859d-f6bbb57e9c96


# cd03af05a4e04d2ac751e88acaf8b13f83da3820 07-Apr-2009 Rene Gollent <anevilyak@gmail.com>

Various cleanups to how the selection indices are maintained when part of the selection is occluded by a collapse operation, which could cause a crash in some instances. This fixes ticket #3711.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30015 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3c17902449b78645a10344961d787f012f15ed4e 29-Oct-2008 Jérôme Duval <korli@users.berlios.de>

missing tabs


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28372 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 39fbf5509b8740d9883b61649027478dc8a3ead8 15-Oct-2008 Oliver Tappe <zooey@hirschkaefer.de>

bonefish + zooey:
* Fixed a general problem with respect to overriding of the reserved
virtual function slots: instead of statically invoking the method
that corresponds to the reserved slot on the class that contains the
slot, we now invoke the virtual Perform() method. Perform() then dispatches
the method invocation to the "proper" class, i.e. the highest class in the
hierarchy that actually implements the requested method.
This fixes a crash in apps that use liblayout's MSlider class and
should fix one or other spurious bug with old apps or libraries, too.
* added new header folder 'binary_compatibility' that contains files that
define the method codes and data structures required by Perform()
* looked for and implemented all used reserved virtual slot functions to
invoke Perform() where necessary or to pass on the method call statically
(for slots that were already maintained by Be)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28124 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ba18b05b5d5de71a9fa1c16724950b03b3e55c13 06-Jul-2008 Karsten Heimrich <host.haiku@gmx.de>

* Fixed broken archive functionality, before we would not archive subitems
and store the archived items in the wrong message field. Verified on R5.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26278 a95241bf-73f2-0310-859d-f6bbb57e9c96


# fa366cbe40ca836e09274cf5b7cd1aa6acbd7299 29-Jun-2008 Rene Gollent <anevilyak@gmail.com>

Accidentally broke CountItemsUnder() for invalid items with previous commit. This fixes
VLC, which for some reason calls CountItemsUnder(NULL) quite a few times on startup.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26167 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 84d75fa44432462fd3495f379c275d0b64c428f1 27-Jun-2008 Rene Gollent <anevilyak@gmail.com>

Rewrote SwapItems() so as to not fail in various cases.
Fixed logic error in CountItemsUnder() that would sometimes
return the wrong count. This would result in issues such as
Vision's network reordering failing to reorder down due to
retrieving the wrong item based on the count.

This fixes ticket #2447.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26149 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ef83ae3e0bc49e51184588a0a5a489749f13b9db 07-Jun-2008 Rene Gollent <anevilyak@gmail.com>

Remove BOutlineListView's home-brew quicksort implementation in favor of a comparator that hooks into the STL's sort algorithm as suggested by Ingo. Tested and seems to work nicely.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25848 a95241bf-73f2-0310-859d-f6bbb57e9c96


# bf319ba31d9e2990462e7ea43b303e2fd7a09f8c 06-Jun-2008 Rene Gollent <anevilyak@gmail.com>

Remove stray debug output.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25832 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e90b17a854b8fec924fff7f6544a06aa30c87467 06-Jun-2008 Rene Gollent <anevilyak@gmail.com>

Fix logic bug in quick sort routine. This would result in infinite recursion such as that in bug #2343.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25831 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 396b8a0dc21d4f99c7ccfd0d0e907a186aca5db2 27-Feb-2008 Rene Gollent <anevilyak@gmail.com>

Rescan the selection range after doing a swap.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24164 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 07d1827688d82e5c08522f58380493baad394ab8 27-Feb-2008 Rene Gollent <anevilyak@gmail.com>

Implement BOutlineListView's derivative of SwapItems(). This makes things like Vision's network reordering shortcuts
work correctly.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24158 a95241bf-73f2-0310-859d-f6bbb57e9c96


# fef393049965c3f0a2deed78de5a565e3d8d92e5 24-Feb-2008 Stephan Aßmus <superstippi@gmx.de>

patch by Rene Gollent:
* BListItems now store the top offset of the frame within the parent BListView.
* This allows binary searching the clicked item.
* ItemFrame() is now a cheap call.
* Fixed several bugs in the sorting code of BOutlineListView which lead to
crashes of client applications.
* Implemented previously unimplemented functions in BOutlineListView.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24092 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 09c3a92d0ae44110e19f277ff9e8349761083884 05-Apr-2007 Axel Dörfler <axeld@pinc-software.de>

Now handles two cases of incorrectly built trees gracefully (instead of crashing).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20574 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b754aa3dbd9e51396f49613d17598b8fcde78531 05-Apr-2007 Axel Dörfler <axeld@pinc-software.de>

RemoveItems() implementation was missing; more or less copied the one from BListView
(which is slow, but works).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20573 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b66c623116aaccc1ea813f86c792fc0d7c25991f 13-Jun-2006 Axel Dörfler <axeld@pinc-software.de>

* AddItem() versions did not work correctly at all: maximum insertion index
was limited by the visible list count, it did not care if the insertion
failed, it didn't maintain the BListItem::fHasSubitems field, neither
fVisible, and it didn't invalidate the latch of the parent, if needed.
* The "add item at end" also did not care if the item should be added to the
visible list, too, it always did.
* AddUnder() would have crashed with a NULL superitem.
* _RemoveItem() now updates the fHasSubitems field as well.
* _SuperitemForIndex() can now return the index of the superitem as well.
* SortItemsUnder() did not check if the "underItem" if the items should be
added to the visible list or not, it also just did.
* SortItemsUnder() now invalidates the part of the visible list that may
have been changed.
* This fixed bug #662, and possibly #663, too (at least I could never
reproduce it).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17812 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 227bf1b686df36027cecf5a8c8d6bce9527f4cb7 03-Apr-2006 Axel Dörfler <axeld@pinc-software.de>

Fixed wrong selection updating when adding items - this fixes bug #279.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16993 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 000d23ff71c0d4b40e58068cf486f59943a63514 08-Mar-2006 Axel Dörfler <axeld@pinc-software.de>

* Removing items from the BOutlineListView should longer crash the application.
* Also, the selection should be updated correctly when items are removed.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16652 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7c74b12b2a1df58a1337dc90ce758444f2e46f80 11-Feb-2006 Axel Dörfler <axeld@pinc-software.de>

* Implemented BOutlineListView::FullListSortItems() and SortItemsUnder() - dunno
what Be's implementation did wrong but instead of taking almost 30 seconds to
sort the MIME type database (roughly 1100 entries, and yes, that's why the
original FileTypes is that slow when it has to show the internal types), this
one needs only 4 ms for the same task (that's an amply 7500x speedup).
* Implemented some more missing functions - it's by no means complete yet, though.
* Rewrote OutlineListView.h, ListItem.h, and StringItem.h.
* Fixed some minor bugs, but there are probably a lot more.
* Major cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16349 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 034104bc0f7faad354431507eadca591f0785b61 14-Nov-2005 Stephan Aßmus <superstippi@gmx.de>

* fix invalidation of changed items
* fix deselecting items
* fix selection with the mouse and also holding down modifiers
* fix some more stuff I have already forgotten
* applied coding style in most places
* renamed private functions to be consistent

needs more work though, some stuff can definitely be
removed, some needs to be added


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14932 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8083cebaaff9ac6e518d0bc9e2fc411731179693 08-Jun-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Fixed warning

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13027 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 585fe26c42c1d465f8b37d2e776ef2f0fd31d1d9 18-May-2005 DarkWyrm <darkwyrm@gmail.com>

Added OutlineListView to build and fixed an include problem


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12707 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 007ed8c58b7dd9b1f0de00f45f33521df353b56f 16-Jun-2003 Marc Flerackers <mflerackers@nowhere.fake>

Compilation fixes and BOutlineListView


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3538 a95241bf-73f2-0310-859d-f6bbb57e9c96