# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1339952693 0 # Node ID 7b049aaca6155d28fe1a3735c7c09328b8fac1f2 # Parent 873960d28f01f0373271224c2c269d5f7016ba24 Fixes for building on OS/2 in ANSI mode. diff -r 873960d28f01 -r 7b049aaca615 os2/dw.c --- a/os2/dw.c Sun Jun 17 05:06:11 2012 +0000 +++ b/os2/dw.c Sun Jun 17 17:04:53 2012 +0000 @@ -2332,6 +2332,12 @@ WinSetFocus(HWND_DESKTOP, handle); } +#define ENTRY_CUT 60901 +#define ENTRY_COPY 60902 +#define ENTRY_PASTE 60903 +#define ENTRY_UNDO 60904 +#define ENTRY_SALL 60905 + #ifdef UNICODE void _combine_text(HWND handle, USHORT pos1, char *text, char *pastetext) { @@ -2352,13 +2358,6 @@ /* Free temporary memory */ free(combined); } -#endif - -#define ENTRY_CUT 60901 -#define ENTRY_COPY 60902 -#define ENTRY_PASTE 60903 -#define ENTRY_UNDO 60904 -#define ENTRY_SALL 60905 /* Internal function to handle Unicode enabled MLE cut, copy and paste */ void _MleCopyPaste(HWND hWnd, int command) @@ -2434,6 +2433,7 @@ if(text) free(text); } +#endif /* Originally just intended for entryfields, it now serves as a generic * procedure for handling TAB presses to change input focus on controls. @@ -2627,7 +2627,7 @@ { char *text = dw_window_get_text(handle); ULONG sel = (ULONG)WinSendMsg(hWnd, EM_QUERYSEL, 0, 0); - SHORT pos1 = SHORT1FROMMP(sel), pos2 = SHORT2FROMMP(sel); + SHORT pos1 = SHORT1FROMMP(sel); WinSendMsg(handle, EM_CLEAR, 0, 0); _combine_text(handle, pos1, text, utf8); @@ -2684,9 +2684,11 @@ break; case WM_CONTEXTMENU: case WM_COMMAND: +#ifdef UNICODE case EM_PASTE: case EM_CUT: case EM_COPY: +#endif return _entryproc(hWnd, msg, mp1, mp2); case WM_SETFOCUS: _run_event(hWnd, msg, mp1, mp2); @@ -2743,9 +2745,11 @@ break; case WM_CONTEXTMENU: case WM_COMMAND: +#ifdef UNICODE case EM_PASTE: case EM_CUT: case EM_COPY: +#endif return _entryproc(hWnd, msg, mp1, mp2); }