History log of /haiku/src/kits/interface/ColumnListView.cpp
Revision Date Author Comments
# 5014ac93 04-Dec-2023 Freaxed <andrea.anzani@gmail.com>

BColumnListView: Resolve column resizing drawing glitch (wider than 600px)

* use of a shared bitmap buffer in OutlineView and TitleView
* dynamically increase of the bitmap buffer after adding a column or a row

Change-Id: I4feddf636fb1446c29e60353b8f70fc084833731
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7176
Reviewed-by: John Scipione <jscipione@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: Stefano Ceccherini <stefano.ceccherini@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>


# cd304559 30-Aug-2022 Augustin Cavalier <waddlesplash@gmail.com>

BColumnListView: Optimize check for whether the focus row has moved.

If the new row is not in an open branch, it cannot possibly have
caused the focused row to have moved, and so we need neither check
nor perform an invalidation if that is the case.

This code has been this way since it was originally imported into
Vision's (!) CVS repository in 2001 from some Be sample code area,
and has not been substantially changed since it was imported into
Haiku's repository in 2004.

This saves quite a number of app_server round-trips and redraws
when importing lots of rows to the list, which fixes the other half
of the hang when changing functions in the call stack in Debugger.


# 861282ff 30-Aug-2022 Augustin Cavalier <waddlesplash@gmail.com>

BColumnListView: Dynamic scrollbar size support.

Improves appearance on HiDPI.


# e7952d44 16-Nov-2021 Augustin Cavalier <waddlesplash@gmail.com>

BColumnListView: Add initializations to silence -Wmaybe-uninitialized.


# e1bb846d 19-Jun-2020 X512 <danger_mail@list.ru>

BColumnListView: fix keyboard navigation

Make expanding/collapsing logic the same as in BOutlineListView.

Change-Id: Ia8669ec6ac1be15c09879aa759474b4841451c39
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2933
Reviewed-by: John Scipione <jscipione@gmail.com>


# 9585fabd 12-May-2020 Augustin Cavalier <waddlesplash@gmail.com>

BColumnListView: Consider current, not preferred, column width for overall preferred with.

Otherwise, the entire list will be scanned for row widths, which
is extremely slow with thousands of items, and may not be what
the user wants anyway, if they have set specific column sizes
which are larger/smaller than that.

Helps with #16012 and #15889 considerably.


# d27546c1 27-Jan-2019 Rob Gill <rrobgill@protonmail.com>

kits/interface Fix PVS902

* replace unformatted printf with puts

Change-Id: I06b5f436bf51423c60ddd3cc81d86217d06c78cd
Reviewed-on: https://review.haiku-os.org/c/961
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>


# 62c7ec5c 23-Nov-2018 Augustin Cavalier <waddlesplash@gmail.com>

Fix various instances of -Wset-but-unused.

Largely no functional change; most of these are just
removing the unused variables.


# aa39f874 12-Sep-2018 Janus <janus2@ymail.com>

BColumnListView: hscrollbar matches visible columns

* _VirtualWidth() ignores invisible columns
This makes the horizontal scrollbar match the width of the visible columns.
Also trigger an initial update of the scrollbars.
* Fixes #14480

Change-Id: I7d4b27a8fdca58c150ac47f9b948b127fb275fdf
Reviewed-on: https://review.haiku-os.org/543
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>


# 81d0a0e0 11-Sep-2018 David Murphy <murphman@gmail.com>

BColumnListView: Always update the reference rect in ::FindVisibleRect...

...if the row is present in the list, but continue to return false if the
row is not currently visible on the screen.

Part of #11675. Cherry-picked from https://review.haiku-os.org/442.


# 7a96554c 09-Dec-2015 looncraz <looncraz@looncraz.net>

kits/interface: Convert to using Set*UIColor.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
Patches 0003-0017 from looncraz, unmodified.


# df459da6 15-Jul-2015 Rene Gollent <rene@gollent.com>

{Tree,Table}: Add cell rect accessor.

BColumnListView:
- Add helper method for getting the visible rect of a given field.
Refactor SuggestTextPosition to use it.

{Tree,Table}:
- Add wrapper to retrieve table cell rect using the aforementioned
BCLV helper.


# d54a4f43 03-May-2015 Janus <janus2@ymail.com>

BColumListView: uses system colors.

* Partialy fixes #10840.


# 85b350ed 05-Apr-2015 Janus <janus2@ymail.com>

BColumnListView: BRow height is proportional to font size.

* Add a BRow default constructor that use font size to compute height.
* Min height size for Title and Row are decoupled.
* The font ratio for Title and Row are decoupled.
* For small font use min height (set to usual 16.0).
* Better baseline formula.
* Fixes #11944.


# 5a7c64f9 04-Apr-2015 Janus <janus2@ymail.com>

BColumnListView: Avoid crash on column resize.

* Inizialize fSelectedColumn before calling ResizeSelectedColumn().
* Fixes #10439.


# 555c1cbf 02-Dec-2014 John Scipione <jscipione@gmail.com>

ColumnListView: Remove pre-ControlLook drawing code


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

ColumnListView: Add default case to switch


# 73b59622 02-Dec-2014 John Scipione <jscipione@gmail.com>

ColumnListView: preserve view high color


# 86ebf4c7 02-Dec-2014 John Scipione <jscipione@gmail.com>

ColumnListView: check for NULL column


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

A bunch of style fixes

No functional changes intended


# fec56923 02-Dec-2014 Chirayu Desai <chirayudesai1@gmail.com>

ColumnListView: Fix two bugs reported by Coverity

* Fix Coverity bug 991147: Copy-paste error
* Fix Coverity bug 991264: Dereference after null check

Signed-off-by: Jérôme Duval <jerome.duval@gmail.com>


# 8b27b730 23-Nov-2014 Rene Gollent <rene@gollent.com>

BCLV: Adjust arrow key behavior.

- Left/right arrow can now be used to collapse/expand the focus
row. Holding shift reverts to the previous behavior of scrolling
the view.


# 073da302 17-Nov-2014 Jérôme Duval <jerome.duval@gmail.com>

ColumnListView: deselect the last selected row

when the shift movement goes back. This behavior feels better to me,
but opinions are welcome. Tested with HaikuDepot package listview.
Noticed that CLV uses Ctrl whereas Tracker uses Alt for single item
selection.


# 62f70e6f 23-Dec-2013 Puck Meerburg <puck@puckipedia.nl>

Fix Coverity bug 1108392: Stray semicolon

Signed-off-by: Philippe Saint-Pierre <stpere@gmail.com>


# 1c9b1111 20-Oct-2013 Rene Gollent <rene@gollent.com>

Implement #10116.

- BColumnListView now accepts middle click as well as double click
to resize a column to preferred.


# ed6f171a 16-Sep-2013 Stephan Aßmus <superstippi@gmx.de>

BColumnListView: Enable invalidating rows, fix SetField()

* Seems like there was no easy way to simply invalidate
a given BRow. Introduced BColumnListView::InvalidateRow().
* BRow::SetField() tried to invalidate the row, but invalidated
the listview instead of the BOutlineView responsible for
drawing the list contents. Use the new InvaalidateRow().


# bdd7ba66 16-Sep-2013 Stephan Aßmus <superstippi@gmx.de>

BColumnListView: Enable invalidating rows, fix SetField()

* Seems like there was no easy way to simply invalidate
a given BRow. Introduced BColumnListView::InvalidateRow().
* BRow::SetField() tried to invalidate the row, but invalidated
the listview instead of the BOutlineView responsible for
drawing the list contents. Use the new InvaalidateRow().


# 1058f86a 10-Aug-2013 Stephan Aßmus <superstippi@gmx.de>

BColumnListView: Regard StatusView in DoLayout() and Draw()


# cc27aad6 02-Jun-2013 Rene Gollent <anevilyak@gmail.com>

BCLV: Force scrollbar fixup if cleared.


# 49126a0e 03-Jan-2013 Tri-Edge AI <triedgeai@gmail.com>

Added ResourceEdit and modified BColumnListView, BRow and BMenu.

Signed-off-by: Matt Madia <mattmadia@gmail.com>


# 9e265b33 14-Dec-2012 Janus <janus2@ymail.com>

Fixes #7639 - the redraw issue in ColumListView.

Signed-off-by: Siarzhuk Zharski <zharik@gmx.li>


# 7bcbf187 06-Nov-2012 Rene Gollent <anevilyak@gmail.com>

Optimize column preferred width calculation a bit.

Move calculating the width of the column title itself out to
OutlineView::GetColumnPreferredWidth(). Previously, each pass would
compute the width of both the field itself and the column title,
leading to considerable redundant work. Also, take outline level indent
into account in the resulting width. Should improve performance a bit.


# 74e28840 08-Aug-2012 Rene Gollent <anevilyak@gmail.com>

64-bit fixes. Gets Debugger fully compiling on x86-64.


# 902a98ad 20-Jul-2012 Rene Gollent <anevilyak@gmail.com>

Fix #8753.

- Store whether or not the use of the horizontal scrollbar is desired
on the class itself. If the CLV was set to use the horizontal scrollbar,
and then asked to lay itself out while hidden, it would incorrectly assume
the horizontal scrollbar wasn't in use, and consequently repositioned its
views such that the horizontal scrollbar and outline view overlapped.


# 03aa456e 18-Jul-2012 Rene Gollent <anevilyak@gmail.com>

Fix mouse down handling error.

- When handling a mouse click, the button was hardcoded instead of
passing the actual button clicked by the user. Spotted by Chris
Roberts.


# ed15f1b8 18-Jul-2012 Rene Gollent <anevilyak@gmail.com>

Fix scrollbar handling when removing rows in BCLV.

- If removing a row results in there no longer being any rows whatsoever
visible, force a scroll back into the visible range. Fixes #8287.


# 61eb1f1d 22-Oct-2011 Alex Wilson <yourpalal2@gmail.com>

Replace remaining InvalidateLayout()'s with LayoutInvalidated(). Also do a bit of cleanup/move methods around.


# 915a7b8c 19-Jan-2011 Oliver Tappe <zooey@hirschkaefer.de>

Make BObjectList<> publically available:
* cleaned up ObjectList.h
* switched several uses of new() to new(std::nothrow)
* moved ugly AsBList() hack into BObjectList<>::Private class and
adjusted all callers accordingly


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


# 8faf0ba7 18-Nov-2010 Philippe Houdoin <philippe.houdoin@gmail.com>

Harmonized default even and odd lines colors with the ones used in
MediaPlayer's playlist.


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


# 3c772f3e 26-Aug-2010 Stephan Aßmus <superstippi@gmx.de>

Finally fixed #3036: BColumnListView::PreferredSize() needs
to take into account the correct extra spacing around
the TitleView, as well the internal margin width that
the TitleView adds to the current column width sum for
its virtual width used to set the horizontal scrollbar
proportion. Introduced TitleView::MarginWidth() for that.


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


# 2f368a27 26-Aug-2010 Stephan Aßmus <superstippi@gmx.de>

Fixed the overly complicated computation of the height of the
removed rows in OutlineView::RemoveRow(BRow* row). It also
contained a bug (tracked down by Duggan in ticket #3897, thanks!)
which caused it to skip the sub-tree height computation when
FindParent() returns false, which it does for root items.
Now the computation is simple: The subTreeHeight is the height
of the row itself, if a) the row doesn't have a parent or b)
the parent is visible and expanded. Then if the row being removed
is expanded, we calculate the sub-tree height recursively.
Removed a lot of duplicated or even trippled checks along the
way and solved two easily solvable TODOs with regards to what is
invalidated. Previously the entire list view was invalidated
for each row being removed, even if they were scrolled out the
view bounds.


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


# dd96260d 26-Aug-2010 Stephan Aßmus <superstippi@gmx.de>

Cleaned up OutlineView::FindParent(), only do the visibility check if required.


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


# 991ab2d3 17-Mar-2010 Stephan Aßmus <superstippi@gmx.de>

Removed left-over, thanks Axel!


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


# cc28efee 16-Mar-2010 Stephan Aßmus <superstippi@gmx.de>

Use the new cursors.


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


# 2fc49d9b 14-Oct-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Added ColumnAt(BPoint) version.


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


# b439d6e5 31-Aug-2009 Stephan Aßmus <superstippi@gmx.de>

* Moved restriction to min/max column width from where GetColumnPreferredWidth
was used into GetColumnPreferredWidth for convenience.
* Disabled cached total column width in title view, since it wasn't properly
maintained. Instead of finding the bug (the code should use proper listening
mechanisms, and such problems would go away automatically), the total width
is now calculated on the fly. It is used for updating the horizontal
scrollbar.
* Resolved TODO in PreferredSize(), the width is now based on the preferred
width of all columns.

+alphabranch


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


# 8c212161 31-Aug-2009 Stephan Aßmus <superstippi@gmx.de>

* When dragging/resizing columns, remember and take the click offset into
account.
* When releasing the mouse buttom from a resize operation, don't reset the
view cursor, as we would still start resizing the column again if we
clicked.

This doesn't only improve these mouse operations, but solves weird jumping
columns, for example when just clicking in the resize hot-area.

+alphabranch


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


# 17a8a6f7 27-Jun-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Made ScrollTo(BRow*) more useful. Now it only scrolls, if the row isn't fully
visible and it only scrolls as much as necessary.


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


# d571c583 09-May-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Introduced methods ResizeColumnToPreferred() and
ResizeAllColumnsToPreferred().
* Automatic white space cleanup.


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


# 1ad26e2a 22-Apr-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Swapped k{Up,Down}SortArrow*. This not only makes the naming more intuitive
(the "down" arrow actually points down, now), it also uses the arrows
consistent with Tracker -- i.e. arrow pointing down means ascending order.


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


# d3171391 09-Apr-2009 Stephan Aßmus <superstippi@gmx.de>

Fixes for the B_NO_BORDER LOOK:
* Draw the left/top border anyways, since it just looks bad with scrollbars
where the frame cannot be turned off. But, don't draw the focus indication
in this mode.
* Fixed layout of the views for B_NO_BORDER_LOOK. There was a one pixel
overlap.


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


# 454ff904 03-Apr-2009 Stephan Aßmus <superstippi@gmx.de>

Prettify the column title drawing. TODO: Make this more re-usable and put into
BControlLook. Then use from Tracker as well. Also, Tracker still has the nicer
sorting indicators.


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


# bfc1a92f 31-Mar-2009 Stephan Aßmus <superstippi@gmx.de>

Make BColumnListView layout-friendly.


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


# 89c9e2b9 31-Mar-2009 Stephan Aßmus <superstippi@gmx.de>

Puh... big coding style cleanup. I probably missed a few issues too... but
should be much better now. There was like three different styles before.


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


# 432bac0e 01-Feb-2009 Rene Gollent <anevilyak@gmail.com>

BColumnListView was hiding BView::ScrollTo(BPoint), due to its own child variant ScrollTo(BRow *). Fixed.


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


# 1d43a131 29-Oct-2008 Rene Gollent <anevilyak@gmail.com>

Remove extra pixel constants that were always added to the total item height when calculating the vertical scrollbar proportions. This fixes the empty space that was always added to the end of the CLV (ticket 2980).


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


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

supports double clicking column title separator to preferred column size


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


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

remove debug output


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


# 9553296a 23-Feb-2008 Stephan Aßmus <superstippi@gmx.de>

* Removed #ifdefs around cursor code (ie activate it).
* Replaced non-stylish/conform looking cursor shapes with cool looking
cursor shapes. (I am always delighted by WonderBrush's cursor code output...)


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


# da5d9701 19-Feb-2008 Stephan Aßmus <superstippi@gmx.de>

* Small code cleanups, a bigger style cleanup should be done, but I didn't
want to mix too much cleanups into real changes.
* Got rid of the weird lines between rows.
* Tweaked colors (selections are usually dark everywhere else in Haiku).
* Implemented slightly tinting alternating rows.
* Removed the code duplication to figure out the appropriate background
row color, fixed some inconsistencies between Draw() and RedrawColumn()
in this regard.

TODO: Default colors should be computed based on current panel color though.

TODO: Figure out why the outline view does not scroll (at least not visibly)
when the vertical scroll bar is used.

TODO: Remove remaining redraw bugs. I observe a column of pixels not being
updated in some cases when resizing columns.


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


# f6a3e563 19-Feb-2008 Stephan Aßmus <superstippi@gmx.de>

* Looking at the diff I remember it contains a patch Andrea Anzani send me,
fixes indicating the focus of the resized column if it isn't the first one.
* Code cleanups by myself in the archiving implementation. No functional change.


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


# 1e634f4d 16-Jan-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Actually use B_COLOR_SELECTION_TEXT when drawing. Patch by Andrea Anzani


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


# dace9db1 22-Dec-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Patch by Andrea Anzani for some visual glitches:
- separation lines weren't drawn correctly if the CLV was scrolled horizontally.
- in some cases, when unhilighting an item, the item itself werent'
drawn correctly.


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


# a445243c 20-Apr-2006 Jérôme Duval <korli@users.berlios.de>

B_COLOR_8_BIT is deprecated


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


# 5c99440e 16-Sep-2004 Jérôme Duval <korli@users.berlios.de>

Added ColorTools and ColumnListView from Vision cvs repository
(ColorTools.h : 1.2, ColorTools.cpp : 1.4,
ColumnListView.h : 1.13, ColumnListView.cpp : 1.3)
Original code from OpenTracker


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


# df459da6ed9a147f1c3fb2ca70429ee20c2d1058 15-Jul-2015 Rene Gollent <rene@gollent.com>

{Tree,Table}: Add cell rect accessor.

BColumnListView:
- Add helper method for getting the visible rect of a given field.
Refactor SuggestTextPosition to use it.

{Tree,Table}:
- Add wrapper to retrieve table cell rect using the aforementioned
BCLV helper.


# d54a4f43ccb59bb0b9d5cc980e9cb7b2dab5a322 03-May-2015 Janus <janus2@ymail.com>

BColumListView: uses system colors.

* Partialy fixes #10840.


# 85b350edda4aeadaf382acefd349b13737a4df5d 05-Apr-2015 Janus <janus2@ymail.com>

BColumnListView: BRow height is proportional to font size.

* Add a BRow default constructor that use font size to compute height.
* Min height size for Title and Row are decoupled.
* The font ratio for Title and Row are decoupled.
* For small font use min height (set to usual 16.0).
* Better baseline formula.
* Fixes #11944.


# 5a7c64f90a086e3e1974017b45844919b8e90c13 04-Apr-2015 Janus <janus2@ymail.com>

BColumnListView: Avoid crash on column resize.

* Inizialize fSelectedColumn before calling ResizeSelectedColumn().
* Fixes #10439.


# 555c1cbfd839946d7270a742ca839cf6aa2f6895 02-Dec-2014 John Scipione <jscipione@gmail.com>

ColumnListView: Remove pre-ControlLook drawing code


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

ColumnListView: Add default case to switch


# 73b596224c576fec28728f23545210a2a4d2bc3c 02-Dec-2014 John Scipione <jscipione@gmail.com>

ColumnListView: preserve view high color


# 86ebf4c7557288f4542278bb96a05370a4f0c328 02-Dec-2014 John Scipione <jscipione@gmail.com>

ColumnListView: check for NULL column


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

A bunch of style fixes

No functional changes intended


# fec56923298355f41c6146c7e570153eb2279983 02-Dec-2014 Chirayu Desai <chirayudesai1@gmail.com>

ColumnListView: Fix two bugs reported by Coverity

* Fix Coverity bug 991147: Copy-paste error
* Fix Coverity bug 991264: Dereference after null check

Signed-off-by: Jérôme Duval <jerome.duval@gmail.com>


# 8b27b730552bf7d9b4e339949a18f33645f34948 23-Nov-2014 Rene Gollent <rene@gollent.com>

BCLV: Adjust arrow key behavior.

- Left/right arrow can now be used to collapse/expand the focus
row. Holding shift reverts to the previous behavior of scrolling
the view.


# 073da30265d23a762719b1bad96ce668fbd73e1c 17-Nov-2014 Jérôme Duval <jerome.duval@gmail.com>

ColumnListView: deselect the last selected row

when the shift movement goes back. This behavior feels better to me,
but opinions are welcome. Tested with HaikuDepot package listview.
Noticed that CLV uses Ctrl whereas Tracker uses Alt for single item
selection.


# 62f70e6f0ad0f5896250903736e47183facf6077 23-Dec-2013 Puck Meerburg <puck@puckipedia.nl>

Fix Coverity bug 1108392: Stray semicolon

Signed-off-by: Philippe Saint-Pierre <stpere@gmail.com>


# 1c9b1111f78880dffe0f65facb366a5e92d30f0c 20-Oct-2013 Rene Gollent <rene@gollent.com>

Implement #10116.

- BColumnListView now accepts middle click as well as double click
to resize a column to preferred.


# ed6f171aa6886208a0a2f2e695fbee97133ca3aa 16-Sep-2013 Stephan Aßmus <superstippi@gmx.de>

BColumnListView: Enable invalidating rows, fix SetField()

* Seems like there was no easy way to simply invalidate
a given BRow. Introduced BColumnListView::InvalidateRow().
* BRow::SetField() tried to invalidate the row, but invalidated
the listview instead of the BOutlineView responsible for
drawing the list contents. Use the new InvaalidateRow().


# bdd7ba66b535f8c428c84958c801c59216ac693e 16-Sep-2013 Stephan Aßmus <superstippi@gmx.de>

BColumnListView: Enable invalidating rows, fix SetField()

* Seems like there was no easy way to simply invalidate
a given BRow. Introduced BColumnListView::InvalidateRow().
* BRow::SetField() tried to invalidate the row, but invalidated
the listview instead of the BOutlineView responsible for
drawing the list contents. Use the new InvaalidateRow().


# 1058f86a5f0b262f67b3cba0ab06daa71281dbcd 10-Aug-2013 Stephan Aßmus <superstippi@gmx.de>

BColumnListView: Regard StatusView in DoLayout() and Draw()


# cc27aad6b02da04e66dd12d8d20baf31a3c484d7 02-Jun-2013 Rene Gollent <anevilyak@gmail.com>

BCLV: Force scrollbar fixup if cleared.


# 49126a0e9b1b7a8a148dab17d0c3aa4eb6e798ed 03-Jan-2013 Tri-Edge AI <triedgeai@gmail.com>

Added ResourceEdit and modified BColumnListView, BRow and BMenu.

Signed-off-by: Matt Madia <mattmadia@gmail.com>


# 9e265b3329b9bcf0b3fcaacdef03125a2699bc2f 14-Dec-2012 Janus <janus2@ymail.com>

Fixes #7639 - the redraw issue in ColumListView.

Signed-off-by: Siarzhuk Zharski <zharik@gmx.li>


# 7bcbf187d0197d78ce4b2b15f2747f8ae1d6093a 06-Nov-2012 Rene Gollent <anevilyak@gmail.com>

Optimize column preferred width calculation a bit.

Move calculating the width of the column title itself out to
OutlineView::GetColumnPreferredWidth(). Previously, each pass would
compute the width of both the field itself and the column title,
leading to considerable redundant work. Also, take outline level indent
into account in the resulting width. Should improve performance a bit.


# 74e288401db48905cf1c10a4560c4315da061bf3 08-Aug-2012 Rene Gollent <anevilyak@gmail.com>

64-bit fixes. Gets Debugger fully compiling on x86-64.


# 902a98ad8340bbbef72bf98b6096ed091abf08f1 20-Jul-2012 Rene Gollent <anevilyak@gmail.com>

Fix #8753.

- Store whether or not the use of the horizontal scrollbar is desired
on the class itself. If the CLV was set to use the horizontal scrollbar,
and then asked to lay itself out while hidden, it would incorrectly assume
the horizontal scrollbar wasn't in use, and consequently repositioned its
views such that the horizontal scrollbar and outline view overlapped.


# 03aa456e2effa939895246dce37cd2454f5534d7 18-Jul-2012 Rene Gollent <anevilyak@gmail.com>

Fix mouse down handling error.

- When handling a mouse click, the button was hardcoded instead of
passing the actual button clicked by the user. Spotted by Chris
Roberts.


# ed15f1b8fb8b635349829c655678177ad3032ccc 18-Jul-2012 Rene Gollent <anevilyak@gmail.com>

Fix scrollbar handling when removing rows in BCLV.

- If removing a row results in there no longer being any rows whatsoever
visible, force a scroll back into the visible range. Fixes #8287.


# 61eb1f1d19eed26b6138b0701612e8eb31bb1d86 22-Oct-2011 Alex Wilson <yourpalal2@gmail.com>

Replace remaining InvalidateLayout()'s with LayoutInvalidated(). Also do a bit of cleanup/move methods around.


# 915a7b8c247e1ed9182bd561df3e9856307e750c 19-Jan-2011 Oliver Tappe <zooey@hirschkaefer.de>

Make BObjectList<> publically available:
* cleaned up ObjectList.h
* switched several uses of new() to new(std::nothrow)
* moved ugly AsBList() hack into BObjectList<>::Private class and
adjusted all callers accordingly


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


# 8faf0ba7cb1648b93ac1d9cf1e3ef0ab8be2ef66 18-Nov-2010 Philippe Houdoin <philippe.houdoin@gmail.com>

Harmonized default even and odd lines colors with the ones used in
MediaPlayer's playlist.


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


# 3c772f3e09e5a01776c097a0f8cad17eac4931d9 26-Aug-2010 Stephan Aßmus <superstippi@gmx.de>

Finally fixed #3036: BColumnListView::PreferredSize() needs
to take into account the correct extra spacing around
the TitleView, as well the internal margin width that
the TitleView adds to the current column width sum for
its virtual width used to set the horizontal scrollbar
proportion. Introduced TitleView::MarginWidth() for that.


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


# 2f368a273ae9a5bd3ae6e84438d952bdc1f2e2e9 26-Aug-2010 Stephan Aßmus <superstippi@gmx.de>

Fixed the overly complicated computation of the height of the
removed rows in OutlineView::RemoveRow(BRow* row). It also
contained a bug (tracked down by Duggan in ticket #3897, thanks!)
which caused it to skip the sub-tree height computation when
FindParent() returns false, which it does for root items.
Now the computation is simple: The subTreeHeight is the height
of the row itself, if a) the row doesn't have a parent or b)
the parent is visible and expanded. Then if the row being removed
is expanded, we calculate the sub-tree height recursively.
Removed a lot of duplicated or even trippled checks along the
way and solved two easily solvable TODOs with regards to what is
invalidated. Previously the entire list view was invalidated
for each row being removed, even if they were scrolled out the
view bounds.


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


# dd96260d50c620b92e81b347e89dc77edd24717c 26-Aug-2010 Stephan Aßmus <superstippi@gmx.de>

Cleaned up OutlineView::FindParent(), only do the visibility check if required.


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


# 991ab2d3755ad84217d731f7881c21295493fd23 17-Mar-2010 Stephan Aßmus <superstippi@gmx.de>

Removed left-over, thanks Axel!


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


# cc28efee7e3e566e3fac3a3d494d30a66250e51e 16-Mar-2010 Stephan Aßmus <superstippi@gmx.de>

Use the new cursors.


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


# 2fc49d9b364ca23babfbed19fed4d6f23d2664c1 14-Oct-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Added ColumnAt(BPoint) version.


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


# b439d6e57313075c6ebc89dd1ea3dc52e5a9164f 31-Aug-2009 Stephan Aßmus <superstippi@gmx.de>

* Moved restriction to min/max column width from where GetColumnPreferredWidth
was used into GetColumnPreferredWidth for convenience.
* Disabled cached total column width in title view, since it wasn't properly
maintained. Instead of finding the bug (the code should use proper listening
mechanisms, and such problems would go away automatically), the total width
is now calculated on the fly. It is used for updating the horizontal
scrollbar.
* Resolved TODO in PreferredSize(), the width is now based on the preferred
width of all columns.

+alphabranch


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


# 8c21216131dd8391ae188410d1837f6621ea4a49 31-Aug-2009 Stephan Aßmus <superstippi@gmx.de>

* When dragging/resizing columns, remember and take the click offset into
account.
* When releasing the mouse buttom from a resize operation, don't reset the
view cursor, as we would still start resizing the column again if we
clicked.

This doesn't only improve these mouse operations, but solves weird jumping
columns, for example when just clicking in the resize hot-area.

+alphabranch


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


# 17a8a6f74b994ed9a3ed18bdedf745018bbfd453 27-Jun-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Made ScrollTo(BRow*) more useful. Now it only scrolls, if the row isn't fully
visible and it only scrolls as much as necessary.


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


# d571c5835d099e1f96b47e630dfa8479fa0e6b04 09-May-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Introduced methods ResizeColumnToPreferred() and
ResizeAllColumnsToPreferred().
* Automatic white space cleanup.


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


# 1ad26e2a7f4d5598a803947b978cfa5a6cdd030f 22-Apr-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Swapped k{Up,Down}SortArrow*. This not only makes the naming more intuitive
(the "down" arrow actually points down, now), it also uses the arrows
consistent with Tracker -- i.e. arrow pointing down means ascending order.


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


# d3171391fa18bcfe3d2bc852045ec98de0596a42 09-Apr-2009 Stephan Aßmus <superstippi@gmx.de>

Fixes for the B_NO_BORDER LOOK:
* Draw the left/top border anyways, since it just looks bad with scrollbars
where the frame cannot be turned off. But, don't draw the focus indication
in this mode.
* Fixed layout of the views for B_NO_BORDER_LOOK. There was a one pixel
overlap.


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


# 454ff904bf21a6d1af1350edc88a253e779581a2 03-Apr-2009 Stephan Aßmus <superstippi@gmx.de>

Prettify the column title drawing. TODO: Make this more re-usable and put into
BControlLook. Then use from Tracker as well. Also, Tracker still has the nicer
sorting indicators.


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


# bfc1a92f8813d767d4e194b9557eedb26ec29c8e 31-Mar-2009 Stephan Aßmus <superstippi@gmx.de>

Make BColumnListView layout-friendly.


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


# 89c9e2b9803a4d462aa46128959d2e8df124be5d 31-Mar-2009 Stephan Aßmus <superstippi@gmx.de>

Puh... big coding style cleanup. I probably missed a few issues too... but
should be much better now. There was like three different styles before.


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


# 432bac0e7a92b14f1a3b7934d7fca1f7ac0c763c 01-Feb-2009 Rene Gollent <anevilyak@gmail.com>

BColumnListView was hiding BView::ScrollTo(BPoint), due to its own child variant ScrollTo(BRow *). Fixed.


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


# 1d43a131eae8d071997c96eedeb54d9b210d293a 29-Oct-2008 Rene Gollent <anevilyak@gmail.com>

Remove extra pixel constants that were always added to the total item height when calculating the vertical scrollbar proportions. This fixes the empty space that was always added to the end of the CLV (ticket 2980).


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


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

supports double clicking column title separator to preferred column size


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


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

remove debug output


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


# 9553296aee7fe23156727054ac8d1996410a423d 23-Feb-2008 Stephan Aßmus <superstippi@gmx.de>

* Removed #ifdefs around cursor code (ie activate it).
* Replaced non-stylish/conform looking cursor shapes with cool looking
cursor shapes. (I am always delighted by WonderBrush's cursor code output...)


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


# da5d970124d5bb3e578a2f79e6a712f4b13886d6 19-Feb-2008 Stephan Aßmus <superstippi@gmx.de>

* Small code cleanups, a bigger style cleanup should be done, but I didn't
want to mix too much cleanups into real changes.
* Got rid of the weird lines between rows.
* Tweaked colors (selections are usually dark everywhere else in Haiku).
* Implemented slightly tinting alternating rows.
* Removed the code duplication to figure out the appropriate background
row color, fixed some inconsistencies between Draw() and RedrawColumn()
in this regard.

TODO: Default colors should be computed based on current panel color though.

TODO: Figure out why the outline view does not scroll (at least not visibly)
when the vertical scroll bar is used.

TODO: Remove remaining redraw bugs. I observe a column of pixels not being
updated in some cases when resizing columns.


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


# f6a3e5637bcdd65f10658d1b78fe7a85e33e71f4 19-Feb-2008 Stephan Aßmus <superstippi@gmx.de>

* Looking at the diff I remember it contains a patch Andrea Anzani send me,
fixes indicating the focus of the resized column if it isn't the first one.
* Code cleanups by myself in the archiving implementation. No functional change.


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


# 1e634f4d9cb18af004c3ec76ef317f584a282f6a 16-Jan-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Actually use B_COLOR_SELECTION_TEXT when drawing. Patch by Andrea Anzani


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


# dace9db1ef3edc032718333472861c07c8ee2918 22-Dec-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Patch by Andrea Anzani for some visual glitches:
- separation lines weren't drawn correctly if the CLV was scrolled horizontally.
- in some cases, when unhilighting an item, the item itself werent'
drawn correctly.


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


# a445243cff2ff082b1b92bfaa5f9f59c88c91da4 20-Apr-2006 Jérôme Duval <korli@users.berlios.de>

B_COLOR_8_BIT is deprecated


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


# 5c99440e0fc0dbde09bbd475a010efb2a600b4aa 16-Sep-2004 Jérôme Duval <korli@users.berlios.de>

Added ColorTools and ColumnListView from Vision cvs repository
(ColorTools.h : 1.2, ColorTools.cpp : 1.4,
ColumnListView.h : 1.13, ColumnListView.cpp : 1.3)
Original code from OpenTracker


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