Changeset 110 for trunk/src/comctl32/status.c
- Timestamp:
- Jun 16, 1999, 10:25:45 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/comctl32/status.c
r94 r110 1 /* $Id: status.c,v 1. 3 1999-06-10 16:22:01 achimhaExp $ */1 /* $Id: status.c,v 1.4 1999-06-16 20:25:43 cbratschi Exp $ */ 2 2 /* 3 3 * Interface code to StatusWindow widget/control … … 6 6 * Copyright 1998, 1999 Eric Kohl 7 7 * Copyright 1999 Achim Hasenmueller 8 * Copyright 1999 Christoph Bratschi 8 9 */ 9 10 … … 56 57 SelectObject (hdc, GetSysColorPen (COLOR_3DSHADOW)); 57 58 for (i = 1; i < 11; i += 4) { 58 59 60 61 62 59 MoveToEx (hdc, pt.x - i, pt.y, NULL); 60 LineTo (hdc, pt.x, pt.y - i); 61 62 MoveToEx (hdc, pt.x - i-1, pt.y, NULL); 63 LineTo (hdc, pt.x, pt.y - i-1); 63 64 } 64 65 65 66 SelectObject (hdc, GetSysColorPen (COLOR_3DHIGHLIGHT)); 66 67 for (i = 3; i < 13; i += 4) { 67 68 68 MoveToEx (hdc, pt.x - i, pt.y, NULL); 69 LineTo (hdc, pt.x, pt.y - i); 69 70 } 70 71 … … 73 74 74 75 75 static void 76 static void 76 77 STATUSBAR_DrawPart (HDC hdc, STATUSWINDOWPART *part) 77 78 { … … 88 89 /* draw the icon */ 89 90 if (part->hIcon) { 90 91 92 93 94 91 INT cy = r.bottom - r.top; 92 93 r.left += 2; 94 DrawIconEx (hdc, r.left, r.top, part->hIcon, cy, cy, 0, 0, DI_NORMAL); 95 r.left += cy; 95 96 } 96 97 … … 101 102 UINT align = DT_LEFT; 102 103 if (*p == L'\t') { 103 104 105 106 107 108 109 104 p++; 105 align = DT_CENTER; 106 107 if (*p == L'\t') { 108 p++; 109 align = DT_RIGHT; 110 } 110 111 } 111 112 r.left += 3; 112 113 DrawTextW (hdc, p, lstrlenW (p), &r, align|DT_VCENTER|DT_SINGLELINE); 113 114 if (oldbkmode != TRANSPARENT) 114 115 SetBkMode(hdc, oldbkmode); 115 116 } 116 117 } … … 128 129 129 130 if (self->clrBk != CLR_DEFAULT) 130 131 hbrBk = CreateSolidBrush (self->clrBk); 131 132 else 132 133 hbrBk = GetSysColorBrush (COLOR_3DFACE); 133 134 FillRect(hdc, &part->bound, hbrBk); 134 135 … … 136 137 137 138 if (part->style == SBT_OWNERDRAW) { 138 139 140 141 142 143 144 145 146 147 139 DRAWITEMSTRUCT dis; 140 141 dis.CtlID = GetWindowLongA (hwnd, GWL_ID); 142 dis.itemID = -1; 143 dis.hwndItem = hwnd; 144 dis.hDC = hdc; 145 dis.rcItem = part->bound; 146 dis.itemData = (INT)part->text; 147 SendMessageA (GetParent (hwnd), WM_DRAWITEM, 148 (WPARAM)dis.CtlID, (LPARAM)&dis); 148 149 } 149 150 else 150 151 STATUSBAR_DrawPart (hdc, part); 151 152 152 153 SelectObject (hdc, hOldFont); 153 154 154 155 if (self->clrBk != CLR_DEFAULT) 155 156 DeleteObject (hbrBk); 156 157 157 158 if (GetWindowLongA (hwnd, GWL_STYLE) & SBARS_SIZEGRIP) { 158 159 160 161 159 RECT rect; 160 161 GetClientRect (hwnd, &rect); 162 STATUSBAR_DrawSizeGrip (hdc, &rect); 162 163 } 163 164 } … … 179 180 180 181 if (infoPtr->clrBk != CLR_DEFAULT) 181 182 hbrBk = CreateSolidBrush (infoPtr->clrBk); 182 183 else 183 184 hbrBk = GetSysColorBrush (COLOR_3DFACE); 184 185 FillRect(hdc, &rect, hbrBk); 185 186 … … 187 188 188 189 if (infoPtr->simple) { 189 190 STATUSBAR_DrawPart (hdc, &infoPtr->part0); 190 191 } 191 192 else { 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 193 for (i = 0; i < infoPtr->numParts; i++) { 194 if (infoPtr->parts[i].style == SBT_OWNERDRAW) { 195 DRAWITEMSTRUCT dis; 196 197 dis.CtlID = GetWindowLongA (hwnd, GWL_ID); 198 dis.itemID = -1; 199 dis.hwndItem = hwnd; 200 dis.hDC = hdc; 201 dis.rcItem = infoPtr->parts[i].bound; 202 dis.itemData = (INT)infoPtr->parts[i].text; 203 SendMessageA (GetParent (hwnd), WM_DRAWITEM, 204 (WPARAM)dis.CtlID, (LPARAM)&dis); 205 } 206 else 207 STATUSBAR_DrawPart (hdc, &infoPtr->parts[i]); 208 } 208 209 } 209 210 … … 211 212 212 213 if (infoPtr->clrBk != CLR_DEFAULT) 213 214 DeleteObject (hbrBk); 214 215 215 216 if (GetWindowLongA(hwnd, GWL_STYLE) & SBARS_SIZEGRIP) 216 217 STATUSBAR_DrawSizeGrip (hdc, &rect); 217 218 218 219 return TRUE; … … 226 227 STATUSWINDOWPART *part; 227 228 RECT rect, *r; 228 int 229 int i; 229 230 230 231 /* get our window size */ … … 238 239 /* set bounds for non-simple rectangles */ 239 240 for (i = 0; i < self->numParts; i++) { 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 241 part = &self->parts[i]; 242 r = &self->parts[i].bound; 243 r->top = rect.top; 244 r->bottom = rect.bottom; 245 if (i == 0) 246 r->left = 0; 247 else 248 r->left = self->parts[i-1].bound.right + HORZ_GAP; 249 if (part->x == -1) 250 r->right = rect.right; 251 else 252 r->right = part->x; 253 254 if (self->hwndToolTip) { 255 TTTOOLINFOA ti; 256 257 ti.cbSize = sizeof(TTTOOLINFOA); 258 ti.hwnd = hwnd; 259 ti.uId = i; 260 ti.rect = *r; 261 SendMessageA (self->hwndToolTip, TTM_NEWTOOLRECTA, 262 0, (LPARAM)&ti); 263 } 263 264 } 264 265 } … … 267 268 static VOID 268 269 STATUSBAR_RelayEvent (HWND hwndTip, HWND hwndMsg, UINT uMsg, 269 270 WPARAM wParam, LPARAM lParam) 270 271 { 271 272 MSG msg; … … 304 305 nPart = (INT)wParam & 0x00ff; 305 306 if ((nPart < -1) || (nPart >= self->numParts)) 306 307 return 0; 307 308 308 309 if (nPart == -1) … … 324 325 parts = (LPINT) lParam; 325 326 if (parts) { 326 327 328 329 327 return (infoPtr->numParts); 328 for (i = 0; i < num_parts; i++) { 329 parts[i] = infoPtr->parts[i].x; 330 } 330 331 } 331 332 return (infoPtr->numParts); … … 337 338 { 338 339 STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (hwnd); 339 int 340 int part_num; 340 341 LPRECT rect; 341 342 … … 343 344 rect = (LPRECT) lParam; 344 345 if (infoPtr->simple) 345 346 *rect = infoPtr->part0.bound; 346 347 else 347 348 *rect = infoPtr->parts[part_num].bound; 348 349 return TRUE; 349 350 } … … 360 361 nPart = ((INT) wParam) & 0x00ff; 361 362 if (self->simple) 362 363 part = &self->part0; 363 364 else 364 365 part = &self->parts[nPart]; 365 366 366 367 if (part->style == SBT_OWNERDRAW) 367 368 result = (LRESULT)part->text; 368 369 else { 369 370 371 372 370 result = part->text ? lstrlenW (part->text) : 0; 371 result |= (part->style << 16); 372 if (lParam && LOWORD(result)) 373 lstrcpyWtoA((LPSTR)lParam, part->text); 373 374 } 374 375 return result; … … 386 387 nPart = ((INT)wParam) & 0x00ff; 387 388 if (infoPtr->simple) 388 389 part = &infoPtr->part0; 389 390 else 390 391 part = &infoPtr->parts[nPart]; 391 392 392 393 if (part->style == SBT_OWNERDRAW) 393 394 result = (LRESULT)part->text; 394 395 else { 395 396 397 398 396 result = part->text ? lstrlenW (part->text) : 0; 397 result |= (part->style << 16); 398 if (lParam) 399 lstrcpyW ((LPWSTR)lParam, part->text); 399 400 } 400 401 return result; … … 413 414 414 415 if (infoPtr->simple) 415 416 part = &infoPtr->part0; 416 417 else 417 418 part = &infoPtr->parts[part_num]; 418 419 419 420 if (part->text) 420 421 result = lstrlenW(part->text); 421 422 else 422 423 result = 0; 423 424 424 425 result |= (part->style << 16); … … 433 434 434 435 if (infoPtr->hwndToolTip) { 435 436 437 438 439 440 441 442 436 TTTOOLINFOA ti; 437 ti.cbSize = sizeof(TTTOOLINFOA); 438 ti.hwnd = hwnd; 439 ti.uId = LOWORD(wParam); 440 SendMessageA (infoPtr->hwndToolTip, TTM_GETTEXTA, 0, (LPARAM)&ti); 441 442 if (ti.lpszText) 443 lstrcpynA ((LPSTR)lParam, ti.lpszText, HIWORD(wParam)); 443 444 } 444 445 … … 453 454 454 455 if (infoPtr->hwndToolTip) { 455 456 457 458 459 460 461 462 456 TTTOOLINFOW ti; 457 ti.cbSize = sizeof(TTTOOLINFOW); 458 ti.hwnd = hwnd; 459 ti.uId = LOWORD(wParam); 460 SendMessageW (infoPtr->hwndToolTip, TTM_GETTEXTW, 0, (LPARAM)&ti); 461 462 if (ti.lpszText) 463 lstrcpynW ((LPWSTR)lParam, ti.lpszText, HIWORD(wParam)); 463 464 } 464 465 … … 505 506 STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (hwnd); 506 507 INT nPart = (INT)wParam & 0x00ff; 507 HDC hdc; 508 HDC hdc; 508 509 509 510 if ((nPart < -1) || (nPart >= self->numParts)) 510 511 return FALSE; 511 512 512 513 hdc = GetDC (hwnd); 513 514 if (nPart == -1) { 514 515 516 515 self->part0.hIcon = (HICON)lParam; 516 if (self->simple) 517 STATUSBAR_RefreshPart (hwnd, &self->part0, hdc); 517 518 } 518 519 else { 519 520 521 520 self->parts[nPart].hIcon = (HICON)lParam; 521 if (!(self->simple)) 522 STATUSBAR_RefreshPart (hwnd, &self->parts[nPart], hdc); 522 523 } 523 524 ReleaseDC (hwnd, hdc); … … 533 534 534 535 if (IsWindowVisible (hwnd)) { 535 536 537 538 539 540 541 542 543 544 545 546 547 536 HWND parent = GetParent (hwnd); 537 INT width, x, y; 538 RECT parent_rect; 539 540 GetClientRect (parent, &parent_rect); 541 self->height = (INT)wParam + VERT_BORDER; 542 width = parent_rect.right - parent_rect.left; 543 x = parent_rect.left; 544 y = parent_rect.bottom - self->height; 545 MoveWindow (hwnd, parent_rect.left, 546 parent_rect.bottom - self->height, 547 width, self->height, TRUE); 548 STATUSBAR_SetPartBounds (hwnd); 548 549 } 549 550 … … 557 558 STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (hwnd); 558 559 STATUSWINDOWPART *tmp; 559 HDC 560 HDC hdc; 560 561 LPINT parts; 561 int 562 int 562 int i; 563 int oldNumParts; 563 564 564 565 if (self->simple) 565 566 self->simple = FALSE; 566 567 567 568 oldNumParts = self->numParts; … … 569 570 parts = (LPINT) lParam; 570 571 if (oldNumParts > self->numParts) { 571 572 573 574 572 for (i = self->numParts ; i < oldNumParts; i++) { 573 if (self->parts[i].text && (self->parts[i].style != SBT_OWNERDRAW)) 574 COMCTL32_Free (self->parts[i].text); 575 } 575 576 } 576 577 else if (oldNumParts < self->numParts) { 577 578 579 580 581 582 583 584 } 585 578 tmp = COMCTL32_Alloc (sizeof(STATUSWINDOWPART) * self->numParts); 579 for (i = 0; i < oldNumParts; i++) { 580 tmp[i] = self->parts[i]; 581 } 582 if (self->parts) 583 COMCTL32_Free (self->parts); 584 self->parts = tmp; 585 } 586 586 587 for (i = 0; i < self->numParts; i++) { 587 588 self->parts[i].x = parts[i]; 588 589 } 589 590 590 591 if (self->hwndToolTip) { 591 592 593 594 595 596 597 598 599 600 601 602 603 // 604 605 606 607 608 609 610 611 612 613 614 615 // 616 617 618 592 INT nTipCount = 593 SendMessageA (self->hwndToolTip, TTM_GETTOOLCOUNT, 0, 0); 594 595 if (nTipCount < self->numParts) { 596 /* add tools */ 597 TTTOOLINFOA ti; 598 INT i; 599 600 ZeroMemory (&ti, sizeof(TTTOOLINFOA)); 601 ti.cbSize = sizeof(TTTOOLINFOA); 602 ti.hwnd = hwnd; 603 for (i = nTipCount; i < self->numParts; i++) { 604 // TRACE (statusbar, "add tool %d\n", i); 605 ti.uId = i; 606 SendMessageA (self->hwndToolTip, TTM_ADDTOOLA, 607 0, (LPARAM)&ti); 608 } 609 } 610 else if (nTipCount > self->numParts) { 611 /* delete tools */ 612 INT i; 613 614 for (i = nTipCount - 1; i >= self->numParts; i--) { 615 616 // FIXME (statusbar, "delete tool %d\n", i); 617 618 } 619 } 619 620 } 620 621 … … 634 635 STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (hwnd); 635 636 STATUSWINDOWPART *part; 636 int 637 int 637 int part_num; 638 int style; 638 639 LPSTR text; 639 int 640 int len; 640 641 HDC hdc; 641 642 … … 645 646 646 647 if ((self->simple) || (self->parts==NULL) || (part_num==255)) 647 648 part = &self->part0; 648 649 else 649 650 part = &self->parts[part_num]; 650 651 if (!part) return FALSE; 651 652 part->style = style; 652 653 if (style == SBT_OWNERDRAW) { 653 654 part->text = (LPWSTR)text; 654 655 } 655 656 else { 656 657 658 659 660 661 662 663 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 } 664 665 } 665 666 … … 686 687 687 688 if ((self->simple) || (self->parts==NULL) || (part_num==255)) 688 689 part = &self->part0; 689 690 else 690 691 part = &self->parts[part_num]; 691 692 if (!part) return FALSE; 692 693 part->style = style; 693 694 if (style == SBT_OWNERDRAW) { 694 695 part->text = text; 695 696 } 696 697 else { 697 698 699 700 701 702 703 704 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 } 705 706 } 706 707 … … 720 721 // TRACE (statusbar, "part %d: \"%s\"\n", (INT)wParam, (LPSTR)lParam); 721 722 if (infoPtr->hwndToolTip) { 722 723 724 725 726 727 728 729 723 TTTOOLINFOA ti; 724 ti.cbSize = sizeof(TTTOOLINFOA); 725 ti.hwnd = hwnd; 726 ti.uId = (INT)wParam; 727 ti.hinst = 0; 728 ti.lpszText = (LPSTR)lParam; 729 SendMessageA (infoPtr->hwndToolTip, TTM_UPDATETIPTEXTA, 730 0, (LPARAM)&ti); 730 731 } 731 732 … … 741 742 // TRACE (statusbar, "part %d: \"%s\"\n", (INT)wParam, (LPSTR)lParam); 742 743 if (infoPtr->hwndToolTip) { 743 744 745 746 747 748 749 750 744 TTTOOLINFOW ti; 745 ti.cbSize = sizeof(TTTOOLINFOW); 746 ti.hwnd = hwnd; 747 ti.uId = (INT)wParam; 748 ti.hinst = 0; 749 ti.lpszText = (LPWSTR)lParam; 750 SendMessageW (infoPtr->hwndToolTip, TTM_UPDATETIPTEXTW, 751 0, (LPARAM)&ti); 751 752 } 752 753 … … 796 797 LPCREATESTRUCTA lpCreate = (LPCREATESTRUCTA)lParam; 797 798 NONCLIENTMETRICSA nclm; 798 RECT 799 int 800 HDC 799 RECT rect; 800 int width, len; 801 HDC hdc; 801 802 STATUSWINDOWINFO *self; 802 803 … … 831 832 832 833 if (IsWindowUnicode (hwnd)) { 833 834 835 836 837 834 self->bUnicode = TRUE; 835 if ((len = lstrlenW ((LPCWSTR)lpCreate->lpszName))) { 836 self->parts[0].text = COMCTL32_Alloc ((len + 1)*sizeof(WCHAR)); 837 lstrcpyW (self->parts[0].text, (LPCWSTR)lpCreate->lpszName); 838 } 838 839 } 839 840 else { 840 841 842 843 841 if ((len = lstrlenA ((LPCSTR)lpCreate->lpszName))) { 842 self->parts[0].text = COMCTL32_Alloc ((len + 1)*sizeof(WCHAR)); 843 lstrcpyAtoW (self->parts[0].text, (LPCSTR)lpCreate->lpszName); 844 } 844 845 } 845 846 846 847 if ((hdc = GetDC (0))) { 847 848 849 850 851 852 853 854 848 TEXTMETRICA tm; 849 HFONT hOldFont; 850 851 hOldFont = SelectObject (hdc,self->hDefaultFont); 852 GetTextMetricsA(hdc, &tm); 853 self->textHeight = tm.tmHeight; 854 SelectObject (hdc, hOldFont); 855 ReleaseDC(0, hdc); 855 856 } 856 857 857 858 if (GetWindowLongA (hwnd, GWL_STYLE) & SBT_TOOLTIPS) { 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 859 self->hwndToolTip = 860 CreateWindowExA (0, TOOLTIPS_CLASSA, NULL, 0, 861 CW_USEDEFAULT, CW_USEDEFAULT, 862 CW_USEDEFAULT, CW_USEDEFAULT, 863 hwnd, 0, 864 GetWindowLongA (hwnd, GWL_HINSTANCE), NULL); 865 866 if (self->hwndToolTip) { 867 NMTOOLTIPSCREATED nmttc; 868 869 nmttc.hdr.hwndFrom = hwnd; 870 nmttc.hdr.idFrom = GetWindowLongA (hwnd, GWL_ID); 871 nmttc.hdr.code = NM_TOOLTIPSCREATED; 872 nmttc.hwndToolTips = self->hwndToolTip; 873 874 SendMessageA (GetParent (hwnd), WM_NOTIFY, 875 (WPARAM)nmttc.hdr.idFrom, (LPARAM)&nmttc); 876 } 876 877 } 877 878 … … 880 881 self->height = self->textHeight + 4 + VERT_BORDER; 881 882 MoveWindow (hwnd, lpCreate->x, lpCreate->y-1, 882 883 width, self->height, FALSE); 883 884 STATUSBAR_SetPartBounds (hwnd); 884 885 … … 891 892 { 892 893 STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (hwnd); 893 int 894 int i; 894 895 895 896 for (i = 0; i < self->numParts; i++) { 896 897 897 if (self->parts[i].text && (self->parts[i].style != SBT_OWNERDRAW)) 898 COMCTL32_Free (self->parts[i].text); 898 899 } 899 900 if (self->part0.text && (self->part0.style != SBT_OWNERDRAW)) 900 901 COMCTL32_Free (self->part0.text); 901 902 COMCTL32_Free (self->parts); 902 903 903 904 /* delete default font */ 904 905 if (self->hDefaultFont) 905 906 DeleteObject (self->hDefaultFont); 906 907 907 908 /* delete tool tip control */ 908 909 if (self->hwndToolTip) 909 910 DestroyWindow (self->hwndToolTip); 910 911 911 912 COMCTL32_Free (self); … … 933 934 len = lstrlenW (infoPtr->parts[0].text); 934 935 if (wParam > len) { 935 936 937 938 939 936 if (infoPtr->bUnicode) 937 lstrcpyW ((LPWSTR)lParam, infoPtr->parts[0].text); 938 else 939 lstrcpyWtoA ((LPSTR)lParam, infoPtr->parts[0].text); 940 return len; 940 941 } 941 942 … … 950 951 951 952 if (infoPtr->hwndToolTip) 952 953 953 STATUSBAR_RelayEvent (infoPtr->hwndToolTip, hwnd, 954 WM_MOUSEMOVE, wParam, lParam); 954 955 return 0; 955 956 } … … 960 961 { 961 962 if (GetWindowLongA (hwnd, GWL_STYLE) & SBARS_SIZEGRIP) { 962 963 964 965 966 967 968 969 970 971 972 973 974 975 963 RECT rect; 964 POINT pt; 965 966 GetClientRect (hwnd, &rect); 967 968 pt.x = (INT)LOWORD(lParam); 969 pt.y = (INT)HIWORD(lParam); 970 ScreenToClient (hwnd, &pt); 971 972 rect.left = rect.right - 13; 973 rect.top += 2; 974 975 if (PtInRect (&rect, pt)) 976 return HTBOTTOMRIGHT; 976 977 } 977 978 … … 1005 1006 STATUSBAR_Refresh (hwnd, hdc); 1006 1007 if (!wParam) 1007 1008 EndPaint (hwnd, &ps); 1008 1009 1009 1010 return 0; … … 1018 1019 infoPtr->hFont = (HFONT)wParam; 1019 1020 if (LOWORD(lParam) == TRUE) { 1020 1021 HDC hdc = GetDC (hwnd); 1021 1022 STATUSBAR_Refresh (hwnd, hdc); 1022 1023 ReleaseDC (hwnd, hdc); … … 1036 1037 1037 1038 if (infoPtr->numParts == 0) 1038 1039 return FALSE; 1039 1040 1040 1041 part = &infoPtr->parts[0]; … … 1044 1045 part->text = 0; 1045 1046 if (infoPtr->bUnicode) { 1046 1047 1048 1049 1047 if (lParam && (len = lstrlenW((LPCWSTR)lParam))) { 1048 part->text = COMCTL32_Alloc ((len+1)*sizeof(WCHAR)); 1049 lstrcpyW (part->text, (LPCWSTR)lParam); 1050 } 1050 1051 } 1051 1052 else { 1052 1053 1054 1055 1053 if (lParam && (len = lstrlenA((LPCSTR)lParam))) { 1054 part->text = COMCTL32_Alloc ((len+1)*sizeof(WCHAR)); 1055 lstrcpyAtoW (part->text, (LPCSTR)lParam); 1056 } 1056 1057 } 1057 1058 … … 1080 1081 1081 1082 if (flags == SIZE_RESTORED) { 1082 1083 1084 1085 1086 1087 1088 MoveWindow (hwnd, parent_rect.left, 1089 1090 1091 1083 /* width and height don't apply */ 1084 parent = GetParent (hwnd); 1085 GetClientRect (parent, &parent_rect); 1086 width = parent_rect.right - parent_rect.left; 1087 x = parent_rect.left; 1088 y = parent_rect.bottom - infoPtr->height; 1089 MoveWindow (hwnd, parent_rect.left, 1090 parent_rect.bottom - infoPtr->height, 1091 width, infoPtr->height, TRUE); 1092 STATUSBAR_SetPartBounds (hwnd); 1092 1093 } 1093 1094 return 0; … … 1113 1114 { 1114 1115 switch (msg) { 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 case SB_SETPARTS: 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1116 case SB_GETBORDERS: 1117 return STATUSBAR_GetBorders (lParam); 1118 1119 case SB_GETICON: 1120 return STATUSBAR_GetIcon (hwnd, wParam); 1121 1122 case SB_GETPARTS: 1123 return STATUSBAR_GetParts (hwnd, wParam, lParam); 1124 1125 case SB_GETRECT: 1126 return STATUSBAR_GetRect (hwnd, wParam, lParam); 1127 1128 case SB_GETTEXTA: 1129 return STATUSBAR_GetTextA (hwnd, wParam, lParam); 1130 1131 case SB_GETTEXTW: 1132 return STATUSBAR_GetTextW (hwnd, wParam, lParam); 1133 1134 case SB_GETTEXTLENGTHA: 1135 case SB_GETTEXTLENGTHW: 1136 return STATUSBAR_GetTextLength (hwnd, wParam); 1137 1138 case SB_GETTIPTEXTA: 1139 return STATUSBAR_GetTipTextA (hwnd, wParam, lParam); 1140 1141 case SB_GETTIPTEXTW: 1142 return STATUSBAR_GetTipTextW (hwnd, wParam, lParam); 1143 1144 case SB_GETUNICODEFORMAT: 1145 return STATUSBAR_GetUnicodeFormat (hwnd); 1146 1147 case SB_ISSIMPLE: 1148 return STATUSBAR_IsSimple (hwnd); 1149 1150 case SB_SETBKCOLOR: 1151 return STATUSBAR_SetBkColor (hwnd, wParam, lParam); 1152 1153 case SB_SETICON: 1154 return STATUSBAR_SetIcon (hwnd, wParam, lParam); 1155 1156 case SB_SETMINHEIGHT: 1157 return STATUSBAR_SetMinHeight (hwnd, wParam, lParam); 1158 1159 case SB_SETPARTS: 1160 return STATUSBAR_SetParts (hwnd, wParam, lParam); 1161 1162 case SB_SETTEXTA: 1163 return STATUSBAR_SetTextA (hwnd, wParam, lParam); 1164 1165 case SB_SETTEXTW: 1166 return STATUSBAR_SetTextW (hwnd, wParam, lParam); 1167 1168 case SB_SETTIPTEXTA: 1169 return STATUSBAR_SetTipTextA (hwnd, wParam, lParam); 1170 1171 case SB_SETTIPTEXTW: 1172 return STATUSBAR_SetTipTextW (hwnd, wParam, lParam); 1173 1174 case SB_SETUNICODEFORMAT: 1175 return STATUSBAR_SetUnicodeFormat (hwnd, wParam); 1176 1177 case SB_SIMPLE: 1178 return STATUSBAR_Simple (hwnd, wParam, lParam); 1179 1180 1181 case WM_CREATE: 1182 return STATUSBAR_WMCreate (hwnd, wParam, lParam); 1183 1184 case WM_DESTROY: 1185 return STATUSBAR_WMDestroy (hwnd); 1186 1187 case WM_GETFONT: 1187 1188 return STATUSBAR_WMGetFont (hwnd); 1188 1189 1189 1190 case WM_GETTEXT: 1190 1191 return STATUSBAR_WMGetText (hwnd, wParam, lParam); 1191 1192 1192 1193 1194 1195 1193 case WM_GETTEXTLENGTH: 1194 return STATUSBAR_GetTextLength (hwnd, 0); 1195 1196 case WM_LBUTTONDBLCLK: 1196 1197 return STATUSBAR_SendNotify (hwnd, NM_DBLCLK); 1197 1198 1198 1199 1200 1201 1199 case WM_LBUTTONUP: 1200 return STATUSBAR_SendNotify (hwnd, NM_CLICK); 1201 1202 case WM_MOUSEMOVE: 1202 1203 return STATUSBAR_WMMouseMove (hwnd, wParam, lParam); 1203 1204 1204 1205 case WM_NCHITTEST: 1205 1206 return STATUSBAR_WMNCHitTest (hwnd, wParam, lParam); 1206 1207 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 // 1234 // 1235 1208 case WM_NCLBUTTONDOWN: 1209 return STATUSBAR_WMNCLButtonDown (hwnd, wParam, lParam); 1210 1211 case WM_NCLBUTTONUP: 1212 return STATUSBAR_WMNCLButtonUp (hwnd, wParam, lParam); 1213 1214 case WM_PAINT: 1215 return STATUSBAR_WMPaint (hwnd, wParam); 1216 1217 case WM_RBUTTONDBLCLK: 1218 return STATUSBAR_SendNotify (hwnd, NM_RDBLCLK); 1219 1220 case WM_RBUTTONUP: 1221 return STATUSBAR_SendNotify (hwnd, NM_RCLICK); 1222 1223 case WM_SETFONT: 1224 return STATUSBAR_WMSetFont (hwnd, wParam, lParam); 1225 1226 case WM_SETTEXT: 1227 return STATUSBAR_WMSetText (hwnd, wParam, lParam); 1228 1229 case WM_SIZE: 1230 return STATUSBAR_WMSize (hwnd, wParam, lParam); 1231 1232 default: 1233 // if (msg >= WM_USER) 1234 // ERR (statusbar, "unknown msg %04x wp=%04x lp=%08lx\n", 1235 // msg, wParam, lParam); 1236 return DefWindowProcA (hwnd, msg, wParam, lParam); 1236 1237 } 1237 1238 return 0; … … 1260 1261 wndClass.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1); 1261 1262 wndClass.lpszClassName = STATUSCLASSNAMEA; 1262 1263 1263 1264 RegisterClassA (&wndClass); 1264 1265 } … … 1275 1276 { 1276 1277 if (GlobalFindAtomA (STATUSCLASSNAMEA)) 1277 1278 } 1279 1278 UnregisterClassA (STATUSCLASSNAMEA, (HINSTANCE)NULL); 1279 } 1280
Note:
See TracChangeset
for help on using the changeset viewer.