Moved scrollbar tracking code to scroll.c.
[wine/multimedia.git] / dlls / user / controls.h
blob5492836840abf690ce6bc10f89bd46c291ad9896
1 /*
2 * User controls definitions
4 * Copyright 2000 Alexandre Julliard
5 */
7 #ifndef __WINE_CONTROLS_H
8 #define __WINE_CONTROLS_H
10 #include "winuser.h"
11 #include "winproc.h"
13 /* Built-in class names (see _Undocumented_Windows_ p.418) */
14 #define POPUPMENU_CLASS_ATOM MAKEINTATOMA(32768) /* PopupMenu */
15 #define DESKTOP_CLASS_ATOM MAKEINTATOMA(32769) /* Desktop */
16 #define DIALOG_CLASS_ATOM MAKEINTATOMA(32770) /* Dialog */
17 #define WINSWITCH_CLASS_ATOM MAKEINTATOMA(32771) /* WinSwitch */
18 #define ICONTITLE_CLASS_ATOM MAKEINTATOMA(32772) /* IconTitle */
20 /* Built-in class descriptor */
21 struct builtin_class_descr
23 LPCSTR name; /* class name */
24 UINT style; /* class style */
25 WNDPROC procA; /* ASCII window procedure */
26 WNDPROC procW; /* Unicode window procedure */
27 INT extra; /* window extra bytes */
28 LPCSTR cursor; /* cursor name */
29 HBRUSH brush; /* brush or system color */
33 /* desktop */
34 extern BOOL DESKTOP_SetPattern( LPCSTR pattern );
36 /* icon title */
37 extern HWND ICONTITLE_Create( HWND hwnd );
39 /* menu controls */
40 extern BOOL MENU_Init(void);
41 extern BOOL MENU_IsMenuActive(void);
42 extern HMENU MENU_GetSysMenu(HWND hWndOwner, HMENU hSysPopup);
43 extern UINT MENU_GetMenuBarHeight( HWND hwnd, UINT menubarWidth,
44 INT orgX, INT orgY );
45 extern void MENU_TrackMouseMenuBar( HWND hwnd, INT ht, POINT pt );
46 extern void MENU_TrackKbdMenuBar( HWND hwnd, UINT wParam, INT vkey );
47 extern UINT MENU_DrawMenuBar( HDC hDC, LPRECT lprect,
48 HWND hwnd, BOOL suppress_draw );
49 extern UINT MENU_FindSubMenu( HMENU *hmenu, HMENU hSubTarget );
51 /* scrollbar */
52 extern void SCROLL_DrawScrollBar( HWND hwnd, HDC hdc, INT nBar, BOOL arrows, BOOL interior );
53 extern void SCROLL_TrackScrollBar( HWND hwnd, INT scrollbar, POINT pt );
54 extern INT SCROLL_SetNCSbState( HWND hwnd, int vMin, int vMax, int vPos,
55 int hMin, int hMax, int hPos );
57 /* combo box */
59 #define ID_CB_LISTBOX 1000
60 #define ID_CB_EDIT 1001
62 /* internal flags */
63 #define CBF_DROPPED 0x0001
64 #define CBF_BUTTONDOWN 0x0002
65 #define CBF_NOROLLUP 0x0004
66 #define CBF_MEASUREITEM 0x0008
67 #define CBF_FOCUSED 0x0010
68 #define CBF_CAPTURE 0x0020
69 #define CBF_EDIT 0x0040
70 #define CBF_NORESIZE 0x0080
71 #define CBF_NOTIFY 0x0100
72 #define CBF_NOREDRAW 0x0200
73 #define CBF_SELCHANGE 0x0400
74 #define CBF_NOEDITNOTIFY 0x1000
75 #define CBF_NOLBSELECT 0x2000 /* do not change current selection */
76 #define CBF_EUI 0x8000
78 /* combo state struct */
79 typedef struct
81 HWND self;
82 HWND owner;
83 UINT dwStyle;
84 HWND hWndEdit;
85 HWND hWndLBox;
86 UINT wState;
87 HFONT hFont;
88 RECT textRect;
89 RECT buttonRect;
90 RECT droppedRect;
91 INT droppedIndex;
92 INT fixedOwnerDrawHeight;
93 INT droppedWidth; /* last two are not used unless set */
94 INT editHeight; /* explicitly */
95 } HEADCOMBO,*LPHEADCOMBO;
97 /* Note, that CBS_DROPDOWNLIST style is actually (CBS_SIMPLE | CBS_DROPDOWN) */
98 #define CB_GETTYPE( lphc ) ((lphc)->dwStyle & (CBS_DROPDOWNLIST))
100 extern BOOL COMBO_FlipListbox( LPHEADCOMBO, BOOL, BOOL );
102 /* Dialog info structure */
103 typedef struct
105 HWND hwndFocus; /* Current control with focus */
106 HFONT hUserFont; /* Dialog font */
107 HMENU hMenu; /* Dialog menu */
108 UINT xBaseUnit; /* Dialog units (depends on the font) */
109 UINT yBaseUnit;
110 INT idResult; /* EndDialog() result / default pushbutton ID */
111 UINT flags; /* EndDialog() called for this dialog */
112 HGLOBAL16 hDialogHeap;
113 } DIALOGINFO;
115 #define DF_END 0x0001
116 #define DF_OWNERENABLED 0x0002
118 /* offset of DIALOGINFO ptr in dialog extra bytes */
119 #define DWL_WINE_DIALOGINFO (DWL_USER+sizeof(ULONG_PTR))
121 inline static DIALOGINFO *DIALOG_get_info( HWND hwnd )
123 return (DIALOGINFO *)GetWindowLongW( hwnd, DWL_WINE_DIALOGINFO );
126 extern BOOL DIALOG_Init(void);
128 #endif /* __WINE_CONTROLS_H */