Changeset 1614 for trunk/src/comctl32/treeview.c
- Timestamp:
- Nov 5, 1999, 1:57:36 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/comctl32/treeview.c
r1565 r1614 1 /* $Id: treeview.c,v 1.1 3 1999-11-02 21:44:04 achimhaExp $ */1 /* $Id: treeview.c,v 1.14 1999-11-05 12:53:06 phaller Exp $ */ 2 2 /* Treeview control 3 3 * … … 51 51 #include "treeview.h" 52 52 53 54 53 /* ffs should be in <string.h>. */ 55 54 … … 966 965 } 967 966 968 967 969 968 GetClientRect (hwnd, &rect); 970 969 if ((rect.left-rect.right ==0) || (rect.top-rect.bottom==0)) return; 971 970 972 infoPtr->cdmode=TREEVIEW_SendCustomDrawNotify 971 infoPtr->cdmode=TREEVIEW_SendCustomDrawNotify 973 972 (hwnd, CDDS_PREPAINT, hdc, rect); 974 973 … … 987 986 988 987 /* draw background */ 989 988 990 989 hbrBk = CreateSolidBrush (infoPtr->clrBk); 991 990 FillRect(hdc, &rect, hbrBk); … … 1017 1016 /* FIXME: remove this in later stage */ 1018 1017 /* 1019 if (wineItem->pszText!=LPSTR_TEXTCALLBACK32A) 1018 if (wineItem->pszText!=LPSTR_TEXTCALLBACK32A) 1020 1019 TRACE (treeview, "%d %d [%d %d %d %d] (%s)\n",y,x, 1021 1020 wineItem->rect.top, wineItem->rect.bottom, 1022 1021 wineItem->rect.left, wineItem->rect.right, 1023 1022 wineItem->pszText); 1024 else 1023 else 1025 1024 TRACE (treeview, "%d [%d %d %d %d] (CALLBACK)\n", 1026 1025 wineItem->hItem, … … 1079 1078 ShowScrollBar (hwnd, SB_VERT, TRUE); 1080 1079 infoPtr->uInternalStatus |=TV_VSCROLL; 1081 SetScrollRange (hwnd, SB_VERT, 0, 1080 SetScrollRange (hwnd, SB_VERT, 0, 1082 1081 y - infoPtr->uVisibleHeight, FALSE); 1083 1082 SetScrollPos (hwnd, SB_VERT, infoPtr->cy, TRUE); 1084 1083 } 1085 1084 else { 1086 if (infoPtr->uInternalStatus & TV_VSCROLL) 1085 if (infoPtr->uInternalStatus & TV_VSCROLL) 1087 1086 ShowScrollBar (hwnd, SB_VERT, FALSE); 1088 1087 infoPtr->uInternalStatus &= ~TV_VSCROLL; … … 1090 1089 1091 1090 1092 if (infoPtr->cdmode & CDRF_NOTIFYPOSTPAINT) 1093 infoPtr->cdmode=TREEVIEW_SendCustomDrawNotify 1091 if (infoPtr->cdmode & CDRF_NOTIFYPOSTPAINT) 1092 infoPtr->cdmode=TREEVIEW_SendCustomDrawNotify 1094 1093 (hwnd, CDDS_POSTPAINT, hdc, rect); 1095 1094 … … 2020 2019 } 2021 2020 2021 2022 //@@@PH: Note - this SubclassProc is sometimes called with the 2023 // wrong window handle. Therefore, infoPtr points to anything 2024 // but the expected structure. 2022 2025 LRESULT CALLBACK 2023 2026 TREEVIEW_Edit_SubclassProc (HWND hwnd, UINT uMsg, WPARAM wParam, … … 2043 2046 { 2044 2047 TREEVIEW_INFO *infoPtr = TREEVIEW_GetInfoPtr(GetParent(hwnd)); 2045 return CallWindowProcA( infoPtr->wpEditOrig, hwnd, uMsg, wParam, lParam); 2048 2049 //@@@PH 1999/11/05 method called with freed infoPtr memory object 2050 if (infoPtr != NULL) 2051 return CallWindowProcA( infoPtr->wpEditOrig, hwnd, uMsg, wParam, lParam); 2052 else 2053 break; 2046 2054 } 2047 2055 } … … 2176 2184 infoPtr->himlNormal = NULL; 2177 2185 infoPtr->himlState = NULL; 2178 2186 infoPtr->uItemHeight = -1; 2179 2187 GetTextMetricsA (hdc, &tm); 2180 2188 infoPtr->hFont = GetStockObject (DEFAULT_GUI_FONT); 2181 2182 2189 GetObjectA (infoPtr->hFont, sizeof (LOGFONTA), &logFont); 2190 logFont.lfWeight=FW_BOLD; 2183 2191 infoPtr->hBoldFont = CreateFontIndirectA (&logFont); 2184 2192 … … 2189 2197 infoPtr->pCallBackSort=NULL; 2190 2198 infoPtr->uScrollTime = 300; /* milliseconds */ 2199 2200 // @@@PH 1999/11/05 2201 infoPtr->wpEditOrig = NULL; /* no subclass */ 2191 2202 2192 2203 /* … … 2243 2254 infoPtr->hwndEdit, 2244 2255 GWL_WNDPROC, 2245 2256 (LONG) TREEVIEW_Edit_SubclassProc); 2246 2257 2247 2258 ReleaseDC (hwnd, hdc); … … 2257 2268 2258 2269 // TRACE (treeview,"\n"); 2270 2259 2271 TREEVIEW_RemoveTree (hwnd); 2272 2273 //@@@PH 1999/11/05 set infoPtr to NULL 2274 SetWindowLongA( hwnd, 0, (DWORD)NULL); 2275 2260 2276 if (infoPtr->Timer & TV_REFRESH_TIMER_SET) 2261 2277 KillTimer (hwnd, TV_REFRESH_TIMER); … … 2264 2280 2265 2281 COMCTL32_Free (infoPtr); 2282 2266 2283 return 0; 2267 2284 }
Note:
See TracChangeset
for help on using the changeset viewer.