Changeset 319
- Timestamp:
- Jul 17, 1999, 11:17:58 AM (26 years ago)
- Location:
- trunk/src/user32/new
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/src/user32/new/makefile ¶
r318 r319 1 # $Id: makefile,v 1. 5 1999-07-17 07:36:50sandervl Exp $1 # $Id: makefile,v 1.6 1999-07-17 09:17:57 sandervl Exp $ 2 2 3 3 # … … 29 29 msgbox.obj window.obj windowmsg.obj windowclass.obj windlgmsg.obj \ 30 30 windowword.obj gen_object.obj oslibwin.obj win32wndchild.obj \ 31 controls.obj button.obj 31 controls.obj button.obj oslibutil.obj 32 32 33 33 … … 77 77 windowword.obj: windowword.cpp win32class.h win32wnd.h win32dlg.h win32wndchild.h 78 78 79 pmwindow.obj: pmwindow.cpp win32class.h win32wnd.h win32dlg.h pmwindow.h win32wndchild.h 79 pmwindow.obj: pmwindow.cpp win32class.h win32wnd.h win32dlg.h pmwindow.h win32wndchild.h $(PDWIN32_INCLUDE)\wprocess.h 80 80 win32class.obj: win32class.cpp win32class.h win32wnd.h win32dlg.h gen_object.h oslibwin.h win32wndchild.h 81 81 win32wnd.obj: win32wnd.cpp win32class.h win32wnd.h win32dlg.h gen_object.h oslibwin.h win32wndchild.h … … 83 83 win32wndchild.obj: win32wndchild.cpp win32wndchild.h 84 84 gen_object.obj: gen_object.cpp gen_object.h 85 oslibwin.obj: oslibwin.cpp oslibwin.h 85 oslibwin.obj: oslibwin.cpp oslibwin.h oslibutil.h 86 oslibutil.obj: oslibutil.cpp oslibutil.h $(PDWIN32_INCLUDE)\wprocess.h 86 87 87 88 clean: -
TabularUnified trunk/src/user32/new/oslibwin.cpp ¶
r314 r319 1 /* $Id: oslibwin.cpp,v 1. 4 1999-07-16 11:32:08 sandervl Exp $ */1 /* $Id: oslibwin.cpp,v 1.5 1999-07-17 09:17:58 sandervl Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 14 14 #include <os2.h> 15 15 #include <os2wrap.h> 16 #include <misc.h> 16 17 #include <oslibwin.h> 17 18 #include "oslibstyle.h" 19 #include "oslibutil.h" 18 20 #include "pmwindow.h" 19 21 … … 33 35 HWND OSLibWinCreateWindow(HWND hwndParent, ULONG dwWinStyle, ULONG dwFrameStyle, 34 36 char *pszName, ULONG x, ULONG y, ULONG cx, ULONG cy, 35 HWND Owner, ULONG fHWND_BOTTOM )37 HWND Owner, ULONG fHWND_BOTTOM, HWND *hwndFrame) 36 38 { 37 39 HWND hwndClient; 38 HWND hwndFrame;39 40 RECTL rectl; 40 41 … … 42 43 hwndParent = HWND_DESKTOP; 43 44 } 44 if(WinQueryWindowRect(hwndParent, &rectl) == 0) {45 if(WinQueryWindowRect(hwndParent, &rectl) == TRUE) { 45 46 y = OS2TOWIN32POINT(rectl.yTop - rectl.yBottom, y); 46 47 } 47 48 if(dwFrameStyle) { 48 49 dwWinStyle &= ~WS_CLIPCHILDREN; //invalid style according to docs 49 hwndFrame = WinCreateStdWindow(hwndParent, dwWinStyle,50 *hwndFrame = WinCreateStdWindow(hwndParent, dwWinStyle, 50 51 &dwFrameStyle, WIN32_STDCLASS, 51 52 "", 0, 0, 0, &hwndClient) != 0; 52 if( hwndFrame) {53 if(*hwndFrame) { 53 54 if(pszName) { 54 WinSetWindowText( hwndFrame, pszName);55 WinSetWindowText(*hwndFrame, pszName); 55 56 } 56 WinSetWindowPos( hwndFrame, (fHWND_BOTTOM) ? HWND_BOTTOM :HWND_TOP,57 WinSetWindowPos(*hwndFrame, (fHWND_BOTTOM) ? HWND_BOTTOM :HWND_TOP, 57 58 x, y, cx, cy, SWP_SIZE | SWP_MOVE); 58 59 59 return hwnd Frame;60 return hwndClient; 60 61 } 62 dprintf(("OSLibWinCreateWindow: WinCreateStdWindow failed (%x)", WinGetLastError(GetThreadHAB()))); 61 63 return 0; 62 64 } 63 else returnWinCreateWindow(hwndParent, WIN32_STDCLASS, pszName, dwWinStyle, x, y, cx, cy,65 hwndClient = WinCreateWindow(hwndParent, WIN32_STDCLASS, pszName, dwWinStyle, x, y, cx, cy, 64 66 Owner, (fHWND_BOTTOM) ? HWND_BOTTOM :HWND_TOP, 0, NULL, 65 67 NULL); 68 *hwndFrame = hwndClient; 69 return hwndClient; 66 70 } 67 71 //****************************************************************************** … … 143 147 //****************************************************************************** 144 148 //****************************************************************************** 149 BOOL OSLibWinSetWindowPos(HWND hwnd, HWND hwndInsertBehind, LONG x, LONG y, LONG cx, 150 LONG cy, ULONG fl) 151 { 152 return WinSetWindowPos(hwnd, hwndInsertBehind, x, y, cx, cy, fl); 153 } 154 //****************************************************************************** 155 //****************************************************************************** 156 BOOL OSLibWinShowWindow(HWND hwnd, ULONG fl) 157 { 158 return WinSetWindowPos(hwnd, 0, 0, 0, 0, 0, fl); 159 } 160 //****************************************************************************** 161 //****************************************************************************** 162 BOOL OSLibWinDestroyWindow(HWND hwnd) 163 { 164 return WinDestroyWindow(hwnd); 165 } 166 //****************************************************************************** 167 //****************************************************************************** 168 BOOL OSLibWinQueryUpdateRect(HWND hwnd, PVOID pRect) 169 { 170 return WinQueryUpdateRect(hwnd, (RECTL *)pRect); 171 } 172 //****************************************************************************** 173 //****************************************************************************** 174 BOOL OSLibWinIsIconic(HWND hwnd) 175 { 176 SWP swp; 177 BOOL rc; 178 179 rc = WinQueryWindowPos(hwnd, &swp); 180 if(rc == FALSE) { 181 dprintf(("OSLibWinIsIconic: WinQueryWindowPos %x failed", hwnd)); 182 return FALSE; 183 } 184 185 if(swp.fl & SWP_MINIMIZE) 186 return TRUE; 187 else return FALSE; 188 } 189 //****************************************************************************** 190 //****************************************************************************** -
TabularUnified trunk/src/user32/new/oslibwin.h ¶
r314 r319 1 /* $Id: oslibwin.h,v 1. 3 1999-07-16 11:32:08 sandervl Exp $ */1 /* $Id: oslibwin.h,v 1.4 1999-07-17 09:17:58 sandervl Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 21 21 HWND OSLibWinCreateWindow(HWND hwndParent, ULONG dwWinStyle, ULONG dwFrameStyle, 22 22 char *pszName, ULONG x, ULONG y, ULONG cx, ULONG cy, 23 HWND Owner, ULONG fHWND_BOTTOM );23 HWND Owner, ULONG fHWND_BOTTOM, HWND *hwndFrame); 24 24 25 25 BOOL OSLibWinConvertStyle(ULONG dwStyle, ULONG *OSWinStyle, ULONG *OSFrameStyle); … … 34 34 HWND OSLibWinQueryTopMostChildWindow(HWND hwndParent); 35 35 36 37 #define SWPOS_SIZE 0x0001 38 #define SWPOS_MOVE 0x0002 39 #define SWPOS_ZORDER 0x0004 40 #define SWPOS_SHOW 0x0008 41 #define SWPOS_HIDE 0x0010 42 #define SWPOS_NOREDRAW 0x0020 43 #define SWPOS_NOADJUST 0x0040 44 #define SWPOS_ACTIVATE 0x0080 45 #define SWPOS_DEACTIVATE 0x0100 46 #define SWPOS_EXTSTATECHANGE 0x0200 47 #define SWPOS_MINIMIZE 0x0400 48 #define SWPOS_MAXIMIZE 0x0800 49 #define SWPOS_RESTORE 0x1000 50 #define SWPOS_FOCUSACTIVATE 0x2000 51 #define SWPOS_FOCUSDEACTIVATE 0x4000 52 #define SWPOS_NOAUTOCLOSE 0x8000 /* Valid in PROGDETAILS struct only */ 53 54 BOOL OSLibWinSetWindowPos(HWND hwnd, HWND hwndInsertBehind, LONG x, LONG y, LONG cx, LONG cy, ULONG fl); 55 BOOL OSLibWinShowWindow(HWND hwnd, ULONG fl); 56 57 BOOL OSLibWinDestroyWindow(HWND hwnd); 58 BOOL OSLibWinQueryUpdateRect(HWND hwnd, PVOID pRect); //must be RECTL pointer! 59 BOOL OSLibWinIsIconic(HWND hwnd); 60 36 61 #endif //__OSLIBWIN_H__ -
TabularUnified trunk/src/user32/new/pmwindow.cpp ¶
r309 r319 1 /* $Id: pmwindow.cpp,v 1. 4 1999-07-15 18:03:02sandervl Exp $ */1 /* $Id: pmwindow.cpp,v 1.5 1999-07-17 09:17:58 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Managment Code for OS/2 … … 22 22 #include "pmwindow.h" 23 23 #include "oslibwin.h" 24 #include "oslibutil.h" 24 25 25 26 HMQ hmq = 0; /* Message queue handle */ … … 51 52 } 52 53 } 54 SetThreadHAB(hab); 55 SetThreadMessageQueue(hmq); 53 56 54 57 if(!WinRegisterClass( /* Register window class */ -
TabularUnified trunk/src/user32/new/win32wnd.cpp ¶
r314 r319 1 /* $Id: win32wnd.cpp,v 1. 4 1999-07-16 11:32:09sandervl Exp $ */1 /* $Id: win32wnd.cpp,v 1.5 1999-07-17 09:17:58 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Code for OS/2 … … 68 68 magic = WIN32PM_MAGIC; 69 69 OS2Hwnd = 0; 70 OS2HwndFrame = 0; 70 71 OS2HwndMenu = 0; 71 72 Win32Hwnd = 0; … … 92 93 hwndLinkAfter = HWND_BOTTOM; 93 94 flags = 0; 95 isIcon = FALSE; 94 96 owner = NULL; 95 97 windowClass = 0; … … 329 331 cs->x, cs->y, cs->cx, cs->cy, 330 332 (owner) ? owner->getOS2WindowHandle() : 0, 331 (hwndLinkAfter == HWND_BOTTOM) ? TRUE : FALSE );333 (hwndLinkAfter == HWND_BOTTOM) ? TRUE : FALSE, &OS2HwndFrame); 332 334 333 335 if(OS2Hwnd == 0) { … … 665 667 ULONG Win32Window::MsgDestroy() 666 668 { 667 return SendMessageA(WM_DESTROY, 0, 0); 669 ULONG rc; 670 671 rc = SendMessageA(WM_DESTROY, 0, 0); 672 delete this; 673 return rc; 668 674 } 669 675 //****************************************************************************** … … 687 693 } 688 694 //****************************************************************************** 695 //TODO: Send WM_NCCALCSIZE message here and correct size if necessary 689 696 //****************************************************************************** 690 697 ULONG Win32Window::MsgSize(ULONG width, ULONG height, BOOL fMinimize, BOOL fMaximize) … … 911 918 if(HMHandleTranslateToOS2(hMenu, (PULONG)&menutemplate) == NO_ERROR) 912 919 { 913 OS2HwndMenu = OSLibWinCreateMenu(OS2Hwnd , menutemplate);920 OS2HwndMenu = OSLibWinCreateMenu(OS2HwndFrame, menutemplate); 914 921 if(OS2HwndMenu == 0) { 915 922 dprintf(("Win32Window::SetMenu OS2HwndMenu == 0")); … … 924 931 BOOL Win32Window::ShowWindow(ULONG nCmdShow) 925 932 { 926 return O32_ShowWindow(OS2Hwnd, nCmdShow); 933 ULONG showstate = 0; 934 935 switch(nCmdShow) 936 { 937 case SW_SHOW: 938 case SW_SHOWDEFAULT: //todo 939 showstate = SWPOS_SHOW; 940 break; 941 case SW_HIDE: 942 showstate = SWPOS_HIDE; 943 break; 944 case SW_MINIMIZE: 945 showstate = SWPOS_MINIMIZE; 946 break; 947 case SW_SHOWMAXIMIZED: 948 showstate = SWPOS_MAXIMIZE | SWPOS_SHOW; 949 break; 950 case SW_SHOWMINIMIZED: 951 showstate = SWPOS_MINIMIZE | SWPOS_SHOW; 952 break; 953 case SW_SHOWMINNOACTIVE: //TODO 954 showstate = SWPOS_MINIMIZE | SWPOS_SHOW; 955 break; 956 case SW_SHOWNA: //TODO 957 showstate = SWPOS_SHOW; 958 break; 959 case SW_SHOWNOACTIVATE: //TODO 960 showstate = SWPOS_SHOW; 961 break; 962 case SW_SHOWNORMAL: 963 showstate = SWPOS_RESTORE; 964 break; 965 } 966 return OSLibWinShowWindow(OS2HwndFrame, showstate); 927 967 } 928 968 //****************************************************************************** … … 931 971 { 932 972 Win32Window *window; 973 ULONG setstate = 0; 933 974 934 975 switch(hwndInsertAfter) { … … 950 991 951 992 } 952 return O32_SetWindowPos(OS2Hwnd, hwndInsertAfter, x, y, cx, cy, fuFlags); 953 } 993 setstate = SWPOS_MOVE | SWPOS_SIZE | SWPOS_ACTIVATE | SWPOS_ZORDER; 994 if(fuFlags & SWP_DRAWFRAME) 995 setstate |= 0; //TODO 996 if(fuFlags & SWP_FRAMECHANGED) 997 setstate |= 0; //TODO 998 if(fuFlags & SWP_HIDEWINDOW) 999 setstate &= ~SWPOS_ZORDER; 1000 if(fuFlags & SWP_NOACTIVATE) 1001 setstate &= ~SWPOS_ACTIVATE; 1002 if(fuFlags & SWP_NOCOPYBITS) 1003 setstate |= 0; //TODO 1004 if(fuFlags & SWP_NOMOVE) 1005 setstate &= ~SWPOS_MOVE; 1006 if(fuFlags & SWP_NOSIZE) 1007 setstate &= ~SWPOS_SIZE; 1008 if(fuFlags & SWP_NOREDRAW) 1009 setstate |= SWPOS_NOREDRAW; 1010 if(fuFlags & SWP_NOZORDER) 1011 setstate &= ~SWPOS_ZORDER; 1012 if(fuFlags & SWP_SHOWWINDOW) 1013 setstate |= SWPOS_SHOW; 1014 1015 return OSLibWinSetWindowPos(OS2HwndFrame, hwndInsertAfter, x, y, cx, cy, setstate); 1016 } 1017 //****************************************************************************** 1018 //Also destroys all the child windows (destroy parent, destroy children) 954 1019 //****************************************************************************** 955 1020 BOOL Win32Window::DestroyWindow() 956 1021 { 957 return TRUE;1022 return OSLibWinDestroyWindow(OS2HwndFrame); 958 1023 } 959 1024 //****************************************************************************** … … 1015 1080 HWND topchild; 1016 1081 1017 topchild = OSLibWinQueryTopMostChildWindow(OS2Hwnd );1082 topchild = OSLibWinQueryTopMostChildWindow(OS2HwndFrame); 1018 1083 if(topchild) 1019 { //TODO1084 { 1020 1085 return topchild; 1021 1086 } … … 1023 1088 } 1024 1089 //****************************************************************************** 1025 //TODO 1090 //Don't call WinUpdateWindow as that one also updates the child windows 1091 //Also need to send WM_PAINT directly to the window procedure, which doesn't 1092 //always happen with WinUpdateWindow (could be posted if thread doesn't own window) 1026 1093 //****************************************************************************** 1027 1094 BOOL Win32Window::UpdateWindow() 1028 1095 { 1096 RECTL rect; 1097 1098 if(OSLibWinQueryUpdateRect(OS2Hwnd, (PVOID)&rect)) 1099 {//update region not empty 1100 SendMessageA((isIcon) ? WM_PAINTICON : WM_PAINT, 0, 0); 1101 } 1029 1102 return TRUE; 1030 1103 } 1031 1104 //****************************************************************************** 1032 //TODO1033 1105 //****************************************************************************** 1034 1106 BOOL Win32Window::IsIconic() 1035 1107 { 1036 return FALSE;1108 return OSLibWinIsIconic(OS2HwndFrame); 1037 1109 } 1038 1110 //****************************************************************************** … … 1144 1216 Win32Window *window; 1145 1217 1146 if(HIWORD(hwnd) != 0x6800) 1218 if(HIWORD(hwnd) != 0x6800) { 1147 1219 return NULL; 1220 } 1148 1221 1149 1222 if(HMHandleTranslateToOS2(LOWORD(hwnd), (PULONG)&window) == NO_ERROR) { -
TabularUnified trunk/src/user32/new/win32wnd.h ¶
r314 r319 1 /* $Id: win32wnd.h,v 1. 4 1999-07-16 11:32:09sandervl Exp $ */1 /* $Id: win32wnd.h,v 1.5 1999-07-17 09:17:58 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Code for OS/2 … … 114 114 115 115 HWND OS2Hwnd; 116 HWND OS2HwndFrame; 116 117 HWND OS2HwndMenu; 117 118 HWND Win32Hwnd; … … 132 133 HWND hwndLinkAfter; 133 134 DWORD flags; 135 136 BOOL isIcon; 134 137 135 138 Win32Window *owner;
Note:
See TracChangeset
for help on using the changeset viewer.