15c99440eSJérôme Duval/*
25c99440eSJérôme DuvalOpen Tracker License
35c99440eSJérôme Duval
45c99440eSJérôme DuvalTerms and Conditions
55c99440eSJérôme Duval
65c99440eSJérôme DuvalCopyright (c) 1991-2000, Be Incorporated. All rights reserved.
75c99440eSJérôme Duval
85c99440eSJérôme DuvalPermission is hereby granted, free of charge, to any person obtaining a copy of
95c99440eSJérôme Duvalthis software and associated documentation files (the "Software"), to deal in
105c99440eSJérôme Duvalthe Software without restriction, including without limitation the rights to
115c99440eSJérôme Duvaluse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
125c99440eSJérôme Duvalof the Software, and to permit persons to whom the Software is furnished to do
135c99440eSJérôme Duvalso, subject to the following conditions:
145c99440eSJérôme Duval
155c99440eSJérôme DuvalThe above copyright notice and this permission notice applies to all licensees
165c99440eSJérôme Duvaland shall be included in all copies or substantial portions of the Software.
175c99440eSJérôme Duval
185c99440eSJérôme DuvalTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
195c99440eSJérôme DuvalIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF TITLE, MERCHANTABILITY,
205c99440eSJérôme DuvalFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
215c99440eSJérôme DuvalBE INCORPORATED BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
225c99440eSJérôme DuvalAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION
235c99440eSJérôme DuvalWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
245c99440eSJérôme Duval
255c99440eSJérôme DuvalExcept as contained in this notice, the name of Be Incorporated shall not be
265c99440eSJérôme Duvalused in advertising or otherwise to promote the sale, use or other dealings in
275c99440eSJérôme Duvalthis Software without prior written authorization from Be Incorporated.
285c99440eSJérôme Duval
295c99440eSJérôme DuvalTracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
305c99440eSJérôme Duvalof Be Incorporated in the United States and other countries. Other brand product
315c99440eSJérôme Duvalnames are registered trademarks or trademarks of their respective holders.
325c99440eSJérôme DuvalAll rights reserved.
335c99440eSJérôme Duval*/
345c99440eSJérôme Duval
355c99440eSJérôme Duval/*******************************************************************************
365c99440eSJérôme Duval/
375c99440eSJérôme Duval/	File:			ColumnListView.cpp
385c99440eSJérôme Duval/
395c99440eSJérôme Duval/   Description:    Experimental multi-column list view.
405c99440eSJérôme Duval/
415c99440eSJérôme Duval/	Copyright 2000+, Be Incorporated, All Rights Reserved
425c99440eSJérôme Duval/					 By Jeff Bush
435c99440eSJérôme Duval/
445c99440eSJérôme Duval*******************************************************************************/
455c99440eSJérôme Duval
4689c9e2b9SStephan Aßmus#include "ColumnListView.h"
4789c9e2b9SStephan Aßmus
485c99440eSJérôme Duval#include <typeinfo>
495c99440eSJérôme Duval
5085b350edSJanus#include <algorithm>
515c99440eSJérôme Duval#include <stdio.h>
525c99440eSJérôme Duval#include <stdlib.h>
535c99440eSJérôme Duval
545c99440eSJérôme Duval#include <Application.h>
555c99440eSJérôme Duval#include <Bitmap.h>
56454ff904SStephan Aßmus#include <ControlLook.h>
575c99440eSJérôme Duval#include <Cursor.h>
585c99440eSJérôme Duval#include <Debug.h>
595c99440eSJérôme Duval#include <GraphicsDefs.h>
60bfc1a92fSStephan Aßmus#include <LayoutUtils.h>
615c99440eSJérôme Duval#include <MenuItem.h>
625c99440eSJérôme Duval#include <PopUpMenu.h>
635c99440eSJérôme Duval#include <Region.h>
645c99440eSJérôme Duval#include <ScrollBar.h>
655c99440eSJérôme Duval#include <String.h>
667bcbf187SRene Gollent#include <SupportDefs.h>
675c99440eSJérôme Duval#include <Window.h>
685c99440eSJérôme Duval
69915a7b8cSOliver Tappe#include <ObjectListPrivate.h>
70915a7b8cSOliver Tappe
7189c9e2b9SStephan Aßmus#include "ObjectList.h"
7289c9e2b9SStephan Aßmus
73539dc1bcSJohn Scipione
745c99440eSJérôme Duval#define DOUBLE_BUFFERED_COLUMN_RESIZE 1
755c99440eSJérôme Duval#define SMART_REDRAW 1
765c99440eSJérôme Duval#define DRAG_TITLE_OUTLINE 1
775c99440eSJérôme Duval#define CONSTRAIN_CLIPPING_REGION 1
78454ff904SStephan Aßmus#define LOWER_SCROLLBAR 0
795c99440eSJérôme Duval
80539dc1bcSJohn Scipione
815c99440eSJérôme Duvalnamespace BPrivate {
825c99440eSJérôme Duval
831ad26e2aSIngo Weinholdstatic const unsigned char kDownSortArrow8x8[] = {
845c99440eSJérôme Duval	0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
855c99440eSJérôme Duval	0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
865c99440eSJérôme Duval	0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
875c99440eSJérôme Duval	0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
885c99440eSJérôme Duval	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
895c99440eSJérôme Duval	0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff,
905c99440eSJérôme Duval	0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
915c99440eSJérôme Duval	0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff
925c99440eSJérôme Duval};
935c99440eSJérôme Duval
941ad26e2aSIngo Weinholdstatic const unsigned char kUpSortArrow8x8[] = {
955c99440eSJérôme Duval	0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff,
965c99440eSJérôme Duval	0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
975c99440eSJérôme Duval	0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff,
985c99440eSJérôme Duval	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
995c99440eSJérôme Duval	0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
1005c99440eSJérôme Duval	0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
1015c99440eSJérôme Duval	0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
1025c99440eSJérôme Duval	0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff
1035c99440eSJérôme Duval};
1045c99440eSJérôme Duval
1051ad26e2aSIngo Weinholdstatic const unsigned char kDownSortArrow8x8Invert[] = {
1065c99440eSJérôme Duval	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1075c99440eSJérôme Duval	0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0xff,
1085c99440eSJérôme Duval	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1095c99440eSJérôme Duval	0xff, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0xff, 0xff,
1105c99440eSJérôme Duval	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1115c99440eSJérôme Duval	0xff, 0xff, 0x1f, 0x1f, 0x1f, 0xff, 0xff, 0xff,
1125c99440eSJérôme Duval	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1135c99440eSJérôme Duval	0xff, 0xff, 0xff, 0x1f, 0xff, 0xff, 0xff, 0xff
1145c99440eSJérôme Duval};
1155c99440eSJérôme Duval
1161ad26e2aSIngo Weinholdstatic const unsigned char kUpSortArrow8x8Invert[] = {
1175c99440eSJérôme Duval	0xff, 0xff, 0xff, 0x1f, 0xff, 0xff, 0xff, 0xff,
1185c99440eSJérôme Duval	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1195c99440eSJérôme Duval	0xff, 0xff, 0x1f, 0x1f, 0x1f, 0xff, 0xff, 0xff,
1205c99440eSJérôme Duval	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1215c99440eSJérôme Duval	0xff, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0xff, 0xff,
1225c99440eSJérôme Duval	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1235c99440eSJérôme Duval	0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0xff,
1245c99440eSJérôme Duval	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
1255c99440eSJérôme Duval};
1265c99440eSJérôme Duval
1278faf0ba7SPhilippe Houdoinstatic const float kTintedLineTint = 1.04;
1285c99440eSJérôme Duval
12985b350edSJanusstatic const float kMinTitleHeight = 16.0;
13085b350edSJanusstatic const float kMinRowHeight = 16.0;
13185b350edSJanusstatic const float kTitleSpacing = 1.4;
13285b350edSJanusstatic const float kRowSpacing = 1.4;
1335c99440eSJérôme Duvalstatic const float kLatchWidth = 15.0;
1345c99440eSJérôme Duval
1355c99440eSJérôme Duvalstatic const int32 kMaxDepth = 1024;
1365c99440eSJérôme Duvalstatic const float kLeftMargin = kLatchWidth;
1373c772f3eSStephan Aßmusstatic const float kRightMargin = 8;
1385c99440eSJérôme Duvalstatic const float kOutlineLevelIndent = kLatchWidth;
1395c99440eSJérôme Duvalstatic const float kColumnResizeAreaWidth = 10.0;
1405c99440eSJérôme Duvalstatic const float kRowDragSensitivity = 5.0;
1415c99440eSJérôme Duvalstatic const float kDoubleClickMoveSensitivity = 4.0;
1425c99440eSJérôme Duvalstatic const float kSortIndicatorWidth = 9.0;
1435c99440eSJérôme Duvalstatic const float kDropHighlightLineHeight = 2.0;
1445c99440eSJérôme Duval
1455c99440eSJérôme Duvalstatic const uint32 kToggleColumn = 'BTCL';
1465c99440eSJérôme Duval
1475c99440eSJérôme Duvalclass BRowContainer : public BObjectList<BRow>
1485c99440eSJérôme Duval{
1495c99440eSJérôme Duval};
1505c99440eSJérôme Duval
1515c99440eSJérôme Duvalclass TitleView : public BView {
15289c9e2b9SStephan Aßmus	typedef BView _inherited;
1535c99440eSJérôme Duvalpublic:
15489c9e2b9SStephan Aßmus								TitleView(BRect frame, OutlineView* outlineView,
15589c9e2b9SStephan Aßmus									BList* visibleColumns, BList* sortColumns,
15689c9e2b9SStephan Aßmus									BColumnListView* masterView,
15789c9e2b9SStephan Aßmus									uint32 resizingMode);
15889c9e2b9SStephan Aßmus	virtual						~TitleView();
15989c9e2b9SStephan Aßmus
16089c9e2b9SStephan Aßmus			void				ColumnAdded(BColumn* column);
161d571c583SIngo Weinhold			void				ColumnResized(BColumn* column, float oldWidth);
16289c9e2b9SStephan Aßmus			void				SetColumnVisible(BColumn* column, bool visible);
16389c9e2b9SStephan Aßmus
16489c9e2b9SStephan Aßmus	virtual	void				Draw(BRect updateRect);
16589c9e2b9SStephan Aßmus	virtual	void				ScrollTo(BPoint where);
16689c9e2b9SStephan Aßmus	virtual	void				MessageReceived(BMessage* message);
16789c9e2b9SStephan Aßmus	virtual	void				MouseDown(BPoint where);
16889c9e2b9SStephan Aßmus	virtual	void				MouseMoved(BPoint where, uint32 transit,
16989c9e2b9SStephan Aßmus									const BMessage* dragMessage);
17089c9e2b9SStephan Aßmus	virtual	void				MouseUp(BPoint where);
17189c9e2b9SStephan Aßmus	virtual	void				FrameResized(float width, float height);
172d571c583SIngo Weinhold
17389c9e2b9SStephan Aßmus			void				MoveColumn(BColumn* column, int32 index);
17489c9e2b9SStephan Aßmus			void				SetColumnFlags(column_flags flags);
1755c99440eSJérôme Duval
17689c9e2b9SStephan Aßmus			void				SetEditMode(bool state)
17789c9e2b9SStephan Aßmus									{ fEditMode = state; }
1785c99440eSJérôme Duval
1793c772f3eSStephan Aßmus			float				MarginWidth() const;
1803c772f3eSStephan Aßmus
1815c99440eSJérôme Duvalprivate:
18289c9e2b9SStephan Aßmus			void				GetTitleRect(BColumn* column, BRect* _rect);
18389c9e2b9SStephan Aßmus			int32				FindColumn(BPoint where, float* _leftEdge);
18489c9e2b9SStephan Aßmus			void				FixScrollBar(bool scrollToFit);
18589c9e2b9SStephan Aßmus			void				DragSelectedColumn(BPoint where);
18689c9e2b9SStephan Aßmus			void				ResizeSelectedColumn(BPoint where,
18789c9e2b9SStephan Aßmus									bool preferred = false);
18889c9e2b9SStephan Aßmus			void				ComputeDragBoundries(BColumn* column,
18989c9e2b9SStephan Aßmus									BPoint where);
19089c9e2b9SStephan Aßmus			void				DrawTitle(BView* view, BRect frame,
19189c9e2b9SStephan Aßmus									BColumn* column, bool depressed);
19289c9e2b9SStephan Aßmus
193b439d6e5SStephan Aßmus			float				_VirtualWidth() const;
194b439d6e5SStephan Aßmus
19589c9e2b9SStephan Aßmus			OutlineView*		fOutlineView;
19689c9e2b9SStephan Aßmus			BList*				fColumns;
19789c9e2b9SStephan Aßmus			BList*				fSortColumns;
198b439d6e5SStephan Aßmus//			float				fColumnsWidth;
19989c9e2b9SStephan Aßmus			BRect				fVisibleRect;
200d571c583SIngo Weinhold
2015c99440eSJérôme Duval#if DOUBLE_BUFFERED_COLUMN_RESIZE
20289c9e2b9SStephan Aßmus			BBitmap*			fDrawBuffer;
20389c9e2b9SStephan Aßmus			BView*				fDrawBufferView;
2045c99440eSJérôme Duval#endif
2055c99440eSJérôme Duval
20689c9e2b9SStephan Aßmus			enum {
20789c9e2b9SStephan Aßmus				INACTIVE,
20889c9e2b9SStephan Aßmus				RESIZING_COLUMN,
20989c9e2b9SStephan Aßmus				PRESSING_COLUMN,
21089c9e2b9SStephan Aßmus				DRAG_COLUMN_INSIDE_TITLE,
21189c9e2b9SStephan Aßmus				DRAG_COLUMN_OUTSIDE_TITLE
21289c9e2b9SStephan Aßmus			}					fCurrentState;
2135c99440eSJérôme Duval
21489c9e2b9SStephan Aßmus			BPopUpMenu*			fColumnPop;
21589c9e2b9SStephan Aßmus			BColumnListView*	fMasterView;
21689c9e2b9SStephan Aßmus			bool				fEditMode;
21789c9e2b9SStephan Aßmus			int32				fColumnFlags;
2185c99440eSJérôme Duval
2195c99440eSJérôme Duval	// State information for resizing/dragging
22089c9e2b9SStephan Aßmus			BColumn*			fSelectedColumn;
22189c9e2b9SStephan Aßmus			BRect				fSelectedColumnRect;
22289c9e2b9SStephan Aßmus			bool				fResizingFirstColumn;
22389c9e2b9SStephan Aßmus			BPoint				fClickPoint; // offset within cell
22489c9e2b9SStephan Aßmus			float				fLeftDragBoundry;
22589c9e2b9SStephan Aßmus			float				fRightDragBoundry;
22689c9e2b9SStephan Aßmus			BPoint				fCurrentDragPosition;
2275c99440eSJérôme Duval
228d571c583SIngo Weinhold
22989c9e2b9SStephan Aßmus			BBitmap*			fUpSortArrow;
23089c9e2b9SStephan Aßmus			BBitmap*			fDownSortArrow;
2319553296aSStephan Aßmus
23289c9e2b9SStephan Aßmus			BCursor*			fResizeCursor;
23389c9e2b9SStephan Aßmus			BCursor*			fMinResizeCursor;
23489c9e2b9SStephan Aßmus			BCursor*			fMaxResizeCursor;
23589c9e2b9SStephan Aßmus			BCursor*			fColumnMoveCursor;
2365c99440eSJérôme Duval};
2375c99440eSJérôme Duval
238539dc1bcSJohn Scipione
2395c99440eSJérôme Duvalclass OutlineView : public BView {
24089c9e2b9SStephan Aßmus	typedef BView _inherited;
2415c99440eSJérôme Duvalpublic:
24289c9e2b9SStephan Aßmus								OutlineView(BRect, BList* visibleColumns,
24389c9e2b9SStephan Aßmus									BList* sortColumns,
24489c9e2b9SStephan Aßmus									BColumnListView* listView);
24589c9e2b9SStephan Aßmus	virtual						~OutlineView();
2465c99440eSJérôme Duval
2475c99440eSJérôme Duval	virtual void				Draw(BRect);
2485c99440eSJérôme Duval	const 	BRect&				VisibleRect() const;
2495c99440eSJérôme Duval
25089c9e2b9SStephan Aßmus			void				RedrawColumn(BColumn* column, float leftEdge,
25189c9e2b9SStephan Aßmus									bool isFirstColumn);
2525c99440eSJérôme Duval			void 				StartSorting();
25389c9e2b9SStephan Aßmus			float				GetColumnPreferredWidth(BColumn* column);
254d571c583SIngo Weinhold
25589c9e2b9SStephan Aßmus			void				AddRow(BRow*, int32 index, BRow* TheRow);
25689c9e2b9SStephan Aßmus			BRow*				CurrentSelection(BRow* lastSelected) const;
2575c99440eSJérôme Duval			void 				ToggleFocusRowSelection(bool selectRange);
2585c99440eSJérôme Duval			void 				ToggleFocusRowOpen();
25989c9e2b9SStephan Aßmus			void 				ChangeFocusRow(bool up, bool updateSelection,
26089c9e2b9SStephan Aßmus									bool addToCurrentSelection);
2615c99440eSJérôme Duval			void 				MoveFocusToVisibleRect();
26289c9e2b9SStephan Aßmus			void 				ExpandOrCollapse(BRow* parent, bool expand);
2635c99440eSJérôme Duval			void 				RemoveRow(BRow*);
2645c99440eSJérôme Duval			BRowContainer*		RowList();
2655c99440eSJérôme Duval			void				UpdateRow(BRow*);
26689c9e2b9SStephan Aßmus			bool				FindParent(BRow* row, BRow** _parent,
26789c9e2b9SStephan Aßmus									bool* _isVisible);
26889c9e2b9SStephan Aßmus			int32				IndexOf(BRow* row);
2695c99440eSJérôme Duval			void				Deselect(BRow*);
2705c99440eSJérôme Duval			void				AddToSelection(BRow*);
2715c99440eSJérôme Duval			void				DeselectAll();
2725c99440eSJérôme Duval			BRow*				FocusRow() const;
27389c9e2b9SStephan Aßmus			void				SetFocusRow(BRow* row, bool select);
27489c9e2b9SStephan Aßmus			BRow*				FindRow(float ypos, int32* _indent,
27589c9e2b9SStephan Aßmus									float* _top);
27689c9e2b9SStephan Aßmus			bool				FindRect(const BRow* row, BRect* _rect);
27789c9e2b9SStephan Aßmus			void				ScrollTo(const BRow* row);
2785c99440eSJérôme Duval
2795c99440eSJérôme Duval			void				Clear();
28089c9e2b9SStephan Aßmus			void				SetSelectionMode(list_view_type type);
2815c99440eSJérôme Duval			list_view_type		SelectionMode() const;
2825c99440eSJérôme Duval			void				SetMouseTrackingEnabled(bool);
2835c99440eSJérôme Duval			void				FixScrollBar(bool scrollToFit);
28489c9e2b9SStephan Aßmus			void				SetEditMode(bool state)
28589c9e2b9SStephan Aßmus									{ fEditMode = state; }
2865c99440eSJérôme Duval
2875c99440eSJérôme Duval	virtual void				FrameResized(float width, float height);
28889c9e2b9SStephan Aßmus	virtual void				ScrollTo(BPoint where);
28989c9e2b9SStephan Aßmus	virtual void				MouseDown(BPoint where);
29089c9e2b9SStephan Aßmus	virtual void				MouseMoved(BPoint where, uint32 transit,
29189c9e2b9SStephan Aßmus									const BMessage* dragMessage);
29289c9e2b9SStephan Aßmus	virtual void				MouseUp(BPoint where);
29389c9e2b9SStephan Aßmus	virtual void				MessageReceived(BMessage* message);
2945c99440eSJérôme Duval
2955c99440eSJérôme Duvalprivate:
29689c9e2b9SStephan Aßmus			bool				SortList(BRowContainer* list, bool isVisible);
29789c9e2b9SStephan Aßmus	static	int32				DeepSortThreadEntry(void* outlineView);
2985c99440eSJérôme Duval			void				DeepSort();
29989c9e2b9SStephan Aßmus			void				SelectRange(BRow* start, BRow* end);
30089c9e2b9SStephan Aßmus			int32				CompareRows(BRow* row1, BRow* row2);
30189c9e2b9SStephan Aßmus			void				AddSorted(BRowContainer* list, BRow* row);
30289c9e2b9SStephan Aßmus			void				RecursiveDeleteRows(BRowContainer* list,
30389c9e2b9SStephan Aßmus									bool owner);
3045c99440eSJérôme Duval			void				InvalidateCachedPositions();
30589c9e2b9SStephan Aßmus			bool				FindVisibleRect(BRow* row, BRect* _rect);
3065c99440eSJérôme Duval
30789c9e2b9SStephan Aßmus			BList*				fColumns;
30889c9e2b9SStephan Aßmus			BList*				fSortColumns;
30989c9e2b9SStephan Aßmus			float				fItemsHeight;
31089c9e2b9SStephan Aßmus			BRowContainer		fRows;
31189c9e2b9SStephan Aßmus			BRect				fVisibleRect;
3125c99440eSJérôme Duval
3135c99440eSJérôme Duval#if DOUBLE_BUFFERED_COLUMN_RESIZE
31489c9e2b9SStephan Aßmus			BBitmap*			fDrawBuffer;
31589c9e2b9SStephan Aßmus			BView*				fDrawBufferView;
3165c99440eSJérôme Duval#endif
3175c99440eSJérôme Duval
31889c9e2b9SStephan Aßmus			BRow*				fFocusRow;
31989c9e2b9SStephan Aßmus			BRect				fFocusRowRect;
32089c9e2b9SStephan Aßmus			BRow*				fRollOverRow;
32189c9e2b9SStephan Aßmus
32289c9e2b9SStephan Aßmus			BRow				fSelectionListDummyHead;
32389c9e2b9SStephan Aßmus			BRow*				fLastSelectedItem;
32489c9e2b9SStephan Aßmus			BRow*				fFirstSelectedItem;
32589c9e2b9SStephan Aßmus
32689c9e2b9SStephan Aßmus			thread_id			fSortThread;
32789c9e2b9SStephan Aßmus			int32				fNumSorted;
32889c9e2b9SStephan Aßmus			bool				fSortCancelled;
32989c9e2b9SStephan Aßmus
33089c9e2b9SStephan Aßmus			enum CurrentState {
33189c9e2b9SStephan Aßmus				INACTIVE,
33289c9e2b9SStephan Aßmus				LATCH_CLICKED,
33389c9e2b9SStephan Aßmus				ROW_CLICKED,
33489c9e2b9SStephan Aßmus				DRAGGING_ROWS
33589c9e2b9SStephan Aßmus			};
336d571c583SIngo Weinhold
33789c9e2b9SStephan Aßmus			CurrentState		fCurrentState;
338d571c583SIngo Weinhold
3395c99440eSJérôme Duval
34089c9e2b9SStephan Aßmus			BColumnListView*	fMasterView;
34189c9e2b9SStephan Aßmus			list_view_type		fSelectionMode;
34289c9e2b9SStephan Aßmus			bool				fTrackMouse;
34389c9e2b9SStephan Aßmus			BField*				fCurrentField;
34489c9e2b9SStephan Aßmus			BRow*				fCurrentRow;
34589c9e2b9SStephan Aßmus			BColumn*			fCurrentColumn;
34689c9e2b9SStephan Aßmus			bool				fMouseDown;
34789c9e2b9SStephan Aßmus			BRect				fFieldRect;
34889c9e2b9SStephan Aßmus			int32				fCurrentCode;
34989c9e2b9SStephan Aßmus			bool				fEditMode;
3505c99440eSJérôme Duval
3515c99440eSJérôme Duval	// State information for mouse/keyboard interaction
35289c9e2b9SStephan Aßmus			BPoint				fClickPoint;
35389c9e2b9SStephan Aßmus			bool				fDragging;
35489c9e2b9SStephan Aßmus			int32				fClickCount;
35589c9e2b9SStephan Aßmus			BRow*				fTargetRow;
35689c9e2b9SStephan Aßmus			float				fTargetRowTop;
35789c9e2b9SStephan Aßmus			BRect				fLatchRect;
35889c9e2b9SStephan Aßmus			float				fDropHighlightY;
3595c99440eSJérôme Duval
3605c99440eSJérôme Duval	friend class RecursiveOutlineIterator;
3615c99440eSJérôme Duval};
3625c99440eSJérôme Duval
363539dc1bcSJohn Scipione
3645c99440eSJérôme Duvalclass RecursiveOutlineIterator {
3655c99440eSJérôme Duvalpublic:
36689c9e2b9SStephan Aßmus								RecursiveOutlineIterator(
36789c9e2b9SStephan Aßmus									BRowContainer* container,
36889c9e2b9SStephan Aßmus									bool openBranchesOnly = true);
36989c9e2b9SStephan Aßmus
37089c9e2b9SStephan Aßmus			BRow*				CurrentRow() const;
37189c9e2b9SStephan Aßmus			int32				CurrentLevel() const;
37289c9e2b9SStephan Aßmus			void				GoToNext();
3735c99440eSJérôme Duval
3745c99440eSJérôme Duvalprivate:
37589c9e2b9SStephan Aßmus			struct {
37689c9e2b9SStephan Aßmus				BRowContainer* fRowSet;
37789c9e2b9SStephan Aßmus				int32 fIndex;
37889c9e2b9SStephan Aßmus				int32 fDepth;
37989c9e2b9SStephan Aßmus			}					fStack[kMaxDepth];
38089c9e2b9SStephan Aßmus
38189c9e2b9SStephan Aßmus			int32				fStackIndex;
38289c9e2b9SStephan Aßmus			BRowContainer*		fCurrentList;
38389c9e2b9SStephan Aßmus			int32				fCurrentListIndex;
38489c9e2b9SStephan Aßmus			int32				fCurrentListDepth;
38589c9e2b9SStephan Aßmus			bool				fOpenBranchesOnly;
3865c99440eSJérôme Duval};
3875c99440eSJérôme Duval
3885c99440eSJérôme Duval}	// namespace BPrivate
3895c99440eSJérôme Duval
39089c9e2b9SStephan Aßmus
3915c99440eSJérôme Duvalusing namespace BPrivate;
3925c99440eSJérôme Duval
39389c9e2b9SStephan Aßmus
3945c99440eSJérôme DuvalBField::BField()
3955c99440eSJérôme Duval{
3965c99440eSJérôme Duval}
3975c99440eSJérôme Duval
39889c9e2b9SStephan Aßmus
3995c99440eSJérôme DuvalBField::~BField()
4005c99440eSJérôme Duval{
4015c99440eSJérôme Duval}
4025c99440eSJérôme Duval
40389c9e2b9SStephan Aßmus
4045c99440eSJérôme Duval// #pragma mark -
4055c99440eSJérôme Duval
40689c9e2b9SStephan Aßmus
40789c9e2b9SStephan Aßmusvoid
40889c9e2b9SStephan AßmusBColumn::MouseMoved(BColumnListView* /*parent*/, BRow* /*row*/,
40989c9e2b9SStephan Aßmus	BField* /*field*/, BRect /*field_rect*/, BPoint/*point*/,
41089c9e2b9SStephan Aßmus	uint32 /*buttons*/, int32 /*code*/)
4115c99440eSJérôme Duval{
4125c99440eSJérôme Duval}
4135c99440eSJérôme Duval
41489c9e2b9SStephan Aßmus
41589c9e2b9SStephan Aßmusvoid
41689c9e2b9SStephan AßmusBColumn::MouseDown(BColumnListView* /*parent*/, BRow* /*row*/,
41789c9e2b9SStephan Aßmus	BField* /*field*/, BRect /*field_rect*/, BPoint /*point*/,
41889c9e2b9SStephan Aßmus	uint32 /*buttons*/)
4195c99440eSJérôme Duval{
4205c99440eSJérôme Duval}
4215c99440eSJérôme Duval
42289c9e2b9SStephan Aßmus
42389c9e2b9SStephan Aßmusvoid
42489c9e2b9SStephan AßmusBColumn::MouseUp(BColumnListView* /*parent*/, BRow* /*row*/, BField* /*field*/)
4255c99440eSJérôme Duval{
4265c99440eSJérôme Duval}
4275c99440eSJérôme Duval
42889c9e2b9SStephan Aßmus
4295c99440eSJérôme Duval// #pragma mark -
4305c99440eSJérôme Duval
43189c9e2b9SStephan Aßmus
43285b350edSJanusBRow::BRow()
43385b350edSJanus	:
43485b350edSJanus	fChildList(NULL),
43585b350edSJanus	fIsExpanded(false),
43685b350edSJanus	fHeight(std::max(kMinRowHeight,
43785b350edSJanus		ceilf(be_plain_font->Size() * kRowSpacing))),
43885b350edSJanus	fNextSelected(NULL),
43985b350edSJanus	fPrevSelected(NULL),
44085b350edSJanus	fParent(NULL),
44185b350edSJanus	fList(NULL)
44285b350edSJanus{
44385b350edSJanus}
44485b350edSJanus
44585b350edSJanus
4465c99440eSJérôme DuvalBRow::BRow(float height)
44789c9e2b9SStephan Aßmus	:
44889c9e2b9SStephan Aßmus	fChildList(NULL),
44989c9e2b9SStephan Aßmus	fIsExpanded(false),
45089c9e2b9SStephan Aßmus	fHeight(height),
45189c9e2b9SStephan Aßmus	fNextSelected(NULL),
45289c9e2b9SStephan Aßmus	fPrevSelected(NULL),
45389c9e2b9SStephan Aßmus	fParent(NULL),
45489c9e2b9SStephan Aßmus	fList(NULL)
4555c99440eSJérôme Duval{
4565c99440eSJérôme Duval}
4575c99440eSJérôme Duval
45889c9e2b9SStephan Aßmus
4595c99440eSJérôme DuvalBRow::~BRow()
4605c99440eSJérôme Duval{
4615c99440eSJérôme Duval	while (true) {
46274e28840SRene Gollent		BField* field = (BField*) fFields.RemoveItem((int32)0);
4635c99440eSJérôme Duval		if (field == 0)
4645c99440eSJérôme Duval			break;
465d571c583SIngo Weinhold
4665c99440eSJérôme Duval		delete field;
467d571c583SIngo Weinhold	}
4685c99440eSJérôme Duval}
4695c99440eSJérôme Duval
47089c9e2b9SStephan Aßmus
47189c9e2b9SStephan Aßmusbool
47289c9e2b9SStephan AßmusBRow::HasLatch() const
4735c99440eSJérôme Duval{
4745c99440eSJérôme Duval	return fChildList != 0;
4755c99440eSJérôme Duval}
4765c99440eSJérôme Duval
47789c9e2b9SStephan Aßmus
47889c9e2b9SStephan Aßmusint32
47989c9e2b9SStephan AßmusBRow::CountFields() const
4805c99440eSJérôme Duval{
4815c99440eSJérôme Duval	return fFields.CountItems();
4825c99440eSJérôme Duval}
4835c99440eSJérôme Duval
48489c9e2b9SStephan Aßmus
48589c9e2b9SStephan AßmusBField*
48689c9e2b9SStephan AßmusBRow::GetField(int32 index)
4875c99440eSJérôme Duval{
48889c9e2b9SStephan Aßmus	return (BField*)fFields.ItemAt(index);
4895c99440eSJérôme Duval}
4905c99440eSJérôme Duval
49189c9e2b9SStephan Aßmus
49289c9e2b9SStephan Aßmusconst BField*
49389c9e2b9SStephan AßmusBRow::GetField(int32 index) const
4945c99440eSJérôme Duval{
49589c9e2b9SStephan Aßmus	return (const BField*)fFields.ItemAt(index);
4965c99440eSJérôme Duval}
4975c99440eSJérôme Duval
49889c9e2b9SStephan Aßmus
49989c9e2b9SStephan Aßmusvoid
50089c9e2b9SStephan AßmusBRow::SetField(BField* field, int32 logicalFieldIndex)
5015c99440eSJérôme Duval{
5025c99440eSJérôme Duval	if (fFields.ItemAt(logicalFieldIndex) != 0)
50389c9e2b9SStephan Aßmus		delete (BField*)fFields.RemoveItem(logicalFieldIndex);
504d571c583SIngo Weinhold
50589c9e2b9SStephan Aßmus	if (NULL != fList) {
5065c99440eSJérôme Duval		ValidateField(field, logicalFieldIndex);
507bdd7ba66SStephan Aßmus		Invalidate();
5085c99440eSJérôme Duval	}
509d571c583SIngo Weinhold
5105c99440eSJérôme Duval	fFields.AddItem(field, logicalFieldIndex);
5115c99440eSJérôme Duval}
5125c99440eSJérôme Duval
51389c9e2b9SStephan Aßmus
51489c9e2b9SStephan Aßmusfloat
51589c9e2b9SStephan AßmusBRow::Height() const
5165c99440eSJérôme Duval{
5175c99440eSJérôme Duval	return fHeight;
5185c99440eSJérôme Duval}
5195c99440eSJérôme Duval
52089c9e2b9SStephan Aßmus
52189c9e2b9SStephan Aßmusbool
52289c9e2b9SStephan AßmusBRow::IsExpanded() const
5235c99440eSJérôme Duval{
5245c99440eSJérôme Duval	return fIsExpanded;
5255c99440eSJérôme Duval}
5265c99440eSJérôme Duval
52789c9e2b9SStephan Aßmus
52849126a0eSTri-Edge AIbool
52949126a0eSTri-Edge AIBRow::IsSelected() const
53049126a0eSTri-Edge AI{
53149126a0eSTri-Edge AI	return fPrevSelected != NULL;
53249126a0eSTri-Edge AI}
53349126a0eSTri-Edge AI
53449126a0eSTri-Edge AI
535bdd7ba66SStephan Aßmusvoid
536bdd7ba66SStephan AßmusBRow::Invalidate()
537bdd7ba66SStephan Aßmus{
538bdd7ba66SStephan Aßmus	if (fList != NULL)
539bdd7ba66SStephan Aßmus		fList->InvalidateRow(this);
540bdd7ba66SStephan Aßmus}
541bdd7ba66SStephan Aßmus
542bdd7ba66SStephan Aßmus
543d571c583SIngo Weinholdvoid
5445c99440eSJérôme DuvalBRow::ValidateFields() const
5455c99440eSJérôme Duval{
54689c9e2b9SStephan Aßmus	for (int32 i = 0; i < CountFields(); i++)
5475c99440eSJérôme Duval		ValidateField(GetField(i), i);
5485c99440eSJérôme Duval}
5495c99440eSJérôme Duval
55089c9e2b9SStephan Aßmus
551d571c583SIngo Weinholdvoid
55289c9e2b9SStephan AßmusBRow::ValidateField(const BField* field, int32 logicalFieldIndex) const
5535c99440eSJérôme Duval{
5545c99440eSJérôme Duval	// The Fields may be moved by the user, but the logicalFieldIndexes
5555c99440eSJérôme Duval	// do not change, so we need to map them over when checking the
5565c99440eSJérôme Duval	// Field types.
557539dc1bcSJohn Scipione	BColumn* column = NULL;
5585c99440eSJérôme Duval	int32 items = fList->CountColumns();
55989c9e2b9SStephan Aßmus	for (int32 i = 0 ; i < items; ++i) {
560539dc1bcSJohn Scipione		column = fList->ColumnAt(i);
561539dc1bcSJohn Scipione		if(column->LogicalFieldNum() == logicalFieldIndex )
5625c99440eSJérôme Duval			break;
5635c99440eSJérôme Duval	}
564d571c583SIngo Weinhold
565539dc1bcSJohn Scipione	if (column == NULL) {
5665c99440eSJérôme Duval		BString dbmessage("\n\n\tThe parent BColumnListView does not have "
567539dc1bcSJohn Scipione			"\n\ta BColumn at the logical field index ");
568d27546c1SRob Gill		dbmessage << logicalFieldIndex << ".\n";
569d27546c1SRob Gill		puts(dbmessage.String());
57089c9e2b9SStephan Aßmus	} else {
571539dc1bcSJohn Scipione		if (!column->AcceptsField(field)) {
5725c99440eSJérôme Duval			BString dbmessage("\n\n\tThe BColumn of type ");
573539dc1bcSJohn Scipione			dbmessage << typeid(*column).name() << "\n\tat logical field index "
574539dc1bcSJohn Scipione				<< logicalFieldIndex << "\n\tdoes not support the field type "
575539dc1bcSJohn Scipione				<< typeid(*field).name() << ".\n\n";
5765c99440eSJérôme Duval			debugger(dbmessage.String());
5775c99440eSJérôme Duval		}
5785c99440eSJérôme Duval	}
5795c99440eSJérôme Duval}
5805c99440eSJérôme Duval
5815c99440eSJérôme Duval
5825c99440eSJérôme Duval// #pragma mark -
5835c99440eSJérôme Duval
58489c9e2b9SStephan Aßmus
5855c99440eSJérôme DuvalBColumn::BColumn(float width, float minWidth, float maxWidth, alignment align)
58689c9e2b9SStephan Aßmus	:
58789c9e2b9SStephan Aßmus	fWidth(width),
58889c9e2b9SStephan Aßmus	fMinWidth(minWidth),
58989c9e2b9SStephan Aßmus	fMaxWidth(maxWidth),
59089c9e2b9SStephan Aßmus	fVisible(true),
59189c9e2b9SStephan Aßmus	fList(0),
59289c9e2b9SStephan Aßmus	fShowHeading(true),
59389c9e2b9SStephan Aßmus	fAlignment(align)
5945c99440eSJérôme Duval{
5955c99440eSJérôme Duval}
5965c99440eSJérôme Duval
59789c9e2b9SStephan Aßmus
5985c99440eSJérôme DuvalBColumn::~BColumn()
5995c99440eSJérôme Duval{
6005c99440eSJérôme Duval}
6015c99440eSJérôme Duval
60289c9e2b9SStephan Aßmus
60389c9e2b9SStephan Aßmusfloat
60489c9e2b9SStephan AßmusBColumn::Width() const
6055c99440eSJérôme Duval{
6065c99440eSJérôme Duval	return fWidth;
6075c99440eSJérôme Duval}
6085c99440eSJérôme Duval
60989c9e2b9SStephan Aßmus
61089c9e2b9SStephan Aßmusvoid
61189c9e2b9SStephan AßmusBColumn::SetWidth(float width)
6125c99440eSJérôme Duval{
6135c99440eSJérôme Duval	fWidth = width;
6145c99440eSJérôme Duval}
6155c99440eSJérôme Duval
61689c9e2b9SStephan Aßmus
61789c9e2b9SStephan Aßmusfloat
61889c9e2b9SStephan AßmusBColumn::MinWidth() const
6195c99440eSJérôme Duval{
6205c99440eSJérôme Duval	return fMinWidth;
6215c99440eSJérôme Duval}
6225c99440eSJérôme Duval
62389c9e2b9SStephan Aßmus
62489c9e2b9SStephan Aßmusfloat
62589c9e2b9SStephan AßmusBColumn::MaxWidth() const
6265c99440eSJérôme Duval{
6275c99440eSJérôme Duval	return fMaxWidth;
6285c99440eSJérôme Duval}
6295c99440eSJérôme Duval
63089c9e2b9SStephan Aßmus
63189c9e2b9SStephan Aßmusvoid
63289c9e2b9SStephan AßmusBColumn::DrawTitle(BRect, BView*)
6335c99440eSJérôme Duval{
6345c99440eSJérôme Duval}
6355c99440eSJérôme Duval
63689c9e2b9SStephan Aßmus
63789c9e2b9SStephan Aßmusvoid
63889c9e2b9SStephan AßmusBColumn::DrawField(BField*, BRect, BView*)
6395c99440eSJérôme Duval{
6405c99440eSJérôme Duval}
6415c99440eSJérôme Duval
64289c9e2b9SStephan Aßmus
64389c9e2b9SStephan Aßmusint
64489c9e2b9SStephan AßmusBColumn::CompareFields(BField*, BField*)
6455c99440eSJérôme Duval{
6465c99440eSJérôme Duval	return 0;
6475c99440eSJérôme Duval}
6485c99440eSJérôme Duval
64989c9e2b9SStephan Aßmus
65089c9e2b9SStephan Aßmusvoid
65189c9e2b9SStephan AßmusBColumn::GetColumnName(BString* into) const
6525c99440eSJérôme Duval{
6535c99440eSJérôme Duval	*into = "(Unnamed)";
6545c99440eSJérôme Duval}
6555c99440eSJérôme Duval
65689c9e2b9SStephan Aßmus
65789c9e2b9SStephan Aßmusfloat
65889c9e2b9SStephan AßmusBColumn::GetPreferredWidth(BField* field, BView* parent) const
6592c558054SJérôme Duval{
6602c558054SJérôme Duval	return fWidth;
6612c558054SJérôme Duval}
6622c558054SJérôme Duval
66389c9e2b9SStephan Aßmus
66489c9e2b9SStephan Aßmusbool
66589c9e2b9SStephan AßmusBColumn::IsVisible() const
6665c99440eSJérôme Duval{
6675c99440eSJérôme Duval	return fVisible;
6685c99440eSJérôme Duval}
6695c99440eSJérôme Duval
67089c9e2b9SStephan Aßmus
67189c9e2b9SStephan Aßmusvoid
67289c9e2b9SStephan AßmusBColumn::SetVisible(bool visible)
6735c99440eSJérôme Duval{
6745c99440eSJérôme Duval	if (fList && (fVisible != visible))
6755c99440eSJérôme Duval		fList->SetColumnVisible(this, visible);
6765c99440eSJérôme Duval}
6775c99440eSJérôme Duval
67889c9e2b9SStephan Aßmus
67989c9e2b9SStephan Aßmusbool
68089c9e2b9SStephan AßmusBColumn::ShowHeading() const
6815c99440eSJérôme Duval{
6825c99440eSJérôme Duval	return fShowHeading;
6835c99440eSJérôme Duval}
6845c99440eSJérôme Duval
68589c9e2b9SStephan Aßmus
68689c9e2b9SStephan Aßmusvoid
68789c9e2b9SStephan AßmusBColumn::SetShowHeading(bool state)
6885c99440eSJérôme Duval{
6895c99440eSJérôme Duval	fShowHeading = state;
6905c99440eSJérôme Duval}
6915c99440eSJérôme Duval
69289c9e2b9SStephan Aßmus
69389c9e2b9SStephan Aßmusalignment
69489c9e2b9SStephan AßmusBColumn::Alignment() const
6955c99440eSJérôme Duval{
6965c99440eSJérôme Duval	return fAlignment;
6975c99440eSJérôme Duval}
6985c99440eSJérôme Duval
69989c9e2b9SStephan Aßmus
70089c9e2b9SStephan Aßmusvoid
70189c9e2b9SStephan AßmusBColumn::SetAlignment(alignment align)
7025c99440eSJérôme Duval{
7035c99440eSJérôme Duval	fAlignment = align;
7045c99440eSJérôme Duval}
7055c99440eSJérôme Duval
70689c9e2b9SStephan Aßmus
70789c9e2b9SStephan Aßmusbool
70889c9e2b9SStephan AßmusBColumn::WantsEvents() const
7095c99440eSJérôme Duval{
7105c99440eSJérôme Duval	return fWantsEvents;
7115c99440eSJérôme Duval}
7125c99440eSJérôme Duval
71389c9e2b9SStephan Aßmus
71489c9e2b9SStephan Aßmusvoid
71589c9e2b9SStephan AßmusBColumn::SetWantsEvents(bool state)
7165c99440eSJérôme Duval{
7175c99440eSJérôme Duval	fWantsEvents = state;
7185c99440eSJérôme Duval}
7195c99440eSJérôme Duval
72089c9e2b9SStephan Aßmus
72189c9e2b9SStephan Aßmusint32
72289c9e2b9SStephan AßmusBColumn::LogicalFieldNum() const
7235c99440eSJérôme Duval{
7245c99440eSJérôme Duval	return fFieldID;
7255c99440eSJérôme Duval}
7265c99440eSJérôme Duval
72789c9e2b9SStephan Aßmus
728d571c583SIngo Weinholdbool
7295c99440eSJérôme DuvalBColumn::AcceptsField(const BField*) const
7305c99440eSJérôme Duval{
7315c99440eSJérôme Duval	return true;
7325c99440eSJérôme Duval}
7335c99440eSJérôme Duval
7345c99440eSJérôme Duval
7355c99440eSJérôme Duval// #pragma mark -
7365c99440eSJérôme Duval
7375c99440eSJérôme Duval
73889c9e2b9SStephan AßmusBColumnListView::BColumnListView(BRect rect, const char* name,
73989c9e2b9SStephan Aßmus	uint32 resizingMode, uint32 flags, border_style border,
74089c9e2b9SStephan Aßmus	bool showHorizontalScrollbar)
74189c9e2b9SStephan Aßmus	:
74289c9e2b9SStephan Aßmus	BView(rect, name, resizingMode,
74389c9e2b9SStephan Aßmus		flags | B_WILL_DRAW | B_FRAME_EVENTS | B_FULL_UPDATE_ON_RESIZE),
744bfc1a92fSStephan Aßmus	fStatusView(NULL),
745bfc1a92fSStephan Aßmus	fSelectionMessage(NULL),
746bfc1a92fSStephan Aßmus	fSortingEnabled(true),
747bfc1a92fSStephan Aßmus	fLatchWidth(kLatchWidth),
748902a98adSRene Gollent	fBorderStyle(border),
749902a98adSRene Gollent	fShowingHorizontalScrollBar(showHorizontalScrollbar)
750bfc1a92fSStephan Aßmus{
751902a98adSRene Gollent	_Init();
752bfc1a92fSStephan Aßmus}
753bfc1a92fSStephan Aßmus
754bfc1a92fSStephan Aßmus
755bfc1a92fSStephan AßmusBColumnListView::BColumnListView(const char* name, uint32 flags,
756bfc1a92fSStephan Aßmus	border_style border, bool showHorizontalScrollbar)
757bfc1a92fSStephan Aßmus	:
758bfc1a92fSStephan Aßmus	BView(name, flags | B_WILL_DRAW | B_FRAME_EVENTS | B_FULL_UPDATE_ON_RESIZE),
759bfc1a92fSStephan Aßmus	fStatusView(NULL),
760bfc1a92fSStephan Aßmus	fSelectionMessage(NULL),
76189c9e2b9SStephan Aßmus	fSortingEnabled(true),
76289c9e2b9SStephan Aßmus	fLatchWidth(kLatchWidth),
763902a98adSRene Gollent	fBorderStyle(border),
764902a98adSRene Gollent	fShowingHorizontalScrollBar(showHorizontalScrollbar)
76589c9e2b9SStephan Aßmus{
766902a98adSRene Gollent	_Init();
7675c99440eSJérôme Duval}
7685c99440eSJérôme Duval
76989c9e2b9SStephan Aßmus
7705c99440eSJérôme DuvalBColumnListView::~BColumnListView()
7715c99440eSJérôme Duval{
77274e28840SRene Gollent	while (BColumn* column = (BColumn*)fColumns.RemoveItem((int32)0))
7735c99440eSJérôme Duval		delete column;
7745c99440eSJérôme Duval}
7755c99440eSJérôme Duval
77689c9e2b9SStephan Aßmus
77789c9e2b9SStephan Aßmusbool
77889c9e2b9SStephan AßmusBColumnListView::InitiateDrag(BPoint, bool)
7795c99440eSJérôme Duval{
7805c99440eSJérôme Duval	return false;
7815c99440eSJérôme Duval}
7825c99440eSJérôme Duval
78389c9e2b9SStephan Aßmus
78489c9e2b9SStephan Aßmusvoid
78589c9e2b9SStephan AßmusBColumnListView::MessageDropped(BMessage*, BPoint)
7865c99440eSJérôme Duval{
7875c99440eSJérôme Duval}
7885c99440eSJérôme Duval
78989c9e2b9SStephan Aßmus
79089c9e2b9SStephan Aßmusvoid
79189c9e2b9SStephan AßmusBColumnListView::ExpandOrCollapse(BRow* row, bool Open)
7925c99440eSJérôme Duval{
79389c9e2b9SStephan Aßmus	fOutlineView->ExpandOrCollapse(row, Open);
7945c99440eSJérôme Duval}
7955c99440eSJérôme Duval
79689c9e2b9SStephan Aßmus
79789c9e2b9SStephan Aßmusstatus_t
79889c9e2b9SStephan AßmusBColumnListView::Invoke(BMessage* message)
7995c99440eSJérôme Duval{
8005c99440eSJérôme Duval	if (message == 0)
8015c99440eSJérôme Duval		message = Message();
8025c99440eSJérôme Duval
8035c99440eSJérôme Duval	return BInvoker::Invoke(message);
8045c99440eSJérôme Duval}
8055c99440eSJérôme Duval
80689c9e2b9SStephan Aßmus
80789c9e2b9SStephan Aßmusvoid
80889c9e2b9SStephan AßmusBColumnListView::ItemInvoked()
8095c99440eSJérôme Duval{
8105c99440eSJérôme Duval	Invoke();
8115c99440eSJérôme Duval}
8125c99440eSJérôme Duval
81389c9e2b9SStephan Aßmus
81489c9e2b9SStephan Aßmusvoid
81589c9e2b9SStephan AßmusBColumnListView::SetInvocationMessage(BMessage* message)
8165c99440eSJérôme Duval{
8175c99440eSJérôme Duval	SetMessage(message);
8185c99440eSJérôme Duval}
8195c99440eSJérôme Duval
82089c9e2b9SStephan Aßmus
82189c9e2b9SStephan AßmusBMessage*
82289c9e2b9SStephan AßmusBColumnListView::InvocationMessage() const
8235c99440eSJérôme Duval{
8245c99440eSJérôme Duval	return Message();
8255c99440eSJérôme Duval}
8265c99440eSJérôme Duval
82789c9e2b9SStephan Aßmus
82889c9e2b9SStephan Aßmusuint32
82989c9e2b9SStephan AßmusBColumnListView::InvocationCommand() const
8305c99440eSJérôme Duval{
8315c99440eSJérôme Duval	return Command();
8325c99440eSJérôme Duval}
8335c99440eSJérôme D