Ignore:
Timestamp:
Jun 23, 1999, 9:45:02 PM (26 years ago)
Author:
achimha
Message:

updated comctl32 with the latest WINE bugfixes. Listview is much better now and tab control doesn't have the wrong color anymore. Many small improvements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/comctl32/status.c

    r110 r164  
    1 /* $Id: status.c,v 1.4 1999-06-16 20:25:43 cbratschi Exp $ */
     1/* $Id: status.c,v 1.5 1999-06-23 19:45:01 achimha Exp $ */
    22/*
    33 * Interface code to StatusWindow widget/control
     
    8080    UINT border = BDR_SUNKENOUTER;
    8181
    82     if (part->style==SBT_POPOUT)
     82    if (part->style & SBT_POPOUT)
    8383      border = BDR_RAISEDOUTER;
    84     else if (part->style==SBT_NOBORDERS)
     84    else if (part->style & SBT_NOBORDERS)
    8585      border = 0;
    8686
     
    136136    hOldFont = SelectObject (hdc, self->hFont ? self->hFont : self->hDefaultFont);
    137137
    138     if (part->style == SBT_OWNERDRAW) {
     138    if (part->style & SBT_OWNERDRAW) {
    139139        DRAWITEMSTRUCT dis;
    140140
     
    192192    else {
    193193        for (i = 0; i < infoPtr->numParts; i++) {
    194             if (infoPtr->parts[i].style == SBT_OWNERDRAW) {
     194            if (infoPtr->parts[i].style & SBT_OWNERDRAW) {
    195195                DRAWITEMSTRUCT dis;
    196196
     
    365365        part = &self->parts[nPart];
    366366
    367     if (part->style == SBT_OWNERDRAW)
     367    if (part->style & SBT_OWNERDRAW)
    368368        result = (LRESULT)part->text;
    369369    else {
     
    391391        part = &infoPtr->parts[nPart];
    392392
    393     if (part->style == SBT_OWNERDRAW)
     393    if (part->style & SBT_OWNERDRAW)
    394394        result = (LRESULT)part->text;
    395395    else {
     
    571571    if (oldNumParts > self->numParts) {
    572572        for (i = self->numParts ; i < oldNumParts; i++) {
    573             if (self->parts[i].text && (self->parts[i].style != SBT_OWNERDRAW))
     573            if (self->parts[i].text && !(self->parts[i].style & SBT_OWNERDRAW))
    574574                COMCTL32_Free (self->parts[i].text);
    575575        }
     
    635635    STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (hwnd);
    636636    STATUSWINDOWPART *part;
    637     int part_num;
    638     int style;
     637    int part_num;
     638    int style;
    639639    LPSTR text;
    640     int len;
     640    int len;
    641641    HDC hdc;
    642642
     
    646646
    647647    if ((self->simple) || (self->parts==NULL) || (part_num==255))
    648         part = &self->part0;
     648        part = &self->part0;
    649649    else
    650         part = &self->parts[part_num];
     650        part = &self->parts[part_num];
    651651    if (!part) return FALSE;
     652
     653    if (!(part->style & SBT_OWNERDRAW) && part->text)
     654        COMCTL32_Free (part->text);
     655    part->text = 0;
     656
     657    if (style & SBT_OWNERDRAW) {
     658        part->text = (LPWSTR)text;
     659    }
     660    else {
     661        /* duplicate string */
     662        if (text && (len = lstrlenA(text))) {
     663            part->text = COMCTL32_Alloc ((len+1)*sizeof(WCHAR));
     664            lstrcpyAtoW (part->text, text);
     665        }
     666    }
    652667    part->style = style;
    653     if (style == SBT_OWNERDRAW) {
    654         part->text = (LPWSTR)text;
    655     }
    656     else {
    657         /* duplicate string */
    658         if (part->text)
    659             COMCTL32_Free (part->text);
    660         part->text = 0;
    661         if (text && (len = lstrlenA(text))) {
    662             part->text = COMCTL32_Alloc ((len+1)*sizeof(WCHAR));
    663             lstrcpyAtoW (part->text, text);
    664         }
    665     }
    666668
    667669    hdc = GetDC (hwnd);
     
    687689
    688690    if ((self->simple) || (self->parts==NULL) || (part_num==255))
    689         part = &self->part0;
     691        part = &self->part0;
    690692    else
    691         part = &self->parts[part_num];
     693        part = &self->parts[part_num];
    692694    if (!part) return FALSE;
     695
     696    if (!(part->style & SBT_OWNERDRAW) && part->text)
     697        COMCTL32_Free (part->text);
     698    part->text = 0;
     699
     700    if (style & SBT_OWNERDRAW) {
     701        part->text = text;
     702    }
     703    else {
     704        /* duplicate string */
     705        if (text && (len = lstrlenW(text))) {
     706            part->text = COMCTL32_Alloc ((len+1)*sizeof(WCHAR));
     707            lstrcpyW(part->text, text);
     708        }
     709    }
    693710    part->style = style;
    694     if (style == SBT_OWNERDRAW) {
    695         part->text = text;
    696     }
    697     else {
    698         /* duplicate string */
    699         if (part->text)
    700             COMCTL32_Free (part->text);
    701         part->text = 0;
    702         if (text && (len = lstrlenW(text))) {
    703             part->text = COMCTL32_Alloc ((len+1)*sizeof(WCHAR));
    704             lstrcpyW(part->text, text);
    705         }
    706     }
    707711
    708712    hdc = GetDC (hwnd);
     
    892896{
    893897    STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (hwnd);
    894     int i;
     898    int i;
    895899
    896900    for (i = 0; i < self->numParts; i++) {
    897         if (self->parts[i].text && (self->parts[i].style != SBT_OWNERDRAW))
    898             COMCTL32_Free (self->parts[i].text);
    899     }
    900     if (self->part0.text && (self->part0.style != SBT_OWNERDRAW))
    901         COMCTL32_Free (self->part0.text);
     901        if (self->parts[i].text && !(self->parts[i].style & SBT_OWNERDRAW))
     902            COMCTL32_Free (self->parts[i].text);
     903    }
     904    if (self->part0.text && !(self->part0.style & SBT_OWNERDRAW))
     905        COMCTL32_Free (self->part0.text);
    902906    COMCTL32_Free (self->parts);
    903907
    904908    /* delete default font */
    905909    if (self->hDefaultFont)
    906         DeleteObject (self->hDefaultFont);
     910        DeleteObject (self->hDefaultFont);
    907911
    908912    /* delete tool tip control */
    909913    if (self->hwndToolTip)
    910         DestroyWindow (self->hwndToolTip);
     914        DestroyWindow (self->hwndToolTip);
    911915
    912916    COMCTL32_Free (self);
Note: See TracChangeset for help on using the changeset viewer.