| 465 | } |
| 466 | |
| 467 | BOOL _SpawnInplaceWindow(IProperty* prop, HTREEITEM hItem) |
| 468 | { |
| 469 | ATLASSERT(prop); |
| 470 | ATLASSERT(hItem); |
| 471 | // Destroy old editor |
| 472 | _DestroyInplaceWindow(); |
| 473 | // Do we need an editor here? |
| 474 | if( hItem == NULL || hItem != GetSelectedItem() ) return FALSE; |
| 475 | if( !prop->IsEnabled() ) return FALSE; |
| 476 | // Create a new editor window |
| 477 | RECT rcValue = { 0 }; |
| 478 | _GetInplaceRect(hItem, &rcValue); |
| 479 | ::InflateRect(&rcValue, 0, -1); |
| 480 | m_hwndInplace = prop->CreateInplaceControl(m_hWnd, rcValue); |
| 481 | if( m_hwndInplace != NULL ) { |
| 482 | // Activate the new editor window |
| 483 | ATLASSERT(::IsWindow(m_hwndInplace)); |
| 484 | ::SetWindowPos(m_hwndInplace, HWND_TOP, 0,0,0,0, SWP_SHOWWINDOW | SWP_NOMOVE | SWP_NOSIZE); |
| 485 | m_iInplaceIndex = hItem; |
| 486 | } |
| 487 | return m_hwndInplace != NULL; |
| 488 | } |
| 489 | |
| 490 | void _InvalidateItem(HTREEITEM hItem) |
| 491 | { |
no test coverage detected