From bdcd4c4685d6693eff7f9575f2a3ee7ed5f0ea5e Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Tue, 15 Mar 2016 23:11:37 +0000 Subject: [PATCH] Added comments to describe functions in widgets/XABAccountView.cpp --- source/widgets/XABAccountView.cpp | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/source/widgets/XABAccountView.cpp b/source/widgets/XABAccountView.cpp index fe7b8c6..8034968 100644 --- a/source/widgets/XABAccountView.cpp +++ b/source/widgets/XABAccountView.cpp @@ -19,38 +19,47 @@ #include "XABAccountView.h" BEGIN_EVENT_TABLE(XABAccountView, wxTreeCtrl) - //EVT_LEFT_UP(XABAccountView::OnMouseClick) - EVT_LEFT_DCLICK(XABAccountView::OnMouseClick) - EVT_TREE_ITEM_EXPANDED(-1, XABAccountView::ExpColProc) - EVT_TREE_ITEM_COLLAPSED(-1, XABAccountView::ExpColProc) +EVT_LEFT_DCLICK(XABAccountView::OnMouseClick) +EVT_TREE_ITEM_EXPANDED(-1, XABAccountView::ExpColProc) +EVT_TREE_ITEM_COLLAPSED(-1, XABAccountView::ExpColProc) END_EVENT_TABLE() void XABAccountView::Init(){ + // Initialise the XABAccountView object. + idx = -1; } bool XABAccountView::Create(wxWindow* parent){ + // Create the XABAccountView control. + return wxTreeCtrl::Create(parent, 1, wxPoint(0,0), wxSize(100,100), wxTR_DEFAULT_STYLE|wxTR_HIDE_ROOT); } wxWindow* XABAccountView::GetControl(){ + // Get the control pointer. + return this; } void XABAccountView::SetStringValue(const wxString& s){ + // Set the string value for the XABAccountView control. + tid = wxTreeCtrl::GetSelection(); } wxString XABAccountView::GetStringValue() const{ + // Get the string value for the XABAccountView control. + if (tid.IsOk()){ wxString wxStrName = wxTreeCtrl::GetItemText(tid); return wxStrName; @@ -81,14 +90,19 @@ void XABAccountView::OnMouseClick(wxMouseEvent& WXUNUSED(event)){ void XABAccountView::SetAccount(){ + // Set the account for the XABAccountView control. + tid = wxTreeCtrl::GetSelection(); Dismiss(); } -// Needed by SetStringValue wxTreeItemId XABAccountView::FindItemByText(wxTreeItemId parent, const wxString& text) { + + // Find an item based on the supplied wxString value. + // Return a wxTreeItemId object if found. + wxTreeItemIdValue cookie; wxTreeItemId child = GetFirstChild(parent, cookie); while (child.IsOk()) @@ -110,6 +124,9 @@ wxTreeItemId XABAccountView::FindItemByText(wxTreeItemId parent, const wxString& void XABAccountView::ExpColProc(wxTreeEvent& event){ + // Function when pressing the down button on the + // XABAccountView control. + ixp = TRUE; } \ No newline at end of file -- 2.39.5