Changeset 1058 for trunk/src/comctl32/status.c
- Timestamp:
- Sep 26, 1999, 1:01:11 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/comctl32/status.c
r496 r1058 1 /* $Id: status.c,v 1.1 0 1999-08-14 16:13:12 cbratschiExp $ */1 /* $Id: status.c,v 1.11 1999-09-26 11:01:10 achimha Exp $ */ 2 2 /* 3 3 * Interface code to StatusWindow widget/control … … 8 8 * Copyright 1999 Christoph Bratschi 9 9 */ 10 11 /* WINE 990923 level */ 10 12 11 13 #include "winbase.h" … … 838 840 LPCREATESTRUCTA lpCreate = (LPCREATESTRUCTA)lParam; 839 841 NONCLIENTMETRICSA nclm; 840 RECT 841 int 842 HDC 842 RECT rect; 843 int width, len; 844 HDC hdc; 843 845 STATUSWINDOWINFO *self; 844 846 … … 873 875 874 876 if (IsWindowUnicode (hwnd)) { 875 876 len = lstrlenW ((LPCWSTR)lpCreate->lpszName); 877 if (len) {878 879 880 877 self->bUnicode = TRUE; 878 if (lpCreate->lpszName && 879 (len = lstrlenW ((LPCWSTR)lpCreate->lpszName))) { 880 self->parts[0].text = COMCTL32_Alloc ((len + 1)*sizeof(WCHAR)); 881 lstrcpyW (self->parts[0].text, (LPCWSTR)lpCreate->lpszName); 882 } 881 883 } 882 884 else { 883 len = lstrlenA ((LPCSTR)lpCreate->lpszName); 884 if (len) { 885 self->parts[0].text = COMCTL32_Alloc ((len + 1)*sizeof(WCHAR)); 886 lstrcpyAtoW (self->parts[0].text, (char*)lpCreate->lpszName); 887 } 888 } 889 890 hdc = GetDC(hwnd); 891 if (hdc) { 892 TEXTMETRICA tm; 893 HFONT hOldFont; 894 895 hOldFont = SelectObject (hdc,self->hDefaultFont); 896 GetTextMetricsA(hdc, &tm); 897 self->textHeight = tm.tmHeight; 898 SelectObject (hdc, hOldFont); 899 ReleaseDC(hwnd, hdc); 885 if (lpCreate->lpszName && 886 (len = lstrlenA ((LPCSTR)lpCreate->lpszName))) { 887 self->parts[0].text = COMCTL32_Alloc ((len + 1)*sizeof(WCHAR)); 888 lstrcpyAtoW (self->parts[0].text, (LPCSTR)lpCreate->lpszName); 889 } 890 } 891 892 if ((hdc = GetDC (0))) { 893 TEXTMETRICA tm; 894 HFONT hOldFont; 895 896 hOldFont = SelectObject (hdc,self->hDefaultFont); 897 GetTextMetricsA(hdc, &tm); 898 self->textHeight = tm.tmHeight; 899 SelectObject (hdc, hOldFont); 900 ReleaseDC(0, hdc); 900 901 } 901 902 902 903 if (GetWindowLongA (hwnd, GWL_STYLE) & SBT_TOOLTIPS) { 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 904 self->hwndToolTip = 905 CreateWindowExA (0, TOOLTIPS_CLASSA, NULL, 0, 906 CW_USEDEFAULT, CW_USEDEFAULT, 907 CW_USEDEFAULT, CW_USEDEFAULT, 908 hwnd, 0, 909 GetWindowLongA (hwnd, GWL_HINSTANCE), NULL); 910 911 if (self->hwndToolTip) { 912 NMTOOLTIPSCREATED nmttc; 913 914 nmttc.hdr.hwndFrom = hwnd; 915 nmttc.hdr.idFrom = GetWindowLongA (hwnd, GWL_ID); 916 nmttc.hdr.code = NM_TOOLTIPSCREATED; 917 nmttc.hwndToolTips = self->hwndToolTip; 918 919 SendMessageA (GetParent (hwnd), WM_NOTIFY, 920 (WPARAM)nmttc.hdr.idFrom, (LPARAM)&nmttc); 921 } 921 922 } 922 923 923 924 GetClientRect (GetParent (hwnd), &rect); 924 925 width = rect.right - rect.left; 925 self->height = self->textHeight +2*VERT_BORDER+2*VERT_SPACE;926 self->height = self->textHeight + 4 + VERT_BORDER; 926 927 MoveWindow (hwnd, lpCreate->x, lpCreate->y-1, 927 928 width, self->height, FALSE); 928 929 STATUSBAR_SetPartBounds (hwnd); 929 930
Note:
See TracChangeset
for help on using the changeset viewer.