- Timestamp:
- Jul 20, 1999, 9:42:36 AM (26 years ago)
- Location:
- trunk/src/user32/new
- Files:
-
- 1 added
- 1 deleted
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/new/loadres.cpp
r336 r342 1 /* $Id: loadres.cpp,v 1. 2 1999-07-19 11:50:04sandervl Exp $ */1 /* $Id: loadres.cpp,v 1.3 1999-07-20 07:42:35 sandervl Exp $ */ 2 2 3 3 /* … … 63 63 64 64 dprintf(("LoadCursor from %X returned %d\n", hinst, rc)); 65 return(rc);66 }67 //******************************************************************************68 //******************************************************************************69 HACCEL WIN32API LoadAcceleratorsA(HINSTANCE hinst, LPCSTR lpszAcc)70 {71 HACCEL rc;72 73 if((int)lpszAcc >> 16 != 0) {//convert string name identifier to numeric id74 dprintf(("lpszAcc %s\n", lpszAcc));75 lpszAcc = (LPCSTR)ConvertNameId(hinst, (char *)lpszAcc);76 }77 else dprintf(("lpszAcc %d\n", (int)lpszAcc));78 79 rc = O32_LoadAccelerators(hinst, lpszAcc);80 81 dprintf(("LoadAccelerators returned %d\n", rc));82 65 return(rc); 83 66 } … … 107 90 return(rc); 108 91 } 109 110 //******************************************************************************111 //******************************************************************************112 HACCEL WIN32API LoadAcceleratorsW(HINSTANCE hinst, LPCWSTR lpszAccel)113 {114 char *astring = NULL;115 HACCEL rc;116 117 if((int)lpszAccel >> 16 != 0) {//convert string name identifier to numeric id118 astring = UnicodeToAsciiString((LPWSTR)lpszAccel);119 120 dprintf(("lpszAccel %s\n", astring));121 lpszAccel = (LPWSTR)ConvertNameId(hinst, (char *)astring);122 }123 else dprintf(("lpszAccel %d\n", (int)lpszAccel));124 125 rc = O32_LoadAccelerators(hinst, (char *)lpszAccel);126 if(astring)127 FreeAsciiString(astring);128 129 dprintf(("LoadAcceleratorsW returned %d\n", rc));130 return(rc);131 }132 92 //****************************************************************************** 133 93 //****************************************************************************** … … 197 157 //****************************************************************************** 198 158 //****************************************************************************** 199 HMENU WIN32API LoadMenuA(HINSTANCE hinst, LPCSTR lpszMenu)200 {201 HMENU rc;202 203 #if 1204 rc = (HMENU)FindResourceA(hinst, lpszMenu, RT_MENUA);205 #else206 if((int)lpszMenu >> 16 != 0) {//convert string name identifier to numeric id207 dprintf(("lpszMenu %s\n", lpszMenu));208 209 lpszMenu = (LPCSTR)ConvertNameId(hinst, (char *)lpszMenu);210 }211 else dprintf(("lpszMenu %d\n", (int)lpszMenu));212 213 rc = O32_LoadMenu(hinst, lpszMenu);214 #endif215 dprintf(("LoadMenuA (%X) returned %d\n", hinst, rc));216 return(rc);217 }218 //******************************************************************************219 //******************************************************************************220 HMENU WIN32API LoadMenuW(HINSTANCE hinst, LPCWSTR lpszMenu)221 {222 HMENU rc;223 224 #if 1225 rc = (HMENU)FindResourceW(hinst, lpszMenu, RT_MENUW);226 #else227 char *astring = NULL;228 if((int)lpszMenu >> 16 != 0) {//convert string name identifier to numeric id229 astring = UnicodeToAsciiString((LPWSTR)lpszMenu);230 231 dprintf(("lpszMenu %s\n", astring));232 lpszMenu = (LPWSTR)ConvertNameId(hinst, (char *)astring);233 }234 else dprintf(("lpszMenu %d\n", (int)lpszMenu));235 236 rc = O32_LoadMenu(hinst, (char *)lpszMenu);237 if(astring)238 FreeAsciiString(astring);239 #endif240 dprintf(("LoadMenuW (%X) returned %d\n", hinst, rc));241 return(rc);242 }243 //******************************************************************************244 //******************************************************************************245 HMENU WIN32API LoadMenuIndirectA( const MENUITEMTEMPLATEHEADER * arg1)246 {247 char *astring = NULL;248 HMENU rc;249 250 dprintf(("OS2LoadMenuIndirectA\n"));251 252 rc = O32_LoadMenuIndirect(arg1);253 if(astring)254 FreeAsciiString(astring);255 return(rc);256 }257 //******************************************************************************258 //Won't work...259 //******************************************************************************260 HMENU WIN32API LoadMenuIndirectW(const MENUITEMTEMPLATEHEADER * arg1)261 {262 dprintf(("OS2LoadMenuIndirectW, improperly implemented!!\n"));263 264 return 0;265 // return O32_LoadMenuIndirect(arg1);266 }267 159 //****************************************************************************** 268 160 //TODO: Far from complete, but works for loading resources from exe -
trunk/src/user32/new/makefile
r336 r342 1 # $Id: makefile,v 1.1 2 1999-07-19 11:50:04sandervl Exp $1 # $Id: makefile,v 1.13 1999-07-20 07:42:35 sandervl Exp $ 2 2 3 3 # … … 23 23 OBJS = user32.obj resstring.obj dialog.obj loadres.obj \ 24 24 dde.obj \ 25 icon.obj hook.obj hooks.obj menu.obj \25 icon.obj hook.obj hooks.obj winmenu.obj \ 26 26 usrcall.obj defwndproc.obj syscolor.obj char.obj initterm.obj \ 27 27 uitools.obj unknown.obj spy.obj wndmsg.obj \ … … 57 57 loadres.obj: loadres.cpp user32.h 58 58 icon.obj: icon.cpp icon.h 59 menu.obj: menu.cpp user32.h59 winmenu.obj: winmenu.cpp user32.h $(PDWIN32_INCLUDE)\winres.h 60 60 syscolor.obj: syscolor.cpp syscolor.h 61 61 usrcall.obj: usrcall.cpp usrcall.h … … 86 86 windowclass.obj: windowclass.cpp win32class.h win32wnd.h win32wndchild.h 87 87 windowword.obj: windowword.cpp win32class.h win32wnd.h win32dlg.h win32wndchild.h 88 winaccel.obj: winaccel.cpp 88 winaccel.obj: winaccel.cpp $(PDWIN32_INCLUDE)\winres.h 89 89 winscrollbar.obj: winscrollbar.cpp 90 90 91 91 pmwindow.obj: pmwindow.cpp win32class.h win32wnd.h win32dlg.h pmwindow.h win32wndchild.h $(PDWIN32_INCLUDE)\wprocess.h oslibgdi.h 92 92 win32class.obj: win32class.cpp win32class.h win32wnd.h win32dlg.h gen_object.h oslibwin.h win32wndchild.h 93 win32wnd.obj: win32wnd.cpp win32class.h win32wnd.h win32dlg.h gen_object.h oslibwin.h win32wndchild.h 93 win32wnd.obj: win32wnd.cpp win32class.h win32wnd.h win32dlg.h gen_object.h oslibwin.h win32wndchild.h $(PDWIN32_INCLUDE)\winres.h 94 94 win32dlg.obj: win32dlg.cpp win32class.h win32wnd.h win32dlg.h gen_object.h oslibwin.h win32wndchild.h 95 95 win32wndchild.obj: win32wndchild.cpp win32wndchild.h -
trunk/src/user32/new/oslibgdi.cpp
r340 r342 1 /* $Id: oslibgdi.cpp,v 1. 3 1999-07-19 18:40:43sandervl Exp $ */1 /* $Id: oslibgdi.cpp,v 1.4 1999-07-20 07:42:35 sandervl Exp $ */ 2 2 /* 3 3 * Window GDI wrapper functions for OS/2 … … 54 54 } 55 55 WinQueryWindowRect(hwndParent, (PRECTL)&rectParent); 56 point->y = rectParent.yTop - point->y ;56 point->y = rectParent.yTop - point->y - 1; 57 57 return TRUE; 58 58 } -
trunk/src/user32/new/oslibgdi.h
r340 r342 1 /* $Id: oslibgdi.h,v 1. 2 1999-07-19 18:40:43sandervl Exp $ */1 /* $Id: oslibgdi.h,v 1.3 1999-07-20 07:42:35 sandervl Exp $ */ 2 2 /* 3 3 * Window GDI wrapper functions for OS/2 … … 43 43 inline ULONG MapOS2ToWin32Y(Win32Window *window, ULONG y) 44 44 { 45 return window->getWindowHeight() - y ;45 return window->getWindowHeight() - y - 1; 46 46 } 47 47 -
trunk/src/user32/new/oslibmsg.cpp
r321 r342 1 /* $Id: oslibmsg.cpp,v 1. 1 1999-07-17 11:52:22sandervl Exp $ */1 /* $Id: oslibmsg.cpp,v 1.2 1999-07-20 07:42:35 sandervl Exp $ */ 2 2 /* 3 3 * Window message translation functions for OS/2 … … 9 9 * Project Odin Software License can be found in LICENSE.TXT 10 10 * 11 * TODO: Simply copy for now. Probably need to make a real translation11 * TODO: Simply copy for now. Need to make a real translation 12 12 * 13 13 */ 14 14 #define INCL_WIN 15 15 #define INCL_PM 16 #define INCL_DOSPROCESS 16 17 #include <os2.h> 17 18 #include <os2wrap.h> … … 19 20 #include <misc.h> 20 21 #include "oslibmsg.h" 22 #include <win32wnd.h> 23 #include "oslibutil.h" 21 24 25 QMSG *MsgThreadPtr = 0; 26 27 //****************************************************************************** 28 //****************************************************************************** 29 BOOL OSLibInitMsgQueue() 30 { 31 if(DosAllocThreadLocalMemory(sizeof(QMSG)/sizeof(ULONG), (PULONG *)&MsgThreadPtr) != 0) 32 { 33 dprintf(("OSLibInitMsgQueue: local thread memory alloc failed!!")); 34 DebugInt3(); 35 return FALSE; 36 } 37 return TRUE; 38 } 22 39 //****************************************************************************** 23 40 //****************************************************************************** … … 32 49 { 33 50 memcpy(winMsg, os2Msg, sizeof(MSG)); 51 winMsg->hwnd = Win32Window::OS2ToWin32Handle(os2Msg->hwnd); 34 52 } 35 53 //****************************************************************************** … … 42 60 //****************************************************************************** 43 61 //****************************************************************************** 62 void OSLibWinPostQuitMessage(ULONG nExitCode) 63 { 64 WinPostQueueMsg(GetThreadMessageQueue(), WM_QUIT, (MPARAM)nExitCode, 0); 65 } 66 //****************************************************************************** 67 //****************************************************************************** 68 LONG OSLibWinDispatchMsg(MSG *msg, BOOL isUnicode) 69 { 70 //TODO: What to do if app changed msg? (translate) 71 // WinToOS2MsgTranslate(msg, &qmsg, isUnicode); 72 73 return (LONG)WinDispatchMsg(GetThreadHAB(), MsgThreadPtr); 74 } 75 //****************************************************************************** 76 //****************************************************************************** 77 BOOL OSLibWinGetMsg(LPMSG pMsg, HWND hwnd, UINT uMsgFilterMin, UINT uMsgFilterMax, BOOL isUnicode) 78 { 79 BOOL rc; 80 81 rc = WinGetMsg(GetThreadHAB(), MsgThreadPtr, TranslateWinMsg(uMsgFilterMin), TranslateWinMsg(uMsgFilterMax), 0); 82 OS2ToWinMsgTranslate(MsgThreadPtr, pMsg, isUnicode); 83 return rc; 84 } 85 //****************************************************************************** 86 //****************************************************************************** -
trunk/src/user32/new/oslibmsg.h
r321 r342 1 /* $Id: oslibmsg.h,v 1. 1 1999-07-17 11:52:22sandervl Exp $ */1 /* $Id: oslibmsg.h,v 1.2 1999-07-20 07:42:35 sandervl Exp $ */ 2 2 /* 3 3 * Window message translation functions for OS/2 … … 17 17 void WinToOS2MsgTranslate(MSG *winMsg, QMSG *os2Msg, BOOL isUnicode); 18 18 19 BOOL OSLibInitMsgQueue(); 20 19 21 #endif //__OSLIBMSG_H__ -
trunk/src/user32/new/oslibwin.cpp
r340 r342 1 /* $Id: oslibwin.cpp,v 1.1 6 1999-07-19 18:40:43sandervl Exp $ */1 /* $Id: oslibwin.cpp,v 1.17 1999-07-20 07:42:35 sandervl Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 149 149 //****************************************************************************** 150 150 //****************************************************************************** 151 BOOL OSLibWinSetAccelTable(HWND hwnd, PVOID acceltemplate) 152 { 153 HACCEL haccel; 154 HAB hab = WinQueryAnchorBlock(hwnd); 155 156 haccel = WinCreateAccelTable(hab, (PACCELTABLE)acceltemplate); 157 if(haccel == 0) { 158 dprintf(("OSLibWinSetAccelTable: WinCreateAccelTable returned 0")); 159 return FALSE; 160 } 161 return WinSetAccelTable(hab, haccel, hwnd); 162 } 163 //****************************************************************************** 164 //****************************************************************************** 151 165 BOOL OSLibWinAlarm(HWND hwndDeskTop,ULONG flStyle) 152 166 { … … 333 347 //****************************************************************************** 334 348 //****************************************************************************** 335 void OSLibWinPostQuitMessage(ULONG nExitCode)336 {337 WinPostQueueMsg(GetThreadMessageQueue(), WM_QUIT, (MPARAM)nExitCode, 0);338 }339 //******************************************************************************340 //******************************************************************************341 LONG OSLibWinDispatchMsg(MSG *msg, BOOL isUnicode)342 {343 QMSG qmsg;344 345 WinToOS2MsgTranslate(msg, &qmsg, isUnicode);346 return (LONG)WinDispatchMsg(GetThreadHAB(), &qmsg);347 }348 //******************************************************************************349 //******************************************************************************350 BOOL OSLibWinGetMsg(LPMSG pMsg, HWND hwnd, UINT uMsgFilterMin, UINT uMsgFilterMax, BOOL isUnicode)351 {352 QMSG qmsg;353 BOOL rc;354 355 rc = WinGetMsg(GetThreadHAB(), &qmsg, TranslateWinMsg(uMsgFilterMin), TranslateWinMsg(uMsgFilterMax), 0);356 OS2ToWinMsgTranslate(&qmsg, pMsg, isUnicode);357 return rc;358 }359 //******************************************************************************360 //******************************************************************************361 349 LONG OSLibWinQueryWindowTextLength(HWND hwnd) 362 350 { -
trunk/src/user32/new/oslibwin.h
r332 r342 1 /* $Id: oslibwin.h,v 1.1 4 1999-07-18 18:04:29sandervl Exp $ */1 /* $Id: oslibwin.h,v 1.15 1999-07-20 07:42:36 sandervl Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 28 28 29 29 HWND OSLibWinCreateMenu(HWND hwndParent, PVOID menutemplate); 30 BOOL OSLibWinSetAccelTable(HWND hwnd, PVOID acceltemplate); 30 31 31 32 #define WAOS_WARNING 0 -
trunk/src/user32/new/pmwindow.cpp
r340 r342 1 /* $Id: pmwindow.cpp,v 1.1 2 1999-07-19 18:40:43sandervl Exp $ */1 /* $Id: pmwindow.cpp,v 1.13 1999-07-20 07:42:36 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Managment Code for OS/2 … … 24 24 #include "oslibutil.h" 25 25 #include "oslibgdi.h" 26 #include "oslibmsg.h" 26 27 27 28 HMQ hmq = 0; /* Message queue handle */ … … 75 76 } 76 77 77 return (TRUE);78 return OSLibInitMsgQueue(); 78 79 } /* End of main */ 79 80 //****************************************************************************** … … 163 164 case WM_ADJUSTWINDOWPOS: 164 165 { 165 RECTLOS2 rectChild;166 ULONG x, y;166 ULONG x, y; 167 PSWP pswp = (PSWP)mp1; 167 168 168 169 dprintf(("OS2: WM_ADJUSTWINDOWPOS %x", hwnd)); 169 170 170 WinQueryWindowRect(hwnd, (PRECTL)&rectChild); 171 172 //Calculate position relative to parent window (real window or desktop) 173 x = rectChild.xLeft; 174 // y = MapOS2ToWin32Y(hwnd, &rectChild, rectChild.yBottom); 175 176 if(win32wnd->MsgMove(x, y)) { 177 goto RunDefWndProc; 178 } 179 break; 171 if(pswp->fl & SWP_MOVE) { 172 if(win32wnd->isChild()) { 173 x = pswp->x; 174 y = pswp->cy - y - 1; 175 } 176 else { 177 OSLIBPOINT point; 178 179 point.x = pswp->x; 180 point.y = pswp->y; 181 182 MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point); 183 x = point.x; 184 y = point.y; 185 } 186 if(win32wnd->MsgMove(x, y)) { 187 goto RunDefWndProc; 188 } 189 break; 190 } 191 goto RunDefWndProc; 180 192 } 181 193 … … 183 195 { 184 196 dprintf(("OS2: WM_WINDOWPOSCHANGED %x", hwnd)); 197 goto RunDefWndProc; 185 198 } 186 199 … … 383 396 win32wnd->MsgCommand(CMD_MENU, SHORT1FROMMP(mp1), 0); 384 397 } 398 if(SHORT1FROMMP(mp2) == CMDSRC_ACCELERATOR) { 399 win32wnd->MsgCommand(CMD_ACCELERATOR, SHORT1FROMMP(mp1), 0); 400 } 385 401 //todo controls + accelerators 386 402 break; 387 403 388 404 case WM_SYSCOMMAND: 405 dprintf(("WM_SYSCOMMAND")); 406 break; 389 407 390 408 case WM_CHAR: 409 dprintf(("WM_CHAR")); 391 410 392 411 case WM_INITMENU: -
trunk/src/user32/new/user32.def
r334 r342 1 ; $Id: user32.def,v 1. 2 1999-07-18 20:41:12 cbratschiExp $1 ; $Id: user32.def,v 1.3 1999-07-20 07:42:35 sandervl Exp $ 2 2 3 3 ;Created by BLAST for IBM's compiler … … 554 554 TrackPopupMenu = _TrackPopupMenu@28 @541 555 555 TrackPopupMenuEx = _TrackPopupMenuEx@24 @542 556 TranslateAccelerator = _TranslateAccelerator @12@543556 TranslateAccelerator = _TranslateAcceleratorA@12 @543 557 557 TranslateAcceleratorA = _TranslateAcceleratorA@12 @544 558 558 TranslateAcceleratorW = _TranslateAcceleratorW@12 @545 -
trunk/src/user32/new/win32wnd.cpp
r340 r342 1 /* $Id: win32wnd.cpp,v 1.1 6 1999-07-19 18:40:44sandervl Exp $ */1 /* $Id: win32wnd.cpp,v 1.17 1999-07-20 07:42:36 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Code for OS/2 … … 99 99 owner = NULL; 100 100 windowClass = 0; 101 102 acceltableResource = NULL; 103 menuResource = NULL; 101 104 } 102 105 //****************************************************************************** … … 115 118 //****************************************************************************** 116 119 //****************************************************************************** 120 BOOL Win32Window::isChild() 121 { 122 return (dwStyle & WS_CHILD) != 0; 123 } 124 //****************************************************************************** 125 //****************************************************************************** 117 126 BOOL Win32Window::CreateWindowExA(CREATESTRUCTA *cs, ATOM classAtom) 118 127 { … … 121 130 POINT maxSize, maxPos, minTrack, maxTrack; 122 131 123 SetLastError(0);124 125 /* Find the parent window */126 if (cs->hwndParent)127 {128 Win32Window *window = GetWindowFromHandle(cs->hwndParent);129 if(!window) {130 dprintf(("Bad parent %04x\n", cs->hwndParent ));131 SetLastError(ERROR_INVALID_PARAMETER);132 return FALSE;133 }134 /* Make sure parent is valid */135 if (!window->IsWindow() )136 {137 dprintf(("Bad parent %04x\n", cs->hwndParent ));138 SetLastError(ERROR_INVALID_PARAMETER);139 return FALSE;140 }141 }142 else143 if ((cs->style & WS_CHILD) && !(cs->style & WS_POPUP)) {144 dprintf(("No parent for child window\n" ));145 SetLastError(ERROR_INVALID_PARAMETER);146 return FALSE; /* WS_CHILD needs a parent, but WS_POPUP doesn't */147 }132 SetLastError(0); 133 134 /* Find the parent window */ 135 if (cs->hwndParent) 136 { 137 Win32Window *window = GetWindowFromHandle(cs->hwndParent); 138 if(!window) { 139 dprintf(("Bad parent %04x\n", cs->hwndParent )); 140 SetLastError(ERROR_INVALID_PARAMETER); 141 return FALSE; 142 } 143 /* Make sure parent is valid */ 144 if (!window->IsWindow() ) 145 { 146 dprintf(("Bad parent %04x\n", cs->hwndParent )); 147 SetLastError(ERROR_INVALID_PARAMETER); 148 return FALSE; 149 } 150 } 151 else 152 if ((cs->style & WS_CHILD) && !(cs->style & WS_POPUP)) { 153 dprintf(("No parent for child window\n" )); 154 SetLastError(ERROR_INVALID_PARAMETER); 155 return FALSE; /* WS_CHILD needs a parent, but WS_POPUP doesn't */ 156 } 148 157 149 158 /* Find the window class */ … … 666 675 //****************************************************************************** 667 676 //****************************************************************************** 668 ULONG Win32Window::MsgMove(ULONG xParent, ULONG yParent) 669 { 670 return SendInternalMessageA(WM_MOVE, 0, MAKELONG((USHORT)xParent, (USHORT)yParent)); 677 ULONG Win32Window::MsgMove(ULONG x, ULONG y) 678 { 679 dprintf(("MsgMove to (%d,%d)", x, y)); 680 return SendInternalMessageA(WM_MOVE, 0, MAKELONG((USHORT)x, (USHORT)y)); 671 681 } 672 682 //****************************************************************************** … … 680 690 return 0; //todo 681 691 case CMD_ACCELERATOR: 692 dprintf(("accelerator command")); 682 693 return 0; //todo 683 694 } … … 733 744 ULONG win32ncmsg; 734 745 746 dprintf(("MsgButton to (%d,%d)", x, y)); 735 747 switch(msg) { 736 748 case BUTTON_LEFTDOWN: … … 1049 1061 Win32Resource *winres = (Win32Resource *)hMenu; 1050 1062 1051 #if 1 1052 if(winres == NULL) { 1063 if(HIWORD(winres) == 0) { 1053 1064 dprintf(("Win32Window:: Win32Resource *winres == 0")); 1065 SetLastError(ERROR_INVALID_PARAMETER); 1054 1066 return FALSE; 1055 1067 } … … 1065 1077 return FALSE; 1066 1078 } 1079 menuResource = winres; 1067 1080 return TRUE; 1068 #else 1069 if(HMHandleTranslateToOS2(hMenu, (PULONG)&menutemplate) == NO_ERROR) 1070 { 1071 OS2HwndMenu = OSLibWinCreateMenu(OS2HwndFrame, menutemplate); 1072 if(OS2HwndMenu == 0) { 1073 dprintf(("Win32Window::SetMenu OS2HwndMenu == 0")); 1074 return FALSE; 1075 } 1076 } 1077 dprintf(("Win32Window::SetMenu unknown hMenu (%x)", hMenu)); 1078 return FALSE; 1079 #endif 1081 } 1082 //****************************************************************************** 1083 //****************************************************************************** 1084 BOOL Win32Window::SetAccelTable(ULONG hAccel) 1085 { 1086 Win32Resource *winres = (Win32Resource *)hAccel; 1087 1088 if(HIWORD(hAccel) == 0) { 1089 dprintf(("SetAccelTable: hAccel %x invalid", hAccel)); 1090 SetLastError(ERROR_INVALID_PARAMETER); 1091 return FALSE; 1092 } 1093 acceltableResource = winres; 1094 return OSLibWinSetAccelTable(OS2HwndFrame, winres->lockOS2Resource()); 1080 1095 } 1081 1096 //****************************************************************************** -
trunk/src/user32/new/win32wnd.h
r340 r342 1 /* $Id: win32wnd.h,v 1.1 5 1999-07-19 18:40:44sandervl Exp $ */1 /* $Id: win32wnd.h,v 1.16 1999-07-20 07:42:36 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Code for OS/2 … … 18 18 #include <gen_object.h> 19 19 #include <win32wndchild.h> 20 #include <winres.h> 20 21 21 22 class Win32Window; … … 87 88 void setWindowId(DWORD id) { windowId = id; }; 88 89 ULONG getWindowHeight() { return rectClient.bottom - rectClient.top; }; 90 BOOL isChild(); 89 91 90 92 DWORD getFlags() { return flags; }; 91 93 void setFlags(DWORD newflags) { flags = newflags; }; 92 94 95 ULONG GetAccelTable() { return (ULONG) acceltableResource; }; 96 BOOL SetAccelTable(ULONG hAccel); 97 98 ULONG GetMenu() { return (ULONG) menuResource; }; 93 99 BOOL SetMenu(ULONG hMenu); 100 94 101 BOOL ShowWindow(ULONG nCmdShow); 95 102 BOOL SetWindowPos(HWND hwndInsertAfter, int x, int y, int cx, int cy, UINT fuFlags); … … 182 189 Win32Window *owner; 183 190 191 Win32Resource *acceltableResource; 192 Win32Resource *menuResource; 193 184 194 char *windowName; 185 195 ULONG wndNameLength; -
trunk/src/user32/new/winaccel.cpp
r332 r342 1 /* $Id: winaccel.cpp,v 1. 2 1999-07-18 18:04:30sandervl Exp $ */1 /* $Id: winaccel.cpp,v 1.3 1999-07-20 07:42:36 sandervl Exp $ */ 2 2 /* 3 3 * Win32 accelartor key functions for OS/2 … … 11 11 #include <os2win.h> 12 12 #include <misc.h> 13 #include <win32wnd.h> 13 14 15 //****************************************************************************** 16 //****************************************************************************** 17 HACCEL WIN32API LoadAcceleratorsA(HINSTANCE hinst, LPCSTR lpszAcc) 18 { 19 HACCEL rc; 20 21 rc = (HACCEL)FindResourceA(hinst, lpszAcc, RT_ACCELERATORA); 22 23 dprintf(("LoadAcceleratorsA returned %d\n", rc)); 24 return(rc); 25 } 26 //****************************************************************************** 27 //****************************************************************************** 28 HACCEL WIN32API LoadAcceleratorsW(HINSTANCE hinst, LPCWSTR lpszAccel) 29 { 30 HACCEL rc; 31 32 rc = (HACCEL)FindResourceW(hinst, lpszAccel, RT_ACCELERATORW); 33 34 dprintf(("LoadAcceleratorsW returned %d\n", rc)); 35 return(rc); 36 } 37 //****************************************************************************** 38 //****************************************************************************** 39 BOOL WIN32API DestroyAcceleratorTable( HACCEL haccel) 40 { 41 Win32Resource *winres; 42 43 if(HIWORD(haccel) == 0) { 44 dprintf(("DestroyAcceleratorTable: invalid haccel %x", haccel)); 45 SetLastError(ERROR_INVALID_PARAMETER); 46 return FALSE; 47 } 48 dprintf(("DestroyAcceleratorTable %x\n", haccel)); 49 winres = (Win32Resource *)haccel; 50 delete winres; 51 return TRUE; 52 } 14 53 //****************************************************************************** 15 54 //TODO: Do more than just return? … … 17 56 int WIN32API TranslateAcceleratorA(HWND hwnd, HACCEL haccel, LPMSG lpmsg) 18 57 { 19 //CB: needs more work 20 //WinTranslateAccel(); 21 //get hab, translate 58 Win32Window *window; 59 60 window = Win32Window::GetWindowFromHandle(hwnd); 61 if(!window) { 62 //Msg for (non-client) child of our frame window 63 // dprintf(("TranslateAcceleratorA, window %x not found", hwnd)); 64 return FALSE; 65 } 66 if(window->GetAccelTable() != haccel) { 67 dprintf(("TranslateAcceleratorA %X %X %X", hwnd, haccel, lpmsg->hwnd)); 68 window->SetAccelTable(haccel); 69 } 70 22 71 //SvL: OS/2 automatically translates accelerator keys 23 72 return FALSE; … … 25 74 //****************************************************************************** 26 75 //****************************************************************************** 27 int WIN32API TranslateAccelerator ( HWND arg1, HACCEL arg2, LPMSG arg3)76 int WIN32API TranslateAcceleratorW( HWND hwnd, HACCEL hAccel, LPMSG lpMsg) 28 77 { 29 //SvL: OS/2 automatically translates accelerator keys 30 return FALSE; 31 } 32 //****************************************************************************** 33 //****************************************************************************** 34 int WIN32API TranslateAcceleratorW( HWND arg1, HACCEL arg2, LPMSG arg3) 35 { 36 //SvL: OS/2 automatically translates accelerator keys 37 return FALSE; 78 return TranslateAcceleratorA(hwnd, hAccel, lpMsg); 38 79 } 39 80 //****************************************************************************** … … 67 108 //****************************************************************************** 68 109 //****************************************************************************** 69 BOOL WIN32API DestroyAcceleratorTable( HACCEL arg1)70 {71 #ifdef DEBUG72 WriteLog("USER32: DestroyAcceleratorTable\n");73 #endif74 return O32_DestroyAcceleratorTable(arg1);75 }76 //******************************************************************************77 //******************************************************************************78 110 int WIN32API CopyAcceleratorTableA(HACCEL hAccelSrc, LPACCEL lpAccelDest, 79 111 int cAccelEntries)
Note:
See TracChangeset
for help on using the changeset viewer.