Author: akhaldi
Date: Sat Sep 14 20:06:00 2013
New Revision: 60117
URL:
http://svn.reactos.org/svn/reactos?rev=60117&view=rev
Log:
[COMCTL32]
* Sync with Wine 1.7.1.
Modified:
trunk/reactos/dll/win32/comctl32/CMakeLists.txt
trunk/reactos/dll/win32/comctl32/comboex.c
trunk/reactos/dll/win32/comctl32/comctl32.h
trunk/reactos/dll/win32/comctl32/comctl32.spec
trunk/reactos/dll/win32/comctl32/commctrl.c
trunk/reactos/dll/win32/comctl32/header.c
trunk/reactos/dll/win32/comctl32/listview.c
trunk/reactos/dll/win32/comctl32/monthcal.c
trunk/reactos/dll/win32/comctl32/progress.c
trunk/reactos/dll/win32/comctl32/rebar.c
trunk/reactos/dll/win32/comctl32/tab.c
trunk/reactos/dll/win32/comctl32/toolbar.c
trunk/reactos/dll/win32/comctl32/trackbar.c
trunk/reactos/dll/win32/comctl32/treeview.c
trunk/reactos/media/doc/README.WINE
Modified: trunk/reactos/dll/win32/comctl32/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/CMakeLi…
==============================================================================
--- trunk/reactos/dll/win32/comctl32/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/comctl32/CMakeLists.txt [iso-8859-1] Sat Sep 14 20:06:00 2013
@@ -48,21 +48,12 @@
treeview.c
updown.c
stubs.c
- rsrc.rc
${CMAKE_CURRENT_BINARY_DIR}/comctl32.def)
-add_library(comctl32 SHARED ${SOURCE})
+add_library(comctl32 SHARED ${SOURCE} rsrc.rc)
set_module_type(comctl32 win32dll UNICODE)
target_link_libraries(comctl32 uuid wine ${PSEH_LIB})
add_delay_importlibs(comctl32 winmm uxtheme)
-
-add_importlibs(comctl32
- user32
- gdi32
- advapi32
- msvcrt
- kernel32
- ntdll)
-
+add_importlibs(comctl32 user32 gdi32 advapi32 msvcrt kernel32 ntdll)
add_pch(comctl32 comctl32.h)
add_cd_file(TARGET comctl32 DESTINATION reactos/system32 FOR all)
Modified: trunk/reactos/dll/win32/comctl32/comboex.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/comboex…
==============================================================================
--- trunk/reactos/dll/win32/comctl32/comboex.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/comctl32/comboex.c [iso-8859-1] Sat Sep 14 20:06:00 2013
@@ -75,7 +75,7 @@
INT nb_items; /* Number of items */
BOOL unicode; /* TRUE if this window is Unicode */
BOOL NtfUnicode; /* TRUE if parent wants notify in Unicode */
- CBE_ITEMDATA *edit; /* item data for edit item */
+ CBE_ITEMDATA edit; /* item data for edit item */
CBE_ITEMDATA *items; /* Array of items */
} COMBOEX_INFO;
@@ -273,9 +273,9 @@
static void COMBOEX_FreeText (CBE_ITEMDATA *item)
{
if (is_textW(item->pszText)) Free(item->pszText);
- item->pszText = 0;
+ item->pszText = NULL;
Free(item->pszTemp);
- item->pszTemp = 0;
+ item->pszTemp = NULL;
}
@@ -455,15 +455,15 @@
}
-static CBE_ITEMDATA * COMBOEX_FindItem(const COMBOEX_INFO *infoPtr, INT_PTR index)
+static CBE_ITEMDATA *COMBOEX_FindItem(COMBOEX_INFO *infoPtr, INT_PTR index)
{
CBE_ITEMDATA *item;
INT i;
if ((index >= infoPtr->nb_items) || (index < -1))
- return 0;
+ return NULL;
if (index == -1)
- return infoPtr->edit;
+ return &infoPtr->edit;
item = infoPtr->items;
i = infoPtr->nb_items - 1;
@@ -481,7 +481,7 @@
/* *** CBEM_xxx message support *** */
-static UINT COMBOEX_GetListboxText(const COMBOEX_INFO *infoPtr, INT_PTR n, LPWSTR buf)
+static UINT COMBOEX_GetListboxText(COMBOEX_INFO *infoPtr, INT_PTR n, LPWSTR buf)
{
CBE_ITEMDATA *item;
LPCWSTR str;
@@ -519,7 +519,7 @@
}
-static INT COMBOEX_DeleteItem (const COMBOEX_INFO *infoPtr, INT_PTR index)
+static INT COMBOEX_DeleteItem (COMBOEX_INFO *infoPtr, INT_PTR index)
{
TRACE("(index=%ld)\n", index);
@@ -534,7 +534,7 @@
}
-static BOOL COMBOEX_GetItemW (const COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW *cit)
+static BOOL COMBOEX_GetItemW (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW *cit)
{
INT_PTR index = cit->iItem;
CBE_ITEMDATA *item;
@@ -555,7 +555,7 @@
}
-static BOOL COMBOEX_GetItemA (const COMBOEX_INFO *infoPtr, COMBOBOXEXITEMA *cit)
+static BOOL COMBOEX_GetItemA (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMA *cit)
{
COMBOBOXEXITEMW tmpcit;
@@ -754,7 +754,7 @@
return himlTemp;
}
-static BOOL COMBOEX_SetItemW (const COMBOEX_INFO *infoPtr, const COMBOBOXEXITEMW *cit)
+static BOOL COMBOEX_SetItemW (COMBOEX_INFO *infoPtr, const COMBOBOXEXITEMW *cit)
{
INT_PTR index = cit->iItem;
CBE_ITEMDATA *item;
@@ -805,7 +805,7 @@
return TRUE;
}
-static BOOL COMBOEX_SetItemA (const COMBOEX_INFO *infoPtr, COMBOBOXEXITEMA const *cit)
+static BOOL COMBOEX_SetItemA (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMA const *cit)
{
COMBOBOXEXITEMW citW;
LPWSTR wstr = NULL;
@@ -863,7 +863,7 @@
}
-static DWORD_PTR COMBOEX_GetItemData (const COMBOEX_INFO *infoPtr, INT_PTR index)
+static DWORD_PTR COMBOEX_GetItemData (COMBOEX_INFO *infoPtr, INT_PTR index)
{
CBE_ITEMDATA const *item1;
CBE_ITEMDATA const *item2;
@@ -903,7 +903,7 @@
}
-static DWORD_PTR COMBOEX_SetItemData (const COMBOEX_INFO *infoPtr, INT_PTR index,
DWORD_PTR data)
+static DWORD_PTR COMBOEX_SetItemData (COMBOEX_INFO *infoPtr, INT_PTR index, DWORD_PTR
data)
{
CBE_ITEMDATA *item1;
CBE_ITEMDATA const *item2;
@@ -1003,23 +1003,13 @@
/* (allow space for the icons). */
infoPtr->hwndCombo = CreateWindowW (WC_COMBOBOXW, NIL,
- /* following line added to match native */
WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_VSCROLL |
CBS_NOINTEGRALHEIGHT | CBS_DROPDOWNLIST |
- /* was base and is necessary */
WS_CHILD | WS_VISIBLE | CBS_OWNERDRAWFIXED |
GetWindowLongW (hwnd, GWL_STYLE),
cs->y, cs->x, cs->cx, cs->cy, hwnd,
(HMENU) GetWindowLongPtrW (hwnd, GWLP_ID),
(HINSTANCE)GetWindowLongPtrW (hwnd, GWLP_HINSTANCE), NULL);
-
- /*
- * native does the following at this point according to trace:
- * GetWindowThreadProcessId(hwndCombo,0)
- * GetCurrentThreadId()
- * GetWindowThreadProcessId(hwndCombo, &???)
- * GetCurrentProcessId()
- */
SetWindowSubclass(infoPtr->hwndCombo, COMBOEX_ComboWndProc, COMBO_SUBCLASSID,
(DWORD_PTR)hwnd);
@@ -1037,12 +1027,6 @@
(HMENU) GetWindowLongPtrW (hwnd, GWLP_ID),
(HINSTANCE)GetWindowLongPtrW (hwnd, GWLP_HINSTANCE), NULL);
- /* native does the following at this point according to trace:
- * GetWindowThreadProcessId(hwndEdit,0)
- * GetCurrentThreadId()
- * GetWindowThreadProcessId(hwndEdit, &???)
- * GetCurrentProcessId()
- */
SetWindowSubclass(infoPtr->hwndEdit, COMBOEX_EditWndProc, EDIT_SUBCLASSID,
(DWORD_PTR)hwnd);
@@ -1089,16 +1073,6 @@
SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOMOVE);
COMBOEX_AdjustEditPos (infoPtr);
-
- /*
- * Create an item structure to represent the data in the
- * EDIT control. It is allocated zero-filled.
- */
- infoPtr->edit = Alloc (sizeof (CBE_ITEMDATA));
- if (!infoPtr->edit) {
- COMBOEX_Destroy(infoPtr);
- return -1;
- }
return 0;
}
@@ -1127,19 +1101,6 @@
return SendMessageW (parent, WM_COMMAND, wParam, (LPARAM)infoPtr->hwndSelf);
case CBN_CLOSEUP:
SendMessageW (parent, WM_COMMAND, wParam, (LPARAM)infoPtr->hwndSelf);
- /*
- * from native trace of first dropdown after typing in URL in IE4
- * CB_GETCURSEL(Combo)
- * GetWindowText(Edit)
- * CB_GETCURSEL(Combo)
- * CB_GETCOUNT(Combo)
- * CB_GETITEMDATA(Combo, n)
- * WM_NOTIFY(parent, CBEN_ENDEDITA|W)
- * CB_GETCURSEL(Combo)
- * CB_SETCURSEL(COMBOEX, n)
- * SetFocus(Combo)
- * the rest is supposition
- */
ShowWindow (infoPtr->hwndEdit, SW_SHOW);
InvalidateRect (infoPtr->hwndCombo, 0, TRUE);
if (infoPtr->hwndEdit) InvalidateRect (infoPtr->hwndEdit, 0, TRUE);
@@ -1225,17 +1186,6 @@
return SendMessageW (parent, WM_COMMAND, wParam, (LPARAM)infoPtr->hwndSelf);
case CBN_KILLFOCUS:
- /*
- * from native trace:
- *
- * pass to parent
- * WM_GETTEXT(Edit, 104)
- * CB_GETCURSEL(Combo) rets -1
- * WM_NOTIFY(CBEN_ENDEDITA) with CBENF_KILLFOCUS
- * CB_GETCURSEL(Combo)
- * InvalidateRect(Combo, 0, 0)
- * return 0
- */
SendMessageW (parent, WM_COMMAND, wParam, (LPARAM)infoPtr->hwndSelf);
if (infoPtr->flags & WCBE_ACTEDIT) {
GetWindowTextW (infoPtr->hwndEdit, wintext, 260);
@@ -1316,17 +1266,17 @@
}
-static LRESULT COMBOEX_DrawItem (const COMBOEX_INFO *infoPtr, DRAWITEMSTRUCT const *dis)
+static LRESULT COMBOEX_DrawItem (COMBOEX_INFO *infoPtr, DRAWITEMSTRUCT const *dis)
{
static const WCHAR nil[] = { 0 };
- CBE_ITEMDATA *item = 0;
+ CBE_ITEMDATA *item = NULL;
SIZE txtsize;
RECT rect;
LPCWSTR str = nil;
UINT xbase, x, y;
INT len;
COLORREF nbkc, ntxc, bkc, txc;
- int drawimage, drawstate, xioff;
+ int drawimage, drawstate, xioff, selected;
TRACE("DRAWITEMSTRUCT: CtlType=0x%08x CtlID=0x%08x\n",
dis->CtlType, dis->CtlID);
@@ -1378,7 +1328,7 @@
/* If draw item is -1 (edit control) setup the item pointer */
if (dis->itemID == 0xffffffff) {
- item = infoPtr->edit;
+ item = &infoPtr->edit;
if (infoPtr->hwndEdit) {
/* free previous text of edit item */
@@ -1427,36 +1377,30 @@
drawimage = -2;
drawstate = ILD_NORMAL;
+ selected = infoPtr->selected == dis->itemID;
+
if (item->mask & CBEIF_IMAGE)
drawimage = item->iImage;
+ if (item->mask & CBEIF_SELECTEDIMAGE && selected)
+ drawimage = item->iSelectedImage;
if (dis->itemState & ODS_COMBOEXLBOX) {
/* drawing listbox entry */
- if (dis->itemState & ODS_SELECTED) {
- if (item->mask & CBEIF_SELECTEDIMAGE)
- drawimage = item->iSelectedImage;
+ if (dis->itemState & ODS_SELECTED)
drawstate = ILD_SELECTED;
- }
} else {
/* drawing combo/edit entry */
if (IsWindowVisible(infoPtr->hwndEdit)) {
/* if we have an edit control, the slave the
* selection state to the Edit focus state
*/
- if (infoPtr->flags & WCBE_EDITFOCUSED) {
- if (item->mask & CBEIF_SELECTEDIMAGE)
- drawimage = item->iSelectedImage;
+ if (infoPtr->flags & WCBE_EDITFOCUSED)
drawstate = ILD_SELECTED;
- }
- } else {
+ } else
/* if we don't have an edit control, use
* the requested state.
*/
- if (dis->itemState & ODS_SELECTED) {
- if (item->mask & CBEIF_SELECTEDIMAGE)
- drawimage = item->iSelectedImage;
+ if (dis->itemState & ODS_SELECTED)
drawstate = ILD_SELECTED;
- }
- }
}
if (infoPtr->himl && !(infoPtr->dwExtStyle &
CBES_EX_NOEDITIMAGEINDENT)) {
@@ -1479,17 +1423,17 @@
if (drawimage == I_IMAGECALLBACK) {
NMCOMBOBOXEXW nmce;
ZeroMemory(&nmce, sizeof(nmce));
- nmce.ceItem.mask = (drawstate == ILD_NORMAL) ? CBEIF_IMAGE : CBEIF_SELECTEDIMAGE;
+ nmce.ceItem.mask = selected ? CBEIF_SELECTEDIMAGE : CBEIF_IMAGE;
nmce.ceItem.lParam = item->lParam;
nmce.ceItem.iItem = dis->itemID;
COMBOEX_NotifyItem(infoPtr, CBEN_GETDISPINFOW, &nmce);
- if (drawstate == ILD_NORMAL) {
+ if (!selected) {
if (nmce.ceItem.mask & CBEIF_DI_SETITEM) item->iImage = nmce.ceItem.iImage;
drawimage = nmce.ceItem.iImage;
- } else if (drawstate == ILD_SELECTED) {
+ } else {
if (nmce.ceItem.mask & CBEIF_DI_SETITEM) item->iSelectedImage =
nmce.ceItem.iSelectedImage;
- drawimage = nmce.ceItem.iSelectedImage;
- } else ERR("Bad draw state = %d\n", drawstate);
+ drawimage = nmce.ceItem.iSelectedImage;
+ }
}
if (overlay == I_IMAGECALLBACK) {
@@ -1576,10 +1520,7 @@
if (infoPtr->hwndEdit)
RemoveWindowSubclass(infoPtr->hwndEdit, COMBOEX_EditWndProc,
EDIT_SUBCLASSID);
- COMBOEX_FreeText (infoPtr->edit);
- Free (infoPtr->edit);
- infoPtr->edit = 0;
-
+ COMBOEX_FreeText (&infoPtr->edit);
COMBOEX_ResetContent (infoPtr);
if (infoPtr->defaultFont)
@@ -1666,6 +1607,15 @@
return 0;
}
+static LRESULT COMBOEX_SetFont( COMBOEX_INFO *infoPtr, HFONT font, BOOL redraw )
+{
+ infoPtr->font = font;
+ SendMessageW( infoPtr->hwndCombo, WM_SETFONT, (WPARAM)font, 0 );
+ if (infoPtr->hwndEdit) SendMessageW( infoPtr->hwndEdit, WM_SETFONT,
(WPARAM)font, 0 );
+ COMBOEX_ReSize( infoPtr );
+ if (redraw) InvalidateRect( infoPtr->hwndCombo, NULL, TRUE );
+ return 0;
+}
static LRESULT COMBOEX_SetRedraw(const COMBOEX_INFO *infoPtr, WPARAM wParam, LPARAM
lParam)
{
@@ -1743,9 +1693,6 @@
return DefSubclassProc(hwnd, uMsg, wParam, lParam);
case WM_ERASEBKGND:
- /*
- * The following was determined by traces of the native
- */
hDC = (HDC) wParam;
obkc = SetBkColor (hDC, comctl32_color.clrWindow);
GetClientRect (hwnd, &rect);
@@ -1761,23 +1708,6 @@
switch ((INT)wParam)
{
case VK_ESCAPE:
- /* native version seems to do following for COMBOEX */
- /*
- * GetWindowTextW(Edit,&?, 0x104) x
- * CB_GETCURSEL to Combo rets -1 x
- * WM_NOTIFY to COMBOEX parent (rebar) x
- * (CBEN_ENDEDIT{A|W}
- * fChanged = FALSE x
- * inewSelection = -1 x
- * txt="www.hoho" x
- * iWhy = 3 x
- * CB_GETCURSEL to Combo rets -1 x
- * InvalidateRect(Combo, 0) x
- * WM_SETTEXT to Edit x
- * EM_SETSEL to Edit (0,0) x
- * EM_SETSEL to Edit (0,-1) x
- * RedrawWindow(Combo, 0, 0, 5) x
- */
TRACE("special code for VK_ESCAPE\n");
GetWindowTextW (infoPtr->hwndEdit, edit_text, 260);
@@ -1802,27 +1732,6 @@
break;
case VK_RETURN:
- /* native version seems to do following for COMBOEX */
- /*
- * GetWindowTextW(Edit,&?, 0x104) x
- * CB_GETCURSEL to Combo rets -1 x
- * CB_GETCOUNT to Combo rets 0
- * if >0 loop
- * CB_GETITEMDATA to match
- * *** above 3 lines simulated by FindItem x
- * WM_NOTIFY to COMBOEX parent (rebar) x
- * (CBEN_ENDEDIT{A|W} x
- * fChanged = TRUE (-1) x
- * iNewSelection = -1 or selected x
- * txt= x
- * iWhy = 2 (CBENF_RETURN) x
- * CB_GETCURSEL to Combo rets -1 x
- * if -1 send CB_SETCURSEL to Combo -1 x
- * InvalidateRect(Combo, 0, 0) x
- * SetFocus(Edit) x
- * CallWindowProc(406615a8, Edit, 0x100, 0xd, 0x1c0001)
- */
-
TRACE("special code for VK_RETURN\n");
GetWindowTextW (infoPtr->hwndEdit, edit_text, 260);
@@ -1850,7 +1759,7 @@
if (COMBOEX_NotifyEndEdit (infoPtr, &cbeend, edit_text)) {
/* abort the change, restore previous */
TRACE("Notify requested abort of change\n");
- COMBOEX_SetEditText (infoPtr, infoPtr->edit);
+ COMBOEX_SetEditText (infoPtr, &infoPtr->edit);
RedrawWindow (infoPtr->hwndCombo, 0, 0, RDW_ERASE |
RDW_INVALIDATE);
return 0;
@@ -1942,9 +1851,6 @@
return DefSubclassProc(hwnd, uMsg, wParam, lParam);
case WM_ERASEBKGND:
- /*
- * The following was determined by traces of the native
- */
hDC = (HDC) wParam;
obkc = SetBkColor (hDC, comctl32_color.clrWindow);
GetClientRect (hwnd, &rect);
@@ -2013,18 +1919,6 @@
return 0;
case EN_KILLFOCUS:
- /*
- * Native does:
- *
- * GetFocus() retns AA
- * GetWindowTextW(Edit)
- * CB_GETCURSEL(Combo) (got -1)
- * WM_NOTIFY(CBEN_ENDEDITA) with CBENF_KILLFOCUS
- * CB_GETCURSEL(Combo) (got -1)
- * InvalidateRect(Combo, 0, 0)
- * WM_KILLFOCUS(Combo, AA)
- * return 0;
- */
focusedhwnd = GetFocus();
if (infoPtr->flags & WCBE_ACTEDIT) {
GetWindowTextW (infoPtr->hwndEdit, edit_text, 260);
@@ -2044,21 +1938,6 @@
return 0;
case EN_SETFOCUS: {
- /*
- * For EN_SETFOCUS this issues the same calls and messages
- * as the native seems to do.
- *
- * for some cases however native does the following:
- * (noticed after SetFocus during LBUTTONDOWN on
- * on dropdown arrow)
- * WM_GETTEXTLENGTH (Edit);
- * WM_GETTEXT (Edit, len+1, str);
- * EM_SETSEL (Edit, 0, 0);
- * WM_GETTEXTLENGTH (Edit);
- * WM_GETTEXT (Edit, len+1, str);
- * EM_SETSEL (Edit, 0, len);
- * WM_NOTIFY (parent, CBEN_BEGINEDIT)
- */
NMHDR hdr;
SendMessageW (infoPtr->hwndEdit, EM_SETSEL, 0, 0);
@@ -2070,10 +1949,6 @@
}
case EN_CHANGE: {
- /*
- * For EN_CHANGE this issues the same calls and messages
- * as the native seems to do.
- */
LPCWSTR lastwrk;
cmp_func_t cmptext = get_cmp_func(infoPtr);
@@ -2084,7 +1959,7 @@
GetWindowTextW (infoPtr->hwndEdit, edit_text, 260);
if (selected == -1) {
- lastwrk = infoPtr->edit->pszText;
+ lastwrk = infoPtr->edit.pszText;
}
else {
CBE_ITEMDATA *item = COMBOEX_FindItem (infoPtr, selected);
@@ -2109,37 +1984,6 @@
}
case LBN_SELCHANGE:
- /*
- * Therefore from traces there is no additional code here
- */
-
- /*
- * Using native COMCTL32 gets the following:
- * 1 == SHDOCVW.DLL issues call/message
- * 2 == COMCTL32.DLL issues call/message
- * 3 == WINE issues call/message
- *
- *
- * for LBN_SELCHANGE:
- * 1 CB_GETCURSEL(ComboEx)
- * 1 CB_GETDROPPEDSTATE(ComboEx)
- * 1 CallWindowProc( *2* for WM_COMMAND(LBN_SELCHANGE)
- * 2 CallWindowProc( *3* for WM_COMMAND(LBN_SELCHANGE)
- ** call CBRollUp( xxx, TRUE for LBN_SELCHANGE, TRUE)
- * 3 WM_COMMAND(ComboEx, CBN_SELENDOK)
- * WM_USER+49(ComboLB, 1,0) <=============!!!!!!!!!!!
- * 3 ShowWindow(ComboLB, SW_HIDE)
- * 3 RedrawWindow(Combo, RDW_UPDATENOW)
- * 3 WM_COMMAND(ComboEX, CBN_CLOSEUP)
- ** end of CBRollUp
- * 3 WM_COMMAND(ComboEx, CBN_SELCHANGE) (echo to parent)
- * ? LB_GETCURSEL <==|
- * ? LB_GETTEXTLEN |
- * ? LB_GETTEXT | Needs to be added to
- * ? WM_CTLCOLOREDIT(ComboEx) | Combo processing
- * ? LB_GETITEMDATA |
- * ? WM_DRAWITEM(ComboEx) <==|
- */
default:
break;
}/* fall through */
@@ -2301,6 +2145,12 @@
case WM_SIZE:
return COMBOEX_Size (infoPtr, LOWORD(lParam), HIWORD(lParam));
+ case WM_GETFONT:
+ return (LRESULT)infoPtr->font;
+
+ case WM_SETFONT:
+ return COMBOEX_SetFont( infoPtr, (HFONT)wParam, LOWORD(lParam) != 0 );
+
case WM_SETREDRAW:
return COMBOEX_SetRedraw(infoPtr, wParam, lParam);
Modified: trunk/reactos/dll/win32/comctl32/comctl32.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/comctl3…
==============================================================================
--- trunk/reactos/dll/win32/comctl32/comctl32.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/comctl32/comctl32.h [iso-8859-1] Sat Sep 14 20:06:00 2013
@@ -41,9 +41,6 @@
extern HMODULE COMCTL32_hModule DECLSPEC_HIDDEN;
extern HBRUSH COMCTL32_hPattern55AABrush DECLSPEC_HIDDEN;
-
-/* has a value of: 0, CCS_TOP, CCS_NOMOVEY, CCS_BOTTOM */
-#define CCS_LAYOUT_MASK 0x3
/* Property sheet / Wizard */
#define IDD_PROPSHEET 1006
@@ -79,23 +76,6 @@
#define IDB_VIEW_LARGE 125
#define IDB_HIST_SMALL 130
#define IDB_HIST_LARGE 131
-
-
-/* Month calendar month menu popup */
-#define IDD_MCMONTHMENU 300
-
-#define IDM_JAN 301
-#define IDM_FEB 302
-#define IDM_MAR 303
-#define IDM_APR 304
-#define IDM_MAY 305
-#define IDM_JUN 306
-#define IDM_JUL 307
-#define IDM_AUG 308
-#define IDM_SEP 309
-#define IDM_OCT 310
-#define IDM_NOV 311
-#define IDM_DEC 312
#define IDM_TODAY 4163
#define IDM_GOTODAY 4164
Modified: trunk/reactos/dll/win32/comctl32/comctl32.spec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/comctl3…
==============================================================================
--- trunk/reactos/dll/win32/comctl32/comctl32.spec [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/comctl32/comctl32.spec [iso-8859-1] Sat Sep 14 20:06:00 2013
@@ -61,6 +61,7 @@
340 stdcall -ordinal DPA_CreateEx(long long)
341 stdcall -noname SendNotify(long long long ptr)
342 stdcall -noname SendNotifyEx(long long long ptr long)
+345 stdcall -ordinal TaskDialogIndirect(ptr ptr ptr ptr)
350 stdcall -noname StrChrA(str str)
351 stdcall -noname StrRChrA(str str long)
352 stdcall -noname StrCmpNA(str str long)
@@ -189,6 +190,5 @@
@ stdcall PropertySheetA(ptr)
@ stdcall PropertySheetW(ptr)
@ stdcall RegisterClassNameW(wstr)
-@ stdcall TaskDialogIndirect(ptr ptr ptr ptr)
@ stdcall UninitializeFlatSB(long)
@ stdcall _TrackMouseEvent(ptr)
Modified: trunk/reactos/dll/win32/comctl32/commctrl.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/commctr…
==============================================================================
--- trunk/reactos/dll/win32/comctl32/commctrl.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/comctl32/commctrl.c [iso-8859-1] Sat Sep 14 20:06:00 2013
@@ -235,7 +235,8 @@
break;
case DLL_PROCESS_DETACH:
- /* clean up subclassing */
+ if (lpvReserved) break;
+ /* clean up subclassing */
THEMING_Uninitialize();
/* unregister all common control classes */
@@ -263,14 +264,11 @@
/* delete local pattern brush */
DeleteObject (COMCTL32_hPattern55AABrush);
- COMCTL32_hPattern55AABrush = NULL;
DeleteObject (COMCTL32_hPattern55AABitmap);
- COMCTL32_hPattern55AABitmap = NULL;
/* delete global subclassing atom */
GlobalDeleteAtom (LOWORD(COMCTL32_wSubclass));
TRACE("Subclassing atom deleted: %p\n", COMCTL32_wSubclass);
- COMCTL32_wSubclass = NULL;
break;
}
@@ -1013,7 +1011,7 @@
ERR("create_manifest failed!\n");
return HRESULT_FROM_WIN32(GetLastError());
}
-
+
return S_OK;
}
Modified: trunk/reactos/dll/win32/comctl32/header.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/header.…
==============================================================================
--- trunk/reactos/dll/win32/comctl32/header.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/comctl32/header.c [iso-8859-1] Sat Sep 14 20:06:00 2013
@@ -293,6 +293,41 @@
}
}
+static void
+HEADER_FillItemFrame(HEADER_INFO *infoPtr, HDC hdc, RECT *r, const HEADER_ITEM *item,
BOOL hottrack)
+{
+ HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
+
+ if (theme) {
+ int state = (item->bDown) ? HIS_PRESSED : (hottrack ? HIS_HOT : HIS_NORMAL);
+ DrawThemeBackground (theme, hdc, HP_HEADERITEM, state, r, NULL);
+ GetThemeBackgroundContentRect (theme, hdc, HP_HEADERITEM, state, r, r);
+ }
+ else
+ {
+ HBRUSH hbr = CreateSolidBrush(GetBkColor(hdc));
+ FillRect(hdc, r, hbr);
+ DeleteObject(hbr);
+ }
+}
+
+static void
+HEADER_DrawItemFrame(HEADER_INFO *infoPtr, HDC hdc, RECT *r, const HEADER_ITEM *item)
+{
+ if (GetWindowTheme(infoPtr->hwndSelf)) return;
+
+ if (!(infoPtr->dwStyle & HDS_FLAT))
+ {
+ if (infoPtr->dwStyle & HDS_BUTTONS) {
+ if (item->bDown)
+ DrawEdge (hdc, r, BDR_RAISEDOUTER, BF_RECT | BF_FLAT | BF_ADJUST);
+ else
+ DrawEdge (hdc, r, EDGE_RAISED, BF_RECT | BF_SOFT | BF_ADJUST);
+ }
+ else
+ DrawEdge (hdc, r, EDGE_ETCHED, BF_BOTTOM | BF_RIGHT | BF_ADJUST);
+ }
+}
static INT
HEADER_DrawItem (HEADER_INFO *infoPtr, HDC hdc, INT iItem, BOOL bHotTrack, LRESULT
lCDFlags)
@@ -329,43 +364,13 @@
return phdi->rect.right;
}
- if (theme != NULL) {
- int state = (phdi->bDown) ? HIS_PRESSED :
- (bHotTrack ? HIS_HOT : HIS_NORMAL);
- DrawThemeBackground (theme, hdc, HP_HEADERITEM, state,
- &r, NULL);
- GetThemeBackgroundContentRect (theme, hdc, HP_HEADERITEM, state,
- &r, &r);
- }
- else {
- HBRUSH hbr;
-
- if (!(infoPtr->dwStyle & HDS_FLAT))
- {
- if (infoPtr->dwStyle & HDS_BUTTONS) {
- if (phdi->bDown) {
- DrawEdge (hdc, &r, BDR_RAISEDOUTER,
- BF_RECT | BF_FLAT | BF_MIDDLE | BF_ADJUST);
- }
- else
- DrawEdge (hdc, &r, EDGE_RAISED,
- BF_RECT | BF_SOFT | BF_MIDDLE | BF_ADJUST);
- }
- else
- DrawEdge (hdc, &r, EDGE_ETCHED, BF_BOTTOM | BF_RIGHT | BF_ADJUST);
- }
-
- hbr = CreateSolidBrush(GetBkColor(hdc));
- FillRect(hdc, &r, hbr);
- DeleteObject(hbr);
- }
- if (phdi->bDown) {
- r.left += 2;
- r.top += 2;
- }
-
- if (phdi->fmt & HDF_OWNERDRAW) {
+ /* Fill background, owner could draw over it. */
+ HEADER_FillItemFrame(infoPtr, hdc, &r, phdi, bHotTrack);
+
+ if (phdi->fmt & HDF_OWNERDRAW)
+ {
DRAWITEMSTRUCT dis;
+ BOOL ret;
dis.CtlType = ODT_HEADER;
dis.CtlID = GetWindowLongPtrW (infoPtr->hwndSelf, GWLP_ID);
@@ -377,11 +382,32 @@
dis.rcItem = phdi->rect;
dis.itemData = phdi->lParam;
oldBkMode = SetBkMode(hdc, TRANSPARENT);
- SendMessageW (infoPtr->hwndNotify, WM_DRAWITEM, dis.CtlID, (LPARAM)&dis);
+ ret = SendMessageW (infoPtr->hwndNotify, WM_DRAWITEM, dis.CtlID,
(LPARAM)&dis);
if (oldBkMode != TRANSPARENT)
SetBkMode(hdc, oldBkMode);
- }
- else {
+
+ if (!ret)
+ HEADER_FillItemFrame(infoPtr, hdc, &r, phdi, bHotTrack);
+
+ /* Edges are always drawn if we don't have attached theme. */
+ HEADER_DrawItemFrame(infoPtr, hdc, &r, phdi);
+ /* If application processed WM_DRAWITEM we should skip label painting,
+ edges are drawn no matter what. */
+ if (ret) return phdi->rect.right;
+ }
+ else
+ {
+ HEADER_FillItemFrame(infoPtr, hdc, &r, phdi, bHotTrack);
+ HEADER_DrawItemFrame(infoPtr, hdc, &r, phdi);
+ }
+
+ if (phdi->bDown) {
+ r.left += 2;
+ r.top += 2;
+ }
+
+ /* Now text and image */
+ {
UINT rw, rh, /* width and height of r */
*x = NULL, *w = NULL; /* x and width of the pic (bmp or img) which is part of cnt
*/
/* cnt,txt,img,bmp */
@@ -499,7 +525,7 @@
SetBkMode(hdc, oldBkMode);
}
HEADER_FreeCallbackItems(phdi);
- }/*Ownerdrawn*/
+ }
return phdi->rect.right;
}
Modified: trunk/reactos/dll/win32/comctl32/listview.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/listvie…
==============================================================================
--- trunk/reactos/dll/win32/comctl32/listview.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/comctl32/listview.c [iso-8859-1] Sat Sep 14 20:06:00 2013
@@ -132,13 +132,6 @@
*
* Functions:
* -- LVGroupComparE
- *
- * Known differences in message stream from native control (not known if
- * these differences cause problems):
- * LVM_INSERTITEM issues LVM_SETITEMSTATE and LVM_SETITEM in certain cases.
- * LVM_SETITEM does not always issue LVN_ITEMCHANGING/LVN_ITEMCHANGED.
- * WM_CREATE does not issue WM_QUERYUISTATE and associated registry
- * processing for "USEDOUBLECLICKTIME".
*/
#include <config.h>
@@ -6284,6 +6277,7 @@
{
lvItem.iItem = nItem;
lvItem.iSubItem = 0;
+ lvItem.pszText = szDispText;
if (!LISTVIEW_GetItemW(infoPtr, &lvItem)) continue;
if (lvItem.mask & LVIF_PARAM)
@@ -7923,17 +7917,6 @@
* nearest number of pixels that are a whole line. Ex: if line height
* is 16 and an 8 is passed, the list will be scrolled by 16. If a 7
* is passed, then the scroll will be 0. (per MSDN 7/2002)
- *
- * For: (per experimentation with native control and CSpy ListView)
- * LV_VIEW_ICON scrolling in any direction is allowed
- * LV_VIEW_SMALLICON scrolling in any direction is allowed
- * LV_VIEW_LIST dx=1 = 1 column (horizontal only)
- * but will only scroll 1 column per message
- * no matter what the value.
- * dy must be 0 or FALSE returned.
- * LV_VIEW_DETAILS dx=1 = 1 pixel
- * dy= see above
- *
*/
static BOOL LISTVIEW_Scroll(LISTVIEW_INFO *infoPtr, INT dx, INT dy)
{
Modified: trunk/reactos/dll/win32/comctl32/monthcal.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/monthca…
==============================================================================
--- trunk/reactos/dll/win32/comctl32/monthcal.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/comctl32/monthcal.c [iso-8859-1] Sat Sep 14 20:06:00 2013
@@ -123,7 +123,6 @@
int width_increment;
INT delta; /* scroll rate; # of months that the */
/* control moves when user clicks a scroll button */
- int visible; /* # of months visible */
int firstDay; /* Start month calendar with firstDay's day,
stored in SYSTEMTIME format */
BOOL firstDaySet; /* first week day differs from locale defined */
@@ -1302,8 +1301,8 @@
if(infoPtr->delta)
return infoPtr->delta;
- else
- return infoPtr->visible;
+
+ return MONTHCAL_GetMonthRange(infoPtr, GMR_VISIBLE, NULL);
}
Modified: trunk/reactos/dll/win32/comctl32/progress.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/progres…
==============================================================================
--- trunk/reactos/dll/win32/comctl32/progress.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/comctl32/progress.c [iso-8859-1] Sat Sep 14 20:06:00 2013
@@ -544,7 +544,7 @@
case WM_CREATE:
{
DWORD dwExStyle = GetWindowLongW (hwnd, GWL_EXSTYLE);
-
+
theme = OpenThemeData (hwnd, themeClass);
dwExStyle &= ~(WS_EX_CLIENTEDGE | WS_EX_WINDOWEDGE);
@@ -690,17 +690,25 @@
return infoPtr->CurVal;
case PBM_SETBARCOLOR:
+ {
+ COLORREF clr = infoPtr->ColorBar;
+
infoPtr->ColorBar = (COLORREF)lParam;
InvalidateRect(hwnd, NULL, TRUE);
- return 0;
+ return clr;
+ }
case PBM_GETBARCOLOR:
return infoPtr->ColorBar;
case PBM_SETBKCOLOR:
+ {
+ COLORREF clr = infoPtr->ColorBk;
+
infoPtr->ColorBk = (COLORREF)lParam;
InvalidateRect(hwnd, NULL, TRUE);
- return 0;
+ return clr;
+ }
case PBM_GETBKCOLOR:
return infoPtr->ColorBk;
Modified: trunk/reactos/dll/win32/comctl32/rebar.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/rebar.c…
==============================================================================
--- trunk/reactos/dll/win32/comctl32/rebar.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/comctl32/rebar.c [iso-8859-1] Sat Sep 14 20:06:00 2013
@@ -46,11 +46,11 @@
* - RB_SETTOOLTIPS
* - WM_CHARTOITEM
* - WM_LBUTTONDBLCLK
- * - WM_MEASUREITEM
* - WM_PALETTECHANGED
* - WM_QUERYNEWPALETTE
* - WM_RBUTTONDOWN
* - WM_RBUTTONUP
+ * - WM_SYSCOLORCHANGE
* - WM_VKEYTOITEM
* - WM_WININICHANGE
* Notifications:
@@ -136,6 +136,9 @@
LPWSTR lpText;
HWND hwndPrevParent;
} REBAR_BAND;
+
+/* has a value of: 0, CCS_TOP, CCS_NOMOVEY, CCS_BOTTOM */
+#define CCS_LAYOUT_MASK 0x3
/* fStatus flags */
#define HAS_GRIPPER 0x00000001
@@ -1049,14 +1052,6 @@
lpBand->rcChild = rbcz.rcChild; /* *** ??? */
}
- /* native (IE4 in "Favorites" frame **1) does:
- * SetRect (&rc, -1, -1, -1, -1)
- * EqualRect (&rc,band->rc???)
- * if ret==0
- * CopyRect (band->rc????, &rc)
- * set flag outside of loop
- */
-
GetClassNameW (lpBand->hwndChild, szClassName,
sizeof(szClassName)/sizeof(szClassName[0]));
if (!lstrcmpW (szClassName, strComboBox) ||
!lstrcmpW (szClassName, WC_COMBOBOXEXW)) {
@@ -1108,15 +1103,6 @@
if (infoPtr->DoRedraw)
UpdateWindow (infoPtr->hwndSelf);
-
- /* native (from **1 above) does:
- * UpdateWindow(rebar)
- * REBAR_ForceResize
- * RBN_HEIGHTCHANGE if necessary
- * if ret from any EqualRect was 0
- * Goto "BeginDeferWindowPos"
- */
-
}
/* Returns the next visible band (the first visible band in [i+1; infoPtr->uNumBands)
)
@@ -3317,29 +3303,6 @@
infoPtr->hFont = infoPtr->hDefaultFont = tfont;
}
-/* native does:
- GetSysColor (numerous);
- GetSysColorBrush (numerous) (see WM_SYSCOLORCHANGE);
- *GetStockObject (SYSTEM_FONT);
- *SetWindowLong (hwnd, 0, info ptr);
- *WM_NOTIFYFORMAT;
- *SetWindowLong (hwnd, GWL_STYLE, style+0x10000001);
- WS_VISIBLE = 0x10000000;
- CCS_TOP = 0x00000001;
- *SystemParametersInfo (SPI_GETNONCLIENTMETRICS...);
- *CreateFontIndirect (lfCaptionFont from above);
- GetDC ();
- SelectObject (hdc, fontabove);
- GetTextMetrics (hdc, ); guessing is tmHeight
- SelectObject (hdc, oldfont);
- ReleaseDC ();
- GetWindowRect ();
- MapWindowPoints (0, parent, rectabove, 2);
- GetWindowRect ();
- GetClientRect ();
- ClientToScreen (clientrect);
- SetWindowPos (hwnd, 0, 0, 0, 0, 0, SWP_NOZORDER);
- */
return TRUE;
}
@@ -3725,6 +3688,7 @@
case WM_COMMAND:
case WM_DRAWITEM:
case WM_NOTIFY:
+ case WM_MEASUREITEM:
return SendMessageW(REBAR_GetNotifyParent (infoPtr), uMsg, wParam, lParam);
@@ -3749,8 +3713,6 @@
case WM_LBUTTONUP:
return REBAR_LButtonUp (infoPtr);
-
-/* case WM_MEASUREITEM: supported according to ControlSpy */
case WM_MOUSEMOVE:
return REBAR_MouseMove (infoPtr, lParam);
Modified: trunk/reactos/dll/win32/comctl32/tab.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/tab.c?r…
==============================================================================
--- trunk/reactos/dll/win32/comctl32/tab.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/comctl32/tab.c [iso-8859-1] Sat Sep 14 20:06:00 2013
@@ -1023,37 +1023,18 @@
/*
* Calculate the position of the scroll control.
*/
- if(infoPtr->dwStyle & TCS_VERTICAL)
- {
- controlPos.right = clientRect->right;
- controlPos.left = controlPos.right - 2 * GetSystemMetrics(SM_CXHSCROLL);
-
- if (infoPtr->dwStyle & TCS_BOTTOM)
- {
- controlPos.top = clientRect->bottom - infoPtr->tabHeight;
- controlPos.bottom = controlPos.top + GetSystemMetrics(SM_CYHSCROLL);
- }
- else
- {
- controlPos.bottom = clientRect->top + infoPtr->tabHeight;
- controlPos.top = controlPos.bottom - GetSystemMetrics(SM_CYHSCROLL);
- }
+ controlPos.right = clientRect->right;
+ controlPos.left = controlPos.right - 2 * GetSystemMetrics(SM_CXHSCROLL);
+
+ if (infoPtr->dwStyle & TCS_BOTTOM)
+ {
+ controlPos.top = clientRect->bottom - infoPtr->tabHeight;
+ controlPos.bottom = controlPos.top + GetSystemMetrics(SM_CYHSCROLL);
}
else
{
- controlPos.right = clientRect->right;
- controlPos.left = controlPos.right - 2 * GetSystemMetrics(SM_CXHSCROLL);
-
- if (infoPtr->dwStyle & TCS_BOTTOM)
- {
- controlPos.top = clientRect->bottom - infoPtr->tabHeight;
- controlPos.bottom = controlPos.top + GetSystemMetrics(SM_CYHSCROLL);
- }
- else
- {
- controlPos.bottom = clientRect->top + infoPtr->tabHeight;
- controlPos.top = controlPos.bottom - GetSystemMetrics(SM_CYHSCROLL);
- }
+ controlPos.bottom = clientRect->top + infoPtr->tabHeight;
+ controlPos.top = controlPos.bottom - GetSystemMetrics(SM_CYHSCROLL);
}
/*
@@ -1917,9 +1898,8 @@
/* Draw the text */
if(infoPtr->dwStyle & TCS_VERTICAL) /* if we are vertical rotate the text and
each character */
{
- static const WCHAR ArialW[] = {
'A','r','i','a','l',0 };
LOGFONTW logfont;
- HFONT hFont = 0;
+ HFONT hFont;
INT nEscapement = 900;
INT nOrientation = 900;
@@ -1930,21 +1910,9 @@
}
/* to get a font with the escapement and orientation we are looking for, we need to
*/
- /* call CreateFontIndirectA, which requires us to set the values of the logfont we
pass in */
- if (!GetObjectW((infoPtr->hFont) ?
- infoPtr->hFont : GetStockObject(SYSTEM_FONT),
- sizeof(LOGFONTW),&logfont))
- {
- INT iPointSize = 9;
-
- lstrcpyW(logfont.lfFaceName, ArialW);
- logfont.lfHeight = -MulDiv(iPointSize, GetDeviceCaps(hdc, LOGPIXELSY),
- 72);
- logfont.lfWeight = FW_NORMAL;
- logfont.lfItalic = 0;
- logfont.lfUnderline = 0;
- logfont.lfStrikeOut = 0;
- }
+ /* call CreateFontIndirect, which requires us to set the values of the logfont we
pass in */
+ if (!GetObjectW(infoPtr->hFont, sizeof(logfont), &logfont))
+ GetObjectW(GetStockObject(DEFAULT_GUI_FONT), sizeof(logfont), &logfont);
logfont.lfEscapement = nEscapement;
logfont.lfOrientation = nOrientation;
Modified: trunk/reactos/dll/win32/comctl32/toolbar.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/toolbar…
==============================================================================
--- trunk/reactos/dll/win32/comctl32/toolbar.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/comctl32/toolbar.c [iso-8859-1] Sat Sep 14 20:06:00 2013
@@ -945,11 +945,6 @@
tbcd.clrHighlightHotTrack = 0;
tbcd.nStringBkMode = TRANSPARENT;
tbcd.nHLStringBkMode = OPAQUE;
- /* MSDN says that this is the text rectangle.
- * But (why always a but) tracing of v5.7 of native shows
- * that this is really a *relative* rectangle based on the
- * the nmcd.rc. Also the left and top are always 0 ignoring
- * any bitmap that might be present. */
tbcd.rcText.left = 0;
tbcd.rcText.top = 0;
tbcd.rcText.right = rcText.right - rc.left;
@@ -5118,7 +5113,6 @@
switch(wParam) {
case 0:
if (lpsize->cx == -1) {
- /* **** this is wrong, native measures each button and sets it */
lpsize->cx = infoPtr->rcBound.right - infoPtr->rcBound.left;
}
else if(HIWORD(lpsize->cx)) {
@@ -5481,8 +5475,7 @@
btnPtr->bDropDownPressed = FALSE;
InvalidateRect(infoPtr->hwndSelf, &btnPtr->rect, TRUE);
- /* find and set hot item
- * NOTE: native doesn't do this, but that is a bug */
+ /* find and set hot item */
GetCursorPos(&pt);
ScreenToClient(infoPtr->hwndSelf, &pt);
nHit = TOOLBAR_InternalHitTest(infoPtr, &pt, &button);
@@ -5663,9 +5656,6 @@
TOOLBAR_SendNotify (&hdr, infoPtr,
NM_RELEASEDCAPTURE);
- /* native issues TBN_ENDDRAG here, if _LBUTTONDOWN issued the
- * TBN_BEGINDRAG
- */
memset(&nmtb, 0, sizeof(nmtb));
nmtb.iItem = btnPtr->idCommand;
TOOLBAR_SendNotify ((NMHDR *) &nmtb, infoPtr,
@@ -5956,39 +5946,6 @@
HINSTANCE hInst = (HINSTANCE)GetWindowLongPtrW (GetParent (hwnd),
GWLP_HINSTANCE);
SetWindowLongPtrW (hwnd, GWLP_HINSTANCE, (LONG_PTR)hInst);
}
-
- /* native control does:
- * Get a lot of colors and brushes
- * WM_NOTIFYFORMAT
- * SystemParametersInfoW(0x1f, 0x3c, adr1, 0)
- * CreateFontIndirectW(adr1)
- * CreateBitmap(0x27, 0x24, 1, 1, 0)
- * hdc = GetDC(toolbar)
- * GetSystemMetrics(0x48)
- * fnt2=CreateFontW(0xe, 0, 0, 0, 0x190, 0, 0, 0, 0, 2,
- * 0, 0, 0, 0, "MARLETT")
- * oldfnt = SelectObject(hdc, fnt2)
- * GetCharWidthW(hdc, 0x36, 0x36, adr2)
- * GetTextMetricsW(hdc, adr3)
- * SelectObject(hdc, oldfnt)
- * DeleteObject(fnt2)
- * ReleaseDC(hdc)
- * InvalidateRect(toolbar, 0, 1)
- * SetWindowLongW(toolbar, 0, addr)
- * SetWindowLongW(toolbar, -16, xxx) **sometimes**
- * WM_STYLECHANGING
- * CallWinEx old new
- * ie 1 0x56000a4c 0x46000a4c 0x56008a4d
- * ie 2 0x4600094c 0x4600094c 0x4600894d
- * ie 3 0x56000b4c 0x46000b4c 0x56008b4d
- * rebar 0x50008844 0x40008844 0x50008845
- * pager 0x50000844 0x40000844 0x50008845
- * IC35mgr 0x5400084e **nochange**
- * on entry to _NCCREATE 0x5400084e
- * rowlist 0x5400004e **nochange**
- * on entry to _NCCREATE 0x5400004e
- *
- */
/* I think the code below is a bug, but it is the way that the native
* controls seem to work. The effect is that if the user of TBSTYLE_FLAT
Modified: trunk/reactos/dll/win32/comctl32/trackbar.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/trackba…
==============================================================================
--- trunk/reactos/dll/win32/comctl32/trackbar.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/comctl32/trackbar.c [iso-8859-1] Sat Sep 14 20:06:00 2013
@@ -499,12 +499,12 @@
offsetthumb = (infoPtr->rcThumb.bottom - infoPtr->rcThumb.top)/2;
rcTics.left = infoPtr->rcThumb.left - 2;
rcTics.right = infoPtr->rcThumb.right + 2;
- rcTics.top = infoPtr->rcChannel.top + offsetthumb + 1;
- rcTics.bottom = infoPtr->rcChannel.bottom - offsetthumb;
+ rcTics.top = infoPtr->rcChannel.top + offsetthumb;
+ rcTics.bottom = infoPtr->rcChannel.bottom - offsetthumb - 1;
} else {
offsetthumb = (infoPtr->rcThumb.right - infoPtr->rcThumb.left)/2;
- rcTics.left = infoPtr->rcChannel.left + offsetthumb + 1;
- rcTics.right = infoPtr->rcChannel.right - offsetthumb;
+ rcTics.left = infoPtr->rcChannel.left + offsetthumb;
+ rcTics.right = infoPtr->rcChannel.right - offsetthumb - 1;
rcTics.top = infoPtr->rcThumb.top - 2;
rcTics.bottom = infoPtr->rcThumb.bottom + 2;
}
@@ -612,19 +612,105 @@
}
}
+#define POINT_COUNT 6
+static int
+TRACKBAR_FillThumb (const TRACKBAR_INFO *infoPtr, HDC hdc, HBRUSH hbrush)
+{
+ const RECT *thumb = &infoPtr->rcThumb;
+ POINT points[6];
+ int PointDepth;
+ HBRUSH oldbr;
+
+ if (infoPtr->dwStyle & TBS_BOTH)
+ {
+ FillRect(hdc, thumb, hbrush);
+ return 0;
+ }
+
+ if (infoPtr->dwStyle & TBS_VERT)
+ {
+ PointDepth = (thumb->bottom - thumb->top) / 2;
+ if (infoPtr->dwStyle & TBS_LEFT)
+ {
+ points[0].x = thumb->right-1;
+ points[0].y = thumb->top;
+ points[1].x = thumb->right-1;
+ points[1].y = thumb->bottom-1;
+ points[2].x = thumb->left + PointDepth;
+ points[2].y = thumb->bottom-1;
+ points[3].x = thumb->left;
+ points[3].y = thumb->top + PointDepth;
+ points[4].x = thumb->left + PointDepth;
+ points[4].y = thumb->top;
+ points[5].x = points[0].x;
+ points[5].y = points[0].y;
+ }
+ else
+ {
+ points[0].x = thumb->right;
+ points[0].y = thumb->top + PointDepth;
+ points[1].x = thumb->right - PointDepth;
+ points[1].y = thumb->bottom-1;
+ points[2].x = thumb->left;
+ points[2].y = thumb->bottom-1;
+ points[3].x = thumb->left;
+ points[3].y = thumb->top;
+ points[4].x = thumb->right - PointDepth;
+ points[4].y = thumb->top;
+ points[5].x = points[0].x;
+ points[5].y = points[0].y;
+ }
+ }
+ else
+ {
+ PointDepth = (thumb->right - thumb->left) / 2;
+ if (infoPtr->dwStyle & TBS_TOP)
+ {
+ points[0].x = thumb->left + PointDepth;
+ points[0].y = thumb->top+1;
+ points[1].x = thumb->right-1;
+ points[1].y = thumb->top + PointDepth + 1;
+ points[2].x = thumb->right-1;
+ points[2].y = thumb->bottom-1;
+ points[3].x = thumb->left;
+ points[3].y = thumb->bottom-1;
+ points[4].x = thumb->left;
+ points[4].y = thumb->top + PointDepth + 1;
+ points[5].x = points[0].x;
+ points[5].y = points[0].y;
+ }
+ else
+ {
+ points[0].x = thumb->right-1;
+ points[0].y = thumb->top;
+ points[1].x = thumb->right-1;
+ points[1].y = thumb->bottom - PointDepth - 1;
+ points[2].x = thumb->left + PointDepth;
+ points[2].y = thumb->bottom-1;
+ points[3].x = thumb->left;
+ points[3].y = thumb->bottom - PointDepth - 1;
+ points[4].x = thumb->left;
+ points[4].y = thumb->top;
+ points[5].x = points[0].x;
+ points[5].y = points[0].y;
+ }
+ }
+
+ oldbr = SelectObject(hdc, hbrush);
+ SetPolyFillMode(hdc, WINDING);
+ Polygon(hdc, points, sizeof(points) / sizeof(points[0]));
+ SelectObject(hdc, oldbr);
+
+ return PointDepth;
+}
+
static void
-TRACKBAR_DrawThumb (const TRACKBAR_INFO *infoPtr, HDC hdc)
-{
- HBRUSH oldbr;
- HPEN oldpen;
- RECT thumb = infoPtr->rcThumb;
- int BlackUntil = 3;
- int PointCount = 6;
- POINT points[6];
- int fillClr;
+TRACKBAR_DrawThumb (TRACKBAR_INFO *infoPtr, HDC hdc)
+{
+ HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
int PointDepth;
- HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
-
+ HBRUSH brush;
+
if (theme)
{
int partId;
@@ -645,113 +731,115 @@
else
stateId = TUS_NORMAL;
- DrawThemeBackground (theme, hdc, partId, stateId, &thumb, 0);
+ DrawThemeBackground (theme, hdc, partId, stateId, &infoPtr->rcThumb,
NULL);
return;
}
- fillClr = infoPtr->flags & TB_DRAG_MODE ? COLOR_BTNHILIGHT : COLOR_BTNFACE;
- oldbr = SelectObject (hdc, GetSysColorBrush(fillClr));
- SetPolyFillMode (hdc, WINDING);
+ if (infoPtr->dwStyle & WS_DISABLED || infoPtr->flags & TB_DRAG_MODE)
+ {
+ if (comctl32_color.clr3dHilight == comctl32_color.clrWindow)
+ brush = COMCTL32_hPattern55AABrush;
+ else
+ brush = GetSysColorBrush(COLOR_SCROLLBAR);
+
+ SetTextColor(hdc, comctl32_color.clr3dFace);
+ SetBkColor(hdc, comctl32_color.clr3dHilight);
+ }
+ else
+ brush = GetSysColorBrush(COLOR_BTNFACE);
+
+ PointDepth = TRACKBAR_FillThumb(infoPtr, hdc, brush);
if (infoPtr->dwStyle & TBS_BOTH)
{
- points[0].x=thumb.right;
- points[0].y=thumb.top;
- points[1].x=thumb.right;
- points[1].y=thumb.bottom;
- points[2].x=thumb.left;
- points[2].y=thumb.bottom;
- points[3].x=thumb.left;
- points[3].y=thumb.top;
- points[4].x=points[0].x;
- points[4].y=points[0].y;
- PointCount = 5;
- BlackUntil = 3;
+ DrawEdge(hdc, &infoPtr->rcThumb, EDGE_RAISED, BF_RECT | BF_SOFT);
+ return;
}
else
{
+ RECT thumb = infoPtr->rcThumb;
+
if (infoPtr->dwStyle & TBS_VERT)
{
- PointDepth = (thumb.bottom - thumb.top) / 2;
if (infoPtr->dwStyle & TBS_LEFT)
{
- points[0].x=thumb.right;
- points[0].y=thumb.top;
- points[1].x=thumb.right;
- points[1].y=thumb.bottom;
- points[2].x=thumb.left + PointDepth;
- points[2].y=thumb.bottom;
- points[3].x=thumb.left;
- points[3].y=(thumb.bottom - thumb.top) / 2 + thumb.top + 1;
- points[4].x=thumb.left + PointDepth;
- points[4].y=thumb.top;
- points[5].x=points[0].x;
- points[5].y=points[0].y;
- BlackUntil = 4;
+ /* rectangular part */
+ thumb.left += PointDepth;
+ DrawEdge(hdc, &thumb, EDGE_RAISED, BF_TOP | BF_RIGHT | BF_BOTTOM |
BF_SOFT);
+
+ /* light edge */
+ thumb.left -= PointDepth;
+ thumb.right = thumb.left + PointDepth;
+ thumb.bottom = infoPtr->rcThumb.top + PointDepth + 1;
+ thumb.top = infoPtr->rcThumb.top;
+ DrawEdge(hdc, &thumb, EDGE_RAISED, BF_DIAGONAL_ENDTOPRIGHT | BF_SOFT);
+
+ /* shadowed edge */
+ thumb.top += PointDepth;
+ thumb.bottom += PointDepth;
+ DrawEdge(hdc, &thumb, EDGE_SUNKEN, BF_DIAGONAL_ENDTOPLEFT | BF_SOFT);
+ return;
}
else
{
- points[0].x=thumb.right;
- points[0].y=(thumb.bottom - thumb.top) / 2 + thumb.top + 1;
- points[1].x=thumb.right - PointDepth;
- points[1].y=thumb.bottom;
- points[2].x=thumb.left;
- points[2].y=thumb.bottom;
- points[3].x=thumb.left;
- points[3].y=thumb.top;
- points[4].x=thumb.right - PointDepth;
- points[4].y=thumb.top;
- points[5].x=points[0].x;
- points[5].y=points[0].y;
+ /* rectangular part */
+ thumb.right -= PointDepth;
+ DrawEdge(hdc, &thumb, EDGE_RAISED, BF_TOP | BF_LEFT | BF_BOTTOM |
BF_SOFT);
+
+ /* light edge */
+ thumb.left = thumb.right;
+ thumb.right += PointDepth + 1;
+ thumb.bottom = infoPtr->rcThumb.top + PointDepth + 1;
+ thumb.top = infoPtr->rcThumb.top;
+ DrawEdge(hdc, &thumb, EDGE_RAISED, BF_DIAGONAL_ENDTOPLEFT | BF_SOFT);
+
+ /* shadowed edge */
+ thumb.top += PointDepth;
+ thumb.bottom += PointDepth;
+ DrawEdge(hdc, &thumb, EDGE_RAISED, BF_DIAGONAL_ENDBOTTOMLEFT | BF_SOFT);
}
}
else
{
- PointDepth = (thumb.right - thumb.left) / 2;
if (infoPtr->dwStyle & TBS_TOP)
{
- points[0].x=(thumb.right - thumb.left) / 2 + thumb.left + 1;
- points[0].y=thumb.top;
- points[1].x=thumb.right;
- points[1].y=thumb.top + PointDepth;
- points[2].x=thumb.right;
- points[2].y=thumb.bottom;
- points[3].x=thumb.left;
- points[3].y=thumb.bottom;
- points[4].x=thumb.left;
- points[4].y=thumb.top + PointDepth;
- points[5].x=points[0].x;
- points[5].y=points[0].y;
- BlackUntil = 4;
+ /* rectangular part */
+ thumb.top += PointDepth;
+ DrawEdge(hdc, &thumb, EDGE_RAISED, BF_LEFT | BF_BOTTOM | BF_RIGHT |
BF_SOFT);
+
+ /* light edge */
+ thumb.left = infoPtr->rcThumb.left;
+ thumb.right = thumb.left + PointDepth;
+ thumb.bottom = infoPtr->rcThumb.top + PointDepth + 1;
+ thumb.top -= PointDepth;
+ DrawEdge(hdc, &thumb, EDGE_RAISED, BF_DIAGONAL_ENDTOPRIGHT | BF_SOFT);
+
+ /* shadowed edge */
+ thumb.left += PointDepth;
+ thumb.right += PointDepth;
+ DrawEdge(hdc, &thumb, EDGE_RAISED, BF_DIAGONAL_ENDBOTTOMRIGHT |
BF_SOFT);
}
else
{
- points[0].x=thumb.right;
- points[0].y=thumb.top;
- points[1].x=thumb.right;
- points[1].y=thumb.bottom - PointDepth;
- points[2].x=(thumb.right - thumb.left) / 2 + thumb.left + 1;
- points[2].y=thumb.bottom;
- points[3].x=thumb.left;
- points[3].y=thumb.bottom - PointDepth;
- points[4].x=thumb.left;
- points[4].y=thumb.top;
- points[5].x=points[0].x;
- points[5].y=points[0].y;
+ /* rectangular part */
+ thumb.bottom -= PointDepth;
+ DrawEdge(hdc, &thumb, EDGE_RAISED, BF_LEFT | BF_TOP | BF_RIGHT |
BF_SOFT);
+
+ /* light edge */
+ thumb.left = infoPtr->rcThumb.left;
+ thumb.right = thumb.left + PointDepth;
+ thumb.top = infoPtr->rcThumb.bottom - PointDepth - 1;
+ thumb.bottom += PointDepth;
+ DrawEdge(hdc, &thumb, EDGE_RAISED, BF_DIAGONAL_ENDTOPLEFT | BF_SOFT);
+
+ /* shadowed edge */
+ thumb.left += PointDepth;
+ thumb.right += PointDepth;
+ DrawEdge(hdc, &thumb, EDGE_RAISED, BF_DIAGONAL_ENDBOTTOMLEFT | BF_SOFT);
}
}
-
- }
-
- /* Draw the thumb now */
- Polygon (hdc, points, PointCount);
- oldpen = SelectObject(hdc, GetStockObject(BLACK_PEN));
- Polyline(hdc,points, BlackUntil);
- SelectObject(hdc, GetStockObject(WHITE_PEN));
- Polyline(hdc, &points[BlackUntil-1], PointCount+1-BlackUntil);
- SelectObject(hdc, oldpen);
- SelectObject(hdc, oldbr);
+ }
}
@@ -1295,9 +1383,11 @@
TRACKBAR_SetThumbLength (TRACKBAR_INFO *infoPtr, UINT iLength)
{
if (infoPtr->dwStyle & TBS_FIXEDLENGTH) {
+ /* We're not supposed to check if it's really changed or not,
+ just repaint in any case. */
infoPtr->uThumbLen = iLength;
infoPtr->flags |= TB_THUMBSIZECHANGED;
- InvalidateRect (infoPtr->hwndSelf, &infoPtr->rcThumb, FALSE);
+ TRACKBAR_InvalidateAll(infoPtr);
}
return 0;
@@ -1571,9 +1661,15 @@
static LRESULT
TRACKBAR_Size (TRACKBAR_INFO *infoPtr)
{
- TRACKBAR_CalcChannel (infoPtr);
- TRACKBAR_UpdateThumb (infoPtr);
+ if (infoPtr->dwStyle & TBS_FIXEDLENGTH)
+ {
+ TRACKBAR_CalcChannel(infoPtr);
+ TRACKBAR_UpdateThumb(infoPtr);
+ }
+ else
+ TRACKBAR_InitializeThumb(infoPtr);
TRACKBAR_AlignBuddies (infoPtr);
+ TRACKBAR_InvalidateAll(infoPtr);
return 0;
}
@@ -1747,6 +1843,19 @@
}
+static LRESULT
+TRACKBAR_Enable (TRACKBAR_INFO *infoPtr, BOOL enable)
+{
+ if (enable)
+ infoPtr->dwStyle &= ~WS_DISABLED;
+ else
+ infoPtr->dwStyle |= WS_DISABLED;
+
+ InvalidateRect(infoPtr->hwndSelf, &infoPtr->rcThumb, TRUE);
+
+ return 1;
+}
+
static LRESULT WINAPI
TRACKBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
@@ -1874,7 +1983,8 @@
case WM_DESTROY:
return TRACKBAR_Destroy (infoPtr);
-/* case WM_ENABLE: */
+ case WM_ENABLE:
+ return TRACKBAR_Enable (infoPtr, (BOOL)wParam);
case WM_ERASEBKGND:
return 0;
Modified: trunk/reactos/dll/win32/comctl32/treeview.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/treevie…
==============================================================================
--- trunk/reactos/dll/win32/comctl32/treeview.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/comctl32/treeview.c [iso-8859-1] Sat Sep 14 20:06:00 2013
@@ -2526,7 +2526,7 @@
* - Otherwise - use background color
*/
if ((item->state & TVIS_DROPHILITED) || ((item == infoPtr->focusedItem)
&& !(item->state & TVIS_SELECTED)) ||
- ((item->state & TVIS_SELECTED) && (!infoPtr->focusedItem) &&
+ ((item->state & TVIS_SELECTED) && (!infoPtr->focusedItem || item ==
infoPtr->focusedItem) &&
(inFocus || (infoPtr->dwStyle & TVS_SHOWSELALWAYS))))
{
if ((item->state & TVIS_DROPHILITED) || inFocus)
@@ -3301,6 +3301,8 @@
TREEVIEW_RemoveAllChildren(infoPtr, item);
item->cChildren = old_cChildren;
}
+ if (!wasExpanded)
+ return FALSE;
if (item->firstChild)
{
Modified: trunk/reactos/media/doc/README.WINE
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
==============================================================================
--- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original)
+++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sat Sep 14 20:06:00 2013
@@ -59,7 +59,7 @@
reactos/dll/win32/cabinet # Synced to Wine-1.5.26
reactos/dll/win32/clusapi # Synced to Wine-1.7.1
reactos/dll/win32/comcat # Synced to Wine-1.7.1
-reactos/dll/win32/comctl32 # Synced to Wine 1.5.26
+reactos/dll/win32/comctl32 # Synced to Wine 1.7.1
reactos/dll/win32/comdlg32 # Synced to Wine 1.3.37
reactos/dll/win32/compstui # Synced to Wine-1.5.19
reactos/dll/win32/credui # Synced to Wine-1.5.4