void CDownloads_Groups::ShowHistoryContextMenu() { CMenu menu; menu.LoadMenu (IDM_GROUP); CMenu *pPopup = menu.GetSubMenu (2); ApplyLanguageToMenu_History (pPopup); pPopup->SetDefaultItem (ID_HISTORY_SETTINGS); if (_DldsMgr.m_histmgr.GetRecordCount () == 0) pPopup->EnableMenuItem (ID_HISTORY_CLEAR, MF_BYCOMMAND | MF_GRAYED); CPoint pt (m_rbX, m_rbY); ClientToScreen (&pt); m_odmenu.Attach (&menu, FALSE); fsSetImage images [] = { fsSetImage (ID_HISTORY_CLEAR, 2), fsSetImage (ID_HISTORY_SETTINGS, 3), }; m_odmenu.SetImages (images, sizeof (images) / sizeof (fsSetImage)); pPopup->TrackPopupMenu (TPM_RIGHTBUTTON | TPM_TOPALIGN | TPM_LEFTALIGN, pt.x, pt.y, this); m_odmenu.Detach (); menu.DestroyMenu (); }
void CSitesWnd::Plugin_GetMenuImages(fsSetImage **ppImages, int *pcImages) { static fsSetImage images [] = { fsSetImage (ID_SITES_ADD, 0), fsSetImage (ID_SITES_PROPERTIES, 1), fsSetImage (ID_SITES_DELETE, 2), }; *ppImages = images; *pcImages = sizeof (images) / sizeof (fsSetImage); }
void CFlashVideoDownloadsWnd::Plugin_GetMenuImages(fsSetImage **ppImages, int *pcImages) { static fsSetImage images [] = { fsSetImage (ID_FVDLD_CREATE, 0), fsSetImage (ID_FVDLD_START, 1), fsSetImage (ID_FVDLD_STOP, 2), fsSetImage (ID_FVDLD_PROPERTIES, 6), fsSetImage (ID_FVDLD_DELETE, 7), }; *ppImages = images; *pcImages = sizeof (images) / sizeof (fsSetImage); }
void CUploadsWnd::Plugin_GetMenuImages(fsSetImage **ppImages, int *pcImages) { static fsSetImage images [] = { fsSetImage (ID_UPL_CREATENEW, 0), fsSetImage (ID_UPL_START, 1), fsSetImage (ID_UPL_STOP, 2), fsSetImage (ID_UPL_PROPERTIES, 6), fsSetImage (ID_UPL_DELETE, 7), }; *ppImages = images; *pcImages = sizeof (images) / sizeof (fsSetImage); }
void CSpiderWnd::Plugin_GetMenuImages(fsSetImage **ppImages, int *pcImages) { static fsSetImage images [] = { fsSetImage (ID_SPIDER_DL, 0), fsSetImage (ID_SPIDER_STARTDL, 1), fsSetImage (ID_SPIDER_STOPDL, 2), fsSetImage (ID_SPIDER_SCHEDULE, 3), fsSetImage (ID_SPIDER_SETTINGS, 4), fsSetImage (ID_SPIDER_DELETE, 5), }; *ppImages = images; *pcImages = sizeof (images) / sizeof (fsSetImage); }
void CDownloads_Groups::ShowGrpContextMenu(HTREEITEM hItem, BOOL bAutoDetect) { if (bAutoDetect) { hItem = GetSelectedItem (); if (hItem) { RECT rc; GetItemRect (hItem, &rc, TRUE); m_rbX = rc.left; m_rbY = rc.top; } } m_hContextMenuItem = hItem; if (hItem) { if (hItem == m_hDeleted) { ShowDeletedContextMenu (); return; } if (hItem == m_hHistory || GetParentItem (hItem) == m_hHistory) { ShowHistoryContextMenu (); return; } } CMenu menu; menu.LoadMenu (IDM_GROUP); CMenu *pPopup = menu.GetSubMenu (0); ApplyLanguageToMenu (pPopup); pPopup->SetDefaultItem (ID_GRPPROPERTIES); if (hItem) { if (hItem == m_hAllGroups || IsGroupItem (hItem)) { if (hItem == m_hAllGroups) { pPopup->EnableMenuItem (ID_GRPDELETE, MF_BYCOMMAND | MF_GRAYED); pPopup->EnableMenuItem (ID_OPENGROUPFOLDER, MF_BYCOMMAND | MF_GRAYED); pPopup->ModifyMenu (ID_GRPPROPERTIES, MF_BYCOMMAND, ID_GRPSETROOTFOLDER, LS (L_SETGRPROOTFOLDER)); } if (hItem == m_hOther) { pPopup->EnableMenuItem (ID_GRPDELETE, MF_BYCOMMAND | MF_GRAYED); } } else { pPopup->EnableMenuItem (ID_GRPPROPERTIES, MF_BYCOMMAND | MF_GRAYED); pPopup->EnableMenuItem (ID_GRPDELETE, MF_BYCOMMAND | MF_GRAYED); pPopup->EnableMenuItem (ID_OPENGROUPFOLDER, MF_BYCOMMAND | MF_GRAYED); if (hItem != m_hFilters && hItem != m_hCompleted && hItem != m_hAllGroups) { pPopup->EnableMenuItem (ID_GRPDELETEALLSUCCESSFUL, MF_BYCOMMAND | MF_GRAYED); pPopup->EnableMenuItem (ID_GRPDELETEALLDEADDLDS, MF_BYCOMMAND | MF_GRAYED); } else if (hItem == m_hCompleted) { pPopup->EnableMenuItem (ID_GRPSTARTALL, MF_BYCOMMAND | MF_GRAYED); pPopup->EnableMenuItem (ID_GRPSTOPALL, MF_BYCOMMAND | MF_GRAYED); pPopup->EnableMenuItem (ID_GRPDELETEALL, MF_BYCOMMAND | MF_GRAYED); } } } else { pPopup->EnableMenuItem (ID_GRPPROPERTIES, MF_BYCOMMAND | MF_GRAYED); pPopup->EnableMenuItem (ID_GRPDELETE, MF_BYCOMMAND | MF_GRAYED); pPopup->EnableMenuItem (ID_OPENGROUPFOLDER, MF_BYCOMMAND | MF_GRAYED); pPopup->EnableMenuItem (ID_GRPSTARTALL, MF_BYCOMMAND | MF_GRAYED); pPopup->EnableMenuItem (ID_GRPSTOPALL, MF_BYCOMMAND | MF_GRAYED); pPopup->EnableMenuItem (ID_GRPDELETEALL, MF_BYCOMMAND | MF_GRAYED); pPopup->EnableMenuItem (ID_GRPDELETEALLSUCCESSFUL, MF_BYCOMMAND | MF_GRAYED); pPopup->EnableMenuItem (ID_GRPDELETEALLDEADDLDS, MF_BYCOMMAND | MF_GRAYED); } CPoint pt (m_rbX, m_rbY); ClientToScreen (&pt); m_odmenu.Attach (&menu, FALSE); fsSetImage images [] = { fsSetImage (ID_GRPCREATE, 0), fsSetImage (ID_GRPDELETE, 1), fsSetImage (ID_GRPDELETEALL, 2), fsSetImage (ID_GRPPROPERTIES, 3), }; m_odmenu.SetImages (images, sizeof (images) / sizeof (fsSetImage)); pPopup->TrackPopupMenu (TPM_RIGHTBUTTON | TPM_TOPALIGN | TPM_LEFTALIGN, pt.x, pt.y, this); m_odmenu.Detach (); menu.DestroyMenu (); }