Changeset 21084


Ignore:
Timestamp:
Mar 22, 2004, 1:44:59 PM (21 years ago)
Author:
sandervl
Message:

Rebar: changed resize fix again

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified tags/trunk/src/comctl32/rebar.c

    r21069 r21084  
    979979
    980980      /* text is visible */
    981       if (lpBand->fStatus & HAS_TEXT) {
     981      if ((lpBand->fStatus & HAS_TEXT) && !(lpBand->fStyle & RBBS_HIDETITLE)) {
    982982          lpBand->fDraw |= DRAW_TEXT;
    983983          lpBand->rcCapText.right = max(lpBand->rcCapText.left,
     
    11251125
    11261126        /* text is visible */
    1127         if (lpBand->fStatus & HAS_TEXT) {
     1127        if ((lpBand->fStatus & HAS_TEXT) && !(lpBand->fStyle & RBBS_HIDETITLE)) {
    11281128            lpBand->fDraw |= DRAW_TEXT;
    11291129            lpBand->rcCapText.bottom = max(lpBand->rcCapText.top,
     
    11721172}
    11731173
     1174#ifdef __WIN32OS2__
     1175// Rewriting the original function below is too much work. Duplicated it
     1176// instead
     1177static VOID
     1178REBAR_ForceResize2 (REBAR_INFO *infoPtr, INT newWidth, INT newHeight)
     1179     /* Function: This changes the size of the REBAR window to that */
     1180     /*  calculated by REBAR_Layout.                                */
     1181{
     1182    RECT rc;
     1183    INT x, y, width, height;
     1184    INT xedge = GetSystemMetrics(SM_CXEDGE);
     1185    INT yedge = GetSystemMetrics(SM_CYEDGE);
     1186
     1187    GetClientRect (infoPtr->hwndSelf, &rc);
     1188
     1189    TRACE( " old [%ld x %ld], new [%ld x %ld], client [%ld x %ld]\n",
     1190           infoPtr->oldSize.cx, infoPtr->oldSize.cy,
     1191           infoPtr->calcSize.cx, infoPtr->calcSize.cy,
     1192           rc.right, rc.bottom);
     1193
     1194    width = 0;
     1195    height = 0;
     1196    x = 0;
     1197    y = 0;
     1198
     1199    if (infoPtr->dwStyle & WS_BORDER) {
     1200        width = 2 * xedge;
     1201        height = 2 * yedge;
     1202    }
     1203
     1204    {
     1205        INT mode = infoPtr->dwStyle & (CCS_VERT | CCS_TOP | CCS_BOTTOM);
     1206
     1207        RECT rcPcl;
     1208
     1209        rcPcl.left = 0; rcPcl.right = newWidth;
     1210        rcPcl.top  = 0; rcPcl.bottom = newHeight;
     1211
     1212        switch (mode) {
     1213        case CCS_TOP:
     1214            /* _TOP sets width to parents width */
     1215            width += (rcPcl.right - rcPcl.left);
     1216            height += infoPtr->calcSize.cy;
     1217            x += ((infoPtr->dwStyle & WS_BORDER) ? -xedge : 0);
     1218            y += ((infoPtr->dwStyle & WS_BORDER) ? -yedge : 0);
     1219            y += ((infoPtr->dwStyle & CCS_NODIVIDER) ? 0 : REBAR_DIVIDER);
     1220            break;
     1221        case CCS_BOTTOM:
     1222            /* FIXME: wrong wrong wrong */
     1223            /* _BOTTOM sets width to parents width */
     1224            width += (rcPcl.right - rcPcl.left);
     1225            height += infoPtr->calcSize.cy;
     1226            x += -xedge;
     1227            y = rcPcl.bottom - height + 1;
     1228            break;
     1229        case CCS_LEFT:
     1230            /* _LEFT sets height to parents height */
     1231            width += infoPtr->calcSize.cx;
     1232            height += (rcPcl.bottom - rcPcl.top);
     1233            x += ((infoPtr->dwStyle & WS_BORDER) ? -xedge : 0);
     1234            x += ((infoPtr->dwStyle & CCS_NODIVIDER) ? 0 : REBAR_DIVIDER);
     1235            y += ((infoPtr->dwStyle & WS_BORDER) ? -yedge : 0);
     1236            break;
     1237        case CCS_RIGHT:
     1238            /* FIXME: wrong wrong wrong */
     1239            /* _RIGHT sets height to parents height */
     1240            width += infoPtr->calcSize.cx;
     1241            height += (rcPcl.bottom - rcPcl.top);
     1242            x = rcPcl.right - width + 1;
     1243            y = -yedge;
     1244            break;
     1245        default:
     1246            width += infoPtr->calcSize.cx;
     1247            height += infoPtr->calcSize.cy;
     1248        }
     1249    }
     1250
     1251    TRACE("hwnd %p, style=%08lx, setting at (%d,%d) for (%d,%d)\n",
     1252        infoPtr->hwndSelf, infoPtr->dwStyle,
     1253        x, y, width, height);
     1254#ifdef __WIN32OS2__
     1255//NOTE: this one is causing problems!!!!
     1256    if(height != 0)
     1257#endif
     1258    SetWindowPos (infoPtr->hwndSelf, 0, x, y, width, height,
     1259                    SWP_NOMOVE|SWP_NOZORDER|SWP_NOACTIVATE);
     1260}
     1261#endif
    11741262
    11751263static VOID
     
    20292117
    20302118    /* text is visible */
    2031     if ((lpBand->fMask & RBBIM_TEXT) && (lpBand->lpText)) {
     2119    if ((lpBand->fMask & RBBIM_TEXT) && (lpBand->lpText) &&
     2120        !(lpBand->fStyle & RBBS_HIDETITLE))
     2121    {
    20322122        HDC hdc = GetDC (0);
    20332123        HFONT hOldFont = SelectObject (hdc, infoPtr->hFont);
     
    44604550            RECT parent_rect, rcWin;
    44614551
    4462             if(HIWORD(lParam) != (rcClient.bottom - rcClient.top) ||
    4463                LOWORD(lParam) != (rcClient.right  - rcClient.left))
     4552            if (!(infoPtr->dwStyle & CCS_NOPARENTALIGN)  &&
     4553               (HIWORD(lParam) != (rcClient.bottom - rcClient.top) ||
     4554                LOWORD(lParam) != (rcClient.right  - rcClient.left)))
    44644555            {
    44654556                /* Need to resize width to match parent */
     
    44704561                GetClientRect (GetParent(infoPtr->hwndSelf), &parent_rect);
    44714562                width = parent_rect.right - parent_rect.left;
     4563
    44724564                TRACE("Rebar: resize to match parent");
    4473                 SetWindowPos (infoPtr->hwndSelf, 0, 0, 0, width, height, SWP_NOMOVE|SWP_NOZORDER|SWP_NOACTIVATE);
    4474                 return 0;;
     4565                REBAR_ForceResize2(infoPtr, width, height);
     4566                return 0;
    44754567            }
    44764568#endif
Note: See TracChangeset for help on using the changeset viewer.