Changeset 1248 for trunk/src


Ignore:
Timestamp:
Oct 11, 1999, 6:04:52 PM (26 years ago)
Author:
cbratschi
Message:

pmframe finished

Location:
trunk/src/user32
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/oslibwin.cpp

    r1240 r1248  
    1 /* $Id: oslibwin.cpp,v 1.19 1999-10-10 08:59:40 sandervl Exp $ */
     1/* $Id: oslibwin.cpp,v 1.20 1999-10-11 16:04:50 cbratschi Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    6767//                dwFrameStyle |= FCF_TITLEBAR;
    6868
    69         dwFrameStyle |= FCF_TASKLIST | FCF_NOMOVEWITHOWNER | FCF_NOBYTEALIGN;
     69        dwFrameStyle |= FCF_NOBYTEALIGN;
     70        if (hwndParent == HWND_DESKTOP) dwFrameStyle |= FCF_TASKLIST | FCF_NOMOVEWITHOWNER;
    7071        dwWinStyle   &= ~WS_CLIPCHILDREN;
    7172
     
    9091//******************************************************************************
    9192//******************************************************************************
    92 BOOL OSLibWinConvertStyle(ULONG dwStyle, ULONG dwExStyle, ULONG *OSWinStyle, ULONG *OSFrameStyle, ULONG *borderWidth, ULONG *borderHeight)
     93BOOL OSLibWinConvertStyle(ULONG dwStyle, ULONG *dwExStyle, ULONG *OSWinStyle, ULONG *OSFrameStyle, ULONG *borderWidth, ULONG *borderHeight)
    9394{
    9495  *OSWinStyle   = 0;
     
    120121  if (dwStyle & WS_CHILD_W)
    121122  {
    122 //SvL: Causes crash in VPBuddy if enabled
     123//SvL: Causes crash in VPBuddy if enabled -> find bug
    123124#if 0
    124     if (dwStyle & WS_BORDER_W ||
    125         dwStyle & WS_DLGFRAME_W ||
    126         dwStyle & WS_THICKFRAME_W)
    127           if (!HAS_3DFRAME(dwExStyle)) dwExStyle |= WS_EX_WINDOWEDGE_W;
     125    if (!HAS_3DFRAME(*dwExStyle) && (dwStyle & (WS_DLGFRAME_W | WS_THICKFRAME_W))) *dwExStyle |= WS_EX_DLGMODALFRAME_W;
    128126#endif
    129127
    130     if (dwExStyle & WS_EX_CLIENTEDGE_W ||
    131         dwExStyle & WS_EX_STATICEDGE_W ||
    132         dwExStyle & WS_EX_WINDOWEDGE_W)
    133           {
    134             *OSFrameStyle |= FCF_DLGBORDER;
    135             *borderHeight = *borderWidth = 2; //CB: right?
    136           }
     128    if (*dwExStyle & WS_EX_CLIENTEDGE_W)
     129    {
     130      *OSFrameStyle |= FCF_SIZEBORDER;
     131      *borderHeight = *borderWidth = 2;
     132    } else if (*dwExStyle & WS_EX_DLGMODALFRAME_W)
     133    {
     134      *OSFrameStyle |= FCF_SIZEBORDER;
     135      *borderHeight = *borderWidth = 3;
     136    } else if (*dwExStyle & WS_EX_STATICEDGE_W)
     137    {
     138      *OSFrameStyle |= FCF_SIZEBORDER;
     139      *borderHeight = *borderWidth = 1;
     140
     141    } else if (*dwExStyle & WS_EX_WINDOWEDGE_W); //no border
     142//SvL: Causes crash in VPBuddy if enabled -> find bug
     143#if 0
     144    else if (dwStyle & WS_BORDER_W)
     145    {
     146      *OSFrameStyle |= FCF_SIZEBORDER;
     147      *borderHeight = *borderWidth = 1;
     148    }
     149#endif
     150
    137151    if(dwStyle & WS_VSCROLL_W)
    138152          *OSFrameStyle |= FCF_VERTSCROLL;
    139153    if(dwStyle & WS_HSCROLL_W)
    140154          *OSFrameStyle |= FCF_HORZSCROLL;
    141   }
    142   else
     155  } else
    143156  {
    144157    if((dwStyle & WS_CAPTION_W) == WS_CAPTION_W)
     
    164177          *OSFrameStyle |= FCF_MAXBUTTON;
    165178
    166     if(dwExStyle & WS_EX_DLGMODALFRAME_W)
     179    if(*dwExStyle & WS_EX_DLGMODALFRAME_W)
    167180          *OSFrameStyle |= FCF_DLGBORDER;
    168181  }
     
    842855void OSLibSetWindowStyle(HWND hwnd, ULONG dwStyle)
    843856{
    844   ULONG OSWinStyle, OSFrameStyle, borderWidth, borderHeight;
    845 
    846   OSLibWinConvertStyle(dwStyle, 0, &OSWinStyle, &OSFrameStyle, &borderWidth, &borderHeight);
     857  ULONG OSWinStyle, OSFrameStyle, borderWidth, borderHeight,dwExStyle;
     858
     859  OSLibWinConvertStyle(dwStyle, &dwExStyle, &OSWinStyle, &OSFrameStyle, &borderWidth, &borderHeight);
    847860
    848861  WinSetWindowULong(hwnd, QWL_STYLE,
  • trunk/src/user32/oslibwin.h

    r1189 r1248  
    1 /* $Id: oslibwin.h,v 1.12 1999-10-08 16:13:08 cbratschi Exp $ */
     1/* $Id: oslibwin.h,v 1.13 1999-10-11 16:04:51 cbratschi Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    3939                           char *pszName, HWND Owner, ULONG fHWND_BOTTOM, HWND *hwndFrame);
    4040
    41 BOOL  OSLibWinConvertStyle(ULONG dwStyle, ULONG dwExStyle, ULONG *OSWinStyle, ULONG *OSFrameStyle, ULONG *borderWidth, ULONG *borderHeight);
     41BOOL  OSLibWinConvertStyle(ULONG dwStyle, ULONG *dwExStyle, ULONG *OSWinStyle, ULONG *OSFrameStyle, ULONG *borderWidth, ULONG *borderHeight);
    4242void  OSLibSetWindowStyle(HWND hwnd, ULONG dwStyle);
    4343
  • trunk/src/user32/pmframe.cpp

    r1209 r1248  
    1 /* $Id: pmframe.cpp,v 1.3 1999-10-09 09:45:27 sandervl Exp $ */
     1/* $Id: pmframe.cpp,v 1.4 1999-10-11 16:04:51 cbratschi Exp $ */
    22/*
    33 * Win32 Frame Managment Code for OS/2
     
    2121#include "wprocess.h"
    2222#include "pmframe.h"
     23#include "oslibutil.h"
     24
     25#define PMFRAMELOG
     26
     27VOID Draw3DRect(HPS hps,RECTL rect,LONG colorBR,LONG colorTL)
     28{
     29  POINTL point;
     30
     31  GpiSetColor(hps,colorBR);
     32  point.x = rect.xLeft;
     33  point.y = rect.yBottom;
     34  GpiMove(hps,&point);
     35  point.x = rect.xRight-1;
     36  GpiLine(hps,&point);
     37  point.y = rect.yTop-1;
     38  GpiLine(hps,&point);
     39  GpiSetColor(hps,colorTL);
     40  point.x--;
     41  GpiMove(hps,&point);
     42  point.x = rect.xLeft;
     43  GpiLine(hps,&point);
     44  point.y = rect.yBottom+1;
     45  GpiLine(hps,&point);
     46}
     47
     48VOID DeflateRect(RECTL *rect)
     49{
     50  rect->xLeft++;
     51  rect->xRight--;
     52  rect->yTop--;
     53  rect->yBottom++;
     54}
     55
     56VOID DrawFrame(HPS hps,RECTL *rect,Win32BaseWindow *win32wnd)
     57{
     58  LONG clrWhite,clrBlack,clrDark,clrLight;
     59  POINTL point;
     60  DWORD dwExStyle = win32wnd->getExStyle();
     61  DWORD dwStyle = win32wnd->getStyle();
     62
     63  clrWhite = CLR_WHITE;
     64  clrBlack = CLR_BLACK;
     65  clrLight = CLR_PALEGRAY;
     66  clrDark  = CLR_DARKGRAY;
     67
     68  if (dwExStyle & WS_EX_CLIENTEDGE_W)
     69  {
     70    Draw3DRect(hps,*rect,clrWhite,clrDark);
     71    DeflateRect(rect);
     72    Draw3DRect(hps,*rect,clrLight,clrBlack);
     73  } else if (dwExStyle & WS_EX_DLGMODALFRAME_W)
     74  {
     75    Draw3DRect(hps,*rect,clrBlack,clrLight);
     76    DeflateRect(rect);
     77    Draw3DRect(hps,*rect,clrDark,clrWhite);
     78    DeflateRect(rect);
     79    Draw3DRect(hps,*rect,clrLight,clrLight);
     80  } else if (dwExStyle & WS_EX_STATICEDGE_W)
     81  {
     82    Draw3DRect(hps,*rect,clrWhite,clrDark);
     83  } else if (dwExStyle & WS_EX_WINDOWEDGE_W);
     84  else if (dwStyle & WS_BORDER_W)
     85  {
     86    Draw3DRect(hps,*rect,clrBlack,clrBlack);
     87  }
     88
     89  DeflateRect(rect);
     90}
     91
     92BOOL CanDrawSizeBox(Win32BaseWindow *win32wnd)
     93{
     94  return (!win32wnd->isChild() && WinQueryWindowULong(win32wnd->getOS2FrameWindowHandle(),QWL_STYLE) & FS_SIZEBORDER
     95          && win32wnd->getVertScrollHandle() && WinQueryWindow(win32wnd->getVertScrollHandle(),QW_PARENT) == win32wnd->getOS2FrameWindowHandle()
     96          && win32wnd->getHorzScrollHandle() && WinQueryWindow(win32wnd->getHorzScrollHandle(),QW_PARENT) == win32wnd->getOS2FrameWindowHandle());
     97}
     98
     99VOID GetSizeBox(Win32BaseWindow *win32wnd,RECTL *rect)
     100{
     101  SWP swpHorz,swpVert;
     102
     103  WinQueryWindowPos(win32wnd->getVertScrollHandle(),&swpVert);
     104  WinQueryWindowPos(win32wnd->getHorzScrollHandle(),&swpHorz);
     105  rect->xLeft = swpVert.x;
     106  rect->xRight = swpVert.x+swpVert.cx;
     107  rect->yTop = swpHorz.y+swpHorz.cy;
     108  rect->yBottom = swpHorz.y;
     109}
     110
     111BOOL InSizeBox(Win32BaseWindow *win32wnd,POINTS *points)
     112{
     113  if (CanDrawSizeBox(win32wnd))
     114  {
     115    RECTL rect;
     116    POINTL point;
     117
     118    point.x = points->x;
     119    point.y = points->y;
     120    GetSizeBox(win32wnd,&rect);
     121    return (WinPtInRect(GetThreadHAB(),&rect,&point));
     122  }
     123
     124  return FALSE;
     125}
     126
     127VOID DrawSizeBox(HPS hps,RECTL rect)
     128{
     129  POINTL p1,p2;
     130  LONG clrDark = CLR_DARKGRAY,clrWhite = CLR_WHITE;
     131  INT x;
     132
     133  WinFillRect(hps,&rect,SYSCLR_DIALOGBACKGROUND);
     134  p1.x = rect.xRight-2;
     135  p1.y = rect.yBottom;
     136  p2.x = rect.xRight-1;
     137  p2.y = rect.yBottom+1;
     138  for (x = 0;x < 3;x++)
     139  {
     140    GpiSetColor(hps,clrDark);
     141    GpiMove(hps,&p1);
     142    GpiLine(hps,&p2);
     143    p1.x--;
     144    p2.y++;
     145    GpiMove(hps,&p1);
     146    GpiLine(hps,&p2);
     147    GpiSetColor(hps,clrWhite);
     148    p1.x--;
     149    p2.y++;
     150    GpiMove(hps,&p1);
     151    GpiLine(hps,&p2);
     152    p1.x -= 2;
     153    p2.y += 2;
     154  }
     155}
    23156
    24157//******************************************************************************
     
    45178  {
    46179    case WM_DESTROY:
     180      #ifdef PMFRAMELOG
     181       dprintf(("PMFRAME: WM_DESTROY"));
     182      #endif
    47183      WinSubclassWindow(hwnd,OldFrameProc);
    48184      win32wnd->setOldFrameProc(NULL);
    49185      goto RunDefFrameProc;
    50186
     187    case WM_MOUSEMOVE:
     188      #ifdef PMFRAMELOG
     189       dprintf(("PMFRAME: WM_MOUSEMOVE"));
     190      #endif
     191      if (InSizeBox(win32wnd,(POINTS*)&mp1))
     192      {
     193        WinSetPointer(HWND_DESKTOP,WinQuerySysPointer(HWND_DESKTOP,SPTR_SIZENWSE,FALSE));
     194        RestoreOS2TIB();
     195        return (MRESULT)TRUE;
     196      } else if (win32wnd->isChild()) goto RunDefWndProc;
     197      else goto RunDefFrameProc;
     198
     199    case WM_BUTTON1DOWN:
     200      #ifdef PMFRAMELOG
     201       dprintf(("PMFRAME: WM_BUTTON1DOWN"));
     202      #endif
     203      if (InSizeBox(win32wnd,(POINTS*)&mp1))
     204      {
     205        WinSendMsg(hwnd,WM_TRACKFRAME,(MPARAM)(TF_RIGHT | TF_BOTTOM),(MPARAM)0);
     206        RestoreOS2TIB();
     207        return (MRESULT)TRUE;
     208      } else if (win32wnd->isChild()) goto RunDefWndProc;
     209      else goto RunDefFrameProc;
     210
     211    case WM_BUTTON2DOWN:
     212    case WM_BUTTON3DOWN:
     213      #ifdef PMFRAMELOG
     214       dprintf(("PMFRAME: WM_BUTTON2/3DOWN"));
     215      #endif
     216      if (win32wnd->isChild()) goto RunDefWndProc;
     217      else goto RunDefFrameProc;
     218
     219    case WM_ACTIVATE:
     220      #ifdef PMFRAMELOG
     221       dprintf(("PMFRAME: WM_ACTIVATE"));
     222      #endif
     223      if (!win32wnd->isChild())
     224      {
     225        if (CanDrawSizeBox(win32wnd))
     226        {
     227          MRESULT res;
     228          HPS hps;
     229          RECTL rect;
     230
     231          RestoreOS2TIB();
     232          res = OldFrameProc(hwnd,msg,mp1,mp2);
     233          SetWin32TIB();
     234
     235          GetSizeBox(win32wnd,&rect);
     236          hps = WinGetPS(hwnd);
     237          DrawSizeBox(hps,rect);
     238          WinReleasePS(hps);
     239
     240          RestoreOS2TIB();
     241          return res;
     242        } else goto RunDefFrameProc;
     243      } else
     244      {
     245        MRESULT res;
     246        HPS hps;
     247        RECTL rect;
     248
     249        RestoreOS2TIB();
     250        res = OldFrameProc(hwnd,msg,mp1,mp2);
     251        SetWin32TIB();
     252
     253        hps = WinGetClipPS(hwnd,0,PSF_CLIPCHILDREN);
     254        WinQueryWindowRect(hwnd,&rect);
     255        DrawFrame(hps,&rect,win32wnd);
     256        WinFillRect(hps,&rect,SYSCLR_DIALOGBACKGROUND);
     257        WinReleasePS(hps);
     258
     259        RestoreOS2TIB();
     260        return res;
     261      }
     262
    51263    case WM_PAINT:
    52       //CB: todo
     264      #ifdef PMFRAMELOG
     265       dprintf(("PMFRAME: WM_PAINT"));
     266      #endif
     267      if (!win32wnd->isChild())
     268      {
     269        if (CanDrawSizeBox(win32wnd))
     270        {
     271          MRESULT res;
     272          HPS hps;
     273          RECTL rect;
     274
     275          RestoreOS2TIB();
     276          res = OldFrameProc(hwnd,msg,mp1,mp2);
     277          SetWin32TIB();
     278
     279          GetSizeBox(win32wnd,&rect);
     280          hps = WinGetPS(hwnd);
     281          DrawSizeBox(hps,rect);
     282          WinReleasePS(hps);
     283
     284          RestoreOS2TIB();
     285          return res;
     286        } else goto RunDefFrameProc;
     287      } else
     288      {
     289        RECTL rect;
     290        HPS hps = WinBeginPaint(hwnd,0,&rect);
     291
     292        DrawFrame(hps,&rect,win32wnd);
     293        WinFillRect(hps,&rect,SYSCLR_DIALOGBACKGROUND);
     294        WinEndPaint(hps);
     295
     296        RestoreOS2TIB();
     297        return (MRESULT)0;
     298      }
    53299
    54300    default:
     
    74320}
    75321
    76 VOID FrameSetBorderSize(Win32BaseWindow *win32wnd)
    77 {
     322VOID FrameGetBorderSize(Win32BaseWindow *win32wnd,PWPOINT pSize)
     323{
     324  WinSendMsg(win32wnd->getOS2FrameWindowHandle(),WM_QUERYBORDERSIZE,(MPARAM)pSize,(MPARAM)0);
     325}
     326
     327VOID FrameSetBorderSize(Win32BaseWindow *win32wnd,BOOL resize)
     328{
     329  POINTL point;
     330
     331  if (!resize)
     332  {
     333    WinSendMsg(win32wnd->getOS2FrameWindowHandle(),WM_SETBORDERSIZE,(MPARAM)win32wnd->getBorderWidth(),(MPARAM)win32wnd->getBorderHeight());
     334
     335    return;
     336  }
     337
     338  FrameGetBorderSize(win32wnd,&point);
    78339  WinSendMsg(win32wnd->getOS2FrameWindowHandle(),WM_SETBORDERSIZE,(MPARAM)win32wnd->getBorderWidth(),(MPARAM)win32wnd->getBorderHeight());
    79 }
     340  if (point.x != win32wnd->getBorderWidth() || point.y != win32wnd->getBorderHeight())
     341  {
     342    INT xDiff = win32wnd->getBorderWidth()-point.x;
     343    INT yDiff = win32wnd->getBorderHeight()-point.y;
     344    SWP swp;
     345
     346    WinQueryWindowPos(win32wnd->getOS2FrameWindowHandle(),&swp);
     347    swp.x  += xDiff;
     348    swp.y  += yDiff;
     349    swp.cx -= 2*xDiff;
     350    swp.cy -= 2*yDiff;
     351    WinSetWindowPos(win32wnd->getOS2FrameWindowHandle(),0,swp.x,swp.y,swp.cx,swp.cy,SWP_MOVE | SWP_SIZE);
     352  }
     353}
     354
     355UINT FrameGetDefSizeBorderSize(VOID)
     356{
     357  return WinQuerySysValue(HWND_DESKTOP,SV_CXSIZEBORDER);
     358}
  • trunk/src/user32/pmframe.h

    r1189 r1248  
    1 /* $Id: pmframe.h,v 1.1 1999-10-08 16:13:08 cbratschi Exp $ */
     1/* $Id: pmframe.h,v 1.2 1999-10-11 16:04:51 cbratschi Exp $ */
    22/*
    33 * Win32 Frame Managment Code for OS/2
     
    1010
    1111PVOID FrameSubclassFrameWindow(Win32BaseWindow *win32wnd);
    12 VOID  FrameSetBorderSize(Win32BaseWindow *win32wnd);
     12VOID  FrameSetBorderSize(Win32BaseWindow *win32wnd,BOOL resize);
     13UINT  FrameGetDefSizeBorderSize(VOID);
    1314
    1415#endif
  • trunk/src/user32/win32dlg.cpp

    r1240 r1248  
    1 /* $Id: win32dlg.cpp,v 1.9 1999-10-10 08:59:41 sandervl Exp $ */
     1/* $Id: win32dlg.cpp,v 1.10 1999-10-11 16:04:51 cbratschi Exp $ */
    22/*
    33 * Win32 Dialog Code for OS/2
     
    10601060        if (nextchild == child) break;
    10611061
    1062             if ((nextchild->getStyle() & WS_VISIBLE) && !(nextchild->getStyle() & WS_DISABLED))
    1063             {
    1064                 lastchild = nextchild;
    1065             if (!fPrevious) break;
    1066         }
     1062            if ((nextchild->getStyle() & WS_VISIBLE) && !(nextchild->getStyle() & WS_DISABLED))
     1063            {
     1064                lastchild = nextchild;
     1065            if (!fPrevious) break;
     1066        }
    10671067    }
    10681068    retvalue = lastchild->getWindowHandle();
  • trunk/src/user32/win32wbase.cpp

    r1245 r1248  
    1 /* $Id: win32wbase.cpp,v 1.34 1999-10-11 15:26:05 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.35 1999-10-11 16:04:51 cbratschi Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    432432  DWORD dwOSWinStyle, dwOSFrameStyle;
    433433
    434   OSLibWinConvertStyle(cs->style, cs->dwExStyle, &dwOSWinStyle, &dwOSFrameStyle, &borderWidth, &borderHeight);
     434  OSLibWinConvertStyle(cs->style, &cs->dwExStyle, &dwOSWinStyle, &dwOSFrameStyle, &borderWidth, &borderHeight);
     435  dwExStyle = cs->dwExStyle;
    435436
    436437//CB: dwOSFrameStyle handled by OSLibWinConvertStyle
     
    532533                     rectClient.right-rectClient.left,
    533534                     rectClient.bottom-rectClient.top,
    534                      SWP_NOACTIVATE | SWP_NOZORDER);
     535                     SWP_NOACTIVATE | SWP_NOZORDER );
    535536  }
    536537  else {
     
    540541                     SWP_NOACTIVATE);
    541542  }
     543
    542544  //Subclass frame
    543 
    544545  if (isFrameWindow())
    545546  {
    546547    pOldFrameProc = FrameSubclassFrameWindow(this);
    547     if (dwStyle & WS_CHILD && HAS_3DFRAME(dwExStyle)) FrameSetBorderSize(this);
     548    if (isChild()) FrameSetBorderSize(this,TRUE);
    548549  }
    549550
     
    14561457    if( ctlType == CTLCOLOR_SCROLLBAR)
    14571458    {
    1458             HBRUSH hb = GetSysColorBrush(COLOR_SCROLLBAR);
     1459            HBRUSH hb = GetSysColorBrush(COLOR_SCROLLBAR);
    14591460        COLORREF bk = GetSysColor(COLOR_3DHILIGHT);
    14601461        SetTextColor( hdc, GetSysColor(COLOR_3DFACE));
     
    14711472        }
    14721473#endif
    1473         UnrealizeObject( hb );
     1474        UnrealizeObject( hb );
    14741475        return (LRESULT)hb;
    14751476    }
     
    14771478    SetTextColor( hdc, GetSysColor(COLOR_WINDOWTEXT));
    14781479
    1479         if ((ctlType == CTLCOLOR_EDIT) || (ctlType == CTLCOLOR_LISTBOX))
    1480         {
    1481             SetBkColor( hdc, GetSysColor(COLOR_WINDOW) );
    1482         }
    1483         else
    1484         {
    1485             SetBkColor( hdc, GetSysColor(COLOR_3DFACE) );
    1486             return (LRESULT)GetSysColorBrush(COLOR_3DFACE);
    1487         }
     1480        if ((ctlType == CTLCOLOR_EDIT) || (ctlType == CTLCOLOR_LISTBOX))
     1481        {
     1482            SetBkColor( hdc, GetSysColor(COLOR_WINDOW) );
     1483        }
     1484        else
     1485        {
     1486            SetBkColor( hdc, GetSysColor(COLOR_3DFACE) );
     1487            return (LRESULT)GetSysColorBrush(COLOR_3DFACE);
     1488        }
    14881489    return (LRESULT)GetSysColorBrush(COLOR_WINDOW);
    14891490}
     
    15311532
    15321533    case WM_CTLCOLOR:
    1533             return DefWndControlColor(HIWORD(lParam), (HDC)wParam);
     1534            return DefWndControlColor(HIWORD(lParam), (HDC)wParam);
    15341535
    15351536    case WM_VKEYTOITEM:
    15361537    case WM_CHARTOITEM:
    1537              return -1;
     1538             return -1;
    15381539
    15391540    case WM_PARENTNOTIFY:
     
    19671968    dprintf(("ShowWindow %x", nCmdShow));
    19681969    if(fFirstShow) {
    1969         if(isFrameWindow() && IS_OVERLAPPED(getStyle())) {
     1970        if(isFrameWindow() && IS_OVERLAPPED(getStyle()) && !isChild()) {
    19701971                SendMessageA(WM_SIZE, SIZE_RESTORED,
    19711972                                MAKELONG(rectClient.right-rectClient.left,
     
    20472048       {
    20482049           hParent = getParent()->getOS2WindowHandle();
    2049            OSLibWinQueryWindowPos(OS2Hwnd, &swpOld);
     2050           OSLibWinQueryWindowPos(isFrameWindow() ? OS2HwndFrame:OS2Hwnd, &swpOld);
    20502051       }
    20512052       else
     
    20642065   if (isFrameWindow())
    20652066   {
    2066       POINT maxSize, maxPos, minTrack, maxTrack;
    2067 
    2068       GetMinMaxInfo(&maxSize, &maxPos, &minTrack, &maxTrack);
    2069 
    2070       if (swp.cx > maxTrack.x) swp.cx = maxTrack.x;
    2071       if (swp.cy > maxTrack.y) swp.cy = maxTrack.y;
    2072       if (swp.cx < minTrack.x) swp.cx = minTrack.x;
    2073       if (swp.cy < minTrack.y) swp.cy = minTrack.y;
     2067      if (!isChild())
     2068      {
     2069        POINT maxSize, maxPos, minTrack, maxTrack;
     2070
     2071        GetMinMaxInfo(&maxSize, &maxPos, &minTrack, &maxTrack);
     2072
     2073        if (swp.cx > maxTrack.x) swp.cx = maxTrack.x;
     2074        if (swp.cy > maxTrack.y) swp.cy = maxTrack.y;
     2075        if (swp.cx < minTrack.x) swp.cx = minTrack.x;
     2076        if (swp.cy < minTrack.y) swp.cy = minTrack.y;
     2077      }
    20742078
    20752079      swp.hwnd = OS2HwndFrame;
     
    26022606Win32BaseWindow *Win32BaseWindow::GetWindowFromOS2FrameHandle(HWND hwnd)
    26032607{
    2604  Win32BaseWindow *win32wnd;
    2605  DWORD        magic;
    2606 
    26072608  return GetWindowFromOS2Handle(OSLibWinWindowFromID(hwnd,OSLIB_FID_CLIENT));
    2608 
    2609   //CB: doesn't work with frame window words
    2610 /*
    2611   win32wnd = (Win32BaseWindow *)OSLibWinGetWindowULong(hwnd, OFFSET_WIN32WNDPTR);
    2612   magic    = OSLibWinGetWindowULong(hwnd, OFFSET_WIN32PM_MAGIC);
    2613 
    2614   if(win32wnd && CheckMagicDword(magic)) {
    2615         return win32wnd;
    2616   }
    2617   return 0;
    2618 */
    26192609}
    26202610//******************************************************************************
     
    26462636//******************************************************************************
    26472637//******************************************************************************
     2638
    26482639GenericObject *Win32BaseWindow::windows  = NULL;
  • trunk/src/user32/win32wbase.h

    r1245 r1248  
    1 /* $Id: win32wbase.h,v 1.17 1999-10-11 15:26:06 sandervl Exp $ */
     1/* $Id: win32wbase.h,v 1.18 1999-10-11 16:04:52 cbratschi Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    205205       PVOID getOldFrameProc() { return pOldFrameProc; };
    206206       VOID  setOldFrameProc(PVOID aOldFrameProc) { pOldFrameProc = aOldFrameProc; };
    207        ULONG   getBorderWidth() { return borderWidth; };
    208        ULONG   getBorderHeight() { return borderHeight; };
     207       ULONG getBorderWidth() { return borderWidth; };
     208       ULONG getBorderHeight() { return borderHeight; };
    209209
    210210protected:
  • trunk/src/user32/windlg.cpp

    r1240 r1248  
    1 /* $Id: windlg.cpp,v 1.4 1999-10-10 08:59:41 sandervl Exp $ */
     1/* $Id: windlg.cpp,v 1.5 1999-10-11 16:04:52 cbratschi Exp $ */
    22/*
    33 * Win32 dialog apis for OS/2
     
    214214    if(!dialog || !dialog->IsDialog()) {
    215215        dprintf(("GetNextDlgTabItem, window %x not found", hwndDlg));
    216         SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     216        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    217217        return 0;
    218218    }
     
    230230    if(!dialog || !dialog->IsDialog()) {
    231231        dprintf(("GetDlgItem, window %x not found", hwnd));
    232         SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     232        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    233233        return 0;
    234234    }
     
    249249    if(!dlgcontrol) {
    250250        dprintf(("GetDlgCtrlID, control %x not found", hwnd));
    251         SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     251        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    252252        return 0;
    253253    }
     
    264264    if(!dialog || !dialog->IsDialog()) {
    265265        dprintf(("GetDlgItem, window %x not found", hwnd));
    266         SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     266        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    267267        return 0;
    268268    }
     
    357357    if(!dialog || !dialog->IsDialog()) {
    358358        dprintf(("GetNextDlgGroupItem, window %x not found", hwnd));
    359         SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     359        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    360360        return 0;
    361361    }
Note: See TracChangeset for help on using the changeset viewer.