Release 950727
[wine] / include / listbox.h
1 /*
2  *   Listbox definitions
3  */
4
5 typedef struct tagLISTSTRUCT {
6         MEASUREITEMSTRUCT mis;
7         UINT            itemState;
8         RECT            itemRect;
9         HANDLE          hData;
10         char            *itemText;
11         struct tagLISTSTRUCT *lpNext;
12 } LISTSTRUCT, *LPLISTSTRUCT;
13
14 typedef struct {
15         WORD    FirstVisible;
16         WORD    ItemsCount;
17         WORD    ItemsVisible;
18         WORD    ColumnsVisible;
19         WORD    ItemsPerColumn;
20         short   ItemFocused;
21         short   PrevFocused;
22         WORD    StdItemHeight;
23         WORD    ColumnsWidth;
24         WORD    DrawCtlType;
25         WORD    CtlID;
26         LPLISTSTRUCT lpFirst;
27         DWORD   dwStyle;
28         HWND    hParent;
29         HFONT   hFont;
30         BOOL    bRedrawFlag;
31         BOOL    HasStrings;
32         BOOL    OwnerDrawn;
33         WORD    iNumStops;
34         LPINT   TabStops;
35         HANDLE  hDrawItemStruct;
36         BOOL    needMeasure;
37 /*      MDESC   *Heap; */
38 } HEADLIST,*LPHEADLIST;
39
40 /* shared code between listbox and combo controls */
41 extern void CreateListBoxStruct(HWND hwnd, WORD CtlType, LONG styles, HWND parent);
42 extern void DestroyListBoxStruct(LPHEADLIST lphl);
43
44 extern void ListBoxSendNotification(LPHEADLIST lphl,HWND hwnd, WORD code);
45
46 extern LPLISTSTRUCT ListBoxGetItem(LPHEADLIST lphl, UINT uIndex);
47 extern int ListMaxFirstVisible(LPHEADLIST lphl);
48 extern int ListBoxScrollToFocus(LPHEADLIST lphl);
49 extern int ListBoxAddString(LPHEADLIST lphl, LPSTR newstr);
50 extern int ListBoxInsertString(LPHEADLIST lphl, UINT uIndex, LPSTR newstr);
51 extern int ListBoxGetText(LPHEADLIST lphl, UINT uIndex, LPSTR OutStr);
52 extern DWORD ListBoxGetItemData(LPHEADLIST lphl, UINT uIndex);
53 extern int ListBoxSetItemData(LPHEADLIST lphl, UINT uIndex, DWORD ItemData);
54 extern int ListBoxDeleteString(LPHEADLIST lphl, UINT uIndex);
55 extern int ListBoxFindString(LPHEADLIST lphl, UINT nFirst, SEGPTR MatchStr);
56 extern int ListBoxResetContent(LPHEADLIST lphl);
57 extern int ListBoxSetCurSel(LPHEADLIST lphl, WORD wIndex);
58 extern int ListBoxSetSel(LPHEADLIST lphl, WORD wIndex, WORD state);
59 extern int ListBoxGetSel(LPHEADLIST lphl, WORD wIndex);
60 extern int ListBoxDirectory(LPHEADLIST lphl, UINT attrib, LPSTR filespec);
61 extern int ListBoxGetItemRect(LPHEADLIST lphl, WORD wIndex, LPRECT rect);
62 extern int ListBoxSetItemHeight(LPHEADLIST lphl, WORD wIndex, long height);
63 extern int ListBoxFindNextMatch(LPHEADLIST lphl, WORD wChar);
64
65 extern void ListBoxDrawItem (HWND hwnd, LPHEADLIST lphl, HDC hdc,
66                              LPLISTSTRUCT lpls, RECT *rect, WORD itemAction,
67                              WORD itemState);
68 extern int ListBoxFindMouse(LPHEADLIST lphl, int X, int Y);
69 extern void ListBoxAskMeasure(LPHEADLIST lphl, LPLISTSTRUCT lpls);