![]() |
Update handler doesn't work for popup menus? |
Post Reply ![]() |
Author | |
Howard Farseer ![]() Groupie ![]() Joined: 30 September 2007 Status: Offline Points: 30 |
![]() ![]() ![]() ![]() ![]() Posted: 20 June 2008 at 2:03pm |
I created a popup menu by loading from resource when right-click at dockpane, but it doesn't change its state like enable/disabled. i'v already immplemented ON_UPDATE_COMMAND_UI for that same item ID and it works for toolbar popup menu. I dont want to append menu one by one but to load menu from resource. Any body knows that?
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
Check what hWnd parameter you use.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Howard Farseer ![]() Groupie ![]() Joined: 30 September 2007 Status: Offline Points: 30 |
![]() ![]() ![]() ![]() ![]() |
Hi, here's my code
void CTodoListView::OnRightClickList(NMHDR* pNMHDR, LRESULT* pResult)
{ NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR; const int nRow = pNMListView->iItem; const int nCol = pNMListView->iSubItem; int ret = 0; POINT point = pNMListView->ptAction; if (nRow != -1 && m_wndTodoList.GetItemState(nRow,LVIS_SELECTED) == LVIS_SELECTED)
{ CMenu menu; // ClientToScreen(&point);
GetCursorPos(&point); VERIFY(menu.LoadMenu(IDR_TODOLIST)); CMenu* pPopup = menu.GetSubMenu(1); ASSERT(pPopup != NULL); /* CShellContextMenus scm; CStringArray saFilesSel; m_wndTodoList.GetAllSelectedPaths(saFilesSel); scm.SetObjects(saFilesSel); UINT idCommand = scm.ShowContextMenu(this, point);*/ // pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, point.x, point.y, this); XTFuncContextMenu(pPopup, TPM_LEFTALIGN | TPM_RIGHTBUTTON, point.x, point.y, this, IDR_TOOLBAR_TODOLIST); ...
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
if you use "this" Update handler have to be in CTodoListView.
Instead "this" try "AfxGetMainWnd()"
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |