| 872 | } |
| 873 | |
| 874 | LRESULT OnUpdateProperty(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/) |
| 875 | { |
| 876 | // Updates a property value using an active editor window. |
| 877 | // The editor window uses this message to update the attached property class. |
| 878 | HWND hWnd = reinterpret_cast<HWND>(lParam); |
| 879 | ATLASSERT(::IsWindow(hWnd)); |
| 880 | if( !::IsWindow(hWnd) || m_iInplaceIndex == -1 ) return 0; |
| 881 | IProperty* prop = reinterpret_cast<IProperty*>(TBase::GetItemData(m_iInplaceIndex)); |
| 882 | ATLASSERT(prop); |
| 883 | if( prop == NULL ) return 0; |
| 884 | // Ask owner about change |
| 885 | NMPROPERTYITEM nmh = { m_hWnd, GetDlgCtrlID(), PIN_ITEMCHANGING, prop }; |
| 886 | if( ::SendMessage(GetParent(), WM_NOTIFY, nmh.hdr.idFrom, (LPARAM) &nmh) == 0 ) { |
| 887 | // Set new value |
| 888 | if( !prop->SetValue(hWnd) ) ::MessageBeep((UINT)-1); |
| 889 | // Let owner know |
| 890 | nmh.hdr.code = PIN_ITEMCHANGED; |
| 891 | ::SendMessage(GetParent(), WM_NOTIFY, nmh.hdr.idFrom, (LPARAM) &nmh); |
| 892 | // Repaint item |
| 893 | InvalidateItem(m_iInplaceIndex); |
| 894 | } |
| 895 | // Destroy inplace editor |
| 896 | _DestroyInplaceWindow(); |
| 897 | return 0; |
| 898 | } |
| 899 | |
| 900 | LRESULT OnCancelProperty(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/) |
| 901 | { |
nothing calls this directly
no test coverage detected