Changeset 1253 for trunk/src/user32/window.cpp
- Timestamp:
- Oct 11, 1999, 10:54:26 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/window.cpp
r1231 r1253 1 /* $Id: window.cpp,v 1.1 2 1999-10-09 18:16:57sandervl Exp $ */1 /* $Id: window.cpp,v 1.13 1999-10-11 20:54:26 sandervl Exp $ */ 2 2 /* 3 3 * Win32 window apis for OS/2 … … 19 19 #include <os2win.h> 20 20 #include <misc.h> 21 #include <string.h> 22 #include <stdio.h> 21 23 #include <win32wbase.h> 22 24 #include <win32wmdiclient.h> 23 25 #include <win32wdesktop.h> 26 #include "win32dlg.h" 24 27 #include <oslibwin.h> 25 28 #include <oslibgdi.h> … … 27 30 #include "winicon.h" 28 31 29 //******************************************************************************30 //******************************************************************************31 #ifdef DEBUG32 void PrintWindowStyle(DWORD dwStyle, DWORD dwExStyle)33 {34 char style[256] = "";35 char exstyle[256] = "";36 37 /* Window styles */38 if(dwStyle & WS_CHILD)39 strcat(style, "WS_CHILD ");40 if(dwStyle & WS_POPUP)41 strcat(style, "WS_POPUP ");42 if(dwStyle & WS_VISIBLE)43 strcat(style, "WS_VISIBLE ");44 if(dwStyle & WS_DISABLED)45 strcat(style, "WS_DISABLED ");46 if(dwStyle & WS_CLIPSIBLINGS)47 strcat(style, "WS_CLIPSIBLINGS ");48 if(dwStyle & WS_CLIPCHILDREN)49 strcat(style, "WS_CLIPCHILDREN ");50 if(dwStyle & WS_MAXIMIZE)51 strcat(style, "WS_MAXIMIZE ");52 if(dwStyle & WS_MINIMIZE)53 strcat(style, "WS_MINIMIZE ");54 if(dwStyle & WS_GROUP)55 strcat(style, "WS_GROUP ");56 if(dwStyle & WS_TABSTOP)57 strcat(style, "WS_TABSTOP ");58 59 if(dwStyle & WS_CAPTION)60 strcat(style, "WS_CAPTION ");61 if(dwStyle & WS_DLGFRAME)62 strcat(style, "WS_DLGFRAME ");63 if(dwStyle & WS_BORDER)64 strcat(style, "WS_BORDER ");65 66 if(dwStyle & WS_VSCROLL)67 strcat(style, "WS_VSCROLL ");68 if(dwStyle & WS_HSCROLL)69 strcat(style, "WS_HSCROLL ");70 if(dwStyle & WS_SYSMENU)71 strcat(style, "WS_SYSMENU ");72 if(dwStyle & WS_THICKFRAME)73 strcat(style, "WS_THICKFRAME ");74 if(dwStyle & WS_MINIMIZEBOX)75 strcat(style, "WS_MINIMIZEBOX ");76 if(dwStyle & WS_MAXIMIZEBOX)77 strcat(style, "WS_MAXIMIZEBOX ");78 79 if(dwExStyle & WS_EX_DLGMODALFRAME)80 strcat(exstyle, "WS_EX_DLGMODALFRAME ");81 if(dwExStyle & WS_EX_ACCEPTFILES)82 strcat(exstyle, "WS_EX_ACCEPTFILES ");83 if(dwExStyle & WS_EX_NOPARENTNOTIFY)84 strcat(exstyle, "WS_EX_NOPARENTNOTIFY ");85 if(dwExStyle & WS_EX_TOPMOST)86 strcat(exstyle, "WS_EX_TOPMOST ");87 if(dwExStyle & WS_EX_TRANSPARENT)88 strcat(exstyle, "WS_EX_TRANSPARENT ");89 90 if(dwExStyle & WS_EX_MDICHILD)91 strcat(exstyle, "WS_EX_MDICHILD ");92 if(dwExStyle & WS_EX_TOOLWINDOW)93 strcat(exstyle, "WS_EX_TOOLWINDOW ");94 if(dwExStyle & WS_EX_WINDOWEDGE)95 strcat(exstyle, "WS_EX_WINDOWEDGE ");96 if(dwExStyle & WS_EX_CLIENTEDGE)97 strcat(exstyle, "WS_EX_CLIENTEDGE ");98 if(dwExStyle & WS_EX_CONTEXTHELP)99 strcat(exstyle, "WS_EX_CONTEXTHELP ");100 if(dwExStyle & WS_EX_RIGHT)101 strcat(exstyle, "WS_EX_RIGHT ");102 if(dwExStyle & WS_EX_LEFT)103 strcat(exstyle, "WS_EX_LEFT ");104 if(dwExStyle & WS_EX_RTLREADING)105 strcat(exstyle, "WS_EX_RTLREADING ");106 if(dwExStyle & WS_EX_LTRREADING)107 strcat(exstyle, "WS_EX_LTRREADING ");108 if(dwExStyle & WS_EX_LEFTSCROLLBAR)109 strcat(exstyle, "WS_EX_LEFTSCROLLBAR ");110 if(dwExStyle & WS_EX_RIGHTSCROLLBAR)111 strcat(exstyle, "WS_EX_RIGHTSCROLLBAR ");112 if(dwExStyle & WS_EX_CONTROLPARENT)113 strcat(exstyle, "WS_EX_CONTROLPARENT ");114 if(dwExStyle & WS_EX_STATICEDGE)115 strcat(exstyle, "WS_EX_STATICEDGE ");116 if(dwExStyle & WS_EX_APPWINDOW)117 strcat(exstyle, "WS_EX_APPWINDOW ");118 119 dprintf(("Window style: %x %s", dwStyle, style));120 dprintf(("Window exStyle: %x %s", dwExStyle, exstyle));121 }122 #endif123 32 //****************************************************************************** 124 33 //****************************************************************************** … … 132 41 ATOM classAtom; 133 42 CREATESTRUCTA cs; 134 135 #ifdef DEBUG 136 PrintWindowStyle(style, exStyle); 137 #endif 43 char tmpClass[20]; 138 44 139 45 if(exStyle & WS_EX_MDICHILD) 140 46 return CreateMDIWindowA(className, windowName, style, x, y, width, height, parent, instance, (LPARAM)data); 141 47 142 //TODO: According to the docs className can be a 16 bits atom143 // Wine seems to assume it's a string though...144 48 /* Find the class atom */ 145 49 if (!(classAtom = GlobalFindAtomA(className))) 146 50 { 147 dprintf(("CreateWindowEx32A: bad class name ")); 148 if (!HIWORD(className)) { 149 dprintf(("CreateWindowEx32A: bad class name %04x\n", LOWORD(className))); 51 if (!HIWORD(className)) 52 { 53 sprintf(tmpClass,"#%d", (int) className); 54 classAtom = GlobalFindAtomA(tmpClass); 55 className = tmpClass; 150 56 } 151 else dprintf(("CreateWindowEx32A: bad class name '%s'\n", className )); 152 SetLastError(ERROR_INVALID_PARAMETER); 153 return 0; 57 if (!classAtom) 58 { 59 if (!HIWORD(className)) { 60 dprintf(("CreateWindowEx32W: bad class name %04x\n", LOWORD(className))); 61 } 62 else dprintf(("CreateWindowEx32W: bad class name '%s'\n", className )); 63 64 SetLastError(ERROR_INVALID_PARAMETER); 65 return 0; 66 } 154 67 } 155 68 … … 172 85 else dprintf(("CreateWindowExA: class %d parent %x (%d,%d) (%d,%d), %x %x", className, parent, x, y, width, height, style, exStyle)); 173 86 174 //TODO: According to the docs className can be a 16 bits atom175 // Wine seems to assume it's a string though...176 87 if(!strcmpi(className, MDICLIENTCLASSNAMEA)) { 177 88 window = (Win32BaseWindow *) new Win32MDIClientWindow(&cs, classAtom, FALSE); 89 } 90 else 91 if(!strcmpi((char *) className, DIALOG_CLASS_NAMEA)) 92 { 93 DLG_TEMPLATE dlgTemplate = {0}; 94 dlgTemplate.style = cs.style; 95 dlgTemplate.exStyle = cs.dwExStyle; 96 dlgTemplate.x = cs.x; 97 dlgTemplate.y = cs.y; 98 dlgTemplate.cx = cs.cx; 99 dlgTemplate.cy = cs.cy; 100 dlgTemplate.className = cs.lpszClass; 101 dlgTemplate.caption = cs.lpszName; 102 window = (Win32BaseWindow *) new Win32Dialog(cs.hInstance, 103 (LPCSTR) &dlgTemplate, 104 cs.hwndParent, 105 NULL, 106 (LPARAM) data, 107 FALSE); 178 108 } 179 109 else { … … 204 134 ATOM classAtom; 205 135 CREATESTRUCTA cs; 136 char tmpClassA[20]; 137 WCHAR tmpClassW[20]; 206 138 207 139 if(exStyle & WS_EX_MDICHILD) 208 140 return CreateMDIWindowW(className, windowName, style, x, y, width, height, parent, instance, (LPARAM)data); 209 141 210 //TODO: According to the docs className can be a 16 bits atom211 // Wine seems to assume it's a string though...212 142 /* Find the class atom */ 213 143 if (!(classAtom = GlobalFindAtomW(className))) 214 144 { 215 dprintf(("CreateWindowEx32A: bad class name ")); 216 if (!HIWORD(className)) { 217 dprintf(("CreateWindowEx32A: bad class name %04x\n", LOWORD(className))); 145 if (!HIWORD(className)) 146 { 147 sprintf(tmpClassA,"#%d", (int) className); 148 AsciiToUnicode(tmpClassA, tmpClassW); 149 classAtom = GlobalFindAtomW(tmpClassW); 150 className = (LPCWSTR)tmpClassW; 218 151 } 219 // else dprintf(("CreateWindowEx32A: bad class name '%s'\n", className )); 220 SetLastError(ERROR_INVALID_PARAMETER); 221 return 0; 152 if (!classAtom) 153 { 154 if (!HIWORD(className)) { 155 dprintf(("CreateWindowEx32W: bad class name %04x\n", LOWORD(className))); 156 } 157 else dprintf(("CreateWindowEx32W: bad class name ")); 158 159 SetLastError(ERROR_INVALID_PARAMETER); 160 return 0; 161 } 222 162 } 223 163 … … 236 176 cs.dwExStyle = exStyle; 237 177 238 //TODO: According to the docs className can be a 16 bits atom239 // Wine seems to assume it's a string though...240 178 if(!lstrcmpiW(className, (LPWSTR)MDICLIENTCLASSNAMEW)) { 241 179 window = (Win32BaseWindow *) new Win32MDIClientWindow(&cs, classAtom, TRUE); 180 } 181 if(!lstrcmpiW(className, (LPWSTR)DIALOG_CLASS_NAMEW)) 182 { 183 DLG_TEMPLATE dlgTemplate = {0}; 184 dlgTemplate.style = cs.style; 185 dlgTemplate.exStyle = cs.dwExStyle; 186 dlgTemplate.x = cs.x; 187 dlgTemplate.y = cs.y; 188 dlgTemplate.cx = cs.cx; 189 dlgTemplate.cy = cs.cy; 190 dlgTemplate.className = cs.lpszClass; 191 dlgTemplate.caption = cs.lpszName; 192 window = (Win32BaseWindow *) new Win32Dialog(cs.hInstance, 193 (LPCSTR) &dlgTemplate, 194 cs.hwndParent, 195 NULL, 196 (LPARAM) data, 197 TRUE); 242 198 } 243 199 else {
Note:
See TracChangeset
for help on using the changeset viewer.