Changeset 753 for trunk/src


Ignore:
Timestamp:
Aug 31, 1999, 4:38:09 PM (26 years ago)
Author:
sandervl
Message:

Fixed menu apis

Location:
trunk/src/user32/new
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/new/makefile

    r750 r753  
    1 # $Id: makefile,v 1.38 1999-08-31 10:36:22 sandervl Exp $
     1# $Id: makefile,v 1.39 1999-08-31 14:38:08 sandervl Exp $
    22
    33#
     
    3333        oslibutil.obj oslibmsg.obj dib.obj oslibdos.obj win32wmdichild.obj \
    3434        winprop.obj wingdi.obj oslibgdi.obj winaccel.obj winscrollbar.obj \
    35         nativerc.obj oslibres.obj dummy.obj \
     35        nativerc.obj oslibres.obj dummy.obj oslibmenu.obj \
    3636        windlgmsg.obj windlg.obj
    3737
     
    6161loadres.obj: loadres.cpp user32.h dib.h
    6262icon.obj: icon.cpp $(PDWIN32_INCLUDE)\winicon.h
    63 winmenu.obj: winmenu.cpp user32.h $(PDWIN32_INCLUDE)\winres.h win32wbase.h
     63winmenu.obj: winmenu.cpp user32.h $(PDWIN32_INCLUDE)\winres.h $(PDWIN32_INCLUDE)\winresmenu.h win32wbase.h
    6464syscolor.obj: syscolor.cpp syscolor.h
    6565usrcall.obj: usrcall.cpp usrcall.h
     
    103103win32class.obj: win32class.cpp win32class.h win32wbase.h win32dlg.h gen_object.h heapshared.h oslibwin.h win32wndchild.h
    104104win32wbase.obj:   win32wbase.cpp win32class.h win32wbase.h win32dlg.h gen_object.h heapshared.h oslibwin.h win32wndchild.h  $(PDWIN32_INCLUDE)\winres.h oslibres.h win32wndhandle.h oslibdos.h
    105 win32wnd.obj:   win32wnd.cpp win32class.h win32wbase.h win32wnd.h win32dlg.h gen_object.h heapshared.h oslibwin.h win32wndchild.h  $(PDWIN32_INCLUDE)\winres.h oslibres.h win32wndhandle.h oslibdos.h
     105win32wnd.obj:   win32wnd.cpp win32class.h win32wbase.h win32wnd.h win32dlg.h gen_object.h heapshared.h oslibwin.h win32wndchild.h  $(PDWIN32_INCLUDE)\winres.h oslibres.h win32wndhandle.h oslibdos.h oslibmenu.h
    106106win32dlg.obj:   win32dlg.cpp win32class.h win32wbase.h win32dlg.h gen_object.h heapshared.h oslibwin.h win32wndchild.h
    107107win32wndchild.obj: win32wndchild.cpp win32wndchild.h
     
    112112oslibutil.obj:  oslibutil.cpp oslibutil.h $(PDWIN32_INCLUDE)\wprocess.h oslibmsg.h
    113113oslibmsg.obj:   oslibmsg.cpp oslibmsg.h
     114oslibmenu.obj:  oslibmenu.cpp oslibmenu.h
    114115oslibgdi.obj:   oslibgdi.cpp oslibgdi.h win32wbase.h
    115116oslibres.obj:   oslibres.cpp oslibwin.h oslibres.h $(PDWIN32_INCLUDE)\winconst.h
  • trunk/src/user32/new/oslibres.cpp

    r647 r753  
    1 /* $Id: oslibres.cpp,v 1.6 1999-08-23 13:56:35 sandervl Exp $ */
     1/* $Id: oslibres.cpp,v 1.7 1999-08-31 14:38:08 sandervl Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    2626
    2727
    28 //******************************************************************************
    29 //******************************************************************************
    30 HWND OSLibWinCreateMenu(HWND hwndParent, PVOID menutemplate)
    31 {
    32   return WinCreateMenu(hwndParent, menutemplate);
    33 }
    3428//******************************************************************************
    3529//******************************************************************************
  • trunk/src/user32/new/oslibres.h

    r601 r753  
    1 /* $Id: oslibres.h,v 1.2 1999-08-20 20:09:51 sandervl Exp $ */
     1/* $Id: oslibres.h,v 1.3 1999-08-31 14:38:09 sandervl Exp $ */
    22/*
    33 * Window GUI resource wrapper functions for OS/2
     
    1717#endif
    1818 
    19 HWND    OSLibWinCreateMenu(HWND hwndParent, PVOID menutemplate);
    2019HANDLE  OSLibWinSetAccelTable(HWND hwnd, HANDLE hAccel, PVOID acceltemplate);
    2120HANDLE  OSLibWinCreateIcon(PVOID iconbitmap);
  • trunk/src/user32/new/win32wbase.cpp

    r750 r753  
    1 /* $Id: win32wbase.cpp,v 1.3 1999-08-31 10:36:22 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.4 1999-08-31 14:38:09 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    2323#include <misc.h>
    2424#include <heapstring.h>
    25 #include <win32wnd.h>
     25#include <win32wbase.h>
     26#include <winres.h>
    2627#include <spy.h>
    2728#include "wndmsg.h"
    2829#include "hooks.h"
    29 #include <oslibwin.h>
    30 #include <oslibutil.h>
    31 #include <oslibgdi.h>
    32 #include <oslibres.h>
     30#include "oslibwin.h"
     31#include "oslibutil.h"
     32#include "oslibgdi.h"
     33#include "oslibres.h"
     34#include "oslibmenu.h"
    3335#include "oslibdos.h"
    34 #include <winres.h>
    3536#include "syscolor.h"
    3637#include "win32wndhandle.h"
  • trunk/src/user32/new/winmenu.cpp

    r741 r753  
    1 /* $Id: winmenu.cpp,v 1.2 1999-08-30 11:59:54 sandervl Exp $ */
     1/* $Id: winmenu.cpp,v 1.3 1999-08-31 14:38:09 sandervl Exp $ */
    22
    33/*
     
    1919#include <stdlib.h>
    2020#include <win32wbase.h>
     21#include "oslibmenu.h"
     22#include <winresmenu.h>
    2123
    2224//******************************************************************************
     
    5153    rc = O32_LoadMenuIndirect(arg1);
    5254    if(astring)
    53     FreeAsciiString(astring);
     55        FreeAsciiString(astring);
    5456    return(rc);
    5557}
     
    5860BOOL WIN32API DestroyMenu(HMENU hmenu)
    5961{
    60  Win32Resource *winres;
     62 Win32MenuRes *winres;
    6163
    6264    dprintf(("OS2DestroyMenu\n"));
    6365    if(HIWORD(hmenu) == 0) {
    64     SetLastError(ERROR_INVALID_PARAMETER);
    65     return FALSE;
    66     }
    67     winres = (Win32Resource *)hmenu;
     66        SetLastError(ERROR_INVALID_PARAMETER);
     67        return FALSE;
     68    }
     69    winres = (Win32MenuRes *)hmenu;
    6870    delete winres;
    6971    return TRUE;
     
    112114DWORD WIN32API GetMenuCheckMarkDimensions(void)
    113115{
    114 #ifdef DEBUG
    115     WriteLog("USER32:  GetMenuCheckMarkDimensions\n");
    116 #endif
     116    dprintf(("USER32:  GetMenuCheckMarkDimensions\n"));
    117117    return O32_GetMenuCheckMarkDimensions();
    118118}
    119119//******************************************************************************
    120120//******************************************************************************
    121 int WIN32API GetMenuItemCount( HMENU arg1)
    122 {
    123 #ifdef DEBUG
    124     WriteLog("USER32:  GetMenuItemCount\n");
    125 #endif
    126     return O32_GetMenuItemCount(arg1);
    127 }
    128 //******************************************************************************
    129 //******************************************************************************
    130 UINT WIN32API GetMenuItemID( HMENU arg1, int  arg2)
    131 {
    132 #ifdef DEBUG
    133     WriteLog("USER32:  GetMenuItemID\n");
    134 #endif
    135     return O32_GetMenuItemID(arg1, arg2);
    136 }
    137 //******************************************************************************
    138 //******************************************************************************
    139 UINT WIN32API GetMenuState( HMENU arg1, UINT arg2, UINT  arg3)
    140 {
    141 #ifdef DEBUG
    142     WriteLog("USER32:  GetMenuState\n");
    143 #endif
    144     return O32_GetMenuState(arg1, arg2, arg3);
    145 }
    146 //******************************************************************************
    147 //******************************************************************************
    148 int WIN32API GetMenuStringA( HMENU arg1, UINT arg2, LPSTR arg3, int arg4, UINT  arg5)
    149 {
    150 #ifdef DEBUG
    151     WriteLog("USER32:  GetMenuString\n");
    152 #endif
    153     return O32_GetMenuString(arg1, arg2, arg3, arg4, arg5);
    154 }
    155 //******************************************************************************
    156 //******************************************************************************
    157 int WIN32API GetMenuStringW(HMENU hmenu, UINT idItem, LPWSTR lpsz, int cchMax, UINT fuFlags)
    158 {
     121int WIN32API GetMenuItemCount( HMENU hMenu)
     122{
     123 Win32MenuRes *menu = (Win32MenuRes *)hMenu;
     124
     125    dprintf(("USER32:  GetMenuItemCount %x", hMenu));
     126    if(menu == NULL || menu->getOS2Handle() == 0)
     127    {
     128        SetLastError(ERROR_INVALID_PARAMETER);
     129        return 0;
     130    }
     131    return OSLibGetMenuItemCount(menu->getOS2Handle());
     132}
     133//******************************************************************************
     134//******************************************************************************
     135UINT WIN32API GetMenuItemID( HMENU hMenu, int nPos)
     136{
     137 Win32MenuRes *menu = (Win32MenuRes *)hMenu;
     138
     139    dprintf(("USER32:  GetMenuItemID %x %d\n", hMenu, nPos));
     140    if(menu == NULL || menu->getOS2Handle() == 0)
     141    {
     142        SetLastError(ERROR_INVALID_PARAMETER);
     143        return 0;
     144    }
     145    return O32_GetMenuItemID(menu->getOS2Handle(), nPos);
     146}
     147//******************************************************************************
     148//******************************************************************************
     149UINT WIN32API GetMenuState(HMENU hMenu, UINT arg2, UINT  arg3)
     150{
     151 Win32MenuRes *menu = (Win32MenuRes *)hMenu;
     152
     153    dprintf(("USER32:  GetMenuState\n"));
     154    if(menu == NULL || menu->getOS2Handle() == 0)
     155    {
     156        SetLastError(ERROR_INVALID_PARAMETER);
     157        return 0;
     158    }
     159    return O32_GetMenuState(menu->getOS2Handle(), arg2, arg3);
     160}
     161//******************************************************************************
     162//******************************************************************************
     163int WIN32API GetMenuStringA( HMENU hMenu, UINT arg2, LPSTR arg3, int arg4, UINT  arg5)
     164{
     165 Win32MenuRes *menu = (Win32MenuRes *)hMenu;
     166
     167    dprintf(("USER32:  GetMenuStringA"));
     168    if(menu == NULL || menu->getOS2Handle() == 0)
     169    {
     170        SetLastError(ERROR_INVALID_PARAMETER);
     171        return 0;
     172    }
     173    return O32_GetMenuString(menu->getOS2Handle(), arg2, arg3, arg4, arg5);
     174}
     175//******************************************************************************
     176//******************************************************************************
     177int WIN32API GetMenuStringW(HMENU hMenu, UINT idItem, LPWSTR lpsz, int cchMax, UINT fuFlags)
     178{
     179 Win32MenuRes *menu = (Win32MenuRes *)hMenu;
    159180 char *astring = (char *)malloc(cchMax);
    160181 int   rc;
    161182
    162     dprintf(("USER32:  OS2GetMenuStringW\n"));
    163     rc = O32_GetMenuString(hmenu, idItem, astring, cchMax, fuFlags);
     183    dprintf(("USER32:  GetMenuStringW"));
     184    if(menu == NULL || menu->getOS2Handle() == 0)
     185    {
     186        SetLastError(ERROR_INVALID_PARAMETER);
     187        return 0;
     188    }
     189    rc = O32_GetMenuString(menu->getOS2Handle(), idItem, astring, cchMax, fuFlags);
    164190    free(astring);
    165191    if(rc) {
     
    172198//******************************************************************************
    173199//******************************************************************************
    174 BOOL WIN32API SetMenuItemBitmaps( HMENU arg1, UINT arg2, UINT arg3, HBITMAP arg4, HBITMAP  arg5)
    175 {
    176 #ifdef DEBUG
    177     WriteLog("USER32:  OS2SetMenuItemBitmaps\n");
    178 #endif
    179     return O32_SetMenuItemBitmaps(arg1, arg2, arg3, arg4, arg5);
    180 }
    181 //******************************************************************************
    182 //******************************************************************************
    183 HMENU WIN32API GetSubMenu(HWND arg1, int  arg2)
    184 {
    185 #ifdef DEBUG
    186     WriteLog("USER32:  GetSubMenu\n");
    187 #endif
    188     return O32_GetSubMenu(arg1, arg2);
    189 }
    190 //******************************************************************************
    191 //******************************************************************************
    192 HMENU WIN32API GetSystemMenu( HWND arg1, BOOL  arg2)
    193 {
    194 #ifdef DEBUG
    195     WriteLog("USER32:  GetSystemMenu\n");
    196 #endif
    197     return O32_GetSystemMenu(arg1, arg2);
    198 }
    199 //******************************************************************************
    200 //******************************************************************************
    201 BOOL WIN32API IsMenu( HMENU arg1)
    202 {
    203 #ifdef DEBUG
    204     WriteLog("USER32:  IsMenu\n");
    205 #endif
    206     return O32_IsMenu(arg1);
    207 }
    208 //******************************************************************************
    209 //******************************************************************************
    210 BOOL WIN32API TrackPopupMenu(HMENU arg1, UINT arg2, int arg3, int arg4, int arg5, HWND arg6, const RECT *  arg7)
    211 {
    212 #ifdef DEBUG
    213     WriteLog("USER32:  TrackPopupMenu\n");
    214 #endif
    215     return O32_TrackPopupMenu(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
    216 }
    217 //******************************************************************************
    218 //******************************************************************************
    219 BOOL WIN32API TrackPopupMenuEx(HMENU hmenu, UINT flags, int X, int Y, HWND hwnd, LPTPMPARAMS lpPM)
    220 {
     200BOOL WIN32API SetMenuItemBitmaps( HMENU hMenu, UINT arg2, UINT arg3, HBITMAP arg4, HBITMAP  arg5)
     201{
     202 Win32MenuRes *menu = (Win32MenuRes *)hMenu;
     203
     204    dprintf(("USER32:  SetMenuItemBitmaps\n"));
     205    if(menu == NULL || menu->getOS2Handle() == 0)
     206    {
     207        SetLastError(ERROR_INVALID_PARAMETER);
     208        return 0;
     209    }
     210    return O32_SetMenuItemBitmaps(menu->getOS2Handle(), arg2, arg3, arg4, arg5);
     211}
     212//******************************************************************************
     213//******************************************************************************
     214HMENU WIN32API GetSubMenu(HWND hMenu, int  arg2)
     215{
     216 Win32MenuRes *menu = (Win32MenuRes *)hMenu;
     217
     218    dprintf(("USER32:  GetSubMenu\n"));
     219    if(menu == NULL || menu->getOS2Handle() == 0)
     220    {
     221        SetLastError(ERROR_INVALID_PARAMETER);
     222        return 0;
     223    }
     224    return O32_GetSubMenu(menu->getOS2Handle(), arg2);
     225}
     226//******************************************************************************
     227//******************************************************************************
     228HMENU WIN32API GetSystemMenu( HWND hMenu, BOOL  arg2)
     229{
     230 Win32MenuRes *menu = (Win32MenuRes *)hMenu;
     231
     232    dprintf(("USER32:  GetSystemMenu\n"));
     233    if(menu == NULL || menu->getOS2Handle() == 0)
     234    {
     235        SetLastError(ERROR_INVALID_PARAMETER);
     236        return 0;
     237    }
     238    return O32_GetSystemMenu(menu->getOS2Handle(), arg2);
     239}
     240//******************************************************************************
     241//******************************************************************************
     242BOOL WIN32API IsMenu( HMENU hMenu)
     243{
     244 Win32MenuRes *menu = (Win32MenuRes *)hMenu;
     245
     246    dprintf(("USER32:  IsMenu\n"));
     247    if(menu == NULL || menu->getOS2Handle() == 0)
     248    {
     249        SetLastError(ERROR_INVALID_PARAMETER);
     250        return 0;
     251    }
     252    return O32_IsMenu(menu->getOS2Handle());
     253}
     254//******************************************************************************
     255//******************************************************************************
     256BOOL WIN32API TrackPopupMenu(HMENU hMenu, UINT arg2, int arg3, int arg4, int arg5, HWND arg6, const RECT *  arg7)
     257{
     258 Win32MenuRes *menu = (Win32MenuRes *)hMenu;
     259
     260    dprintf(("USER32:  TrackPopupMenu\n"));
     261    if(menu == NULL || menu->getOS2Handle() == 0)
     262    {
     263        SetLastError(ERROR_INVALID_PARAMETER);
     264        return 0;
     265    }
     266    return O32_TrackPopupMenu(menu->getOS2Handle(), arg2, arg3, arg4, arg5, arg6, arg7);
     267}
     268//******************************************************************************
     269//******************************************************************************
     270BOOL WIN32API TrackPopupMenuEx(HMENU hMenu, UINT flags, int X, int Y, HWND hwnd, LPTPMPARAMS lpPM)
     271{
     272 Win32MenuRes *menu = (Win32MenuRes *)hMenu;
    221273 RECT *rect = NULL;
    222274
    223 #ifdef DEBUG
    224   WriteLog("USER32:  TrackPopupMenuEx, not completely implemented\n");
    225 #endif
    226   if(lpPM->cbSize != 0)
     275
     276    dprintf(("USER32:  TrackPopupMenuEx, not completely implemented\n"));
     277    if(lpPM->cbSize != 0)
    227278        rect = &lpPM->rcExclude;
    228279
    229   return O32_TrackPopupMenu(hmenu, flags, X, Y, 0, hwnd, rect);
    230 }
    231 //******************************************************************************
    232 //******************************************************************************
    233 BOOL WIN32API AppendMenuA(HMENU hMenu, UINT uFlags, UINT ulDNewItem,
    234                              LPCSTR lpNewItem)
    235 {
    236 #ifdef DEBUG
    237 BOOL rc;
    238 
    239     WriteLog("USER32:  OS2AppendMenuA uFlags = %X\n", uFlags);
     280    if(menu == NULL || menu->getOS2Handle() == 0)
     281    {
     282        SetLastError(ERROR_INVALID_PARAMETER);
     283        return 0;
     284    }
     285    return O32_TrackPopupMenu(menu->getOS2Handle(), flags, X, Y, 0, hwnd, rect);
     286}
     287//******************************************************************************
     288//******************************************************************************
     289BOOL WIN32API AppendMenuA(HMENU hMenu, UINT uFlags, UINT ulDNewItem, LPCSTR lpNewItem)
     290{
     291 Win32MenuRes *menu = (Win32MenuRes *)hMenu;
     292 BOOL rc;
     293
     294    dprintf(("USER32:  OS2AppendMenuA uFlags = %X\n", uFlags));
    240295
    241296    if(uFlags & MF_STRING || uFlags == 0)
    242             WriteLog("USER32:  OS2AppendMenuA %s\n", lpNewItem);
    243 
    244     rc = O32_AppendMenu(hMenu, uFlags, ulDNewItem, lpNewItem);
    245     WriteLog("USER32:  OS2AppendMenuA returned %d\n", rc);
     297            dprintf(("USER32:  OS2AppendMenuA %s\n", lpNewItem));
     298
     299    if(menu == NULL || menu->getOS2Handle() == 0)
     300    {
     301        SetLastError(ERROR_INVALID_PARAMETER);
     302        return 0;
     303    }
     304    rc = O32_AppendMenu(menu->getOS2Handle(), uFlags, ulDNewItem, lpNewItem);
     305    dprintf(("USER32:  OS2AppendMenuA returned %d\n", rc));
    246306    return rc;
    247 #else
    248     return O32_AppendMenu(hMenu, uFlags, ulDNewItem, lpNewItem);
    249 #endif
    250 }
    251 //******************************************************************************
    252 //******************************************************************************
    253 BOOL WIN32API AppendMenuW( HMENU arg1, UINT arg2, UINT arg3, LPCWSTR  arg4)
    254 {
     307}
     308//******************************************************************************
     309//******************************************************************************
     310BOOL WIN32API AppendMenuW( HMENU hMenu, UINT arg2, UINT arg3, LPCWSTR  arg4)
     311{
     312    Win32MenuRes *menu = (Win32MenuRes *)hMenu;
    255313    BOOL  rc;
    256314    char *astring = NULL;
    257315
    258 #ifdef DEBUG
    259     WriteLog("USER32:  OS2AppendMenuW\n");
    260 #endif
     316    dprintf(("USER32:  OS2AppendMenuW\n"));
     317
    261318    if(arg2 & MF_STRING  && (int)arg4 >> 16 != 0)
    262319      astring = UnicodeToAsciiString((LPWSTR)arg4);
     
    264321      astring = (char *) arg4;
    265322
    266     rc = O32_AppendMenu(arg1, arg2, arg3, astring);
     323    if(menu == NULL || menu->getOS2Handle() == 0)
     324    {
     325        SetLastError(ERROR_INVALID_PARAMETER);
     326        return 0;
     327    }
     328    rc = O32_AppendMenu(menu->getOS2Handle(), arg2, arg3, astring);
    267329    if(arg2 & MF_STRING  && (int)arg4 >> 16 != 0)
    268330      FreeAsciiString(astring);
     
    271333//******************************************************************************
    272334//******************************************************************************
    273 DWORD WIN32API CheckMenuItem( HMENU arg1, UINT arg2, UINT  arg3)
    274 {
    275 #ifdef DEBUG
    276     WriteLog("USER32:  OS2CheckMenuItem\n");
    277 #endif
    278     return O32_CheckMenuItem(arg1, arg2, arg3);
     335DWORD WIN32API CheckMenuItem( HMENU hMenu, UINT arg2, UINT  arg3)
     336{
     337 Win32MenuRes *menu = (Win32MenuRes *)hMenu;
     338
     339    dprintf(("USER32:  OS2CheckMenuItem\n"));
     340    if(menu == NULL || menu->getOS2Handle() == 0)
     341    {
     342        SetLastError(ERROR_INVALID_PARAMETER);
     343        return 0;
     344    }
     345    return O32_CheckMenuItem(menu->getOS2Handle(), arg2, arg3);
    279346}
    280347//******************************************************************************
     
    282349HMENU WIN32API CreateMenu(void)
    283350{
    284 #ifdef DEBUG
    285  HMENU rc;
    286 
    287     rc = O32_CreateMenu();
    288     WriteLog("USER32:  OS2CreateMenu returned %d\n", rc);
    289     return(rc);
    290 #else
    291     return(O32_CreateMenu());
    292 #endif
     351 Win32MenuRes *menu = 0;
     352 HMENU hMenu;
     353
     354    hMenu = O32_CreateMenu();
     355    if(hMenu) {
     356        menu = new Win32MenuRes(hMenu);
     357        if(menu == NULL) {
     358            return 0;
     359        }
     360    }
     361    dprintf(("USER32:  OS2CreateMenu returned %d\n", hMenu));
     362    return (HMENU)menu;
    293363}
    294364//******************************************************************************
     
    296366HMENU WIN32API CreatePopupMenu(void)
    297367{
    298 #ifdef DEBUG
    299     WriteLog("USER32:  OS2CreatePopupMenu\n");
    300 #endif
    301     return O32_CreatePopupMenu();
    302 }
    303 //******************************************************************************
    304 //******************************************************************************
    305 BOOL WIN32API EnableMenuItem( HMENU arg1, UINT arg2, UINT  arg3)
    306 {
    307 #ifdef DEBUG
    308     WriteLog("USER32:  OS2EnableMenuItem\n");
    309 #endif
    310     return O32_EnableMenuItem(arg1, arg2, arg3);
    311 }
    312 //******************************************************************************
    313 //******************************************************************************
    314 BOOL WIN32API ModifyMenuA( HMENU arg1, UINT arg2, UINT arg3, UINT arg4, LPCSTR  arg5)
    315 {
    316 #ifdef DEBUG
    317     WriteLog("USER32:  OS2ModifyMenuA\n");
    318 #endif
    319     return O32_ModifyMenu(arg1, arg2, arg3, arg4, arg5);
    320 }
    321 //******************************************************************************
    322 //******************************************************************************
    323 BOOL WIN32API ModifyMenuW( HMENU arg1, UINT arg2, UINT arg3, UINT arg4, LPCWSTR arg5)
    324 {
    325     BOOL  rc;
    326     char *astring = NULL;
    327 
    328 #ifdef DEBUG
    329     WriteLog("USER32: OS2ModifyMenuW %s\n", astring);
    330 #endif
     368 Win32MenuRes *menu = 0;
     369 HMENU hMenu;
     370
     371    dprintf(("USER32:  OS2CreatePopupMenu\n"));
     372    hMenu = O32_CreatePopupMenu();
     373    if(hMenu) {
     374        menu = new Win32MenuRes(hMenu);
     375        if(menu == NULL) {
     376            return 0;
     377        }
     378    }
     379    return (HMENU)menu;
     380}
     381//******************************************************************************
     382//******************************************************************************
     383BOOL WIN32API EnableMenuItem( HMENU hMenu, UINT arg2, UINT  arg3)
     384{
     385 Win32MenuRes *menu = (Win32MenuRes *)hMenu;
     386
     387    dprintf(("USER32:  OS2EnableMenuItem\n"));
     388    if(menu == NULL || menu->getOS2Handle() == 0)
     389    {
     390        SetLastError(ERROR_INVALID_PARAMETER);
     391        return 0;
     392    }
     393    return O32_EnableMenuItem(menu->getOS2Handle(), arg2, arg3);
     394}
     395//******************************************************************************
     396//******************************************************************************
     397BOOL WIN32API ModifyMenuA( HMENU hMenu, UINT arg2, UINT arg3, UINT arg4, LPCSTR  arg5)
     398{
     399 Win32MenuRes *menu = (Win32MenuRes *)hMenu;
     400
     401    dprintf(("USER32:  OS2ModifyMenuA\n"));
     402    if(menu == NULL || menu->getOS2Handle() == 0)
     403    {
     404        SetLastError(ERROR_INVALID_PARAMETER);
     405        return 0;
     406    }
     407    return O32_ModifyMenu(menu->getOS2Handle(), arg2, arg3, arg4, arg5);
     408}
     409//******************************************************************************
     410//******************************************************************************
     411BOOL WIN32API ModifyMenuW( HMENU hMenu, UINT arg2, UINT arg3, UINT arg4, LPCWSTR arg5)
     412{
     413 BOOL  rc;
     414 char *astring = NULL;
     415 Win32MenuRes *menu = (Win32MenuRes *)hMenu;
     416
     417    dprintf(("USER32: OS2ModifyMenuW %s\n", astring));
     418
     419    if(menu == NULL || menu->getOS2Handle() == 0)
     420    {
     421        SetLastError(ERROR_INVALID_PARAMETER);
     422        return 0;
     423    }
     424
    331425    if(arg3 & MF_STRING  && (int)arg5 >> 16 != 0)
    332426      astring = UnicodeToAsciiString((LPWSTR)arg5);
     
    334428      astring = (char *) arg5;
    335429
    336     rc = O32_ModifyMenu(arg1, arg2, arg3, arg4, astring);
     430    rc = O32_ModifyMenu(menu->getOS2Handle(), arg2, arg3, arg4, astring);
    337431    if(arg3 & MF_STRING  && (int)arg5 >> 16 != 0)
    338432      FreeAsciiString(astring);
     
    341435//******************************************************************************
    342436//******************************************************************************
    343 BOOL WIN32API RemoveMenu( HMENU arg1, UINT arg2, UINT  arg3)
    344 {
    345 #ifdef DEBUG
    346     WriteLog("USER32:  OS2RemoveMenu\n");
    347 #endif
    348     return O32_RemoveMenu(arg1, arg2, arg3);
    349 }
    350 //******************************************************************************
    351 //******************************************************************************
    352 BOOL WIN32API DeleteMenu( HMENU arg1, UINT arg2, UINT  arg3)
    353 {
    354 #ifdef DEBUG
    355     WriteLog("USER32:  OS2DeleteMenu\n");
    356 #endif
    357     return O32_DeleteMenu(arg1, arg2, arg3);
    358 }
    359 //******************************************************************************
    360 //******************************************************************************
    361 BOOL WIN32API HiliteMenuItem( HWND arg1, HMENU arg2, UINT arg3, UINT  arg4)
    362 {
    363 #ifdef DEBUG
    364     WriteLog("USER32:  OS2HiliteMenuItem\n");
    365 #endif
    366     return O32_HiliteMenuItem(arg1, arg2, arg3, arg4);
    367 }
    368 //******************************************************************************
    369 //******************************************************************************
    370 BOOL WIN32API InsertMenuA( HMENU arg1, UINT arg2, UINT arg3, UINT arg4, LPCSTR  arg5)
    371 {
    372 #ifdef DEBUG
    373     WriteLog("USER32:  OS2InsertMenuA\n");
    374 #endif
    375     return O32_InsertMenu(arg1, arg2, arg3, arg4, arg5);
    376 }
    377 //******************************************************************************
    378 //******************************************************************************
    379 BOOL WIN32API InsertMenuW(HMENU arg1, UINT arg2, UINT arg3, UINT arg4, LPCWSTR arg5)
    380 {
    381     BOOL  rc;
    382     char *astring = NULL;
    383 
    384 #ifdef DEBUG
    385     WriteLog("USER32:  OS2InsertMenuW %s\n", astring);
    386 #endif
     437BOOL WIN32API RemoveMenu( HMENU hMenu, UINT arg2, UINT  arg3)
     438{
     439 Win32MenuRes *menu = (Win32MenuRes *)hMenu;
     440
     441    dprintf(("USER32:  OS2RemoveMenu\n"));
     442    if(menu == NULL || menu->getOS2Handle() == 0)
     443    {
     444        SetLastError(ERROR_INVALID_PARAMETER);
     445        return 0;
     446    }
     447
     448    return O32_RemoveMenu(menu->getOS2Handle(), arg2, arg3);
     449}
     450//******************************************************************************
     451//******************************************************************************
     452BOOL WIN32API DeleteMenu( HMENU hMenu, UINT arg2, UINT  arg3)
     453{
     454 Win32MenuRes *menu = (Win32MenuRes *)hMenu;
     455
     456    dprintf(("USER32:  OS2DeleteMenu\n"));
     457    if(menu == NULL || menu->getOS2Handle() == 0)
     458    {
     459        SetLastError(ERROR_INVALID_PARAMETER);
     460        return 0;
     461    }
     462
     463    return O32_DeleteMenu(menu->getOS2Handle(), arg2, arg3);
     464}
     465//******************************************************************************
     466//******************************************************************************
     467BOOL WIN32API HiliteMenuItem( HWND hMenu, HMENU arg2, UINT arg3, UINT  arg4)
     468{
     469 Win32MenuRes *menu = (Win32MenuRes *)hMenu;
     470
     471    dprintf(("USER32:  OS2HiliteMenuItem\n"));
     472    if(menu == NULL || menu->getOS2Handle() == 0)
     473    {
     474        SetLastError(ERROR_INVALID_PARAMETER);
     475        return 0;
     476    }
     477
     478    return O32_HiliteMenuItem(menu->getOS2Handle(), arg2, arg3, arg4);
     479}
     480//******************************************************************************
     481//******************************************************************************
     482BOOL WIN32API InsertMenuA( HMENU hMenu, UINT arg2, UINT arg3, UINT arg4, LPCSTR  arg5)
     483{
     484 Win32MenuRes *menu = (Win32MenuRes *)hMenu;
     485
     486    dprintf(("USER32:  OS2InsertMenuA\n"));
     487    if(menu == NULL || menu->getOS2Handle() == 0)
     488    {
     489        SetLastError(ERROR_INVALID_PARAMETER);
     490        return 0;
     491    }
     492
     493    return O32_InsertMenu(menu->getOS2Handle(), arg2, arg3, arg4, arg5);
     494}
     495//******************************************************************************
     496//******************************************************************************
     497BOOL WIN32API InsertMenuW(HMENU hMenu, UINT arg2, UINT arg3, UINT arg4, LPCWSTR arg5)
     498{
     499 BOOL  rc;
     500 char *astring = NULL;
     501 Win32MenuRes *menu = (Win32MenuRes *)hMenu;
     502
     503    dprintf(("USER32:  OS2InsertMenuW %s\n", astring));
     504    if(menu == NULL || menu->getOS2Handle() == 0)
     505    {
     506        SetLastError(ERROR_INVALID_PARAMETER);
     507        return 0;
     508    }
    387509    if(arg3 & MF_STRING  && (int)arg5 >> 16 != 0)
    388510      astring = UnicodeToAsciiString((LPWSTR)arg5);
     
    390512      astring = (char *) arg5;
    391513
    392     rc = O32_InsertMenu(arg1, arg2, arg3, arg4, astring);
     514    rc = O32_InsertMenu(menu->getOS2Handle(), arg2, arg3, arg4, astring);
    393515    if(arg3 & MF_STRING  && (int)arg5 >> 16 != 0)
    394516      FreeAsciiString(astring);
     
    399521BOOL WIN32API SetMenuContextHelpId(HMENU hmenu, DWORD dwContextHelpId)
    400522{
    401 #ifdef DEBUG
    402   WriteLog("USER32:  OS2SetMenuContextHelpId, not implemented\n");
    403 #endif
     523  dprintf(("USER32:  OS2SetMenuContextHelpId, not implemented\n"));
    404524  return(TRUE);
    405525}
     
    408528DWORD WIN32API GetMenuContextHelpId(HMENU hmenu)
    409529{
    410 #ifdef DEBUG
    411   WriteLog("USER32:  OS2GetMenuContextHelpId, not implemented\n");
    412 #endif
     530  dprintf(("USER32:  OS2GetMenuContextHelpId, not implemented\n"));
    413531  return(0);
    414532}
     
    418536                                    UINT idCheck, UINT uFlags)
    419537{
    420 #ifdef DEBUG
    421   WriteLog("USER32:  OS2CheckMenuRadioItem, not implemented\n");
    422 #endif
     538  dprintf(("USER32:  OS2CheckMenuRadioItem, not implemented\n"));
    423539  return(TRUE);
    424540}
    425541//******************************************************************************
    426 //Stolen from Wine (controls\menu.c)
    427542//******************************************************************************
    428543BOOL WIN32API ChangeMenuA(HMENU hMenu, UINT pos, LPCSTR data, UINT id, UINT flags)
    429544{
    430 #ifdef DEBUG
    431     WriteLog("USER32:  ChangeMenuA flags %X\n", flags);
    432 #endif
     545    dprintf(("USER32:  ChangeMenuA flags %X\n", flags));
     546
    433547    if (flags & MF_APPEND) return AppendMenuA(hMenu, flags & ~MF_APPEND,
    434548                                             id, data );
     
    443557}
    444558//******************************************************************************
    445 //Stolen from Wine (controls\menu.c)
    446559//******************************************************************************
    447560BOOL WIN32API ChangeMenuW(HMENU hMenu, UINT pos, LPCWSTR data,
    448561                          UINT id, UINT flags )
    449562{
    450 #ifdef DEBUG
    451     WriteLog("USER32:  ChangeMenuW flags %X\n", flags);
    452 #endif
     563    dprintf(("USER32:  ChangeMenuW flags %X\n", flags));
     564
    453565    if (flags & MF_APPEND) return AppendMenuW(hMenu, flags & ~MF_APPEND,
    454566                                                 id, data );
     
    467579                               const MENUITEMINFOA * lpMenuItemInfo)
    468580{
    469 #ifdef DEBUG
    470   WriteLog("USER32:  SetMenuItemInfoA, faked\n");
    471 #endif
     581  dprintf(("USER32:  SetMenuItemInfoA, faked\n"));
    472582  return(TRUE);
    473583}
     
    506616BOOL WIN32API SetMenuDefaultItem(HMENU hmenu, UINT uItem, UINT fByPos )
    507617{
    508 #ifdef DEBUG
    509   WriteLog("USER32:  SetMenuDefaultItem, faked\n");
    510 #endif
     618  dprintf(("USER32:  SetMenuDefaultItem, faked\n"));
    511619  return(TRUE);
    512620}
     
    517625
    518626{
    519 #ifdef DEBUG
    520   WriteLog("USER32:  GetMenuItemInfoA, faked\n");
    521 #endif
     627  dprintf(("USER32:  GetMenuItemInfoA, faked\n"));
    522628  return(TRUE);
    523629}
Note: See TracChangeset for help on using the changeset viewer.