comctl32: Introduce ListBox control.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2018-02-14 08:35:18 +03:00 committed by Alexandre Julliard
parent 6204bbc389
commit 04fe481d2b
7 changed files with 3076 additions and 38 deletions

View File

@ -21,6 +21,7 @@ C_SRCS = \
hotkey.c \ hotkey.c \
imagelist.c \ imagelist.c \
ipaddress.c \ ipaddress.c \
listbox.c \
listview.c \ listview.c \
monthcal.c \ monthcal.c \
nativefont.c \ nativefont.c \

View File

@ -79,44 +79,9 @@ static UINT CBitHeight, CBitWidth;
#define COMBO_EDITBUTTONSPACE() 0 #define COMBO_EDITBUTTONSPACE() 0
#define EDIT_CONTROL_PADDING() 1 #define EDIT_CONTROL_PADDING() 1
#define CBF_DROPPED 0x0001
#define CBF_BUTTONDOWN 0x0002
#define CBF_NOROLLUP 0x0004
#define CBF_MEASUREITEM 0x0008
#define CBF_FOCUSED 0x0010
#define CBF_CAPTURE 0x0020
#define CBF_EDIT 0x0040
#define CBF_NORESIZE 0x0080
#define CBF_NOTIFY 0x0100
#define CBF_NOREDRAW 0x0200
#define CBF_SELCHANGE 0x0400
#define CBF_HOT 0x0800
#define CBF_NOEDITNOTIFY 0x1000
#define CBF_NOLBSELECT 0x2000 /* do not change current selection */
#define CBF_BEENFOCUSED 0x4000 /* has it ever had focus */
#define CBF_EUI 0x8000
#define ID_CB_LISTBOX 1000 #define ID_CB_LISTBOX 1000
#define ID_CB_EDIT 1001 #define ID_CB_EDIT 1001
typedef struct
{
HWND self;
HWND owner;
UINT dwStyle;
HWND hWndEdit;
HWND hWndLBox;
UINT wState;
HFONT hFont;
RECT textRect;
RECT buttonRect;
RECT droppedRect;
INT droppedIndex;
INT fixedOwnerDrawHeight;
INT droppedWidth; /* last two are not used unless set */
INT editHeight; /* explicitly */
} HEADCOMBO, *LPHEADCOMBO;
/*********************************************************************** /***********************************************************************
* COMBO_Init * COMBO_Init
* *

View File

@ -107,6 +107,48 @@ extern HBRUSH COMCTL32_hPattern55AABrush DECLSPEC_HIDDEN;
#define IDS_BUTTON_CANCEL 3004 #define IDS_BUTTON_CANCEL 3004
#define IDS_BUTTON_CLOSE 3005 #define IDS_BUTTON_CLOSE 3005
#define WM_SYSTIMER 0x0118
enum combobox_state_flags
{
CBF_DROPPED = 0x0001,
CBF_BUTTONDOWN = 0x0002,
CBF_NOROLLUP = 0x0004,
CBF_MEASUREITEM = 0x0008,
CBF_FOCUSED = 0x0010,
CBF_CAPTURE = 0x0020,
CBF_EDIT = 0x0040,
CBF_NORESIZE = 0x0080,
CBF_NOTIFY = 0x0100,
CBF_NOREDRAW = 0x0200,
CBF_SELCHANGE = 0x0400,
CBF_HOT = 0x0800,
CBF_NOEDITNOTIFY = 0x1000,
CBF_NOLBSELECT = 0x2000, /* do not change current selection */
CBF_BEENFOCUSED = 0x4000, /* has it ever had focus */
CBF_EUI = 0x8000,
};
typedef struct
{
HWND self;
HWND owner;
UINT dwStyle;
HWND hWndEdit;
HWND hWndLBox;
UINT wState;
HFONT hFont;
RECT textRect;
RECT buttonRect;
RECT droppedRect;
INT droppedIndex;
INT fixedOwnerDrawHeight;
INT droppedWidth; /* last two are not used unless set */
INT editHeight; /* explicitly */
} HEADCOMBO, *LPHEADCOMBO;
extern BOOL COMBO_FlipListbox(HEADCOMBO *lphc, BOOL ok, BOOL bRedrawButton) DECLSPEC_HIDDEN;
typedef struct typedef struct
{ {
COLORREF clrBtnHighlight; /* COLOR_BTNHIGHLIGHT */ COLORREF clrBtnHighlight; /* COLOR_BTNHIGHLIGHT */
@ -181,6 +223,7 @@ extern void BUTTON_Register(void) DECLSPEC_HIDDEN;
extern void COMBO_Register(void) DECLSPEC_HIDDEN; extern void COMBO_Register(void) DECLSPEC_HIDDEN;
extern void COMBOEX_Register(void) DECLSPEC_HIDDEN; extern void COMBOEX_Register(void) DECLSPEC_HIDDEN;
extern void COMBOEX_Unregister(void) DECLSPEC_HIDDEN; extern void COMBOEX_Unregister(void) DECLSPEC_HIDDEN;
extern void COMBOLBOX_Register(void) DECLSPEC_HIDDEN;
extern void DATETIME_Register(void) DECLSPEC_HIDDEN; extern void DATETIME_Register(void) DECLSPEC_HIDDEN;
extern void DATETIME_Unregister(void) DECLSPEC_HIDDEN; extern void DATETIME_Unregister(void) DECLSPEC_HIDDEN;
extern void EDIT_Register(void) DECLSPEC_HIDDEN; extern void EDIT_Register(void) DECLSPEC_HIDDEN;
@ -192,6 +235,7 @@ extern void HOTKEY_Register(void) DECLSPEC_HIDDEN;
extern void HOTKEY_Unregister(void) DECLSPEC_HIDDEN; extern void HOTKEY_Unregister(void) DECLSPEC_HIDDEN;
extern void IPADDRESS_Register(void) DECLSPEC_HIDDEN; extern void IPADDRESS_Register(void) DECLSPEC_HIDDEN;
extern void IPADDRESS_Unregister(void) DECLSPEC_HIDDEN; extern void IPADDRESS_Unregister(void) DECLSPEC_HIDDEN;
extern void LISTBOX_Register(void) DECLSPEC_HIDDEN;
extern void LISTVIEW_Register(void) DECLSPEC_HIDDEN; extern void LISTVIEW_Register(void) DECLSPEC_HIDDEN;
extern void LISTVIEW_Unregister(void) DECLSPEC_HIDDEN; extern void LISTVIEW_Unregister(void) DECLSPEC_HIDDEN;
extern void MONTHCAL_Register(void) DECLSPEC_HIDDEN; extern void MONTHCAL_Register(void) DECLSPEC_HIDDEN;

View File

@ -100,7 +100,9 @@ static void unregister_versioned_classes(void)
{ {
VERSION WC_BUTTONA, VERSION WC_BUTTONA,
VERSION WC_COMBOBOXA, VERSION WC_COMBOBOXA,
VERSION "ComboLBox",
VERSION WC_EDITA, VERSION WC_EDITA,
VERSION WC_LISTBOXA,
VERSION WC_STATICA, VERSION WC_STATICA,
}; };
int i; int i;
@ -172,7 +174,9 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
BUTTON_Register (); BUTTON_Register ();
COMBO_Register (); COMBO_Register ();
COMBOLBOX_Register ();
EDIT_Register (); EDIT_Register ();
LISTBOX_Register ();
STATIC_Register (); STATIC_Register ();
/* subclass user32 controls */ /* subclass user32 controls */

3024
dlls/comctl32/listbox.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -348,7 +348,9 @@ static void check_class( const char *name, int must_exist, UINT style, UINT igno
todo_wine_if(strcmp(name, "Button") && todo_wine_if(strcmp(name, "Button") &&
strcmp(name, "ComboBox") && strcmp(name, "ComboBox") &&
strcmp(name, "Edit") && strcmp(name, "Edit") &&
strcmp(name, "Static")) strcmp(name, "Static") &&
strcmp(name, "ListBox") &&
strcmp(name, "ComboLBox"))
ok( !(~wc.style & style & ~ignore), "System class %s is missing bits %x (%08x/%08x)\n", ok( !(~wc.style & style & ~ignore), "System class %s is missing bits %x (%08x/%08x)\n",
name, ~wc.style & style, wc.style, style ); name, ~wc.style & style, wc.style, style );
ok( !(wc.style & ~style), "System class %s has extra bits %x (%08x/%08x)\n", ok( !(wc.style & ~style), "System class %s has extra bits %x (%08x/%08x)\n",

View File

@ -166,9 +166,7 @@ static BOOL is_builtin_class( const WCHAR *name )
{ {
static const WCHAR classesW[][20] = static const WCHAR classesW[][20] =
{ {
{'C','o','m','b','o','L','B','o','x',0},
{'I','M','E',0}, {'I','M','E',0},
{'L','i','s','t','B','o','x',0},
{'M','D','I','C','l','i','e','n','t',0}, {'M','D','I','C','l','i','e','n','t',0},
{'S','c','r','o','l','l','b','a','r',0}, {'S','c','r','o','l','l','b','a','r',0},
}; };