diff options
| author | Pietro Gagliardi <[email protected]> | 2014-08-20 14:17:00 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-08-20 14:17:00 -0400 |
| commit | ac6d0429f1befcceb94bca7ad57b19bd11afd1b6 (patch) | |
| tree | 1461f3d8ee9b388c5a3c86bb08181982feba1d74 /redo/basicctrls_windows.c | |
| parent | e06e32715552764769e85c72a43bf5ee78e5f555 (diff) | |
Implemented TextField.Invalid() on Windows.
Diffstat (limited to 'redo/basicctrls_windows.c')
| -rw-r--r-- | redo/basicctrls_windows.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/redo/basicctrls_windows.c b/redo/basicctrls_windows.c index 1676776..c82c5d6 100644 --- a/redo/basicctrls_windows.c +++ b/redo/basicctrls_windows.c @@ -104,3 +104,23 @@ void setTextFieldSubclass(HWND hwnd, void *data) if ((*fv_SetWindowSubclass)(hwnd, textfieldSubProc, 0, (DWORD_PTR) data) == FALSE) xpanic("error subclassing TextField to give it its own event handler", GetLastError()); } + +void textfieldSetAndShowInvalidBalloonTip(HWND hwnd, WCHAR *text) +{ + EDITBALLOONTIP ti; + + ZeroMemory(&ti, sizeof (EDITBALLOONTIP)); + ti.cbStruct = sizeof (EDITBALLOONTIP); + ti.pszTitle = L"Invalid Input"; // TODO verify + ti.pszText = text; + ti.ttiIcon = TTI_ERROR; + if (SendMessageW(hwnd, EM_SHOWBALLOONTIP, 0, (LPARAM) (&ti)) == FALSE) + xpanic("error showing TextField.Invalid() balloon tip", GetLastError()); + MessageBeep(0xFFFFFFFF); // TODO can this return an error? +} + +void textfieldHideInvalidBalloonTip(HWND hwnd) +{ + if (SendMessageW(hwnd, EM_HIDEBALLOONTIP, 0, 0) == FALSE) + xpanic("error hiding TextField.Invalid() balloon tip", GetLastError()); +} |
