1 /*$
2  Copyright (C) 2016-2020 Azel.
3 
4  This file is part of AzPainterB.
5 
6  AzPainterB is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  AzPainterB is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 $*/
19 
20 #ifndef MLIB_LISTVIEWAREA_H
21 #define MLIB_LISTVIEWAREA_H
22 
23 #include "mScrollViewArea.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 #define M_LISTVIEWAREA(p)  ((mListViewArea *)(p))
30 
31 typedef struct _mListHeader mListHeader;
32 
33 typedef struct
34 {
35 	mLVItemMan *manager;
36 	mImageList *iconimg;
37 	mListHeader *header;
38 	mWidget *owner;
39 	uint32_t style,
40 		styleLV;
41 	int itemH,
42 		headerH;
43 }mListViewAreaData;
44 
45 typedef struct _mListViewArea
46 {
47 	mWidget wg;
48 	mScrollViewAreaData sva;
49 	mListViewAreaData lva;
50 }mListViewArea;
51 
52 
53 enum MLISTVIEWAREA_STYLE
54 {
55 	MLISTVIEWAREA_S_POPUP = 1
56 };
57 
58 enum MLISTVIEWAREA_NOTIFY
59 {
60 	MLISTVIEWAREA_N_POPUPEND = 10000
61 };
62 
63 
64 #define MLISTVIEW_DRAW_ITEM_MARGIN    3
65 #define MLISTVIEW_DRAW_CHECKBOX_SIZE  13
66 #define MLISTVIEW_DRAW_CHECKBOX_SPACE 4
67 #define MLISTVIEW_DRAW_ICON_SPACE     3
68 
69 
70 /*------*/
71 
72 mListViewArea *mListViewAreaNew(int size,mWidget *parent,
73 	uint32_t style,uint32_t style_listview,
74 	mLVItemMan *manager,mWidget *owner);
75 
76 void mListViewArea_setImageList(mListViewArea *p,mImageList *img);
77 void mListViewArea_scrollToFocus(mListViewArea *p,int dir,int margin_num);
78 
79 #ifdef __cplusplus
80 }
81 #endif
82 
83 #endif
84