summaryrefslogtreecommitdiff
path: root/public/mxtk/mxlistview.h
blob: c622f5a02e0853a04311c4e0adb28ca559a90cfc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//========= Copyright � 1996-2003, Valve LLC, All rights reserved. ============
//
// Purpose: 
//
//=============================================================================

#ifndef MXLISTVIEW_H
#define MXLISTVIEW_H
#ifdef _WIN32
#pragma once
#endif

#ifndef INCLUDED_MXWIDGET
#include "mxtk/mxWidget.h"
#endif

#include <wchar.h>

class mxWindow;

class mxListView_i;
class mxListView : public mxWidget
{
	mxListView_i *d_this;

public:
	// CREATORS
	mxListView (mxWindow *parent, int x, int y, int w, int h, int id = 0);
	virtual ~mxListView ();

	// MANIPULATORS
	int add( const char *label );
	void remove ( int item );
	void removeAll ();
	void setLabel ( int item, int column, const char *label);
	void setLabel( int item, int column, const wchar_t *label );

	void setUserData (int item, int column, void *userData);
	void setSelected ( int item, bool b);
	void deselectAll();
	void setImageList( void *himagelist );
	void setImage( int item, int column, int imagenormal );

	void insertTextColumn( int column, int width, char const *label );
	void insertImageColumn( int column, int width, int imageindex );

	void scrollToItem( int item );

	// ACCESSORS
	int	getItemCount() const;
	int getNumSelected() const;
	int getNextSelectedItem ( int startitem = 0 ) const;
	const char *getLabel ( int oitem, int column ) const;
	void *getUserData (int item, int column ) const;
	bool isSelected ( int index ) const;

	void setDrawingEnabled( bool draw );


private:
	// NOT IMPLEMENTED
	mxListView (const mxListView&);
	mxListView& operator= (const mxListView&);
};

#endif // MXLISTVIEW_H