Skip to content

Commit

Permalink
[COMCTL32] Improve IP Address Controls (Tab and caret) (#3212)
Browse files Browse the repository at this point in the history
Improve IP address controls.
- Set focus to EDIT control to show caret.
- Process WM_GETDLGCODE messages on EDIT control to catch Tab key.
- Process Tab key and Shift+Tab key in processing WM_KEYDOWN.
CORE-3479
  • Loading branch information
katahiromz committed Sep 22, 2020
1 parent 17e094c commit 3f30b1e
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions dll/win32/comctl32/ipaddress.c
Expand Up @@ -453,6 +453,9 @@ static BOOL IPADDRESS_GotoNextField (const IPADDRESS_INFO *infoPtr, int cur, int
end = -1;
SendMessageW(next->EditHwnd, EM_SETSEL, start, end);
}
#ifdef __REACTOS__
SetFocus(next->EditHwnd);
#endif
return TRUE;
}

Expand Down Expand Up @@ -563,6 +566,26 @@ IPADDRESS_SubclassProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return 0;
}
break;
#ifdef __REACTOS__
case VK_TAB:
if (GetKeyState(VK_SHIFT) < 0)
{
/* Shift+Tab */
if (index == 0)
SetFocus(GetNextDlgTabItem(GetParent(infoPtr->Self), infoPtr->Self, TRUE));
else
IPADDRESS_GotoNextField(infoPtr, index - 2, POS_SELALL);
}
else
{
/* Tab */
if (index == 3)
SetFocus(GetNextDlgTabItem(GetParent(infoPtr->Self), infoPtr->Self, FALSE));
else
IPADDRESS_GotoNextField(infoPtr, index, POS_SELALL);
}
break;
#endif
}
break;
case WM_KILLFOCUS:
Expand All @@ -573,6 +596,13 @@ IPADDRESS_SubclassProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
if (IPADDRESS_GetPartIndex(infoPtr, (HWND)wParam) < 0)
IPADDRESS_Notify(infoPtr, EN_SETFOCUS);
break;
#ifdef __REACTOS__
case WM_GETDLGCODE:
{
LRESULT ret = DefWindowProcW(hwnd, uMsg, wParam, lParam);
return ret | DLGC_WANTTAB;
}
#endif
}
return CallWindowProcW (part->OrigProc, hwnd, uMsg, wParam, lParam);
}
Expand Down Expand Up @@ -602,6 +632,11 @@ IPADDRESS_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_PAINT:
return IPADDRESS_Paint (infoPtr, (HDC)wParam);

#ifdef __REACTOS__
case WM_SETFOCUS:
IPADDRESS_GotoNextField(infoPtr, -1, POS_SELALL);
return 0;
#endif
case WM_COMMAND:
switch(wParam >> 16) {
case EN_CHANGE:
Expand Down

4 comments on commit 3f30b1e

@HBelusca
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any plans to send this to wine?

@katahiromz
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After retest became successful.

@katahiromz
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tkreuzer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the ticket:

Patches aren't picked up from bugzilla, please see https://wiki.winehq.org/Submitting_Patches for more info.

Please sign in to comment.