mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 06:25:49 +00:00
fixed handling of control focus
svn path=/trunk/; revision=7423
This commit is contained in:
parent
7fbcfcbc71
commit
33f1db80ee
4 changed files with 23 additions and 8 deletions
|
@ -141,6 +141,7 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
|
||||||
pChildWnd->hWnd = hWnd;
|
pChildWnd->hWnd = hWnd;
|
||||||
pChildWnd->hTreeWnd = CreateTreeView(hWnd, pChildWnd->szPath, TREE_WINDOW);
|
pChildWnd->hTreeWnd = CreateTreeView(hWnd, pChildWnd->szPath, TREE_WINDOW);
|
||||||
pChildWnd->hListWnd = CreateListView(hWnd, LIST_WINDOW/*, pChildWnd->szPath*/);
|
pChildWnd->hListWnd = CreateListView(hWnd, LIST_WINDOW/*, pChildWnd->szPath*/);
|
||||||
|
SetFocus(pChildWnd->hTreeWnd);
|
||||||
break;
|
break;
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
if (!_CmdWndProc(hWnd, message, wParam, lParam)) {
|
if (!_CmdWndProc(hWnd, message, wParam, lParam)) {
|
||||||
|
@ -284,6 +285,9 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case NM_SETFOCUS:
|
||||||
|
pChildWnd->nFocusPanel = 1;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
goto def;
|
goto def;
|
||||||
}
|
}
|
||||||
|
@ -291,10 +295,17 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
|
||||||
{
|
{
|
||||||
if ((int)wParam == LIST_WINDOW)
|
if ((int)wParam == LIST_WINDOW)
|
||||||
{
|
{
|
||||||
|
switch (((LPNMHDR)lParam)->code) {
|
||||||
|
case NM_SETFOCUS:
|
||||||
|
pChildWnd->nFocusPanel = 0;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
if(ListWndNotifyProc(pChildWnd->hListWnd, wParam, lParam, &Result))
|
if(ListWndNotifyProc(pChildWnd->hListWnd, wParam, lParam, &Result))
|
||||||
{
|
{
|
||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -387,7 +387,7 @@ HWND CreateListView(HWND hwndParent, int id)
|
||||||
/* Get the dimensions of the parent window's client area, and create the list view control. */
|
/* Get the dimensions of the parent window's client area, and create the list view control. */
|
||||||
GetClientRect(hwndParent, &rcClient);
|
GetClientRect(hwndParent, &rcClient);
|
||||||
hwndLV = CreateWindowEx(WS_EX_CLIENTEDGE, WC_LISTVIEW, _T("List View"),
|
hwndLV = CreateWindowEx(WS_EX_CLIENTEDGE, WC_LISTVIEW, _T("List View"),
|
||||||
WS_VISIBLE | WS_CHILD | LVS_REPORT | LVS_EDITLABELS,
|
WS_VISIBLE | WS_CHILD | WS_TABSTOP | LVS_REPORT | LVS_EDITLABELS,
|
||||||
0, 0, rcClient.right, rcClient.bottom,
|
0, 0, rcClient.right, rcClient.bottom,
|
||||||
hwndParent, (HMENU)id, hInst, NULL);
|
hwndParent, (HMENU)id, hInst, NULL);
|
||||||
if (!hwndLV) return NULL;
|
if (!hwndLV) return NULL;
|
||||||
|
|
|
@ -185,7 +185,8 @@ int APIENTRY WinMain(HINSTANCE hInstance,
|
||||||
|
|
||||||
/* Main message loop */
|
/* Main message loop */
|
||||||
while (GetMessage(&msg, (HWND)NULL, 0, 0)) {
|
while (GetMessage(&msg, (HWND)NULL, 0, 0)) {
|
||||||
if (!TranslateAccelerator(msg.hwnd, hAccel, &msg)) {
|
if (!TranslateAccelerator(msg.hwnd, hAccel, &msg) &&
|
||||||
|
!IsDialogMessage(hFrameWnd, &msg)) {
|
||||||
TranslateMessage(&msg);
|
TranslateMessage(&msg);
|
||||||
DispatchMessage(&msg);
|
DispatchMessage(&msg);
|
||||||
}
|
}
|
||||||
|
|
|
@ -151,6 +151,9 @@ static BOOL InitTreeViewItems(HWND hwndTV, LPTSTR pHostName)
|
||||||
if (!AddEntryToTree(hwndTV, hRoot, _T("HKEY_USERS"), HKEY_USERS, 1)) return FALSE;
|
if (!AddEntryToTree(hwndTV, hRoot, _T("HKEY_USERS"), HKEY_USERS, 1)) return FALSE;
|
||||||
if (!AddEntryToTree(hwndTV, hRoot, _T("HKEY_CURRENT_CONFIG"), HKEY_CURRENT_CONFIG, 1)) return FALSE;
|
if (!AddEntryToTree(hwndTV, hRoot, _T("HKEY_CURRENT_CONFIG"), HKEY_CURRENT_CONFIG, 1)) return FALSE;
|
||||||
|
|
||||||
|
/* expand and select host name */
|
||||||
|
TreeView_Expand(hwndTV, hRoot, TVE_EXPAND);
|
||||||
|
TreeView_Select(hwndTV, hRoot, TVGN_CARET);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -262,7 +265,7 @@ HWND CreateTreeView(HWND hwndParent, LPTSTR pHostName, int id)
|
||||||
/* Get the dimensions of the parent window's client area, and create the tree view control. */
|
/* Get the dimensions of the parent window's client area, and create the tree view control. */
|
||||||
GetClientRect(hwndParent, &rcClient);
|
GetClientRect(hwndParent, &rcClient);
|
||||||
hwndTV = CreateWindowEx(WS_EX_CLIENTEDGE, WC_TREEVIEW, _T("Tree View"),
|
hwndTV = CreateWindowEx(WS_EX_CLIENTEDGE, WC_TREEVIEW, _T("Tree View"),
|
||||||
WS_VISIBLE | WS_CHILD | TVS_HASLINES | TVS_HASBUTTONS | TVS_LINESATROOT,
|
WS_VISIBLE | WS_CHILD | WS_TABSTOP | TVS_HASLINES | TVS_HASBUTTONS | TVS_LINESATROOT,
|
||||||
0, 0, rcClient.right, rcClient.bottom,
|
0, 0, rcClient.right, rcClient.bottom,
|
||||||
hwndParent, (HMENU)id, hInst, NULL);
|
hwndParent, (HMENU)id, hInst, NULL);
|
||||||
/* Initialize the image list, and add items to the control. */
|
/* Initialize the image list, and add items to the control. */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue