reactos/dll/win32/comctl32/comctl32_ros.diff

265 lines
8 KiB
Diff
Raw Normal View History

Index: propsheet.c
===================================================================
--- propsheet.c (revision 38890)
+++ propsheet.c (working copy)
@@ -2417,6 +2417,29 @@
return FALSE;
}
+BOOL CALLBACK
+EnumChildProc(HWND hwnd, LPARAM lParam)
+{
+ WCHAR szType[20];
+ RealGetWindowClassW(hwnd, szType, 20);
+
+ if (strcmpW(szType, WC_EDITW) == 0)
+ {
+ if (IsWindowEnabled(hwnd) && IsWindowVisible(hwnd))
+ {
+ SetFocus(hwnd);
+ return FALSE;
+ }
+ }
+ else
+ {
+ EnumChildWindows(hwnd, EnumChildProc, 0);
+ }
+
+ return TRUE;
+}
+
+
/******************************************************************************
* PROPSHEET_SetWizButtons
*
@@ -2438,17 +2461,6 @@
EnableWindow(hwndNext, FALSE);
EnableWindow(hwndFinish, FALSE);
- /* set the default pushbutton to an enabled button */
- if (((dwFlags & PSWIZB_FINISH) || psInfo->hasFinish) && !(dwFlags & PSWIZB_DISABLEDFINISH))
- SendMessageW(hwndDlg, DM_SETDEFID, IDC_FINISH_BUTTON, 0);
- else if (dwFlags & PSWIZB_NEXT)
- SendMessageW(hwndDlg, DM_SETDEFID, IDC_NEXT_BUTTON, 0);
- else if (dwFlags & PSWIZB_BACK)
- SendMessageW(hwndDlg, DM_SETDEFID, IDC_BACK_BUTTON, 0);
- else
- SendMessageW(hwndDlg, DM_SETDEFID, IDCANCEL, 0);
-
-
if (dwFlags & PSWIZB_BACK)
EnableWindow(hwndBack, TRUE);
@@ -2478,6 +2490,31 @@
}
else if (!(dwFlags & PSWIZB_DISABLEDFINISH))
EnableWindow(hwndFinish, TRUE);
+
+ /* set the default pushbutton to an enabled button and give it focus */
+ if (((dwFlags & PSWIZB_FINISH) || psInfo->hasFinish) && !(dwFlags & PSWIZB_DISABLEDFINISH))
+ {
+ SendMessageW(hwndDlg, DM_SETDEFID, IDC_FINISH_BUTTON, 0);
+ SetFocus(hwndFinish);
+ }
+ else if (dwFlags & PSWIZB_NEXT)
+ {
+ SendMessageW(hwndDlg, DM_SETDEFID, IDC_NEXT_BUTTON, 0);
+ SetFocus(hwndNext);
+ }
+ else if (dwFlags & PSWIZB_BACK)
+ {
+ SendMessageW(hwndDlg, DM_SETDEFID, IDC_BACK_BUTTON, 0);
+ SetFocus(hwndBack);
+ }
+ else
+ {
+ SendMessageW(hwndDlg, DM_SETDEFID, IDCANCEL, 0);
+ SetFocus(GetDlgItem(hwndDlg, IDCANCEL));
+ }
+
+ /* Now try to find an edit control that deserves focus */
+ EnumChildWindows(PropSheet_GetCurrentPageHwnd(hwndDlg), EnumChildProc, 0);
}
/******************************************************************************
Index: tooltips.c
===================================================================
--- tooltips.c (revision 38890)
+++ tooltips.c (working copy)
@@ -2488,8 +2488,33 @@
static LRESULT
TOOLTIPS_NotifyFormat (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
- FIXME ("hwnd=%p wParam=%lx lParam=%lx\n", hwnd, wParam, lParam);
+ TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
+ TTTOOL_INFO *toolPtr = infoPtr->tools;
+ INT nResult;
+ TRACE("hwnd=%p wParam=%lx lParam=%lx\n", hwnd, wParam, lParam);
+
+ if (lParam == NF_QUERY) {
+ if (toolPtr->bNotifyUnicode) {
+ return NFR_UNICODE;
+ } else {
+ return NFR_ANSI;
+ }
+ }
+ else if (lParam == NF_REQUERY) {
+ nResult = (INT) SendMessageW (toolPtr->hwnd, WM_NOTIFYFORMAT,
+ (WPARAM)hwnd, (LPARAM)NF_QUERY);
+ if (nResult == NFR_ANSI) {
+ toolPtr->bNotifyUnicode = FALSE;
+ TRACE(" -- WM_NOTIFYFORMAT returns: NFR_ANSI\n");
+ } else if (nResult == NFR_UNICODE) {
+ toolPtr->bNotifyUnicode = TRUE;
+ TRACE(" -- WM_NOTIFYFORMAT returns: NFR_UNICODE\n");
+ } else {
+ TRACE (" -- WM_NOTIFYFORMAT returns: error!\n");
+ }
+ return nResult;
+ }
return 0;
}
Index: treeview.c
===================================================================
--- treeview.c (revision 38890)
+++ treeview.c (working copy)
@@ -2830,7 +2830,12 @@
}
}
- TREEVIEW_UpdateScrollBars(infoPtr);
+ //
+ // This is correct, but is causes and infinite loop of WM_PAINT messages, resulting
+ // in continuous painting of the scroll bar in reactos. Comment out until the real
+ // bug is found
+ //
+ //TREEVIEW_UpdateScrollBars(infoPtr);
if (infoPtr->cdmode & CDRF_NOTIFYPOSTPAINT)
infoPtr->cdmode =
Index: listview.c
===================================================================
--- listview.c (revision 51320)
+++ listview.c (working copy)
@@ -315,6 +315,7 @@
COLORREF clrBk;
COLORREF clrText;
COLORREF clrTextBk;
+ BOOL bDefaultBkColor;
/* font */
HFONT hDefaultFont;
@@ -1635,8 +1636,19 @@
/* used to handle collapse main item column case */
static inline BOOL LISTVIEW_DrawFocusRect(const LISTVIEW_INFO *infoPtr, HDC hdc)
{
- return (infoPtr->rcFocus.left < infoPtr->rcFocus.right) ?
- DrawFocusRect(hdc, &infoPtr->rcFocus) : FALSE;
+ BOOL Ret = FALSE;
+
+ if (infoPtr->rcFocus.left < infoPtr->rcFocus.right)
+ {
+ DWORD dwOldBkColor, dwOldTextColor;
+
+ dwOldBkColor = SetBkColor(hdc, RGB(255, 255, 255));
+ dwOldTextColor = SetBkColor(hdc, RGB(0, 0, 0));
+ Ret = DrawFocusRect(hdc, &infoPtr->rcFocus);
+ SetBkColor(hdc, dwOldBkColor);
+ SetBkColor(hdc, dwOldTextColor);
+ }
+ return Ret;
}
/* Listview invalidation functions: use _only_ these functions to invalidate */
@@ -5042,7 +5054,11 @@
/* Draw marquee rectangle if appropriate */
if (infoPtr->bMarqueeSelect)
+ {
+ SetBkColor(hdc, RGB(255, 255, 255));
+ SetTextColor(hdc, RGB(0, 0, 0));
DrawFocusRect(hdc, &infoPtr->marqueeDrawRect);
+ }
if (cdmode & CDRF_NOTIFYPOSTPAINT)
notify_postpaint(infoPtr, &nmlvcd);
@@ -7856,6 +7872,7 @@
{
TRACE("(clrBk=%x)\n", clrBk);
+ infoPtr->bDefaultBkColor = FALSE;
if(infoPtr->clrBk != clrBk) {
if (infoPtr->clrBk != CLR_NONE) DeleteObject(infoPtr->hBkBrush);
infoPtr->clrBk = clrBk;
@@ -9248,6 +9265,7 @@
infoPtr->clrText = CLR_DEFAULT;
infoPtr->clrTextBk = CLR_DEFAULT;
LISTVIEW_SetBkColor(infoPtr, comctl32_color.clrWindow);
+ infoPtr->bDefaultBkColor = TRUE;
/* set default values */
infoPtr->nFocusedItem = -1;
@@ -11510,6 +11528,11 @@
case WM_SYSCOLORCHANGE:
COMCTL32_RefreshSysColors();
+ if (infoPtr->bDefaultBkColor)
+ {
+ LISTVIEW_SetBkColor(infoPtr, comctl32_color.clrWindow);
+ infoPtr->bDefaultBkColor = TRUE;
+ }
return 0;
/* case WM_TIMER: */
Index: rebar.c
===================================================================
--- rebar.c (revision 51320)
+++ rebar.c (working copy)
@@ -51,7 +51,6 @@
* - WM_QUERYNEWPALETTE
* - WM_RBUTTONDOWN
* - WM_RBUTTONUP
- * - WM_SYSCOLORCHANGE
* - WM_VKEYTOITEM
* - WM_WININICHANGE
* Notifications:
@@ -2540,10 +2539,8 @@
/* initialize band */
memset(lpBand, 0, sizeof(*lpBand));
- lpBand->clrFore = infoPtr->clrText == CLR_NONE ? infoPtr->clrBtnText :
- infoPtr->clrText;
- lpBand->clrBack = infoPtr->clrBk == CLR_NONE ? infoPtr->clrBtnFace :
- infoPtr->clrBk;
+ lpBand->clrFore = infoPtr->clrText;
+ lpBand->clrBack = infoPtr->clrBk;
lpBand->iImage = -1;
REBAR_CommonSetupBand(infoPtr->hwndSelf, lprbbi, lpBand);
@@ -3793,6 +3790,8 @@
case WM_SYSCOLORCHANGE:
COMCTL32_RefreshSysColors();
+ infoPtr->clrBtnText = comctl32_color.clrBtnText;
+ infoPtr->clrBtnFace = comctl32_color.clrBtnFace;
return 0;
/* case WM_VKEYTOITEM: supported according to ControlSpy */
Index: monthcal.c
===================================================================
--- monthcal.c (Revision 51719)
+++ monthcal.c (Arbeitskopie)
@@ -143,8 +143,8 @@
/* empty SYSTEMTIME const */
static const SYSTEMTIME st_null;
/* valid date limits */
-static const SYSTEMTIME max_allowed_date = { .wYear = 9999, .wMonth = 12, .wDay = 31 };
-static const SYSTEMTIME min_allowed_date = { .wYear = 1752, .wMonth = 9, .wDay = 14 };
+static const SYSTEMTIME max_allowed_date = { 9999, 12, 0, 31, 0, 0, 0, 0 };
+static const SYSTEMTIME min_allowed_date = { 1752, 9, 0, 14, 0, 0, 0, 0 };
/* Prev/Next buttons */
enum nav_direction