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

Function _SpawnInplaceWindow

Libraries/PropertyGrid/PropertyGrid.h:519–545  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

517 }
518
519 BOOL _SpawnInplaceWindow(IProperty* prop, int iItem, int iSubItem)
520 {
521 ATLASSERT(prop);
522 ATLASSERT(iItem!=-1);
523 ATLASSERT(iSubItem!=-1);
524 // Destroy old in-place editor
525 _DestroyInplaceWindow();
526 // Do we need an editor here?
527 if( iItem == -1 || iSubItem == -1 || iItem != GetSelectedIndex() ) return FALSE;
528 if( !prop->IsEnabled() ) return FALSE;
529 // Create a new editor window
530 RECT rcValue = { 0 };
531 _GetSubItemRect(iItem, iSubItem, &rcValue);
532 rcValue.right--; // Let the borders
533 rcValue.bottom--; // ... display (right/bottom)
534 m_hwndInplace = prop->CreateInplaceControl(m_hWnd, rcValue);
535 if( m_hwndInplace ) {
536 // Activate the new editor window
537 ATLASSERT(::IsWindow(m_hwndInplace));
538 ::SetWindowPos(m_hwndInplace, HWND_TOP, 0,0,0,0, SWP_SHOWWINDOW|SWP_NOMOVE|SWP_NOSIZE);
539 ::SetFocus(m_hwndInplace);
540 m_iInplaceRow = iItem;
541 m_iInplaceCol = iSubItem;
542 return TRUE;
543 }
544 return m_hwndInplace != NULL;
545 }
546
547 void _DestroyInplaceWindow()
548 {

Callers 5

SetItemValueFunction · 0.70
OnLButtonDownFunction · 0.70
OnKeyDownFunction · 0.70
OnCharFunction · 0.70
OnChangedPropertyFunction · 0.70

Calls 4

_GetSubItemRectFunction · 0.85
IsEnabledMethod · 0.80
_DestroyInplaceWindowFunction · 0.70
CreateInplaceControlMethod · 0.45

Tested by

no test coverage detected