Changeset 2858 for trunk/src/comctl32/toolbar.c
- Timestamp:
- Feb 22, 2000, 6:11:41 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/comctl32/toolbar.c
r2523 r2858 1 /* $Id: toolbar.c,v 1.2 5 2000-01-26 18:04:30 cbratschi Exp $ */1 /* $Id: toolbar.c,v 1.26 2000-02-22 17:11:40 cbratschi Exp $ */ 2 2 /* 3 3 * Toolbar control … … 28 28 */ 29 29 30 /* WINE 991212 level */ 30 /* 31 - Corel 20000212 level 32 - WINE 991212 level 33 */ 31 34 32 35 /* CB: Odin32/WINE bugs … … 616 619 /* the last row. */ 617 620 infoPtr->nHeight = TOP_BORDER + (nRows + 1) * infoPtr->nButtonHeight + 618 nSepRows * SEPARATOR_WIDTH * 2 / 3+621 nSepRows * (SEPARATOR_WIDTH * 2 / 3) + 619 622 nSepRows * (infoPtr->nBitmapHeight + 1) + 620 623 BOTTOM_BORDER; … … 2197 2200 RECT parent_rect; 2198 2201 HWND parent; 2199 /* INT32 x, y; */2202 INT x, y; 2200 2203 INT cx, cy; 2201 2204 UINT uPosFlags = 0; 2202 2205 2203 // TRACE (toolbar, "resize forced!\n"); 2204 2206 //TRACE (toolbar, "resize forced!\n"); 2207 2208 x = y = 0; 2205 2209 parent = GetParent (hwnd); 2206 2210 GetClientRect(parent, &parent_rect); … … 2225 2229 cy += GetSystemMetrics(SM_CYEDGE); 2226 2230 2231 if (dwStyle & WS_BORDER) 2232 { 2233 x = y = 1; 2234 cy += GetSystemMetrics(SM_CYEDGE); 2235 cx += GetSystemMetrics(SM_CYEDGE); 2236 } 2237 2227 2238 infoPtr->bAutoSize = TRUE; 2228 SetWindowPos (hwnd, HWND_TOP, parent_rect.left , parent_rect.top,2239 SetWindowPos (hwnd, HWND_TOP, parent_rect.left - x, parent_rect.top - y, 2229 2240 cx, cy, uPosFlags); 2230 2241 … … 2290 2301 INT nIndex; 2291 2302 INT nOldIndex = -1; 2303 BOOL bChecked = FALSE; 2292 2304 2293 2305 nIndex = TOOLBAR_GetButtonIndex (infoPtr, (INT)wParam); … … 2299 2311 if (!(btnPtr->fsStyle & TBSTYLE_CHECK)) 2300 2312 return FALSE; 2313 2314 bChecked = (btnPtr->fsState & TBSTATE_CHECKED) ? TRUE : FALSE; 2301 2315 2302 2316 if (LOWORD(lParam) == FALSE) … … 2314 2328 } 2315 2329 2316 hdc = GetDC (hwnd); 2317 if (nOldIndex != -1) 2318 TOOLBAR_DrawButton (hwnd, &infoPtr->buttons[nOldIndex], hdc); 2319 TOOLBAR_DrawButton (hwnd, btnPtr, hdc); 2320 ReleaseDC (hwnd, hdc); 2330 if( bChecked != LOWORD(lParam) ) 2331 { 2332 hdc = GetDC (hwnd); 2333 if (nOldIndex != -1) 2334 TOOLBAR_DrawButton (hwnd, &infoPtr->buttons[nOldIndex], hdc); 2335 TOOLBAR_DrawButton (hwnd, btnPtr, hdc); 2336 ReleaseDC (hwnd, hdc); 2337 } 2321 2338 2322 2339 /* FIXME: Send a WM_NOTIFY?? */ … … 2439 2456 HDC hdc; 2440 2457 INT nIndex; 2458 BOOL bEnabled = FALSE; 2441 2459 2442 2460 nIndex = TOOLBAR_GetButtonIndex (infoPtr, (INT)wParam); … … 2445 2463 2446 2464 btnPtr = &infoPtr->buttons[nIndex]; 2465 bEnabled = (btnPtr->fsState & TBSTATE_ENABLED )? TRUE : FALSE ; 2466 2447 2467 if (LOWORD(lParam) == FALSE) 2448 2468 btnPtr->fsState &= ~(TBSTATE_ENABLED | TBSTATE_PRESSED); … … 2450 2470 btnPtr->fsState |= TBSTATE_ENABLED; 2451 2471 2452 hdc = GetDC (hwnd); 2453 TOOLBAR_DrawButton (hwnd, btnPtr, hdc); 2454 ReleaseDC (hwnd, hdc); 2472 if( bEnabled != LOWORD(lParam) ) 2473 { 2474 hdc = GetDC (hwnd); 2475 TOOLBAR_DrawButton (hwnd, btnPtr, hdc); 2476 ReleaseDC (hwnd, hdc); 2477 } 2455 2478 2456 2479 return TRUE; … … 3230 3253 if (((INT)LOWORD(lParam) <= 0) || ((INT)HIWORD(lParam) <= 0)) return FALSE; 3231 3254 3255 /* Bitmap size can only be set before adding any button to the toolbar 3256 according to the documentation. */ 3257 if( infoPtr->nNumButtons != 0 ) 3258 return FALSE; 3259 3232 3260 infoPtr->nBitmapWidth = (INT)LOWORD(lParam); 3233 3261 infoPtr->nBitmapHeight = (INT)HIWORD(lParam); … … 3339 3367 if (((INT)LOWORD(lParam) <= 0) || ((INT)HIWORD(lParam) <= 0)) return FALSE; 3340 3368 3369 /* Button size can only be set before adding any button to the toolbar 3370 according to the documentation. */ 3371 if( infoPtr->nNumButtons != 0 ) 3372 return FALSE; 3373 3341 3374 infoPtr->nButtonWidth = (INT)LOWORD(lParam); 3342 3375 infoPtr->nButtonHeight = (INT)HIWORD(lParam); … … 3670 3703 /* initialize info structure */ 3671 3704 infoPtr->nButtonHeight = 22; 3672 infoPtr->nButtonWidth = 2 3;3705 infoPtr->nButtonWidth = 24; 3673 3706 infoPtr->nBitmapHeight = 15; 3674 3707 infoPtr->nBitmapWidth = 16; … … 4101 4134 GetWindowRect (hwnd, &rcWindow); 4102 4135 OffsetRect (&rcWindow, -rcWindow.left, -rcWindow.top); 4136 if( dwStyle & WS_BORDER ) 4137 OffsetRect (&rcWindow, 1, 1); 4103 4138 DrawEdge (hdc, &rcWindow, EDGE_ETCHED, BF_TOP); 4104 4139 } … … 4162 4197 RECT parent_rect; 4163 4198 HWND parent; 4164 INT x ,y,cx,cy;4199 INT x = 0,y = 0,cx,cy; 4165 4200 INT flags; 4166 4201 UINT uPosFlags = 0; … … 4213 4248 cy += GetSystemMetrics(SM_CYEDGE); 4214 4249 4215 SetWindowPos (hwnd, 0, x, y, 4250 if (dwStyle & WS_BORDER) 4251 { 4252 x = y = 1; 4253 cy += GetSystemMetrics(SM_CYEDGE); 4254 cx += GetSystemMetrics(SM_CYEDGE); 4255 } 4256 4257 SetWindowPos (hwnd, 0, parent_rect.left - x, parent_rect.top - y, 4216 4258 cx, cy, uPosFlags | SWP_NOZORDER); 4217 4259 } … … 4587 4629 { 4588 4630 WNDCLASSA wndClass; 4589 4590 //SvL: Don't check this now4591 // if (GlobalFindAtomA (TOOLBARCLASSNAMEA)) return;4592 4631 4593 4632 ZeroMemory (&wndClass, sizeof(WNDCLASSA)); … … 4607 4646 TOOLBAR_Unregister (VOID) 4608 4647 { 4609 if (GlobalFindAtomA (TOOLBARCLASSNAMEA)) 4610 UnregisterClassA (TOOLBARCLASSNAMEA, (HINSTANCE)NULL); 4611 } 4612 4648 UnregisterClassA (TOOLBARCLASSNAMEA, (HINSTANCE)NULL); 4649 } 4650
Note:
See TracChangeset
for help on using the changeset viewer.