void frmSearch::ShowContactMenu( wxMouseEvent& event ){
- ContactMenu->SetupPointers(this, lstResults);
+ ContactMenu->SetupPointersSearch(this, lstResults, SearchMode);
PopupMenu(ContactMenu->MenuPointer(), wxDefaultPosition);
}
-void XABContactMenu::SetupPointers(wxWindow* WindowPtrIn,
- wxListCtrl* ContactListCtrlIn){
+void XABContactMenu::SetupPointersSearch(wxWindow* WindowPtrIn,
+ wxListCtrl* ContactListCtrlIn,
+ bool SearchModeOnlyIn){
WindowPtr = WindowPtrIn;
ContactListCtrl = ContactListCtrlIn;
+ SearchModeOnly = SearchModeOnlyIn;
}
std::map<std::string, wxMenuItem*>::iterator MenuItemIter = MenuItems.find("opencontact");
MenuItemIter->second->Enable(ContactSelected);
- MenuItemIter = MenuItems.find("editcontact");
- MenuItemIter->second->Enable(ContactSelected);
- MenuItemIter = MenuItems.find("revealcontact");
- MenuItemIter->second->Enable(ContactSelected);
+
+ if (SearchModeOnly == TRUE){
+
+ MenuItemIter = MenuItems.find("editcontact");
+ MenuItemIter->second->Enable(FALSE);
+ MenuItemIter = MenuItems.find("revealcontact");
+ MenuItemIter->second->Enable(FALSE);
+
+ } else {
+
+ MenuItemIter = MenuItems.find("editcontact");
+ MenuItemIter->second->Enable(ContactSelected);
+ MenuItemIter = MenuItems.find("revealcontact");
+ MenuItemIter->second->Enable(ContactSelected);
+
+ }
}
wxListCtrl *ContactListCtrl = NULL;
wxWindow *WindowPtr = NULL;
bool EnableAccountSettings = FALSE;
+ bool SearchModeOnly = FALSE;
void AppendMenuItem(wxString ObjectName,
wxString MenuName,
wxString MenuDescription,
public:
XABContactMenu(int MenuType);
~XABContactMenu();
- void SetupPointers(wxWindow* WindowPtrIn,
- wxListCtrl* ContactListCtrlIn);
+ void SetupPointersSearch(wxWindow* WindowPtrIn,
+ wxListCtrl* ContactListCtrlIn,
+ bool SearchModeOnlyIn);
void SetupPointers(wxWindow* WindowPtrIn,
wxListCtrl* ContactListCtrlIn,
bool EnableAccountSettingsIn);