probleme with popupmenu and wxListCtrl

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
j
Earned a small fee
Earned a small fee
Posts: 18
Joined: Tue Jan 23, 2007 10:54 am
Location: Luxembourg
Contact:

probleme with popupmenu and wxListCtrl

Post by j » Fri Aug 03, 2007 1:16 pm

Hi All,
I explain you, i have my wxListCtrl, i would like when user click on an item, display a popupmenu and when user click on a menu, display what contain my item in my console.

this is my code in my event table

Code: Select all

EVT_LIST_ITEM_RIGHT_CLICK(XRCID("m_buddyListCtrl"), MyFrame::OnColRightClick)

this is my function call when user click right

Code: Select all

void MyFrame::OnColRightClick(wxListEvent& event)
{
    wxMenu menu(wxT("Delete"));
        menu.Append(LIST_DELETE, _T("&About"));
    PopupMenu(&menu, wxPoint(event.GetPoint().x,(event.GetPoint().y)+110));
}
so for now all is ok and running, now when user clique on "About", i want the item display in my console, the problem is how get this item !

so in my event table i've that :

Code: Select all

EVT_MENU(LIST_DELETE,  MyFrame::OnDeleteContact)
But now i block here !
well if somebody have info on that .... :arrow:

benedicte
wxWorld Domination!
wxWorld Domination!
Posts: 1409
Joined: Wed Jan 19, 2005 3:44 pm
Location: Paris, France

Post by benedicte » Fri Aug 03, 2007 5:04 pm

Maybe you can simply get the currently selected line in the listCtrl when you enter the "OnDeleteContact" function.

Post Reply