Ignore:
Timestamp:
Feb 21, 2001, 9:51:07 PM (25 years ago)
Author:
sandervl
Message:

fixes for minimizing frame windows + WM_BUTTONxMOTIONSTART/END handling

File:
1 edited

Legend:

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

    r5215 r5236  
    1 /* $Id: win32wbasepos.cpp,v 1.19 2001-02-20 15:40:23 sandervl Exp $ */
     1/* $Id: win32wbasepos.cpp,v 1.20 2001-02-21 20:51:07 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2 (nonclient/position methods)
     
    227227
    228228    if(IsRectEmpty(&windowpos.rcNormalPosition)) {
    229     CopyRect(&windowpos.rcNormalPosition, &rectWindow);
     229        CopyRect(&windowpos.rcNormalPosition, &rectWindow);
    230230    }
    231231    if(!HOOK_CallHooksA(WH_CBT, HCBT_MINMAX, getWindowHandle(), cmd))
    232232    {
    233     if(getStyle() & WS_MINIMIZE )
    234     {
    235         if(!SendInternalMessageA(WM_QUERYOPEN, 0, 0L))
    236         return (SWP_NOSIZE | SWP_NOMOVE);
    237     }
    238     switch( cmd )
    239     {
     233        if(getStyle() & WS_MINIMIZE )
     234        {
     235            if(!SendInternalMessageA(WM_QUERYOPEN, 0, 0L))
     236                return (SWP_NOSIZE | SWP_NOMOVE);
     237        }
     238        switch( cmd )
     239        {
    240240        case SW_MINIMIZE:
    241         if( getStyle() & WS_MAXIMIZE)
    242         {
    243                 setFlags(getFlags() | WIN_RESTORE_MAX);
    244                 setStyle(getStyle() & ~WS_MAXIMIZE);
    245                 }
    246                 else    setFlags(getFlags() & ~WIN_RESTORE_MAX);
    247 
    248         setStyle(getStyle() | WS_MINIMIZE);
    249 
    250         SetRect(lpRect, windowpos.ptMinPosition.x, windowpos.ptMinPosition.y,
    251                 GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON) );
    252         break;
     241            if( getStyle() & WS_MAXIMIZE)
     242            {
     243                 setFlags(getFlags() | WIN_RESTORE_MAX);
     244                 setStyle(getStyle() & ~WS_MAXIMIZE);
     245            }
     246            else setFlags(getFlags() & ~WIN_RESTORE_MAX);
     247
     248            setStyle(getStyle() | WS_MINIMIZE);
     249
     250            SetRect(lpRect, windowpos.ptMinPosition.x, windowpos.ptMinPosition.y,
     251                    GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON) );
     252            break;
    253253
    254254        case SW_MAXIMIZE:
    255                 GetMinMaxInfo(&size, &windowpos.ptMaxPosition, NULL, NULL );
    256 
    257         if(getStyle() & WS_MINIMIZE )
    258         {
    259              setStyle(getStyle() & ~WS_MINIMIZE);
    260         }
    261                 setStyle(getStyle() | WS_MAXIMIZE);
    262 
    263         SetRect(lpRect, windowpos.ptMaxPosition.x, windowpos.ptMaxPosition.y,
    264                 size.x, size.y );
    265         break;
     255            GetMinMaxInfo(&size, &windowpos.ptMaxPosition, NULL, NULL );
     256
     257            if(getStyle() & WS_MINIMIZE )
     258            {
     259                 setStyle(getStyle() & ~WS_MINIMIZE);
     260            }
     261            setStyle(getStyle() | WS_MAXIMIZE);
     262
     263            SetRect(lpRect, windowpos.ptMaxPosition.x, windowpos.ptMaxPosition.y,
     264                    size.x, size.y );
     265            break;
    266266
    267267        case SW_RESTORE:
    268         if(getStyle() & WS_MINIMIZE)
    269         {
     268            if(getStyle() & WS_MINIMIZE)
     269            {
    270270                setStyle(getStyle() & ~WS_MINIMIZE);
    271271
    272272                if( getFlags() & WIN_RESTORE_MAX)
    273273                {
    274                 /* Restore to maximized position */
    275                             GetMinMaxInfo(&size, &windowpos.ptMaxPosition, NULL, NULL);
    276                 setStyle(getStyle() | WS_MAXIMIZE);
    277                 SetRect(lpRect, windowpos.ptMaxPosition.x, windowpos.ptMaxPosition.y, size.x, size.y);
    278                 break;
     274                    /* Restore to maximized position */
     275                    GetMinMaxInfo(&size, &windowpos.ptMaxPosition, NULL, NULL);
     276                    setStyle(getStyle() | WS_MAXIMIZE);
     277                    SetRect(lpRect, windowpos.ptMaxPosition.x, windowpos.ptMaxPosition.y, size.x, size.y);
     278                    break;
    279279                }
    280         }
    281         else
     280            }
     281            else
    282282            if( !(getStyle() & WS_MAXIMIZE) )
    283             return 0;
    284             else    setStyle(getStyle() & ~WS_MAXIMIZE);
    285 
    286         /* Restore to normal position */
    287 
    288         *lpRect = windowpos.rcNormalPosition;
    289         lpRect->right -= lpRect->left;
    290         lpRect->bottom -= lpRect->top;
    291         break;
    292     }
     283                 return 0;
     284            else setStyle(getStyle() & ~WS_MAXIMIZE);
     285
     286            /* Restore to normal position */
     287            *lpRect = windowpos.rcNormalPosition;
     288            lpRect->right -= lpRect->left;
     289            lpRect->bottom -= lpRect->top;
     290            break;
     291        }
    293292    }
    294293    else swpFlags |= SWP_NOSIZE | SWP_NOMOVE;
Note: See TracChangeset for help on using the changeset viewer.