diff options
| author | Pietro Gagliardi <[email protected]> | 2014-11-02 20:49:39 -0500 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-11-02 20:49:39 -0500 |
| commit | 8f04623115832d2e3b64acb10011a638514135f9 (patch) | |
| tree | b4b034f4914fdca68e6fd808bab56a4ae94fc685 /basicctrls_windows.c | |
| parent | 280723763c985497cc5d87bfd0d3cbe3c020b0ab (diff) | |
Started the work for Spinbox.OnChanged() on Windows with the edit control.
Diffstat (limited to 'basicctrls_windows.c')
| -rw-r--r-- | basicctrls_windows.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/basicctrls_windows.c b/basicctrls_windows.c index 0c5659f..60cc0c8 100644 --- a/basicctrls_windows.c +++ b/basicctrls_windows.c @@ -210,3 +210,29 @@ HWND newUpDown(HWND prevUpDown, void *data) xpanic("error subclassing Spinbox up-down control to give it its own event handler", GetLastError()); return hwnd; } + +static LRESULT CALLBACK spinboxEditSubProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR id, DWORD_PTR data) +{ + switch (uMsg) { + case msgCOMMAND: + if (HIWORD(wParam) == EN_CHANGE) { + spinboxEditChanged((void *) data); + return 0; + } + return (*fv_DefSubclassProc)(hwnd, uMsg, wParam, lParam); + case WM_NCDESTROY: + if ((*fv_RemoveWindowSubclass)(hwnd, spinboxEditSubProc, id) == FALSE) + xpanic("error removing Spinbox edit control subclass (which was for its own event handler)", GetLastError()); + return (*fv_DefSubclassProc)(hwnd, uMsg, wParam, lParam); + default: + return (*fv_DefSubclassProc)(hwnd, uMsg, wParam, lParam); + } + xmissedmsg("Spinbox edit control", "spinboxEditSubProc()", uMsg); + return 0; // unreached +} + +void setSpinboxEditSubclass(HWND hwnd, void *data) +{ + if ((*fv_SetWindowSubclass)(hwnd, spinboxEditSubProc, 0, (DWORD_PTR) data) == FALSE) + xpanic("error subclassing Spinbox edit control to give it its own event handler", GetLastError()); +}
\ No newline at end of file |
