| 694 | } |
| 695 | |
| 696 | LRESULT OnChangedProperty(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/) |
| 697 | { |
| 698 | // Updates a property value. |
| 699 | // A property class uses this message to make sure the corresponding editor window |
| 700 | // is updated as well. |
| 701 | // Parameters: |
| 702 | // WPARAM = New value (VARIANT*) |
| 703 | // LPARAM = Property (IProperty*) |
| 704 | IProperty* prop = reinterpret_cast<IProperty*>(lParam); |
| 705 | VARIANT* pVariant = reinterpret_cast<VARIANT*>(wParam); |
| 706 | ATLASSERT(prop && pVariant); |
| 707 | if( prop == NULL || pVariant == NULL ) return 0; |
| 708 | // Ask owner about change |
| 709 | NMPROPERTYITEM nmh = { m_hWnd, GetDlgCtrlID(), PIN_ITEMCHANGING, prop }; |
| 710 | if( ::SendMessage(GetParent(), WM_NOTIFY, nmh.hdr.idFrom, (LPARAM) &nmh) == 0 ) { |
| 711 | // Set new value |
| 712 | // NOTE: Do not call this from IProperty::SetValue(VARIANT*) = endless loop |
| 713 | if( !prop->SetValue(*pVariant) ) ::MessageBeep((UINT)-1); |
| 714 | // Let owner know |
| 715 | nmh.hdr.code = PIN_ITEMCHANGED; |
| 716 | ::SendMessage(GetParent(), WM_NOTIFY, nmh.hdr.idFrom, (LPARAM) &nmh); |
| 717 | } |
| 718 | // Locate the updated tree item |
| 719 | HTREEITEM hItem = _FindProperty(prop); |
| 720 | // Repaint item |
| 721 | _InvalidateItem(hItem); |
| 722 | // Recycle in-place control so it displays the new value |
| 723 | if( hItem != NULL && (hItem == m_iInplaceIndex) ) _SpawnInplaceWindow(prop, hItem); |
| 724 | return 0; |
| 725 | } |
| 726 | |
| 727 | LRESULT OnDeleteItem(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/) |
| 728 | { |
nothing calls this directly
no test coverage detected