35#include "wine/unicode.h"
44#define KEYDATA_ALT 0x2000
45#define KEYDATA_PREVSTATE 0x4000
51#define CB_NOTIFY( lphc, code ) \
52 (SendMessageW((lphc)->owner, WM_COMMAND, \
53 MAKEWPARAM(GetWindowLongPtrW((lphc)->self,GWLP_ID), (code)), (LPARAM)(lphc)->self))
55#define CB_DISABLED( lphc ) (!IsWindowEnabled((lphc)->self))
56#define CB_OWNERDRAWN( lphc ) ((lphc)->dwStyle & (CBS_OWNERDRAWFIXED | CBS_OWNERDRAWVARIABLE))
57#define CB_HASSTRINGS( lphc ) ((lphc)->dwStyle & CBS_HASSTRINGS)
58#define CB_HWND( lphc ) ((lphc)->self)
59#define CB_GETTYPE( lphc ) ((lphc)->dwStyle & (CBS_DROPDOWNLIST))
61#define ISWIN31 (LOWORD(GetVersion()) == 0x0a03)
73#define COMBO_YBORDERGAP 5
74#define COMBO_XBORDERSIZE() 2
75#define COMBO_YBORDERSIZE() 2
76#define COMBO_EDITBUTTONSPACE() 0
77#define EDIT_CONTROL_PADDING() 1
79#define ID_CB_LISTBOX 1000
80#define ID_CB_EDIT 1001
126 if (
COMBO_Init() && (lphc = heap_alloc_zero(
sizeof(*lphc))))
148 TRACE(
"[%p], style = %08x\n", lphc, lphc->dwStyle );
161 TRACE(
"[%p]: freeing storage\n", lphc->
self);
207 baseUnitY =
tm.tmHeight;
214 iTextItemHeight = baseUnitY + 4;
226 INT originalItemHeight = iTextItemHeight;
234 lphc->
wState &= ~CBF_MEASUREITEM;
270 return iTextItemHeight;
438 static const WCHAR clbName[] = {
'C',
'o',
'm',
'b',
'o',
'L',
'B',
'o',
'x',0};
439 static const WCHAR editName[] = {
'E',
'd',
'i',
't',0};
520 lbeStyle &= ~WS_BORDER;
575 TRACE(
"init done\n");
578 ERR(
"edit control failure.\n");
579 }
else ERR(
"listbox failure.\n");
580 }
else ERR(
"no owner for visible combo.\n");
674 FIXME(
"LB_ERR probably not handled yet\n");
694 UINT itemState = ODS_COMBOBOXEDIT;
696 HBRUSH hPrevBrush, hBkgBrush;
844 HBRUSH hPrevBrush, hBkgBrush;
1008 if (nDroppedHeight <
r.bottom -
r.top)
1009 nDroppedHeight =
r.bottom -
r.top;
1018 nDroppedHeight -= 1;
1029 r.top =
rect.bottom;
1031 r.bottom =
r.top + nDroppedHeight;
1035 mon_info.
cbSize =
sizeof(mon_info);
1065 TRACE(
"[%p]: sel ok? [%i] dropped? [%i]\n",
1077 lphc->
wState &= ~CBF_DROPPED;
1174 lphc->
wState &= ~CBF_FOCUSED;
1227 lphc->
wState &= ~CBF_NOLBSELECT;
1262 TRACE(
"[%p]: lbox selection change [%x]\n", lphc->
self, lphc->
wState );
1270 else lphc->
wState &= ~CBF_NOROLLUP;
1396 const RECT *rectEdit,
1407 rectEdit->
left, rectEdit->
top,
1422 lphc->
wState &= ~CBF_DROPPED;
1444 int newComboHeight, curComboHeight, curComboWidth;
1460 if( curComboHeight > newComboHeight )
1462 TRACE(
"oldComboHeight=%d, newComboHeight=%d, oldDropBottom=%d, oldDropTop=%d\n",
1470 if( curComboHeight != newComboHeight )
1600 lphc->
wState &= ~CBF_BUTTONDOWN;
1606 lphc->
wState &= ~CBF_CAPTURE;
1631 lphc->
wState &= ~CBF_CAPTURE;
1640 lphc->
wState &= ~CBF_NOLBSELECT;
1649 lphc->
wState &= ~CBF_BUTTONDOWN;
1676 lphc->
wState &= ~CBF_BUTTONDOWN;
1685 lphc->
wState &= ~CBF_CAPTURE;
1749 case WM_THEMECHANGED:
1826 if (!hwndFocus || (hwndFocus != lphc->
hWndEdit && hwndFocus != lphc->
hWndLBox))
1843 if (
j == -1)
return 0;
1851 lphc->
wState &= ~CBF_NOEDITNOTIFY;
1881 lphc->
wState &= ~CBF_NOREDRAW;
1949 lphc->
wState &= ~CBF_HOT;
2097 lphc->
wState &= ~CBF_SELCHANGE;
2129 lphc->
wState &= ~CBF_EUI;
2163 memset(&wndClass, 0,
sizeof(wndClass));
2175void COMBO_Unregister(
void)
static void * heap_alloc(size_t len)
static BOOL heap_free(void *mem)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
static LRESULT COMBO_Paint(HEADCOMBO *lphc, HDC hdc)
static LRESULT COMBO_NCDestroy(HEADCOMBO *lphc)
static void CBRepaintButton(LPHEADCOMBO lphc)
#define COMBO_EDITBUTTONSPACE()
static LRESULT COMBO_NCCreate(HWND hwnd, LONG style)
static BOOL COMBO_Init(void)
#define EDIT_CONTROL_PADDING()
void COMBO_Register(void)
static void COMBO_LButtonDown(LPHEADCOMBO lphc, LPARAM lParam)
static void COMBO_KillFocus(LPHEADCOMBO lphc)
static HBRUSH COMBO_PrepareColors(LPHEADCOMBO lphc, HDC hDC)
static void CBPaintBorder(HWND hwnd, const HEADCOMBO *lphc, HDC hdc)
static INT CBUpdateLBox(LPHEADCOMBO lphc, BOOL bSelect)
static void COMBO_MouseMove(LPHEADCOMBO lphc, WPARAM wParam, LPARAM lParam)
static void CBCalcPlacement(HWND hwnd, LPHEADCOMBO lphc, LPRECT lprEdit, LPRECT lprButton, LPRECT lprLB)
static LRESULT COMBO_GetComboBoxInfo(const HEADCOMBO *lphc, COMBOBOXINFO *pcbi)
static void COMBO_SetFocus(LPHEADCOMBO lphc)
#define CB_OWNERDRAWN(lphc)
static void CBForceDummyResize(LPHEADCOMBO lphc)
static void CBPaintText(HEADCOMBO *lphc, HDC hdc_paint)
#define COMBO_YBORDERSIZE()
static LRESULT COMBO_Command(LPHEADCOMBO lphc, WPARAM wParam, HWND hWnd)
static void COMBO_LButtonUp(LPHEADCOMBO lphc)
#define CB_HASSTRINGS(lphc)
static void COMBO_Size(LPHEADCOMBO lphc)
static LRESULT COMBO_ThemedPaint(HTHEME theme, HEADCOMBO *lphc, HDC hdc)
static INT CBGetTextAreaHeight(HWND hwnd, LPHEADCOMBO lphc)
static LRESULT COMBO_ItemOp(LPHEADCOMBO lphc, UINT msg, LPARAM lParam)
#define COMBO_XBORDERSIZE()
static LRESULT COMBO_SelectString(LPHEADCOMBO lphc, INT start, LPARAM pText)
static void CBRollUp(LPHEADCOMBO lphc, BOOL ok, BOOL bButton)
BOOL COMBO_FlipListbox(LPHEADCOMBO lphc, BOOL ok, BOOL bRedrawButton)
static LRESULT COMBO_SetItemHeight(LPHEADCOMBO lphc, INT index, INT height)
static void CBResetPos(LPHEADCOMBO lphc, const RECT *rectEdit, const RECT *rectLB, BOOL bRedraw)
static void CBDropDown(LPHEADCOMBO lphc)
static LRESULT COMBO_GetText(HEADCOMBO *lphc, INT count, LPWSTR buf)
static void COMBO_Font(LPHEADCOMBO lphc, HFONT hFont, BOOL bRedraw)
#define CB_DISABLED(lphc)
#define CB_NOTIFY(lphc, code)
static void CBGetDroppedControlRect(LPHEADCOMBO lphc, LPRECT lpRect)
static void CBPaintButton(LPHEADCOMBO lphc, HDC hdc, RECT rectButton)
static LRESULT COMBO_Create(HWND hwnd, LPHEADCOMBO lphc, HWND hwndParent, LONG style)
static void CBUpdateEdit(LPHEADCOMBO lphc, INT index)
static LRESULT CALLBACK COMBO_WindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
HRESULT WINAPI DrawThemeBackground(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect)
HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR classlist)
HTHEME WINAPI GetWindowTheme(HWND hwnd)
HRESULT WINAPI CloseThemeData(HTHEME hTheme)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
GLuint GLuint GLsizei count
GLint GLint GLsizei GLsizei height
GLdouble GLdouble GLdouble r
GLenum GLuint GLenum GLsizei const GLchar * buf
GLuint GLsizei GLsizei * length
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
static HTHEME(WINAPI *pOpenThemeDataEx)(HWND
HMONITOR WINAPI MonitorFromRect(LPCRECT, DWORD)
#define LBS_DISABLENOSCROLL
#define WS_EX_NOPARENTNOTIFY
#define LBS_NOINTEGRALHEIGHT
static __inline const char * wine_dbgstr_rect(const RECT *rect)
static const WCHAR empty_stringW[]
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
BOOL WINAPI GetTextMetricsW(_In_ HDC, _Out_ LPTEXTMETRICW)
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
BOOL WINAPI ExtTextOutW(_In_ HDC hdc, _In_ int x, _In_ int y, _In_ UINT options, _In_opt_ const RECT *lprect, _In_reads_opt_(c) LPCWSTR lpString, _In_ UINT c, _In_reads_opt_(c) const INT *lpDx)
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
BOOL WINAPI DeleteDC(_In_ HDC)
int WINAPI SelectClipRgn(_In_ HDC, _In_opt_ HRGN)
#define CBS_OWNERDRAWFIXED
HWND WINAPI SetCapture(_In_ HWND hWnd)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
DWORD WINAPI GetSysColor(_In_ int)
#define STATE_SYSTEM_PRESSED
BOOL WINAPI CopyRect(_Out_ LPRECT, _In_ LPCRECT)
BOOL WINAPI IsWindow(_In_opt_ HWND)
int WINAPI FrameRect(_In_ HDC, _In_ LPCRECT, _In_ HBRUSH)
#define WM_CTLCOLORSTATIC
#define CB_GETHORIZONTALEXTENT
#define CB_SETDROPPEDWIDTH
#define LB_FINDSTRINGEXACT
BOOL WINAPI RedrawWindow(_In_opt_ HWND, _In_opt_ LPCRECT, _In_opt_ HRGN, _In_ UINT)
#define GetWindowLongPtrW
#define LB_SETHORIZONTALEXTENT
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI ReleaseCapture(void)
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define CBS_NOINTEGRALHEIGHT
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI InvertRect(_In_ HDC, _In_ LPCRECT)
BOOL WINAPI DrawFrameControl(_In_ HDC, _Inout_ LPRECT, _In_ UINT, _In_ UINT)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define CB_SETHORIZONTALEXTENT
#define CBS_OWNERDRAWVARIABLE
HWND WINAPI SetParent(_In_ HWND, _In_opt_ HWND)
HBRUSH WINAPI GetSysColorBrush(_In_ int)
LONG WINAPI SetWindowLongW(_In_ HWND, _In_ int, _In_ LONG)
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
#define CBS_DISABLENOSCROLL
LPWSTR WINAPI CharLowerW(_Inout_ LPWSTR)
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
BOOL WINAPI IsRectEmpty(_In_ LPCRECT)
HWND WINAPI GetCapture(void)
#define WM_CTLCOLORSCROLLBAR
#define CB_FINDSTRINGEXACT
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
#define CB_GETDROPPEDWIDTH
#define CB_GETCOMBOBOXINFO
#define WM_CTLCOLORMSGBOX
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
BOOL WINAPI PtInRect(_In_ LPCRECT, _In_ POINT)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define CB_GETDROPPEDCONTROLRECT
BOOL WINAPI DrawEdge(_In_ HDC, _Inout_ LPRECT, _In_ UINT, _In_ UINT)
HWND WINAPI SetFocus(_In_opt_ HWND)
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
#define LB_GETHORIZONTALEXTENT
#define STATE_SYSTEM_INVISIBLE
BOOL WINAPI UpdateWindow(_In_ HWND)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define COLOR_HIGHLIGHTTEXT
HDC WINAPI GetDC(_In_opt_ HWND)
#define DFCS_SCROLLCOMBOBOX
#define CB_GETDROPPEDSTATE
BOOL WINAPI IsWindowEnabled(_In_ HWND)
#define WM_CTLCOLORLISTBOX
BOOL WINAPI UnregisterClassW(_In_ LPCWSTR, HINSTANCE)
BOOL WINAPI GetMonitorInfoW(_In_ HMONITOR, _Inout_ LPMONITORINFO)
BOOL WINAPI DrawFocusRect(_In_ HDC, _In_ LPCRECT)
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define MAKEINTRESOURCEW(i)
HBITMAP WINAPI LoadBitmapW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
BOOL WINAPI UnionRect(_Out_ LPRECT, _In_ LPCRECT, _In_ LPCRECT)
#define SetWindowLongPtrW
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)
BOOL WINAPI IsWindowVisible(_In_ HWND)
BOOL WINAPI DestroyWindow(_In_ HWND)
int WINAPI GetSystemMetrics(_In_ int)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
LPWSTR WINAPI CharUpperW(_Inout_ LPWSTR)