Changeset 342 for trunk/src/user32/new/win32wnd.cpp
- Timestamp:
- Jul 20, 1999, 9:42:36 AM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.