Changeset 2099 for trunk/src


Ignore:
Timestamp:
Dec 17, 1999, 6:18:04 PM (26 years ago)
Author:
cbratschi
Message:

MDI cascade/tile, WM_PARENTNOTIFY cursor pos mapping, free timers after WM_DESTROY

Location:
trunk/src/user32
Files:
6 edited

Legend:

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

    r1418 r2099  
    1 /* $Id: timer.cpp,v 1.6 1999-10-23 16:45:21 cbratschi Exp $ */
     1/* $Id: timer.cpp,v 1.7 1999-12-17 17:18:03 cbratschi Exp $ */
    22
    33/*
     
    184184    WinStopTimer (GetThreadHAB(), pTimer->PMhwnd, pTimer->PMid);
    185185
     186    pTimer->inUse   = TIMER::free;
     187    pTimer->PMhwnd  = 0;
     188    pTimer->PMid    = 0;
     189
    186190    LeaveCriticalSection();
    187191
     
    189193}
    190194
     195VOID TIMER_KillTimerFromWindow(HWND hwnd)
     196{
     197    Win32BaseWindow *wnd = Win32BaseWindow::GetWindowFromHandle(hwnd);
     198    int i;
     199    TIMER * pTimer;
     200
     201    if (hwnd && !wnd) return;
     202
     203    EnterCriticalSection();
     204
     205    for (i = 0, pTimer = TimersArray; i < NB_TIMERS; i++, pTimer++)
     206      if (pTimer->inUse && pTimer->hwnd == hwnd)
     207      {
     208        pTimer->inUse   = TIMER::free;
     209        pTimer->PMhwnd  = 0;
     210        pTimer->PMid    = 0;
     211      }
     212
     213    LeaveCriticalSection();
     214}
     215
    191216/***********************************************************************
    192217 *           SetTimer32   (USER32.511)
  • trunk/src/user32/timer.h

    r1418 r2099  
    1 /* $Id: timer.h,v 1.2 1999-10-23 16:45:22 cbratschi Exp $ */
     1/* $Id: timer.h,v 1.3 1999-12-17 17:18:03 cbratschi Exp $ */
    22/*
    33 * public timer functions
     
    1313#define __TIMER_H__
    1414
     15#ifndef INCL_TIMERWIN32
    1516extern BOOL TIMER_GetTimerInfo(HWND PMhwnd,ULONG PMid,PBOOL sys,PULONG id);
    1617extern BOOL TIMER_HandleTimer (PQMSG pMsg);
     18#endif
     19extern VOID TIMER_KillTimerFromWindow(HWND hwnd);
    1720
    1821#endif //__TIMER_H__
  • trunk/src/user32/win32wbase.cpp

    r2089 r2099  
    1 /* $Id: win32wbase.cpp,v 1.112 1999-12-16 00:47:21 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.113 1999-12-17 17:18:03 cbratschi Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    4242#include "winmouse.h"
    4343#include <win\hook.h>
     44#define INCL_TIMERWIN32
     45#include "timer.h"
    4446
    4547#define HAS_DLGFRAME(style,exStyle) \
     
    807809    SendInternalMessageA(WM_DESTROY, 0, 0);
    808810    if(::IsWindow(hwnd) == FALSE) {
    809         //object already destroyed, so return immediately
    810         return 1;
     811        //object already destroyed, so return immediately
     812        return 1;
    811813    }
    812814    SendInternalMessageA(WM_NCDESTROY, 0, 0);
     
    814816    if (hwndHorzScroll && OSLibWinQueryWindow(hwndHorzScroll,QWOS_PARENT) == OSLibWinQueryObjectWindow()) OSLibWinDestroyWindow(hwndHorzScroll);
    815817    if (hwndVertScroll && OSLibWinQueryWindow(hwndVertScroll,QWOS_PARENT) == OSLibWinQueryObjectWindow()) OSLibWinDestroyWindow(hwndVertScroll);
     818
     819    TIMER_KillTimerFromWindow(OS2Hwnd);
    816820
    817821    if(getFirstChild() == NULL) {
     
    19891993        case WM_MBUTTONDOWN:
    19901994        case WM_RBUTTONDOWN:
    1991                 NotifyParent(Msg, wParam, lParam);
     1995        {
     1996                if (getParent())
     1997                {
     1998                  POINTS pt = MAKEPOINTS(lParam);
     1999                  POINT point;
     2000
     2001                  point.x = pt.x;
     2002                  point.y = pt.y;
     2003                  MapWindowPoints(getParent()->getWindowHandle(),Win32Hwnd,&point,1);
     2004                  NotifyParent(Msg,wParam,MAKELPARAM(point.x,point.y));
     2005                }
    19922006                rc = win32wndproc(getWindowHandle(), Msg, wParam, lParam);
    19932007                break;
     2008        }
    19942009
    19952010        case WM_DESTROY:
  • trunk/src/user32/win32wmdichild.cpp

    r2084 r2099  
    1 /* $Id: win32wmdichild.cpp,v 1.12 1999-12-16 00:11:48 sandervl Exp $ */
     1/* $Id: win32wmdichild.cpp,v 1.13 1999-12-17 17:18:04 cbratschi Exp $ */
    22/*
    33 * Win32 MDI Child Window Class for OS/2
     
    294294
    295295    /* calculate placement */
    296     calcDefaultChildPos(client, client->incTotalCreated(), pos, 0);
     296    calcDefaultChildPos(client, client->incTotalCreated()-1, pos, 0);
    297297
    298298    if (cs->cx == CW_USEDEFAULT || !cs->cx) cs->cx = pos[1].x;
  • trunk/src/user32/win32wmdiclient.cpp

    r2084 r2099  
    1 /* $Id: win32wmdiclient.cpp,v 1.14 1999-12-16 00:11:48 sandervl Exp $ */
     1/* $Id: win32wmdiclient.cpp,v 1.15 1999-12-17 17:18:04 cbratschi Exp $ */
    22/*
    33 * Win32 MDI Client Window Class for OS/2
     
    1717#include <win.h>
    1818#include <stdlib.h>
     19#include <math.h>
    1920#include <string.h>
    2021#include <stdarg.h>
     
    131132        goto END;
    132133
    133 #if 0
    134134    case WM_MDICASCADE:
    135         retvalue = MDICascade(w, ci);
    136         goto END;
    137 #endif
     135        retvalue = cascade(wParam);
     136        goto END;
    138137
    139138    case WM_MDICREATE:
     
    159158        goto END;
    160159
    161 #if 0
    162160    case WM_MDIICONARRANGE:
    163161        mdiFlags |= MDIF_NEEDUPDATE;
    164         ArrangeIconicWindows(hwnd);
     162        ArrangeIconicWindows(Win32Hwnd);
    165163        sbRecalc = SB_BOTH+1;
    166         SendMessageA(hwnd, WM_MDICALCCHILDSCROLL, 0, 0L);
     164        SendMessageA(WM_MDICALCCHILDSCROLL,0,0L);
    167165        retvalue = 0;
    168166        goto END;
    169 #endif
    170167
    171168    case WM_MDIMAXIMIZE:
     
    193190        goto END;
    194191
    195 #if 0
    196192    case WM_MDITILE:
    197193        mdiFlags |= MDIF_NEEDUPDATE;
    198         ShowScrollBar(hwnd,SB_BOTH,FALSE);
    199         MDITile(w, ci, wParam);
     194        ShowScrollBar(Win32Hwnd,SB_BOTH,FALSE);
     195        tile(wParam);
    200196        mdiFlags &= ~MDIF_NEEDUPDATE;
    201197        retvalue = 0;
     
    205201    case WM_HSCROLL:
    206202        mdiFlags |= MDIF_NEEDUPDATE;
    207         ScrollChildren(hwnd, message, wParam, lParam);
     203        ScrollChildren(Win32Hwnd, message, wParam, lParam);
    208204        mdiFlags &= ~MDIF_NEEDUPDATE;
    209205        retvalue = 0;
    210206        goto END;
    211 #endif
    212207
    213208    case WM_SETFOCUS:
     
    258253        break;
    259254
    260 #if 0
    261255    case WM_MDICALCCHILDSCROLL:
    262256        if( (mdiFlags & MDIF_NEEDUPDATE) && sbRecalc )
    263257        {
    264             CalcChildScroll(hwnd, sbRecalc-1);
     258            CalcChildScroll(Win32Hwnd, sbRecalc-1);
    265259            sbRecalc = 0;
    266260            mdiFlags &= ~MDIF_NEEDUPDATE;
     
    268262        retvalue = 0;
    269263        goto END;
    270 #endif
    271264    }
    272265    retvalue = DefWindowProcA(message, wParam, lParam );
     
    649642}
    650643
     644Win32BaseWindow** Win32MDIClientWindow::buildWindowArray(UINT bwaFlags,PUINT total)
     645{
     646  Win32BaseWindow **list = NULL,*win32wnd,**pos;
     647  UINT skipHidden;
     648  DWORD skipFlags;
     649
     650  skipHidden = bwaFlags & BWA_SKIPHIDDEN;
     651  skipFlags = (bwaFlags & BWA_SKIPDISABLED) ? WS_DISABLED : 0;
     652  if (bwaFlags & BWA_SKIPICONIC) skipFlags |= WS_MINIMIZE;
     653
     654  /* First count the windows */
     655  *total = 0;
     656  win32wnd = (Win32BaseWindow*)this->getFirstChild();
     657  while (win32wnd)
     658  {
     659    if (!(win32wnd->getStyle() & skipFlags) && (!skipHidden || (win32wnd->getStyle() & WS_VISIBLE)))
     660          (*total)++;
     661    win32wnd = (Win32BaseWindow*)win32wnd->getNextChild();
     662  }
     663
     664  if (*total)
     665  {
     666    /* Now build the list of all windows */
     667    list = (Win32BaseWindow**)HeapAlloc(GetProcessHeap(),0,sizeof(Win32BaseWindow*)*(*total+1));
     668    if (list)
     669    {
     670      for (win32wnd = (Win32BaseWindow*)this->getFirstChild(),pos = list;win32wnd;win32wnd = (Win32BaseWindow*)win32wnd->getNextChild())
     671      {
     672        if ((win32wnd->getStyle() & skipFlags));
     673        else if(!skipHidden || win32wnd->getStyle() & WS_VISIBLE)
     674          *pos++ = win32wnd;
     675      }
     676      *pos = NULL;
     677    }
     678  }
     679
     680  return list;
     681}
     682
     683void Win32MDIClientWindow::releaseWindowArray(Win32BaseWindow **wndArray)
     684{
     685  HeapFree(GetProcessHeap(),0,wndArray);
     686}
     687
     688/**********************************************************************
     689 *                      MDI_CalcDefaultChildPos
     690 *
     691 *  It seems that the default height is about 2/3 of the client rect
     692 */
     693void Win32MDIClientWindow::calcDefaultChildPos(WORD n,LPPOINT lpPos,INT delta)
     694{
     695    INT  nstagger;
     696    RECT rect = *this->getClientRect();
     697    INT  spacing = GetSystemMetrics(SM_CYCAPTION) +
     698                     GetSystemMetrics(SM_CYFRAME) - 1;
     699
     700    if( rect.bottom - rect.top - delta >= spacing )
     701        rect.bottom -= delta;
     702
     703    nstagger = (rect.bottom - rect.top)/(3 * spacing);
     704    lpPos[1].x = (rect.right - rect.left - nstagger * spacing);
     705    lpPos[1].y = (rect.bottom - rect.top - nstagger * spacing);
     706    lpPos[0].x = lpPos[0].y = spacing * (n%(nstagger+1));
     707}
     708
     709/**********************************************************************
     710 *              MDICascade
     711 */
     712BOOL Win32MDIClientWindow::cascade(UINT fuCascade)
     713{
     714  Win32BaseWindow **list;
     715  UINT total = 0;
     716
     717  if (getMaximizedChild())
     718    SendInternalMessageA(WM_MDIRESTORE, (WPARAM)getMaximizedChild()->getWindowHandle(), 0);
     719
     720  if (nActiveChildren == 0) return 0;
     721
     722  list = buildWindowArray(BWA_SKIPHIDDEN | BWA_SKIPOWNED | BWA_SKIPICONIC,&total);
     723  if (list)
     724  {
     725    Win32BaseWindow** heapPtr = list;
     726    if (total)
     727    {
     728      INT delta = 0,n = 0;
     729      POINT pos[2];
     730
     731
     732      if (total < nActiveChildren)
     733        delta = GetSystemMetrics(SM_CYICONSPACING)+GetSystemMetrics(SM_CYICON);
     734
     735      // walk the list (backwards) and move windows
     736      while (*list) list++;
     737      while (list != heapPtr)
     738      {
     739        list--;
     740
     741        calcDefaultChildPos(n++,pos,delta);
     742        ::SetWindowPos((*list)->getWindowHandle(),0,pos[0].x,pos[0].y,pos[1].x,pos[1].y,SWP_DRAWFRAME | SWP_NOACTIVATE | SWP_NOZORDER);
     743      }
     744    }
     745    releaseWindowArray(heapPtr);
     746  }
     747
     748  if (total < nActiveChildren)
     749    ArrangeIconicWindows(Win32Hwnd);
     750
     751  return TRUE;
     752}
     753
     754/**********************************************************************
     755 *                  MDITile
     756 */
     757BOOL Win32MDIClientWindow::tile(UINT fuTile)
     758{
     759  Win32BaseWindow** list;
     760  UINT total = 0;
     761
     762  if (getMaximizedChild())
     763    SendInternalMessageA(WM_MDIRESTORE, (WPARAM)getMaximizedChild()->getWindowHandle(), 0);
     764
     765  if (nActiveChildren == 0) return TRUE;
     766
     767  list = buildWindowArray(BWA_SKIPHIDDEN | BWA_SKIPOWNED | BWA_SKIPICONIC |
     768          ((fuTile & MDITILE_SKIPDISABLED)? BWA_SKIPDISABLED : 0), &total );
     769
     770  if (list)
     771  {
     772    Win32BaseWindow** heapPtr = list;
     773
     774    if (total)
     775    {
     776      RECT    rect;
     777      int     x, y, xsize, ysize;
     778      int     rows, columns, r, c, i;
     779
     780      GetClientRect(Win32Hwnd,&rect);
     781      rows    = (int) sqrt((double)total);
     782      columns = total / rows;
     783
     784      if( fuTile & MDITILE_HORIZONTAL )  // version >= 3.1
     785      {
     786        i = rows;
     787        rows = columns;  // exchange r and c
     788        columns = i;
     789      }
     790
     791      if( total != nActiveChildren)
     792      {
     793        y = rect.bottom - 2 * GetSystemMetrics(SM_CYICONSPACING) - GetSystemMetrics(SM_CYICON);
     794        rect.bottom = ( y - GetSystemMetrics(SM_CYICON) < rect.top )? rect.bottom: y;
     795      }
     796
     797      ysize   = rect.bottom / rows;
     798      xsize   = rect.right  / columns;
     799
     800      for (x = i = 0, c = 1; c <= columns && *list; c++)
     801      {
     802        if (c == columns)
     803        {
     804          rows  = total - i;
     805          ysize = rect.bottom / rows;
     806        }
     807
     808        y = 0;
     809        for (r = 1; r <= rows && *list; r++, i++)
     810        {
     811          ::SetWindowPos((*list)->getWindowHandle(), 0, x, y, xsize, ysize,
     812                         SWP_DRAWFRAME | SWP_NOACTIVATE | SWP_NOZORDER);
     813          y += ysize;
     814          list++;
     815        }
     816        x += xsize;
     817      }
     818    }
     819    releaseWindowArray(heapPtr);
     820  }
     821
     822  if( total < nActiveChildren ) ArrangeIconicWindows(Win32Hwnd);
     823
     824  return TRUE;
     825}
    651826#if 0
    652 /**********************************************************************
    653  *              MDICascade
    654  */
    655 LONG Win32MDIClientWindow::cascade()
    656 {
    657     WND**   ppWnd;
    658     UINT    total;
    659 
    660     if (getMaximizedChild())
    661         SendInternalMessageA(WM_MDIRESTORE, (WPARAM)getMaximizedChild()->getWindowHandle(), 0);
    662 
    663     if (nActiveChildren == 0) return 0;
    664 
    665     if ((ppWnd = WIN_BuildWinArray(clientWnd, BWA_SKIPHIDDEN | BWA_SKIPOWNED |
    666                           BWA_SKIPICONIC, &total)))
    667     {
    668         WND**   heapPtr = ppWnd;
    669         if( total )
    670         {
    671             INT delta = 0, n = 0;
    672             POINT   pos[2];
    673             if( total < ci->nActiveChildren )
    674                 delta = GetSystemMetrics(SM_CYICONSPACING) +
    675             GetSystemMetrics(SM_CYICON);
    676 
    677             /* walk the list (backwards) and move windows */
    678             while (*ppWnd) ppWnd++;
    679                 while (ppWnd != heapPtr)
    680                 {
    681                     ppWnd--;
    682 
    683                     MDI_CalcDefaultChildPos(clientWnd, n++, pos, delta);
    684                     SetWindowPos( (*ppWnd)->hwndSelf, 0, pos[0].x, pos[0].y,
    685                                 pos[1].x, pos[1].y,
    686                                 SWP_DRAWFRAME | SWP_NOACTIVATE | SWP_NOZORDER);
    687                 }
    688         }
    689         WIN_ReleaseWinArray(heapPtr);
    690     }
    691 
    692     if( total < ci->nActiveChildren )
    693         ArrangeIconicWindows( clientWnd->hwndSelf );
    694 
    695     return 0;
    696 }
    697 
    698 /**********************************************************************
    699  *                  MDITile
    700  */
    701 void Win32MDIClientWindow::MDITile(WPARAM wParam )
    702 {
    703     WND**   ppWnd;
    704     UINT    total = 0;
    705 
    706     if (getMaximizedChild())
    707         SendInternalMessageA(WM_MDIRESTORE, (WPARAM)getMaximizedChild()->getWindowHandle(), 0);
    708 
    709     if (nActiveChildren == 0) return;
    710 
    711     ppWnd = WIN_BuildWinArray(wndClient, BWA_SKIPHIDDEN | BWA_SKIPOWNED | BWA_SKIPICONIC |
    712             ((wParam & MDITILE_SKIPDISABLED)? BWA_SKIPDISABLED : 0), &total );
    713 
    714     TRACE("%u windows to tile\n", total);
    715 
    716     if( ppWnd )
    717     {
    718         WND**   heapPtr = ppWnd;
    719 
    720         if( total )
    721         {
    722             RECT    rect;
    723             int     x, y, xsize, ysize;
    724             int     rows, columns, r, c, i;
    725 
    726             GetClientRect(wndClient->hwndSelf,&rect);
    727             rows    = (int) sqrt((double)total);
    728             columns = total / rows;
    729 
    730             if( wParam & MDITILE_HORIZONTAL )  /* version >= 3.1 */
    731             {
    732                 i = rows;
    733                 rows = columns;  /* exchange r and c */
    734                 columns = i;
    735             }
    736 
    737             if( total != ci->nActiveChildren)
    738             {
    739                 y = rect.bottom - 2 * GetSystemMetrics(SM_CYICONSPACING) - GetSystemMetrics(SM_CYICON);
    740                 rect.bottom = ( y - GetSystemMetrics(SM_CYICON) < rect.top )? rect.bottom: y;
    741             }
    742 
    743             ysize   = rect.bottom / rows;
    744             xsize   = rect.right  / columns;
    745 
    746             for (x = i = 0, c = 1; c <= columns && *ppWnd; c++)
    747             {
    748                 if (c == columns)
    749                 {
    750                     rows  = total - i;
    751                     ysize = rect.bottom / rows;
    752                 }
    753 
    754                 y = 0;
    755                 for (r = 1; r <= rows && *ppWnd; r++, i++)
    756                 {
    757                     SetWindowPos((*ppWnd)->hwndSelf, 0, x, y, xsize, ysize,
    758                         SWP_DRAWFRAME | SWP_NOACTIVATE | SWP_NOZORDER);
    759                             y += ysize;
    760                     ppWnd++;
    761                 }
    762                 x += xsize;
    763             }
    764     }
    765     WIN_ReleaseWinArray(heapPtr);
    766     }
    767 
    768     if( total < ci->nActiveChildren ) ArrangeIconicWindows( wndClient->hwndSelf );
    769 }
    770 
    771827/* ----------------------- Frame window ---------------------------- */
    772828
     
    912968}
    913969#endif
     970
     971/***********************************************************************
     972 *           CalcChildScroll   (USER.462)
     973 */
     974void WINAPI CalcChildScroll(HWND hwnd,WORD scroll)
     975{
     976    Win32BaseWindow *win32wnd = Win32BaseWindow::GetWindowFromHandle(hwnd);
     977    SCROLLINFO info;
     978    RECT childRect, clientRect;
     979    INT  vmin, vmax, hmin, hmax, vpos, hpos;
     980
     981    if (!win32wnd) return;
     982
     983    GetClientRect( hwnd, &clientRect );
     984    SetRectEmpty( &childRect );
     985
     986    for (win32wnd = (Win32BaseWindow*)win32wnd->getFirstChild();win32wnd;win32wnd = (Win32BaseWindow*)win32wnd->getNextChild())
     987    {
     988          if( win32wnd->getStyle() & WS_MAXIMIZE )
     989          {
     990              ShowScrollBar(hwnd, SB_BOTH, FALSE);
     991              return;
     992          }
     993          UnionRect(&childRect,win32wnd->getWindowRect(),&childRect);
     994    }
     995    UnionRect( &childRect, &clientRect, &childRect );
     996
     997    hmin = childRect.left; hmax = childRect.right - clientRect.right;
     998    hpos = clientRect.left - childRect.left;
     999    vmin = childRect.top; vmax = childRect.bottom - clientRect.bottom;
     1000    vpos = clientRect.top - childRect.top;
     1001
     1002    switch( scroll )
     1003    {
     1004        case SB_HORZ:
     1005                        vpos = hpos; vmin = hmin; vmax = hmax;
     1006        case SB_VERT:
     1007                        info.cbSize = sizeof(info);
     1008                        info.nMax = vmax; info.nMin = vmin; info.nPos = vpos;
     1009                        info.fMask = SIF_POS | SIF_RANGE;
     1010                        SetScrollInfo(hwnd, scroll, &info, TRUE);
     1011                        break;
     1012        case SB_BOTH:
     1013        {
     1014          SCROLLINFO vInfo, hInfo;
     1015
     1016          vInfo.cbSize = hInfo.cbSize = sizeof(SCROLLINFO);
     1017          vInfo.nMin   = vmin;
     1018          hInfo.nMin   = hmin;
     1019          vInfo.nMax   = vmax;
     1020          hInfo.nMax   = hmax;
     1021          vInfo.nPos   = vpos;
     1022          hInfo.nPos   = hpos;
     1023          vInfo.fMask  = hInfo.fMask = SIF_RANGE | SIF_POS;
     1024
     1025          SetScrollInfo(hwnd,SB_VERT,&vInfo,TRUE);
     1026          SetScrollInfo(hwnd,SB_HORZ,&hInfo,TRUE);
     1027        }
     1028    }
     1029}
     1030
     1031/***********************************************************************
     1032 *           ScrollChildren32   (USER32.448)
     1033 */
     1034void WINAPI ScrollChildren(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam)
     1035{
     1036  Win32BaseWindow *win32wnd = Win32BaseWindow::GetWindowFromHandle(hWnd);
     1037  INT newPos = -1;
     1038  INT curPos, length, minPos, maxPos, shift;
     1039
     1040  if (!win32wnd) return;
     1041
     1042  if (uMsg == WM_HSCROLL)
     1043  {
     1044    GetScrollRange(hWnd,SB_HORZ,&minPos,&maxPos);
     1045    curPos = GetScrollPos(hWnd,SB_HORZ);
     1046    length = win32wnd->getWindowWidth()/2;
     1047    shift = GetSystemMetrics(SM_CYHSCROLL);
     1048  } else if (uMsg == WM_VSCROLL)
     1049  {
     1050    GetScrollRange(hWnd,SB_VERT,&minPos,&maxPos);
     1051    curPos = GetScrollPos(hWnd,SB_VERT);
     1052    length = win32wnd->getWindowHeight()/2;
     1053    shift = GetSystemMetrics(SM_CXVSCROLL);
     1054  } else return;
     1055
     1056  switch( wParam )
     1057  {
     1058    case SB_LINEUP:
     1059      newPos = curPos - shift;
     1060      break;
     1061
     1062    case SB_LINEDOWN:
     1063      newPos = curPos + shift;
     1064      break;
     1065
     1066    case SB_PAGEUP:
     1067      newPos = curPos - length;
     1068      break;
     1069
     1070    case SB_PAGEDOWN:
     1071      newPos = curPos + length;
     1072      break;
     1073
     1074    case SB_THUMBPOSITION:
     1075      newPos = LOWORD(lParam);
     1076      break;
     1077
     1078    case SB_THUMBTRACK:
     1079      return;
     1080
     1081    case SB_TOP:
     1082      newPos = minPos;
     1083      break;
     1084
     1085    case SB_BOTTOM:
     1086      newPos = maxPos;
     1087      break;
     1088
     1089    case SB_ENDSCROLL:
     1090      CalcChildScroll(hWnd,(uMsg == WM_VSCROLL)?SB_VERT:SB_HORZ);
     1091      return;
     1092  }
     1093
     1094  if( newPos > maxPos )
     1095    newPos = maxPos;
     1096  else
     1097    if( newPos < minPos )
     1098      newPos = minPos;
     1099
     1100  SetScrollPos(hWnd, (uMsg == WM_VSCROLL)?SB_VERT:SB_HORZ , newPos, TRUE);
     1101
     1102  if( uMsg == WM_VSCROLL )
     1103    ScrollWindowEx(hWnd ,0 ,curPos - newPos, NULL, NULL, 0, NULL,
     1104                   SW_INVALIDATE | SW_ERASE | SW_SCROLLCHILDREN );
     1105  else
     1106    ScrollWindowEx(hWnd ,curPos - newPos, 0, NULL, NULL, 0, NULL,
     1107                   SW_INVALIDATE | SW_ERASE | SW_SCROLLCHILDREN );
     1108}
     1109
    9141110/* -------- Miscellaneous service functions ----------
    9151111 *
  • trunk/src/user32/win32wmdiclient.h

    r1429 r2099  
    1 /* $Id: win32wmdiclient.h,v 1.4 1999-10-24 12:30:29 sandervl Exp $ */
     1/* $Id: win32wmdiclient.h,v 1.5 1999-12-17 17:18:04 cbratschi Exp $ */
    22/*
    33 * Win32 MDI Client Window Class for OS/2
     
    1818#define MDICLIENTCLASSNAMEW L"MDICLIENT"
    1919
    20 #define MDIF_NEEDUPDATE         0x0001
     20#define MDIF_NEEDUPDATE         0x0001
    2121
    2222//******************************************************************************
     
    3030virtual  BOOL   isMDIClient();
    3131
    32            int  incTotalCreated()                { return ++nTotalCreated; };
    33            int  getFirstChildId()                { return idFirstChild;    };
     32           int  incTotalCreated()                { return ++nTotalCreated; };
     33           int  getFirstChildId()                { return idFirstChild;    };
    3434
    35            HWND getMDIMenu()                     { return hWindowMenu;     };
     35           HWND getMDIMenu()                     { return hWindowMenu;     };
    3636
    3737Win32MDIChildWindow *getMaximizedChild()         { return maximizedChild;  };
     
    4646               void postUpdate(WORD recalc);
    4747
    48            int  getNrOfChildren()                { return nActiveChildren; };
    49            int  incNrActiveChildren()            { return ++nActiveChildren; };
    50            int  decNrActiveChildren()            { return --nActiveChildren; };
     48           int  getNrOfChildren()                { return nActiveChildren; };
     49           int  incNrActiveChildren()            { return ++nActiveChildren; };
     50           int  decNrActiveChildren()            { return --nActiveChildren; };
    5151
    52            int  getMdiFlags()                    { return mdiFlags; };
     52           int  getMdiFlags()                    { return mdiFlags; };
    5353           void setMdiFlags(int newflags)        { mdiFlags = newflags; };
    5454
    5555           void updateFrameText(BOOL repaint, LPCSTR lpTitle );
    5656
    57            LONG childActivate(Win32MDIChildWindow *child);
     57           LONG childActivate(Win32MDIChildWindow *child);
    5858           void switchActiveChild(Win32MDIChildWindow *nextActiveChild, BOOL bNextWindow );
    5959        LRESULT destroyChild(Win32MDIChildWindow *child, BOOL flagDestroy );
    6060
    61         LRESULT setMDIMenu(HMENU hmenuFrame, HMENU hmenuWindow);
    62         LRESULT refreshMDIMenu(HMENU hmenuFrame, HMENU hmenuWindow);
    63         BOOL    restoreFrameMenu(Win32BaseWindow *child);
     61        LRESULT setMDIMenu(HMENU hmenuFrame, HMENU hmenuWindow);
     62        LRESULT refreshMDIMenu(HMENU hmenuFrame, HMENU hmenuWindow);
     63        BOOL    restoreFrameMenu(Win32BaseWindow *child);
    6464
    6565       LRESULT  MDIClientWndProc(UINT message, WPARAM wParam, LPARAM lParam);
     66
     67Win32BaseWindow** buildWindowArray(UINT bwaFlags,PUINT total);
     68        void    releaseWindowArray(Win32BaseWindow **wndArray);
     69        void    calcDefaultChildPos(WORD n,LPPOINT lpPos,INT delta);
     70        BOOL    cascade(UINT fuCascade);
     71        BOOL    tile(UINT fuTile);
    6672
    6773private:
     
    6975  Win32MDIChildWindow *activeChild;
    7076
    71         HWND    hWindowMenu;
     77        HWND    hWindowMenu;
    7278        int     idFirstChild;
    7379
    74         int     nActiveChildren;
    75         int     nTotalCreated;
    76         int     sbRecalc;
    77         LPSTR   frameTitle;
    78         DWORD   mdiFlags;
     80        int     nActiveChildren;
     81        int     nTotalCreated;
     82        int     sbRecalc;
     83        LPSTR   frameTitle;
     84        DWORD   mdiFlags;
    7985
    8086};
Note: See TracChangeset for help on using the changeset viewer.