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;
246 iTextItemHeight = 6 + measureItem.itemHeight;
255 measureItem.CtlID =
id;
256 measureItem.itemID = 0;
257 measureItem.itemWidth = clientRect.
right;
258 measureItem.itemHeight = originalItemHeight;
259 measureItem.itemData = 0;
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};
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",
1262 TRACE(
"[%p]: lbox selection change [%x]\n", lphc->
self, lphc->
wState );
1396 const RECT *rectEdit,
1407 rectEdit->
left, rectEdit->
top,
1444 int newComboHeight, curComboHeight, curComboWidth;
1460 if( curComboHeight > newComboHeight )
1462 TRACE(
"oldComboHeight=%d, newComboHeight=%d, oldDropBottom=%d, oldDropTop=%d\n",
1470 if( curComboHeight != newComboHeight )
1749 case WM_THEMECHANGED:
1826 if (!hwndFocus || (hwndFocus != lphc->
hWndEdit && hwndFocus != lphc->
hWndLBox))
1843 if (
j == -1)
return 0;
2163 memset(&wndClass, 0,
sizeof(wndClass));
2175 void COMBO_Unregister(
void)
void COMBO_Register(void)
#define CBS_OWNERDRAWFIXED
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)
BOOL WINAPI RedrawWindow(_In_opt_ HWND, _In_opt_ LPCRECT, _In_opt_ HRGN, _In_ UINT)
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)
static LRESULT COMBO_SetItemHeight(LPHEADCOMBO lphc, INT index, INT height)
#define CB_DISABLED(lphc)
static void CBGetDroppedControlRect(LPHEADCOMBO lphc, LPRECT lpRect)
BOOL WINAPI GetTextMetricsW(_In_ HDC, _Out_ LPTEXTMETRICW)
#define CB_GETDROPPEDSTATE
#define LB_FINDSTRINGEXACT
static LRESULT CALLBACK COMBO_WindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
int WINAPI SelectClipRgn(_In_ HDC, _In_opt_ HRGN)
static INT CBGetTextAreaHeight(HWND hwnd, LPHEADCOMBO lphc)
static void COMBO_Font(LPHEADCOMBO lphc, HFONT hFont, BOOL bRedraw)
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
#define LB_SETHORIZONTALEXTENT
BOOL WINAPI UnregisterClassW(_In_ LPCWSTR, HINSTANCE)
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define LB_GETHORIZONTALEXTENT
static LRESULT COMBO_GetText(HEADCOMBO *lphc, INT count, LPWSTR buf)
static void CBDropDown(LPHEADCOMBO lphc)
HDC WINAPI GetDC(_In_opt_ HWND)
#define CB_SETDROPPEDWIDTH
#define CB_SETHORIZONTALEXTENT
static LRESULT COMBO_Paint(HEADCOMBO *lphc, HDC hdc)
HWND WINAPI SetParent(_In_ HWND, _In_opt_ HWND)
GLdouble GLdouble GLdouble r
static void COMBO_Size(LPHEADCOMBO lphc)
static void CBRollUp(LPHEADCOMBO lphc, BOOL ok, BOOL bButton)
GLuint GLuint GLsizei count
#define WM_CTLCOLORSTATIC
LPWSTR WINAPI CharLowerW(_Inout_ LPWSTR)
BOOL WINAPI DrawFocusRect(_In_ HDC, _In_ LPCRECT)
BOOL WINAPI UpdateWindow(_In_ HWND)
static void COMBO_LButtonUp(LPHEADCOMBO lphc)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
static HTHEME(WINAPI *pOpenThemeDataEx)(HWND
static void CBCalcPlacement(HWND hwnd, LPHEADCOMBO lphc, LPRECT lprEdit, LPRECT lprButton, LPRECT lprLB)
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
HWND WINAPI SetFocus(_In_opt_ HWND)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
#define CB_OWNERDRAWN(lphc)
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
BOOL WINAPI DrawFrameControl(_In_ HDC, _Inout_ LPRECT, _In_ UINT, _In_ UINT)
#define GetWindowLongPtrW
static LRESULT COMBO_ItemOp(LPHEADCOMBO lphc, UINT msg, LPARAM lParam)
static HBRUSH COMBO_PrepareColors(LPHEADCOMBO lphc, HDC hDC)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
BOOL WINAPI InvertRect(_In_ HDC, _In_ LPCRECT)
static LRESULT COMBO_NCDestroy(HEADCOMBO *lphc)
#define WM_CTLCOLORLISTBOX
BOOL WINAPI DestroyWindow(_In_ HWND)
HRESULT WINAPI DrawThemeBackground(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect)
DWORD WINAPI GetSysColor(_In_ int)
#define CBS_OWNERDRAWVARIABLE
static void * heap_alloc(size_t len)
static void CBUpdateEdit(LPHEADCOMBO lphc, INT index)
LPWSTR WINAPI CharUpperW(_Inout_ LPWSTR)
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
GLenum GLuint GLenum GLsizei const GLchar * buf
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
#define EDIT_CONTROL_PADDING()
#define CB_GETDROPPEDWIDTH
static void CBPaintBorder(HWND hwnd, const HEADCOMBO *lphc, HDC hdc)
static LRESULT COMBO_Command(LPHEADCOMBO lphc, WPARAM wParam, HWND hWnd)
#define CB_NOTIFY(lphc, code)
#define LBS_NOINTEGRALHEIGHT
static void COMBO_KillFocus(LPHEADCOMBO lphc)
LONG WINAPI SetWindowLongW(_In_ HWND, _In_ int, _In_ LONG)
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
BOOL WINAPI DrawEdge(_In_ HDC, _Inout_ LPRECT, _In_ UINT, _In_ UINT)
HWND WINAPI GetCapture(void)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
GLenum GLuint GLenum GLsizei length
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
#define WM_CTLCOLORSCROLLBAR
#define STATE_SYSTEM_PRESSED
BOOL WINAPI IsRectEmpty(_In_ LPCRECT)
#define CB_HASSTRINGS(lphc)
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
WINE_DEFAULT_DEBUG_CHANNEL(combo)
#define CB_GETCOMBOBOXINFO
static LRESULT COMBO_Create(HWND hwnd, LPHEADCOMBO lphc, HWND hwndParent, LONG style)
#define WM_CTLCOLORMSGBOX
BOOL WINAPI IsWindowEnabled(_In_ HWND)
static void CBRepaintButton(LPHEADCOMBO lphc)
#define COLOR_HIGHLIGHTTEXT
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
#define CB_GETDROPPEDCONTROLRECT
static void CBResetPos(LPHEADCOMBO lphc, const RECT *rectEdit, const RECT *rectLB, BOOL bRedraw)
BOOL WINAPI GetMonitorInfoW(_In_ HMONITOR, _Inout_ LPMONITORINFO)
static LRESULT COMBO_NCCreate(HWND hwnd, LONG style)
const char * wine_dbgstr_rect(const RECT *rect)
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
int WINAPI GetSystemMetrics(_In_ int)
static BOOL COMBO_Init(void)
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
BOOL WINAPI UnionRect(_Out_ LPRECT, _In_ LPCRECT, _In_ LPCRECT)
HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR classlist)
#define CB_GETHORIZONTALEXTENT
HTHEME WINAPI GetWindowTheme(HWND hwnd)
#define COMBO_YBORDERSIZE()
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)
static void CBForceDummyResize(LPHEADCOMBO lphc)
static void CBPaintButton(LPHEADCOMBO lphc, HDC hdc, RECT rectButton)
#define COMBO_XBORDERSIZE()
GLint GLint GLsizei GLsizei height
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
static void COMBO_LButtonDown(LPHEADCOMBO lphc, LPARAM lParam)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
HWND WINAPI SetCapture(_In_ HWND hWnd)
#define WS_EX_NOPARENTNOTIFY
BOOL COMBO_FlipListbox(LPHEADCOMBO lphc, BOOL ok, BOOL bRedrawButton)
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
BOOL WINAPI DeleteDC(_In_ HDC)
HBITMAP WINAPI LoadBitmapW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
#define LBS_DISABLENOSCROLL
static void COMBO_MouseMove(LPHEADCOMBO lphc, WPARAM wParam, LPARAM lParam)
static INT CBUpdateLBox(LPHEADCOMBO lphc, BOOL bSelect)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static void COMBO_SetFocus(LPHEADCOMBO lphc)
#define DFCS_SCROLLCOMBOBOX
static LRESULT COMBO_GetComboBoxInfo(const HEADCOMBO *lphc, COMBOBOXINFO *pcbi)
static LRESULT COMBO_ThemedPaint(HTHEME theme, HEADCOMBO *lphc, HDC hdc)
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
BOOL WINAPI PtInRect(_In_ LPCRECT, _In_ POINT)
BOOL WINAPI ReleaseCapture(void)
BOOL WINAPI CopyRect(_Out_ LPRECT, _In_ LPCRECT)
BOOL WINAPI IsWindowVisible(_In_ HWND)
HMONITOR WINAPI MonitorFromRect(LPCRECT, DWORD)
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define SetWindowLongPtrW
#define MAKEINTRESOURCEW(i)
#define COMBO_EDITBUTTONSPACE()
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
HBRUSH WINAPI GetSysColorBrush(_In_ int)
#define CBS_NOINTEGRALHEIGHT
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
static const WCHAR empty_stringW[]
#define STATE_SYSTEM_INVISIBLE
HRESULT WINAPI CloseThemeData(HTHEME hTheme)
static LRESULT COMBO_SelectString(LPHEADCOMBO lphc, INT start, LPARAM pText)
int WINAPI FrameRect(_In_ HDC, _In_ LPCRECT, _In_ HBRUSH)
static BOOL heap_free(void *mem)
static void CBPaintText(HEADCOMBO *lphc, HDC hdc_paint)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
#define CBS_DISABLENOSCROLL
#define CB_FINDSTRINGEXACT