comparison os2/dw.c @ 1315:9c585eaacb22

Moved the menu IDs used for entryfields on OS/2 into the resevered range between the two pools of IDs. Also added an internal use of setting check to -1 to allow specifying IDs that are over 30k and not automatically generating an ID.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Fri, 04 Nov 2011 23:56:38 +0000
parents c969db49606e
children 3475887f9445
comparison
equal deleted inserted replaced
1314:c969db49606e 1315:9c585eaacb22
1792 } 1792 }
1793 else 1793 else
1794 WinSetFocus(HWND_DESKTOP, handle); 1794 WinSetFocus(HWND_DESKTOP, handle);
1795 } 1795 }
1796 1796
1797 #define ENTRY_CUT 1001 1797 #define ENTRY_CUT 60901
1798 #define ENTRY_COPY 1002 1798 #define ENTRY_COPY 60902
1799 #define ENTRY_PASTE 1003 1799 #define ENTRY_PASTE 60903
1800 #define ENTRY_UNDO 1004 1800 #define ENTRY_UNDO 60904
1801 #define ENTRY_SALL 1005 1801 #define ENTRY_SALL 60905
1802 1802
1803 /* Originally just intended for entryfields, it now serves as a generic 1803 /* Originally just intended for entryfields, it now serves as a generic
1804 * procedure for handling TAB presses to change input focus on controls. 1804 * procedure for handling TAB presses to change input focus on controls.
1805 */ 1805 */
1806 MRESULT EXPENTRY _entryproc(HWND hWnd, ULONG msg, MPARAM mp1, MPARAM mp2) 1806 MRESULT EXPENTRY _entryproc(HWND hWnd, ULONG msg, MPARAM mp1, MPARAM mp2)
1827 HMENUI hwndMenu = dw_menu_new(0L); 1827 HMENUI hwndMenu = dw_menu_new(0L);
1828 long x, y; 1828 long x, y;
1829 1829
1830 if(strncmp(tmpbuf, "#10", 4)==0 && !WinSendMsg(hWnd, MLM_QUERYREADONLY, 0, 0)) 1830 if(strncmp(tmpbuf, "#10", 4)==0 && !WinSendMsg(hWnd, MLM_QUERYREADONLY, 0, 0))
1831 { 1831 {
1832 dw_menu_append_item(hwndMenu, "Undo", ENTRY_UNDO, 0L, TRUE, FALSE, 0L); 1832 dw_menu_append_item(hwndMenu, "Undo", ENTRY_UNDO, 0L, TRUE, -1, 0L);
1833 dw_menu_append_item(hwndMenu, "", 0L, 0L, TRUE, FALSE, 0L); 1833 dw_menu_append_item(hwndMenu, "", 0L, 0L, TRUE, -1, 0L);
1834 } 1834 }
1835 dw_menu_append_item(hwndMenu, "Copy", ENTRY_COPY, 0L, TRUE, FALSE, 0L); 1835 dw_menu_append_item(hwndMenu, "Copy", ENTRY_COPY, 0L, TRUE, -1, 0L);
1836 if((strncmp(tmpbuf, "#10", 4)!=0 && !dw_window_get_data(hWnd, "_dw_disabled")) || (strncmp(tmpbuf, "#10", 4)==0 && !WinSendMsg(hWnd, MLM_QUERYREADONLY, 0, 0))) 1836 if((strncmp(tmpbuf, "#10", 4)!=0 && !dw_window_get_data(hWnd, "_dw_disabled")) || (strncmp(tmpbuf, "#10", 4)==0 && !WinSendMsg(hWnd, MLM_QUERYREADONLY, 0, 0)))
1837 { 1837 {
1838 dw_menu_append_item(hwndMenu, "Cut", ENTRY_CUT, 0L, TRUE, FALSE, 0L); 1838 dw_menu_append_item(hwndMenu, "Cut", ENTRY_CUT, 0L, TRUE, -1, 0L);
1839 dw_menu_append_item(hwndMenu, "Paste", ENTRY_PASTE, 0L, TRUE, FALSE, 0L); 1839 dw_menu_append_item(hwndMenu, "Paste", ENTRY_PASTE, 0L, TRUE, -1, 0L);
1840 } 1840 }
1841 dw_menu_append_item(hwndMenu, "", 0L, 0L, TRUE, FALSE, 0L); 1841 dw_menu_append_item(hwndMenu, "", 0L, 0L, TRUE, -1, 0L);
1842 dw_menu_append_item(hwndMenu, "Select All", ENTRY_SALL, 0L, TRUE, FALSE, 0L); 1842 dw_menu_append_item(hwndMenu, "Select All", ENTRY_SALL, 0L, TRUE, -1, 0L);
1843 1843
1844 WinSetFocus(HWND_DESKTOP, hWnd); 1844 WinSetFocus(HWND_DESKTOP, hWnd);
1845 dw_pointer_query_pos(&x, &y); 1845 dw_pointer_query_pos(&x, &y);
1846 dw_menu_popup(&hwndMenu, hWnd, x, y); 1846 dw_menu_popup(&hwndMenu, hWnd, x, y);
1847 } 1847 }
4759 tempid++; 4759 tempid++;
4760 id = tempid; 4760 id = tempid;
4761 4761
4762 if(tempid > 65500) 4762 if(tempid > 65500)
4763 tempid = 61000; 4763 tempid = 61000;
4764 } 4764 }
4765 /* Special internal case */
4766 else if(id > 60000 && check == -1)
4767 {
4768 check = 0;
4769 }
4765 /* Second pool is larger for more static windows */ 4770 /* Second pool is larger for more static windows */
4766 else if(!id || id >= 30000) 4771 else if(!id || id >= 30000)
4767 { 4772 {
4768 static ULONG menuid = 30000; 4773 static ULONG menuid = 30000;
4769 4774