Author: greatlrd
Date: Sun Feb 11 01:26:45 2007
New Revision: 25769
URL:
http://svn.reactos.org/svn/reactos?rev=25769&view=rev
Log:
merge 25768 from trunk to 0.3.1 : fixed
Property sheet:
- Set focus to defpushbutton or to first WC_EDIT child window if present, like it works on
windows.
- update wine diff
This fixes the regression in 2nd stage setup when no keyboard focus was present.
Modified:
branches/ros-branch-0_3_1/reactos/dll/win32/comctl32/comctl32_ros.diff
branches/ros-branch-0_3_1/reactos/dll/win32/comctl32/propsheet.c
Modified: branches/ros-branch-0_3_1/reactos/dll/win32/comctl32/comctl32_ros.diff
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_1/reactos/dll/wi…
==============================================================================
--- branches/ros-branch-0_3_1/reactos/dll/win32/comctl32/comctl32_ros.diff (original)
+++ branches/ros-branch-0_3_1/reactos/dll/win32/comctl32/comctl32_ros.diff Sun Feb 11
01:26:45 2007
@@ -13,4 +13,97 @@
- (lvItem.state & LVIS_SELECTED) &&
(infoPtr->bFocus) ? ILD_SELECTED : ILD_NORMAL);
}
- /* Don't bother painting item being edited */
+ /* Don't bother painting item being edited */
+Index: propsheet.c
+===================================================================
+--- propsheet.c (revision 25766)
++++ propsheet.c (working copy)
+@@ -2422,6 +2422,28 @@
+ 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
+ *
+@@ -2444,17 +2466,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);
+
+@@ -2484,6 +2495,32 @@
+ }
+ 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);
++
+ }
+
+ /******************************************************************************
+@@ -3548,7 +3585,7 @@
+
+ return FALSE;
+ }
+-
++
+ case WM_SYSCOLORCHANGE:
+ COMCTL32_RefreshSysColors();
+ return FALSE;
Modified: branches/ros-branch-0_3_1/reactos/dll/win32/comctl32/propsheet.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_1/reactos/dll/wi…
==============================================================================
--- branches/ros-branch-0_3_1/reactos/dll/win32/comctl32/propsheet.c (original)
+++ branches/ros-branch-0_3_1/reactos/dll/win32/comctl32/propsheet.c Sun Feb 11 01:26:45
2007
@@ -2422,6 +2422,28 @@
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
*
@@ -2444,17 +2466,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);
@@ -2484,6 +2495,32 @@
}
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);
+
}
/******************************************************************************
@@ -3548,7 +3585,7 @@
return FALSE;
}
-
+
case WM_SYSCOLORCHANGE:
COMCTL32_RefreshSysColors();
return FALSE;