Changeset 164 for trunk/src/comctl32/status.c
- Timestamp:
- Jun 23, 1999, 9:45:02 PM (26 years ago)
- 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 cbratschiExp $ */1 /* $Id: status.c,v 1.5 1999-06-23 19:45:01 achimha Exp $ */ 2 2 /* 3 3 * Interface code to StatusWindow widget/control … … 80 80 UINT border = BDR_SUNKENOUTER; 81 81 82 if (part->style ==SBT_POPOUT)82 if (part->style & SBT_POPOUT) 83 83 border = BDR_RAISEDOUTER; 84 else if (part->style ==SBT_NOBORDERS)84 else if (part->style & SBT_NOBORDERS) 85 85 border = 0; 86 86 … … 136 136 hOldFont = SelectObject (hdc, self->hFont ? self->hFont : self->hDefaultFont); 137 137 138 if (part->style ==SBT_OWNERDRAW) {138 if (part->style & SBT_OWNERDRAW) { 139 139 DRAWITEMSTRUCT dis; 140 140 … … 192 192 else { 193 193 for (i = 0; i < infoPtr->numParts; i++) { 194 if (infoPtr->parts[i].style ==SBT_OWNERDRAW) {194 if (infoPtr->parts[i].style & SBT_OWNERDRAW) { 195 195 DRAWITEMSTRUCT dis; 196 196 … … 365 365 part = &self->parts[nPart]; 366 366 367 if (part->style ==SBT_OWNERDRAW)367 if (part->style & SBT_OWNERDRAW) 368 368 result = (LRESULT)part->text; 369 369 else { … … 391 391 part = &infoPtr->parts[nPart]; 392 392 393 if (part->style ==SBT_OWNERDRAW)393 if (part->style & SBT_OWNERDRAW) 394 394 result = (LRESULT)part->text; 395 395 else { … … 571 571 if (oldNumParts > self->numParts) { 572 572 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)) 574 574 COMCTL32_Free (self->parts[i].text); 575 575 } … … 635 635 STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (hwnd); 636 636 STATUSWINDOWPART *part; 637 int 638 int 637 int part_num; 638 int style; 639 639 LPSTR text; 640 int 640 int len; 641 641 HDC hdc; 642 642 … … 646 646 647 647 if ((self->simple) || (self->parts==NULL) || (part_num==255)) 648 648 part = &self->part0; 649 649 else 650 650 part = &self->parts[part_num]; 651 651 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 } 652 667 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 }666 668 667 669 hdc = GetDC (hwnd); … … 687 689 688 690 if ((self->simple) || (self->parts==NULL) || (part_num==255)) 689 691 part = &self->part0; 690 692 else 691 693 part = &self->parts[part_num]; 692 694 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 } 693 710 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 }707 711 708 712 hdc = GetDC (hwnd); … … 892 896 { 893 897 STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (hwnd); 894 int 898 int i; 895 899 896 900 for (i = 0; i < self->numParts; i++) { 897 if (self->parts[i].text && (self->parts[i].style !=SBT_OWNERDRAW))898 899 } 900 if (self->part0.text && (self->part0.style !=SBT_OWNERDRAW))901 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); 902 906 COMCTL32_Free (self->parts); 903 907 904 908 /* delete default font */ 905 909 if (self->hDefaultFont) 906 910 DeleteObject (self->hDefaultFont); 907 911 908 912 /* delete tool tip control */ 909 913 if (self->hwndToolTip) 910 914 DestroyWindow (self->hwndToolTip); 911 915 912 916 COMCTL32_Free (self);
Note:
See TracChangeset
for help on using the changeset viewer.