Mercurial > dwindows
comparison win/dw.c @ 1305:18a31ab94e3d
Added DW_MENU_AUTO and DW_MENU_POPUP flags that can be passed to dw_menu_append_item() in the id field.
On OS/2 and Windows AUTO will automatically allocate a menu ID from the larger static pool of IDs.
POPUP will automatically allocate an ID from the smaller pool for transient popup menus.
These flags don't do anything on the other platforms since they don't require menu IDs.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Thu, 03 Nov 2011 10:09:11 +0000 |
parents | ca02c24e80c9 |
children | dbd507f42947 |
comparison
equal
deleted
inserted
replaced
1304:68f18dccfb8f | 1305:18a31ab94e3d |
---|---|
4846 tmp++; | 4846 tmp++; |
4847 } | 4847 } |
4848 } | 4848 } |
4849 | 4849 |
4850 if (title && *title) | 4850 if (title && *title) |
4851 { | |
4852 /* Code to autogenerate a menu ID if not specified or invalid | |
4853 * First pool is smaller for transient popup menus | |
4854 */ | |
4855 if(id == (ULONG)-1) | |
4856 { | |
4857 static ULONG tempid = 61000; | |
4858 | |
4859 tempid++; | |
4860 id = tempid; | |
4861 | |
4862 if(tempid > 65500) | |
4863 tempid = 61000; | |
4864 } | |
4865 /* Second pool is larger for more static windows */ | |
4866 else if(!id || id >= 30000) | |
4867 { | |
4868 static ULONG menuid = 30000; | |
4869 | |
4870 menuid++; | |
4871 id = menuid; | |
4872 | |
4873 if(menuid > 60000) | |
4874 menuid = 30000; | |
4875 } | |
4851 mii.fType = MFT_STRING; | 4876 mii.fType = MFT_STRING; |
4877 } | |
4852 else | 4878 else |
4853 mii.fType = MFT_SEPARATOR; | 4879 mii.fType = MFT_SEPARATOR; |
4854 | 4880 |
4855 /* | 4881 /* |
4856 * Handle flags | 4882 * Handle flags |