| 915 | } |
| 916 | |
| 917 | LRESULT OnChangedProperty(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/) |
| 918 | { |
| 919 | // Updates a property value. |
| 920 | // A property class uses this message to make sure the corresponding editor window |
| 921 | // is updated as well. |
| 922 | IProperty* prop = reinterpret_cast<IProperty*>(lParam); |
| 923 | VARIANT* pVariant = reinterpret_cast<VARIANT*>(wParam); |
| 924 | ATLASSERT(prop && pVariant); |
| 925 | if( prop == NULL || pVariant == NULL ) return 0; |
| 926 | // Ask owner about change |
| 927 | NMPROPERTYITEM nmh = { m_hWnd, GetDlgCtrlID(), PIN_ITEMCHANGING, prop }; |
| 928 | if( ::SendMessage(GetParent(), WM_NOTIFY, nmh.hdr.idFrom, (LPARAM) &nmh) == 0 ) { |
| 929 | // Set new value |
| 930 | // NOTE: Do not call this from IProperty::SetValue(VARIANT*) = endless loop |
| 931 | if( !prop->SetValue(*pVariant) ) ::MessageBeep((UINT)-1); |
| 932 | // Let owner know |
| 933 | nmh.hdr.code = PIN_ITEMCHANGED; |
| 934 | ::SendMessage(GetParent(), WM_NOTIFY, nmh.hdr.idFrom, (LPARAM) &nmh); |
| 935 | } |
| 936 | // Locate the updated property index |
| 937 | int idx = FindProperty(prop); |
| 938 | // Repaint item |
| 939 | InvalidateItem(idx); |
| 940 | // Recycle in-place control so it displays the new value |
| 941 | if( idx >= 0 && idx == m_iInplaceIndex ) _SpawnInplaceWindow(prop, idx); |
| 942 | return 0; |
| 943 | } |
| 944 | |
| 945 | LRESULT OnExpand(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/) |
| 946 | { |
nothing calls this directly
no test coverage detected