[haiku-development] Re: ColumnListView.h

  • From: Stephan Aßmus <superstippi@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 11 Jan 2012 10:13:09 +0100

Hi,

On 10.01.2012 15:59, Ingo Weinhold wrote:
There's a MVC based table implementation I created for the table-heavy 
DebugAnalyzer [1]. It is not complete yet and currently uses ColumnListView as 
a back-end (which can (and was intended to) be replaced without changing the 
public interface). It is mostly inspired by Swing's JTree and JTable design, 
i.e. unlike Qt it uses different models for trees and flat lists. The unified 
model design has a few nice properties (most notably the flexibility in use -- 
e.g. also for combo boxen (where Qt unfortunately fails ATM) or common 
sort/filter proxy models), so it might be worthwhile considering migrating to 
such a design. Though I think it doesn't make much of a difference as long as 
it's only used for the table and tree classes, anyway.

An interface that works across all list-like stuff, combos and menus included, is certainly nice to have.

The TableView are a Container View (BGridView) and all Items can add in the
Grid.

BGridView is probably not the best choice. While the table items are indeed laid out in a 
grid, the main feature of BGridLayout -- laying out the items according to their minimum 
and maximum sizes -- is not really needed. Item heights are usually fixed and column 
width are set manually or algorithmically (with an explicit "resize to fit" 
option).

Actually, in practice one usually wants a mix of weighted widths and fixed widths. And there are indeed use-cases where the height of table items would be variable, so the full functionality of the BGridLayout may be adequat to drive a BTableView. The use-cases I have in mind may not be the same where one would have thousands of items, so maybe the layout implementation should be exchangable to optimize for the fixed height case.

Best regards,
-Stephan

Other related posts: