Changeset 760 for trunk/src/user32
- Timestamp:
- Aug 31, 1999, 7:14:52 PM (26 years ago)
- Location:
- trunk/src/user32/new
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/new/controls.cpp
r743 r760 1 /* $Id: controls.cpp,v 1. 9 1999-08-30 14:21:24sandervl Exp $ */1 /* $Id: controls.cpp,v 1.10 1999-08-31 17:14:51 sandervl Exp $ */ 2 2 /* File: controls.cpp -- Win32 common controls 3 3 * … … 39 39 atom = GlobalFindAtomA(EDITCLASSNAME); 40 40 if(atom) GlobalDeleteAtom(atom); 41 atom = GlobalFindAtomA(MDICLIENTCLASSNAME );41 atom = GlobalFindAtomA(MDICLIENTCLASSNAMEA); 42 42 if(atom) GlobalDeleteAtom(atom); 43 43 //END to be removed code -
trunk/src/user32/new/defwndproc.cpp
r741 r760 1 /* $Id: defwndproc.cpp,v 1. 6 1999-08-30 11:59:53sandervl Exp $ */1 /* $Id: defwndproc.cpp,v 1.7 1999-08-31 17:14:51 sandervl Exp $ */ 2 2 3 3 /* … … 16 16 #include "win32wbase.h" 17 17 #include "win32wnd.h" 18 #include "win32wmdichild.h" 18 19 19 20 #ifdef DEBUG … … 148 149 LRESULT WIN32API DefMDIChildProcA(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam) 149 150 { 150 #ifdef DEBUG 151 //// WriteLog("*DMP*"); 152 #endif 153 switch(Msg) { 154 case WM_SETREDRAW: //Open32 does not set the visible flag 155 if(wParam) 156 SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) | WS_VISIBLE); 157 else 158 SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) & ~WS_VISIBLE); 159 return O32_DefMDIChildProc(hwnd, Msg, wParam, lParam); 160 case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing) 161 return(TRUE); 162 case WM_CTLCOLORMSGBOX: 163 case WM_CTLCOLOREDIT: 164 case WM_CTLCOLORLISTBOX: 165 case WM_CTLCOLORBTN: 166 case WM_CTLCOLORDLG: 167 case WM_CTLCOLORSTATIC: 168 case WM_CTLCOLORSCROLLBAR: 169 SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW)); 170 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT)); 171 return GetSysColorBrush(COLOR_BTNFACE); 151 Win32MDIChildWindow *window; 172 152 173 case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!! 174 dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwnd)); 153 window = (Win32MDIChildWindow *)Win32BaseWindow::GetWindowFromHandle(hwnd); 154 if(!window) { 155 dprintf(("DefMDIProcA, window %x not found", hwnd)); 175 156 return 0; 176 177 default:178 return O32_DefMDIChildProc(hwnd, Msg, wParam, lParam);179 157 } 158 return window->DefMDIChildProcA(Msg, wParam, lParam); 180 159 } 181 160 //****************************************************************************** 182 //NOTE: Unicode msg translation!183 161 //****************************************************************************** 184 162 LRESULT WIN32API DefMDIChildProcW(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam) 185 163 { 186 #ifdef DEBUG 187 //// WriteLog("*DMPW*"); 188 #endif 189 switch(Msg) { 190 case WM_SETREDRAW: //Open32 does not set the visible flag 191 if(wParam) 192 SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) | WS_VISIBLE); 193 else 194 SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) & ~WS_VISIBLE); 195 return O32_DefMDIChildProc(hwnd, Msg, wParam, lParam); 196 case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing) 197 return(TRUE); 198 case WM_CTLCOLORMSGBOX: 199 case WM_CTLCOLOREDIT: 200 case WM_CTLCOLORLISTBOX: 201 case WM_CTLCOLORBTN: 202 case WM_CTLCOLORDLG: 203 case WM_CTLCOLORSTATIC: 204 case WM_CTLCOLORSCROLLBAR: 205 SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW)); 206 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT)); 207 return GetSysColorBrush(COLOR_BTNFACE); 164 Win32MDIChildWindow *window; 208 165 209 case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!! 210 dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwnd)); 166 window = (Win32MDIChildWindow *)Win32BaseWindow::GetWindowFromHandle(hwnd); 167 if(!window) { 168 dprintf(("DefMDIProcW, window %x not found", hwnd)); 211 169 return 0; 212 213 default:214 return O32_DefMDIChildProc(hwnd, Msg, wParam, lParam);215 170 } 171 return window->DefMDIChildProcW(Msg, wParam, lParam); 216 172 } 217 173 //****************************************************************************** -
trunk/src/user32/new/makefile
r753 r760 1 # $Id: makefile,v 1. 39 1999-08-31 14:38:08sandervl Exp $1 # $Id: makefile,v 1.40 1999-08-31 17:14:51 sandervl Exp $ 2 2 3 3 # … … 67 67 dde.obj: dde.cpp 68 68 hook.obj: hook.cpp hooks.h 69 defwndproc.obj: defwndproc.cpp syscolor.h 69 defwndproc.obj: defwndproc.cpp syscolor.h win32wmdiclient.h win32wbase.h win32wnd.h 70 70 hooks.obj: hooks.cpp hooks.h 71 71 initterm.obj: initterm.cpp $(PDWIN32_INCLUDE)\spy.h pmwindow.h heapshared.h … … 87 87 88 88 msgbox.obj: msgbox.cpp 89 window.obj: window.cpp win32class.h win32wbase.h win32wndchild.h oslibwin.h 89 window.obj: window.cpp win32class.h win32wbase.h win32wndchild.h oslibwin.h win32wmdiclient.h 90 90 windowmsg.obj: windowmsg.cpp win32class.h win32wbase.h win32wndchild.h 91 91 winprop.obj: winprop.cpp -
trunk/src/user32/new/win32wmdichild.cpp
r750 r760 1 /* $Id: win32wmdichild.cpp,v 1. 1 1999-08-31 10:36:23sandervl Exp $ */1 /* $Id: win32wmdichild.cpp,v 1.2 1999-08-31 17:14:51 sandervl Exp $ */ 2 2 /* 3 3 * Win32 MDI Child Window Class for OS/2 … … 9 9 * Copyright 1994, Bob Amstadt 10 10 * 1995,1996 Alex Korobka 11 * 12 * 13 * TODO: See #if 0's 11 14 * 12 15 * Project Odin Software License can be found in LICENSE.TXT … … 50 53 { 51 54 } 55 //****************************************************************************** 56 //****************************************************************************** 57 LRESULT Win32MDIChildWindow::DefMDIChildProcA(UINT Msg, WPARAM wParam, LPARAM lParam) 58 { 59 Win32MDIClientWindow *client = (Win32MDIClientWindow *)getParent(); 60 61 switch (Msg) 62 { 63 case WM_SETTEXT: 64 DefWindowProcA(Msg, wParam, lParam); 65 menuModifyItem(); 66 #if 0 67 if( client->getMaximizedChild() == this ) 68 MDI_UpdateFrameText( clientWnd->parent, ci->self, MDI_REPAINTFRAME, NULL ); 69 #endif 70 return 0; 71 72 case WM_GETMINMAXINFO: 73 { 74 childGetMinMaxInfo((MINMAXINFO *)lParam); 75 return 0; 76 } 77 78 case WM_MENUCHAR: 79 /* MDI children don't have menu bars */ 80 client->PostMessageA(WM_SYSCOMMAND, (WPARAM)SC_KEYMENU, (LPARAM)LOWORD(wParam) ); 81 return 0x00010000L; 82 83 case WM_CLOSE: 84 client->SendMessageA(WM_MDIDESTROY,(WPARAM16)getWindowHandle(), 0L); 85 return 0; 86 87 case WM_SETFOCUS: 88 if(client->getActiveChild() != this ) 89 client->childActivate(this); 90 break; 91 92 case WM_CHILDACTIVATE: 93 client->childActivate(this); 94 return 0; 95 96 case WM_NCPAINT: 97 break; 98 99 case WM_SYSCOMMAND: 100 switch( wParam ) 101 { 102 case SC_MOVE: 103 if( client->getMaximizedChild() == this) 104 { 105 return 0; 106 } 107 break; 108 case SC_RESTORE: 109 case SC_MINIMIZE: 110 setStyle(getStyle() | WS_SYSMENU); 111 break; 112 113 case SC_MAXIMIZE: 114 if( client->getMaximizedChild() == this) 115 { 116 return client->SendMessageA(Msg, wParam, lParam); 117 } 118 setStyle(getStyle() & ~WS_SYSMENU); 119 break; 120 121 case SC_NEXTWINDOW: 122 client->SendMessageA(WM_MDINEXT, 0, 0); 123 return 0; 124 125 case SC_PREVWINDOW: //WM_MDINEXT?? 126 client->SendMessageA(WM_MDINEXT, 0, 0); 127 return 0; 128 } 129 break; 130 131 case WM_SETVISIBLE: 132 #if 0 133 if( client->getMaximizedChild()) ci->mdiFlags &= ~MDIF_NEEDUPDATE; 134 else 135 MDI_PostUpdate(clientWnd->hwndSelf, ci, SB_BOTH+1); 136 #endif 137 break; 138 139 #if 0 140 case WM_SIZE: 141 /* do not change */ 142 143 if( ci->hwndActiveChild == hwnd && wParam != SIZE_MAXIMIZED ) 144 { 145 ci->hwndChildMaximized = 0; 146 147 MDI_RestoreFrameMenu( clientWnd->parent, hwnd); 148 MDI_UpdateFrameText( clientWnd->parent, ci->self, 149 MDI_REPAINTFRAME, NULL ); 150 } 151 152 if( wParam == SIZE_MAXIMIZED ) 153 { 154 HWND16 hMaxChild = ci->hwndChildMaximized; 155 156 if( hMaxChild == hwnd ) break; 157 158 if( hMaxChild) 159 { 160 SendMessage16( hMaxChild, WM_SETREDRAW, FALSE, 0L ); 161 162 MDI_RestoreFrameMenu( clientWnd->parent, hMaxChild); 163 ShowWindow16( hMaxChild, SW_SHOWNOACTIVATE); 164 165 SendMessage16( hMaxChild, WM_SETREDRAW, TRUE, 0L ); 166 } 167 168 ci->hwndChildMaximized = hwnd; /* !!! */ 169 ci->hwndActiveChild = hwnd; 170 171 MDI_AugmentFrameMenu( ci, clientWnd->parent, hwnd); 172 MDI_UpdateFrameText( clientWnd->parent, ci->self, 173 MDI_REPAINTFRAME, NULL ); 174 } 175 176 if( wParam == SIZE_MINIMIZED ) 177 { 178 HWND16 switchTo = MDI_GetWindow(clientWnd, hwnd, TRUE, WS_MINIMIZE); 179 180 if( switchTo ) 181 SendMessage16( switchTo, WM_CHILDACTIVATE, 0, 0L); 182 } 183 184 MDI_PostUpdate(clientWnd->hwndSelf, ci, SB_BOTH+1); 185 break; 186 #endif 187 188 #if 0 189 case WM_NEXTMENU: 190 if( wParam == VK_LEFT ) /* switch to frame system menu */ 191 { 192 return MAKELONG( GetSubMenu(clientWnd->parent->hSysMenu, 0), 193 clientWnd->parent->hwndSelf ); 194 goto END; 195 } 196 if( wParam == VK_RIGHT ) /* to frame menu bar */ 197 { 198 retvalue = MAKELONG( clientWnd->parent->wIDmenu, 199 clientWnd->parent->hwndSelf ); 200 goto END; 201 } 202 #endif 203 case WM_SYSCHAR: 204 if (wParam == '-') 205 { 206 SendMessageA(WM_SYSCOMMAND, (WPARAM)SC_KEYMENU, (LPARAM)(DWORD)VK_SPACE); 207 return 0; 208 } 209 } 210 return DefWindowProcA(Msg, wParam, lParam); 211 } 212 //****************************************************************************** 213 //****************************************************************************** 214 LRESULT Win32MDIChildWindow::DefMDIChildProcW(UINT Msg, WPARAM wParam, LPARAM lParam) 215 { 216 switch (Msg) 217 { 218 case WM_SETTEXT: 219 DefWindowProcW(Msg, wParam, lParam); 220 menuModifyItem(); 221 #if 0 222 if( client->getMaximizedChild() == this ) 223 MDI_UpdateFrameText( clientWnd->parent, ci->self, MDI_REPAINTFRAME, NULL ); 224 #endif 225 return 0; 226 227 case WM_GETMINMAXINFO: 228 case WM_MENUCHAR: 229 case WM_CLOSE: 230 case WM_SETFOCUS: 231 case WM_CHILDACTIVATE: 232 case WM_NCPAINT: 233 case WM_SYSCOMMAND: 234 case WM_SETVISIBLE: 235 case WM_SIZE: 236 case WM_NEXTMENU: 237 return DefMDIChildProcA(Msg, wParam, lParam ); 238 239 case WM_SYSCHAR: 240 if (wParam == '-') 241 { 242 SendMessageW(WM_SYSCOMMAND, SC_KEYMENU, (LPARAM)(DWORD)VK_SPACE); 243 return 0; 244 } 245 break; 246 } 247 return DefWindowProcW(Msg, wParam, lParam); 248 } 52 249 /********************************************************************** 53 250 * MDICreateChild -
trunk/src/user32/new/win32wmdichild.h
r750 r760 1 /* $Id: win32wmdichild.h,v 1. 1 1999-08-31 10:36:23sandervl Exp $ */1 /* $Id: win32wmdichild.h,v 1.2 1999-08-31 17:14:51 sandervl Exp $ */ 2 2 /* 3 3 * Win32 MDI Client Window Class for OS/2 … … 30 30 BOOL menuDeleteItem(); 31 31 32 LRESULT DefMDIChildProcA(UINT Msg, WPARAM wParam, LPARAM lParam); 33 LRESULT DefMDIChildProcW(UINT Msg, WPARAM wParam, LPARAM lParam); 34 32 35 static void calcDefaultChildPos(Win32MDIClientWindow *client, WORD n, LPPOINT lpPos, INT delta); 33 36 private: -
trunk/src/user32/new/win32wmdiclient.cpp
r750 r760 1 /* $Id: win32wmdiclient.cpp,v 1. 2 1999-08-31 10:36:23sandervl Exp $ */1 /* $Id: win32wmdiclient.cpp,v 1.3 1999-08-31 17:14:52 sandervl Exp $ */ 2 2 /* 3 3 * Win32 MDI Client Window Class for OS/2 … … 445 445 WNDCLASSA wndClass; 446 446 447 if (GlobalFindAtomA(MDICLIENTCLASSNAME )) return FALSE;447 if (GlobalFindAtomA(MDICLIENTCLASSNAMEA)) return FALSE; 448 448 449 449 ZeroMemory(&wndClass,sizeof(WNDCLASSA)); … … 454 454 wndClass.hCursor = 0; 455 455 wndClass.hbrBackground = (HBRUSH)0; 456 wndClass.lpszClassName = MDICLIENTCLASSNAME ;456 wndClass.lpszClassName = MDICLIENTCLASSNAMEA; 457 457 458 458 return RegisterClassA(&wndClass); … … 462 462 BOOL MDICLIENT_Unregister() 463 463 { 464 if (GlobalFindAtomA(MDICLIENTCLASSNAME ))465 return UnregisterClassA(MDICLIENTCLASSNAME ,(HINSTANCE)NULL);464 if (GlobalFindAtomA(MDICLIENTCLASSNAMEA)) 465 return UnregisterClassA(MDICLIENTCLASSNAMEA,(HINSTANCE)NULL); 466 466 else return FALSE; 467 467 } -
trunk/src/user32/new/win32wmdiclient.h
r750 r760 1 /* $Id: win32wmdiclient.h,v 1. 2 1999-08-31 10:36:23sandervl Exp $ */1 /* $Id: win32wmdiclient.h,v 1.3 1999-08-31 17:14:52 sandervl Exp $ */ 2 2 /* 3 3 * Win32 MDI Client Window Class for OS/2 … … 15 15 #include <mdi.h> 16 16 17 #define MDICLIENTCLASSNAME "MDICLIENT" 17 #define MDICLIENTCLASSNAMEA "MDICLIENT" 18 #define MDICLIENTCLASSNAMEW L"MDICLIENT" 18 19 19 20 //****************************************************************************** -
trunk/src/user32/new/window.cpp
r750 r760 1 /* $Id: window.cpp,v 1.2 0 1999-08-31 10:36:24sandervl Exp $ */1 /* $Id: window.cpp,v 1.21 1999-08-31 17:14:52 sandervl Exp $ */ 2 2 /* 3 3 * Win32 window apis for OS/2 … … 19 19 #include <misc.h> 20 20 #include <win32wbase.h> 21 #include <win32wmdiclient.h> 21 22 #include <oslibwin.h> 22 23 #include <oslibgdi.h> … … 40 41 return CreateMDIWindowA(className, windowName, style, x, y, width, height, parent, instance, (LPARAM)data); 41 42 43 //TODO: According to the docs className can be a 16 bits atom 44 // Wine seems to assume it's a string though... 42 45 /* Find the class atom */ 43 46 if (!(classAtom = GlobalFindAtomA(className))) … … 66 69 cs.dwExStyle = exStyle; 67 70 dprintf(("CreateWindowExA: (%d,%d) (%d,%d), %x %x", x, y, width, height, style, exStyle)); 68 window = new Win32BaseWindow( &cs, classAtom, FALSE ); 71 72 //TODO: According to the docs className can be a 16 bits atom 73 // Wine seems to assume it's a string though... 74 if(!stricmp(className, MDICLIENTCLASSNAMEA)) { 75 window = (Win32BaseWindow *) new Win32MDIClientWindow(&cs, classAtom, FALSE); 76 } 77 else { 78 window = new Win32BaseWindow( &cs, classAtom, FALSE ); 79 } 69 80 if(window == NULL) 70 81 { … … 95 106 return CreateMDIWindowW(className, windowName, style, x, y, width, height, parent, instance, (LPARAM)data); 96 107 108 //TODO: According to the docs className can be a 16 bits atom 109 // Wine seems to assume it's a string though... 97 110 /* Find the class atom */ 98 111 if (!(classAtom = GlobalFindAtomW(className))) … … 120 133 cs.lpszClass = (LPSTR)className; 121 134 cs.dwExStyle = exStyle; 122 window = new Win32BaseWindow( &cs, classAtom, TRUE ); 135 136 //TODO: According to the docs className can be a 16 bits atom 137 // Wine seems to assume it's a string though... 138 if(!lstrcmpW(className, (LPWSTR)MDICLIENTCLASSNAMEW)) { 139 window = (Win32BaseWindow *) new Win32MDIClientWindow(&cs, classAtom, TRUE); 140 } 141 else { 142 window = new Win32BaseWindow( &cs, classAtom, TRUE ); 143 } 123 144 if(window == NULL) 124 145 { -
trunk/src/user32/new/winmenu.cpp
r753 r760 1 /* $Id: winmenu.cpp,v 1. 3 1999-08-31 14:38:09sandervl Exp $ */1 /* $Id: winmenu.cpp,v 1.4 1999-08-31 17:14:52 sandervl Exp $ */ 2 2 3 3 /* … … 43 43 } 44 44 //****************************************************************************** 45 //****************************************************************************** 46 HMENU WIN32API LoadMenuIndirectA( const MENUITEMTEMPLATEHEADER * arg1) 47 { 48 char *astring = NULL; 49 HMENU rc; 45 //TODO: Create PM object? 46 //NOTE: menutemplate strings are always in Unicode format 47 //****************************************************************************** 48 HMENU WIN32API LoadMenuIndirectA( const MENUITEMTEMPLATEHEADER * menuTemplate) 49 { 50 Win32MenuRes *winres; 50 51 51 52 dprintf(("OS2LoadMenuIndirectA\n")); 52 53 rc = O32_LoadMenuIndirect(arg1); 54 if(astring) 55 FreeAsciiString(astring); 56 return(rc); 53 winres = new Win32MenuRes((LPVOID)menuTemplate); 54 if(winres == NULL) { 55 return 0; 56 } 57 return (HMENU)winres; 58 } 59 //****************************************************************************** 60 //****************************************************************************** 61 HMENU WIN32API LoadMenuIndirectW(const MENUITEMTEMPLATEHEADER *menuTemplate) 62 { 63 Win32MenuRes *winres; 64 65 dprintf(("OS2LoadMenuIndirectW\n")); 66 winres = new Win32MenuRes((LPVOID)menuTemplate); 67 if(winres == NULL) { 68 return 0; 69 } 70 return (HMENU)winres; 57 71 } 58 72 //****************************************************************************** … … 70 84 delete winres; 71 85 return TRUE; 72 }73 //******************************************************************************74 //Won't work...75 //******************************************************************************76 HMENU WIN32API LoadMenuIndirectW(const MENUITEMTEMPLATEHEADER * arg1)77 {78 dprintf(("OS2LoadMenuIndirectW, improperly implemented!!\n"));79 80 return 0;81 // return O32_LoadMenuIndirect(arg1);82 86 } 83 87 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.