Changeset 319


Ignore:
Timestamp:
Jul 17, 1999, 11:17:58 AM (26 years ago)
Author:
sandervl
Message:

Lots of changes/additions

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:50 sandervl Exp $
     1# $Id: makefile,v 1.6 1999-07-17 09:17:57 sandervl Exp $
    22
    33#
     
    2929        msgbox.obj window.obj windowmsg.obj windowclass.obj windlgmsg.obj \
    3030        windowword.obj gen_object.obj oslibwin.obj win32wndchild.obj \
    31         controls.obj button.obj
     31        controls.obj button.obj oslibutil.obj
    3232
    3333
     
    7777windowword.obj:  windowword.cpp win32class.h win32wnd.h win32dlg.h win32wndchild.h
    7878
    79 pmwindow.obj:   pmwindow.cpp win32class.h win32wnd.h win32dlg.h pmwindow.h win32wndchild.h
     79pmwindow.obj:   pmwindow.cpp win32class.h win32wnd.h win32dlg.h pmwindow.h win32wndchild.h $(PDWIN32_INCLUDE)\wprocess.h
    8080win32class.obj: win32class.cpp win32class.h win32wnd.h win32dlg.h gen_object.h oslibwin.h win32wndchild.h
    8181win32wnd.obj:   win32wnd.cpp win32class.h win32wnd.h win32dlg.h gen_object.h oslibwin.h win32wndchild.h
     
    8383win32wndchild.obj: win32wndchild.cpp win32wndchild.h
    8484gen_object.obj: gen_object.cpp gen_object.h
    85 oslibwin.obj:   oslibwin.cpp oslibwin.h
     85oslibwin.obj:   oslibwin.cpp oslibwin.h oslibutil.h
     86oslibutil.obj:  oslibutil.cpp oslibutil.h $(PDWIN32_INCLUDE)\wprocess.h
    8687
    8788clean:
  • 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 $ */
    22/*
    33 * Window API wrappers for OS/2
     
    1414#include <os2.h>
    1515#include <os2wrap.h>
     16#include <misc.h>
    1617#include <oslibwin.h>
    1718#include "oslibstyle.h"
     19#include "oslibutil.h"
    1820#include "pmwindow.h"
    1921
     
    3335HWND OSLibWinCreateWindow(HWND hwndParent, ULONG dwWinStyle, ULONG dwFrameStyle,
    3436                          char *pszName, ULONG x, ULONG y, ULONG cx, ULONG cy,
    35                           HWND Owner, ULONG fHWND_BOTTOM)
     37                          HWND Owner, ULONG fHWND_BOTTOM, HWND *hwndFrame)
    3638{
    3739 HWND  hwndClient;
    38  HWND  hwndFrame;
    3940 RECTL rectl;
    4041
     
    4243        hwndParent = HWND_DESKTOP;
    4344  }
    44   if(WinQueryWindowRect(hwndParent, &rectl) == 0) {
     45  if(WinQueryWindowRect(hwndParent, &rectl) == TRUE) {
    4546        y = OS2TOWIN32POINT(rectl.yTop - rectl.yBottom, y);
    4647  }
    4748  if(dwFrameStyle) {
    4849        dwWinStyle &= ~WS_CLIPCHILDREN; //invalid style according to docs
    49         hwndFrame = WinCreateStdWindow(hwndParent, dwWinStyle,
     50        *hwndFrame = WinCreateStdWindow(hwndParent, dwWinStyle,
    5051                                       &dwFrameStyle, WIN32_STDCLASS,
    5152                                       "", 0, 0, 0, &hwndClient) != 0;
    52         if(hwndFrame) {
     53        if(*hwndFrame) {
    5354                if(pszName) {
    54                         WinSetWindowText(hwndFrame, pszName);
     55                        WinSetWindowText(*hwndFrame, pszName);
    5556                }
    56                 WinSetWindowPos(hwndFrame, (fHWND_BOTTOM) ? HWND_BOTTOM :HWND_TOP,
     57                WinSetWindowPos(*hwndFrame, (fHWND_BOTTOM) ? HWND_BOTTOM :HWND_TOP,
    5758                                x, y, cx, cy, SWP_SIZE | SWP_MOVE);
    5859
    59                 return hwndFrame;
     60                return hwndClient;
    6061        }
     62        dprintf(("OSLibWinCreateWindow: WinCreateStdWindow failed (%x)", WinGetLastError(GetThreadHAB())));
    6163        return 0;
    6264  }
    63   else  return WinCreateWindow(hwndParent, WIN32_STDCLASS, pszName, dwWinStyle, x, y, cx, cy,
     65  hwndClient = WinCreateWindow(hwndParent, WIN32_STDCLASS, pszName, dwWinStyle, x, y, cx, cy,
    6466                               Owner, (fHWND_BOTTOM) ? HWND_BOTTOM :HWND_TOP, 0, NULL,
    6567                               NULL);
     68  *hwndFrame = hwndClient;
     69  return hwndClient;
    6670}
    6771//******************************************************************************
     
    143147//******************************************************************************
    144148//******************************************************************************
     149BOOL 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//******************************************************************************
     156BOOL OSLibWinShowWindow(HWND hwnd, ULONG fl)
     157{
     158  return WinSetWindowPos(hwnd, 0, 0, 0, 0, 0, fl);
     159}
     160//******************************************************************************
     161//******************************************************************************
     162BOOL OSLibWinDestroyWindow(HWND hwnd)
     163{
     164  return WinDestroyWindow(hwnd);
     165}
     166//******************************************************************************
     167//******************************************************************************
     168BOOL OSLibWinQueryUpdateRect(HWND hwnd, PVOID pRect)
     169{
     170  return WinQueryUpdateRect(hwnd, (RECTL *)pRect);
     171}
     172//******************************************************************************
     173//******************************************************************************
     174BOOL 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 $ */
    22/*
    33 * Window API wrappers for OS/2
     
    2121HWND  OSLibWinCreateWindow(HWND hwndParent, ULONG dwWinStyle, ULONG dwFrameStyle,
    2222                           char *pszName, ULONG x, ULONG y, ULONG cx, ULONG cy,
    23                            HWND Owner, ULONG fHWND_BOTTOM);
     23                           HWND Owner, ULONG fHWND_BOTTOM, HWND *hwndFrame);
    2424
    2525BOOL  OSLibWinConvertStyle(ULONG dwStyle, ULONG *OSWinStyle, ULONG *OSFrameStyle);
     
    3434HWND  OSLibWinQueryTopMostChildWindow(HWND hwndParent);
    3535
     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
     54BOOL  OSLibWinSetWindowPos(HWND hwnd, HWND hwndInsertBehind, LONG x, LONG y, LONG cx, LONG cy, ULONG fl);
     55BOOL  OSLibWinShowWindow(HWND hwnd, ULONG fl);
     56
     57BOOL  OSLibWinDestroyWindow(HWND hwnd);
     58BOOL  OSLibWinQueryUpdateRect(HWND hwnd, PVOID pRect); //must be RECTL pointer!
     59BOOL  OSLibWinIsIconic(HWND hwnd);
     60
    3661#endif //__OSLIBWIN_H__
  • TabularUnified trunk/src/user32/new/pmwindow.cpp

    r309 r319  
    1 /* $Id: pmwindow.cpp,v 1.4 1999-07-15 18:03:02 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.5 1999-07-17 09:17:58 sandervl Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    2222#include "pmwindow.h"
    2323#include "oslibwin.h"
     24#include "oslibutil.h"
    2425
    2526HMQ  hmq = 0;                             /* Message queue handle         */
     
    5152        }
    5253  }
     54  SetThreadHAB(hab);
     55  SetThreadMessageQueue(hmq);
    5356
    5457  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:09 sandervl Exp $ */
     1/* $Id: win32wnd.cpp,v 1.5 1999-07-17 09:17:58 sandervl Exp $ */
    22/*
    33 * Win32 Window Code for OS/2
     
    6868  magic            = WIN32PM_MAGIC;
    6969  OS2Hwnd          = 0;
     70  OS2HwndFrame     = 0;
    7071  OS2HwndMenu      = 0;
    7172  Win32Hwnd        = 0;
     
    9293  hwndLinkAfter    = HWND_BOTTOM;
    9394  flags            = 0;
     95  isIcon           = FALSE;
    9496  owner            = NULL;
    9597  windowClass      = 0;
     
    329331                                 cs->x, cs->y, cs->cx, cs->cy,
    330332                                 (owner) ? owner->getOS2WindowHandle() : 0,
    331                                  (hwndLinkAfter == HWND_BOTTOM) ? TRUE : FALSE);
     333                                 (hwndLinkAfter == HWND_BOTTOM) ? TRUE : FALSE, &OS2HwndFrame);
    332334
    333335  if(OS2Hwnd == 0) {
     
    665667ULONG Win32Window::MsgDestroy()
    666668{
    667   return SendMessageA(WM_DESTROY, 0, 0);
     669 ULONG rc;
     670
     671  rc = SendMessageA(WM_DESTROY, 0, 0);
     672  delete this;
     673  return rc;
    668674}
    669675//******************************************************************************
     
    687693}
    688694//******************************************************************************
     695//TODO: Send WM_NCCALCSIZE message here and correct size if necessary
    689696//******************************************************************************
    690697ULONG Win32Window::MsgSize(ULONG width, ULONG height, BOOL fMinimize, BOOL fMaximize)
     
    911918   if(HMHandleTranslateToOS2(hMenu, (PULONG)&menutemplate) == NO_ERROR)
    912919   {
    913         OS2HwndMenu = OSLibWinCreateMenu(OS2Hwnd, menutemplate);
     920        OS2HwndMenu = OSLibWinCreateMenu(OS2HwndFrame, menutemplate);
    914921        if(OS2HwndMenu == 0) {
    915922                dprintf(("Win32Window::SetMenu OS2HwndMenu == 0"));
     
    924931BOOL Win32Window::ShowWindow(ULONG nCmdShow)
    925932{
    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);
    927967}
    928968//******************************************************************************
     
    931971{
    932972 Win32Window *window;
     973 ULONG        setstate = 0;
    933974
    934975  switch(hwndInsertAfter) {
     
    950991               
    951992  }
    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)
    9541019//******************************************************************************
    9551020BOOL Win32Window::DestroyWindow()
    9561021{
    957   return TRUE;
     1022  return OSLibWinDestroyWindow(OS2HwndFrame);
    9581023}
    9591024//******************************************************************************
     
    10151080 HWND topchild;
    10161081
    1017   topchild = OSLibWinQueryTopMostChildWindow(OS2Hwnd);
     1082  topchild = OSLibWinQueryTopMostChildWindow(OS2HwndFrame);
    10181083  if(topchild)
    1019   {//TODO
     1084  {
    10201085        return topchild;
    10211086  }
     
    10231088}
    10241089//******************************************************************************
    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)
    10261093//******************************************************************************
    10271094BOOL Win32Window::UpdateWindow()
    10281095
     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  }
    10291102  return TRUE;
    10301103}
    10311104//******************************************************************************
    1032 //TODO
    10331105//******************************************************************************
    10341106BOOL Win32Window::IsIconic()
    10351107{
    1036   return FALSE;
     1108  return OSLibWinIsIconic(OS2HwndFrame);
    10371109}
    10381110//******************************************************************************
     
    11441216 Win32Window *window;
    11451217
    1146    if(HIWORD(hwnd) != 0x6800)
     1218   if(HIWORD(hwnd) != 0x6800) {
    11471219        return NULL;
     1220   }
    11481221
    11491222   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:09 sandervl Exp $ */
     1/* $Id: win32wnd.h,v 1.5 1999-07-17 09:17:58 sandervl Exp $ */
    22/*
    33 * Win32 Window Code for OS/2
     
    114114
    115115        HWND    OS2Hwnd;
     116        HWND    OS2HwndFrame;
    116117        HWND    OS2HwndMenu;
    117118        HWND    Win32Hwnd;
     
    132133         HWND   hwndLinkAfter;
    133134        DWORD   flags;
     135
     136        BOOL    isIcon;
    134137
    135138   Win32Window *owner;                 
Note: See TracChangeset for help on using the changeset viewer.