Beispiel #1
0
void CSerManager::OnRclickList(NMHDR* pNMHDR, LRESULT* pResult)
{
    // TODO: Add your control notification handler code here
    if (m_list_server.IsWindowVisible())
    {
        CMenu	popup;
        popup.LoadMenu(IDR_SLIST);
        CMenu*	pM = popup.GetSubMenu(0);
        CPoint	p;
        GetCursorPos(&p);

        pM->TrackPopupMenu(TPM_LEFTALIGN, p.x, p.y, this);
        *pResult = 0;
    }
}
Beispiel #2
0
void CPage4::OnNMRClickListProcess(NMHDR *pNMHDR, LRESULT *pResult)
{
    LPNMITEMACTIVATE pNMItemActivate = reinterpret_cast<LPNMITEMACTIVATE>(pNMHDR);
    // TODO: 在此添加控件通知处理程序代码
    NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
    if (pNMListView->iItem != -1 && pNMListView->iSubItem != -1)
    {
        CPoint pt;
        GetCursorPos(&pt);
        CMenu menu;
        menu.LoadMenu(IDR_MENU4_PROCESS);
        CMenu* pMenu = menu.GetSubMenu(0);
        pMenu->TrackPopupMenu(TPM_LEFTALIGN | TPM_LEFTBUTTON, pt.x, pt.y, this);
    }
    *pResult = 0;
}
BOOL CCompileEditView::CreateSaveMenu()
{
    if(g_pSaveMenu.m_hMenu != NULL)
        g_pSaveMenu.DestroyMenu();

    if( !g_pSaveMenu.LoadMenu(IDR_SAVEMENU) )
        return FALSE;

    CTreeCtrlFormula* pTree = NULL;

    if( pTree == NULL )
        return FALSE;

    CMenu& popup = *g_pSaveMenu.GetSubMenu(0);
    if( popup.m_hMenu == NULL )
        return FALSE;

    popup.RemoveMenu(0,MF_BYPOSITION);
    pTree->AddTreeGroupToMenu(SAVEMENU_BEGIN,popup);

    return TRUE;
}
void CSheduler_Tasks::OnRClick()
{
    CMenu menu;
    menu.LoadMenu (IDM_TASKS);
    ApplyLanguageToMenu (&menu);
    CMenu *pPopup = menu.GetSubMenu (0);

    UpdateMenu (pPopup);

    ClientToScreen (&m_rbPt);

    m_odmenu.Attach (&menu, FALSE);

    m_odmenu.SetImageList (&((CMainFrame*)AfxGetApp ()->m_pMainWnd)->m_imgsMenu, &((CMainFrame*)AfxGetApp ()->m_pMainWnd)->m_dimgsMenu);
    fsSetImage *pImages;
    int cImages;
    CShedulerWnd::Plugin_GetMenuImages (&pImages, &cImages);
    m_odmenu.SetImages (pImages, cImages);

    pPopup->TrackPopupMenu (TPM_RIGHTBUTTON | TPM_TOPALIGN | TPM_LEFTALIGN,	m_rbPt.x, m_rbPt.y, this);
    m_odmenu.Detach ();

    menu.DestroyMenu ();
}