MCPcopy Create free account
hub / github.com/CobaltFusion/DebugViewPP / OnUpdateProperty

Function OnUpdateProperty

Libraries/PropertyGrid/PropertyGrid.h:1032–1061  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1030 }
1031
1032 LRESULT OnUpdateProperty(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/)
1033 {
1034 // Updates a property value using an active editor window.
1035 // The editor window uses this message to update the attached property class.
1036 // Parameters:
1037 // LPARAM = Window (HWND)
1038 HWND hWnd = reinterpret_cast<HWND>(lParam);
1039 ATLASSERT(::IsWindow(hWnd));
1040 if( !::IsWindow(hWnd) || (m_iInplaceRow == -1) || (m_iInplaceCol == -1) ) return 0;
1041 ATLASSERT(hWnd==m_hwndInplace);
1042 IProperty* prop = GetProperty(m_iInplaceRow, m_iInplaceCol);
1043 if( prop == NULL ) return 0;
1044 // Ask owner about change
1045 NMPROPERTYITEM nmh = { m_hWnd, GetDlgCtrlID(), PIN_ITEMCHANGING, prop };
1046 if( ::SendMessage(GetParent(), WM_NOTIFY, nmh.hdr.idFrom, (LPARAM) &nmh) == 0 ) {
1047 // Commit change
1048 if( !prop->SetValue(hWnd) ) {
1049 ::MessageBeep((UINT)-1);
1050 return 0;
1051 }
1052 // Let owner know
1053 nmh.hdr.code = PIN_ITEMCHANGED;
1054 ::SendMessage(GetParent(), WM_NOTIFY, nmh.hdr.idFrom, (LPARAM) &nmh);
1055 // Repaint item
1056 _InvalidateItem(m_iInplaceRow, m_iInplaceCol);
1057 }
1058 // Destroy in-place control...
1059 _DestroyInplaceWindow();
1060 return 0;
1061 }
1062
1063 LRESULT OnCancelProperty(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/)
1064 {

Callers

nothing calls this directly

Calls 4

GetPropertyFunction · 0.70
_InvalidateItemFunction · 0.70
_DestroyInplaceWindowFunction · 0.70
SetValueMethod · 0.45

Tested by

no test coverage detected