From dfa9f8aa5104828d7464a02c0bcf2a6021993eff Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Tue, 15 Mar 2016 23:22:38 +0000 Subject: [PATCH] Added comments to describe functions in widgets/XABContactMenu.cpp --- source/widgets/XABContactMenu.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/source/widgets/XABContactMenu.cpp b/source/widgets/XABContactMenu.cpp index b468833..cfef818 100644 --- a/source/widgets/XABContactMenu.cpp +++ b/source/widgets/XABContactMenu.cpp @@ -31,6 +31,8 @@ enum { XABContactMenu::XABContactMenu(int MenuTypeIn){ + // Setup the XABContactMenu control. + MenuType = MenuTypeIn; // Setup the menu items. @@ -70,6 +72,8 @@ XABContactMenu::XABContactMenu(int MenuTypeIn){ XABContactMenu::~XABContactMenu(){ + // Destory the XABContactMenu object. + // Delete the menu items. for (std::map::iterator MenuItemIter = MenuItems.begin(); @@ -94,6 +98,8 @@ void XABContactMenu::AppendMenuItem(wxString ObjectName, int ItemID, wxItemKind ItemType){ + // Append a menu item to the XABContactMenu control. + wxMenuItem *menuitem = new wxMenuItem( NULL, ItemID, @@ -113,6 +119,8 @@ void XABContactMenu::SetupPointersSearch(wxWindow* WindowPtrIn, wxListCtrl* ContactListCtrlIn, bool SearchModeOnlyIn){ + // Setup the pointers when being used in the search window. + WindowPtr = WindowPtrIn; ContactListCtrl = ContactListCtrlIn; SearchModeOnly = SearchModeOnlyIn; @@ -123,6 +131,8 @@ void XABContactMenu::SetupPointers(wxWindow* WindowPtrIn, wxListCtrl* ContactListCtrlIn, bool EnableAccountSettingsIn){ + // Setup the pointers. + WindowPtr = WindowPtrIn; ContactListCtrl = ContactListCtrlIn; EnableAccountSettings = EnableAccountSettingsIn; @@ -131,6 +141,8 @@ void XABContactMenu::SetupPointers(wxWindow* WindowPtrIn, wxMenu* XABContactMenu::MenuPointer(){ + // Process the menu pointer. + // Check for the following before passing the pointer: // If an account has been selected. // - Disable Refresh Address Book if not. @@ -204,6 +216,9 @@ wxMenu* XABContactMenu::MenuPointer(){ void XABContactMenu::ProcessMenuItemClick( wxCommandEvent& event){ + // Process an action when a menu item in the XABContactMenu + // control is selected. + int ItemID = event.GetId(); if (MenuType == XABCONTACTMENU_MAIN){ -- 2.39.5