STDMETHODIMP_(bool) CTextExt :: MenuInit (HMENU hMenu, LPARAM lParam, HWND hWnd) { m_hWnd = hWnd; m_hMenu = hMenu; short iType = 0; if (m_hWnd != 0) { /* short iCnt = 0; ELK.eKey = (DWORD)(void *)m_hWnd; ELK.eFcn = (ENUMLONGKEYPROC) EnumSelObjectsFuerMenue;// alle selektierten Objekte ELK.ePtr = (void*)&iCnt; if (!DEX_EnumSelectedObjects(ELK)) return FALSE; if (iCnt > 0) */ DEXOR_QuerySelectedObjectTypes (m_hWnd, iType); if ( iType & OTText ) { EnableMenuItem (m_hMenu, UINT(IDM_OBRECH+MenuOffset()), MF_GRAYED); EnableMenuItem (m_hMenu, UINT(IDM_OBREABH+MenuOffset()), MF_GRAYED); EnableMenuItem (m_hMenu, UINT(IDM_ORLOESCH+MenuOffset()), MF_GRAYED); } else { EnableMenuItem (m_hMenu, UINT(IDM_OBRECH+MenuOffset()), MF_ENABLED); EnableMenuItem (m_hMenu, UINT(IDM_OBREABH+MenuOffset()), MF_ENABLED); EnableMenuItem (m_hMenu, UINT(IDM_ORLOESCH+MenuOffset()), MF_ENABLED); } } return TRUE; }
// -------------------------------------------------------------------------------------------- // MenuOffset geben lassen STDMETHODIMP CGeoEditExtension::GetMenuOffset (UINT* pMenuOffset) { *pMenuOffset = MenuOffset(); return S_OK; }