[Project64] Add enhancements right click edit

This commit is contained in:
zilmar 2019-01-18 12:30:19 +10:30
parent 52c62e5707
commit afa4619bc0
2 changed files with 18 additions and 0 deletions

View File

@ -220,6 +220,22 @@ LRESULT CEnhancementConfig::OnEnhancementListSelChanged(NMHDR * /*pNMHDR*/)
return TRUE;
}
LRESULT CEnhancementConfig::OnEditItem(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
if (m_hSelectedItem != NULL)
{
TVITEM item;
item.mask = TVIF_PARAM;
item.hItem = m_hSelectedItem;
m_TreeList.GetItem(&item);
CEditEnhancement(item.lParam).Display(m_hWnd);
RefreshList();
}
return TRUE;
}
LRESULT CEnhancementConfig::OnDeleteItem(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
if (m_hSelectedItem == NULL)

View File

@ -17,6 +17,7 @@ public:
BEGIN_MSG_MAP_EX(CEnhancementConfig)
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
COMMAND_ID_HANDLER(IDCANCEL, OnCloseCmd)
COMMAND_ID_HANDLER(ID_POPUP_EDIT, OnEditItem)
COMMAND_ID_HANDLER(ID_POPUP_DELETE, OnDeleteItem)
COMMAND_ID_HANDLER(ID_POPUP_ADDENHANCEMENT, OnAddEnhancement)
NOTIFY_HANDLER_EX(IDC_ENHANCEMENTLIST, NM_CLICK, OnEnhancementListClicked)
@ -40,6 +41,7 @@ public:
LRESULT OnEnhancementListDblClicked(NMHDR* pNMHDR);
LRESULT OnEnhancementListSelChanged(NMHDR* pNMHDR);
LRESULT OnDeleteItem(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
LRESULT OnEditItem(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
private:
CEnhancementConfig(const CEnhancementConfig&); // Disable copy constructor