From: <vo...@us...> - 2014-01-28 04:50:13
|
Revision: 6046 http://sourceforge.net/p/moneymanagerex/code/6046 Author: vomikan Date: 2014-01-28 04:50:10 +0000 (Tue, 28 Jan 2014) Log Message: ----------- cleanup Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2014-01-28 02:23:52 UTC (rev 6045) +++ trunk/src/mmcheckingpanel.cpp 2014-01-28 04:50:10 UTC (rev 6046) @@ -219,67 +219,32 @@ reconciled_balance_ = account_balance_; filteredBalance_ = 0.0; - int interval = GetTickCount(); const auto& trans = Model_Account::transaction(this->m_account); - - std::map <wxString, int> speed; - speed["1. Get Data"] += GetTickCount() - interval; - for (const auto& tran : trans) { - interval = GetTickCount(); double transaction_amount = Model_Checking::amount(tran, m_AccountID); if (Model_Checking::status(tran) != Model_Checking::VOID_) account_balance_ += transaction_amount; if (Model_Checking::status(tran) != Model_Checking::VOID_) reconciled_balance_ += transaction_amount; - //reconciled_balance_ += Model_Checking::reconciled(tran, m_AccountID); - speed["2. Balances calc"] += GetTickCount() - interval; if (transFilterActive_) - { - interval = GetTickCount(); if (!transFilterDlg_->checkAll(tran, m_AccountID)) - { - speed["3. Filter"] += GetTickCount() - interval; continue; - } - speed["3. Filter"] += GetTickCount() - interval; - } else - { - interval = GetTickCount(); - if (!Model_Checking::TRANSDATE(tran) - .IsBetween(quickFilterBeginDate_, quickFilterEndDate_)) - { - speed["3. Filter"] += GetTickCount() - interval; + if (!Model_Checking::TRANSDATE(tran).IsBetween(quickFilterBeginDate_, quickFilterEndDate_)) continue; - } - speed["3. Filter"] += GetTickCount() - interval; - } if (!m_listCtrlAccount->showDeletedTransactions_ && Model_Checking::status(tran) == Model_Checking::VOID_) continue; - interval = GetTickCount(); Model_Checking::Full_Data full_tran(tran, account_balance_); - speed["4. Get Full_Data"] += GetTickCount() - interval; full_tran.AMOUNT = transaction_amount; - filteredBalance_ += transaction_amount; - interval = GetTickCount(); this->m_trans.push_back(full_tran); - speed["5. push_back"] += GetTickCount() - interval; } - - wxLogDebug("-----------------------------------------------------------------\n Records: %s", wxString() << trans.size()); - for (const auto& item : speed) - { - wxLogDebug("%s - %s ms", item.first, wxString::Format("%i", item.second)); - } - } void mmCheckingPanel::updateTable() @@ -594,7 +559,7 @@ if (selIndex > -1) { enableEditDeleteButtons(true); - const Model_Checking::Full_Data& tran = this->m_trans.at(selIndex); + const Model_Checking::Data& tran = this->m_trans.at(selIndex); info_panel_->SetLabel(tran.NOTES); wxString miniStr; miniStr = getMiniInfoStr(selIndex); @@ -802,6 +767,23 @@ return mmGetDateForDisplay(Model_Checking::TRANSDATE(tran)); case TransactionListCtrl::COL_NUMBER: return tran.TRANSACTIONNUMBER; + case TransactionListCtrl::COL_STATUS: + return tran.STATUS; + case TransactionListCtrl::COL_NOTES: + return tran.NOTES; + case TransactionListCtrl::COL_WITHDRAWAL: + return tran.AMOUNT <= 0 ? Model_Currency::toString(fabs(tran.AMOUNT), this->m_currency) : ""; + case TransactionListCtrl::COL_DEPOSIT: + return tran.AMOUNT > 0 ? Model_Currency::toString(tran.AMOUNT, this->m_currency) : ""; + case TransactionListCtrl::COL_BALANCE: + return Model_Currency::toString(tran.BALANCE, this->m_currency); + case TransactionListCtrl::COL_CATEGORY: + { + if (Model_Checking::splittransaction(tran).empty()) + return Model_Category::instance().full_name(tran.CATEGID, tran.SUBCATEGID); + else + return "..."; + } case TransactionListCtrl::COL_PAYEE_STR: { if (Model_Checking::TRANSFER == Model_Checking::type(tran)) @@ -824,23 +806,6 @@ } return ""; } - case TransactionListCtrl::COL_STATUS: - return tran.STATUS; - case TransactionListCtrl::COL_CATEGORY: - { - if (Model_Checking::splittransaction(tran).empty()) - return Model_Category::instance().full_name(tran.CATEGID, tran.SUBCATEGID); - else - return "..."; - } - case TransactionListCtrl::COL_WITHDRAWAL: - return tran.AMOUNT <= 0 ? Model_Currency::toString(fabs(tran.AMOUNT), this->m_currency) : ""; - case TransactionListCtrl::COL_DEPOSIT: - return tran.AMOUNT > 0 ? Model_Currency::toString(tran.AMOUNT, this->m_currency) : ""; - case TransactionListCtrl::COL_BALANCE: - return Model_Currency::toString(tran.BALANCE, this->m_currency); - case TransactionListCtrl::COL_NOTES: - return tran.NOTES; default: return ""; } This was sent by MMEX an easy to use, money management application. |
From: <vo...@us...> - 2014-01-28 04:52:54
|
Revision: 6047 http://sourceforge.net/p/moneymanagerex/code/6047 Author: vomikan Date: 2014-01-28 04:52:51 +0000 (Tue, 28 Jan 2014) Log Message: ----------- cleanup Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2014-01-28 04:50:10 UTC (rev 6046) +++ trunk/src/mmcheckingpanel.cpp 2014-01-28 04:52:51 UTC (rev 6047) @@ -52,19 +52,6 @@ #include <algorithm> //---------------------------------------------------------------------------- -#ifndef _WIN32 -#include <sys/time.h> - -unsigned GetTickCount() -{ - struct timeval tv; - if (gettimeofday(&tv, NULL) != 0) - return 0; - - return (tv.tv_sec * 1000) + (tv.tv_usec / 1000); -} -#endif - BEGIN_EVENT_TABLE(mmCheckingPanel, wxPanel) EVT_BUTTON(wxID_NEW, mmCheckingPanel::OnNewTransaction) EVT_BUTTON(wxID_EDIT, mmCheckingPanel::OnEditTransaction) This was sent by MMEX an easy to use, money management application. |
From: <vo...@us...> - 2014-01-28 06:59:22
|
Revision: 6049 http://sourceforge.net/p/moneymanagerex/code/6049 Author: vomikan Date: 2014-01-28 06:59:17 +0000 (Tue, 28 Jan 2014) Log Message: ----------- TODO Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2014-01-28 06:33:21 UTC (rev 6048) +++ trunk/src/mmcheckingpanel.cpp 2014-01-28 06:59:17 UTC (rev 6049) @@ -198,6 +198,7 @@ reconciled_balance_ = account_balance_; filteredBalance_ = 0.0; + std::map <wxString, int> speed; const auto& trans = Model_Account::transaction(this->m_account); for (const auto& tran : trans) { @@ -216,14 +217,20 @@ if (!m_listCtrlAccount->showDeletedTransactions_ && Model_Checking::status(tran) == Model_Checking::VOID_) continue; - + int interval = GetTickCount(); Model_Checking::Full_Data full_tran(tran, m_AccountID, account_balance_); + speed["Full_Data"] += GetTickCount() - interval; full_tran.AMOUNT = transaction_amount; filteredBalance_ += transaction_amount; this->m_trans.push_back(full_tran); } + + for (const auto& item : speed) + { + wxLogDebug("%s - %s ms", item.first, wxString::Format("%i", item.second)); + } } void mmCheckingPanel::updateTable() @@ -1466,7 +1473,7 @@ // decide whether top or down icon needs to be shown setColumnImage(g_sortcol, g_asc ? ICON_ASC : ICON_DESC); - m_cp->filterTable(); + m_cp->filterTable(); //FIXME: too slow function to be called from here (column sorting slow) m_cp->sortTable(); SetItemCount(m_cp->m_trans.size()); m_cp->markSelectedTransaction(trans_id); This was sent by MMEX an easy to use, money management application. |
From: <vo...@us...> - 2014-01-28 10:04:40
|
Revision: 6051 http://sourceforge.net/p/moneymanagerex/code/6051 Author: vomikan Date: 2014-01-28 10:04:35 +0000 (Tue, 28 Jan 2014) Log Message: ----------- [bugs:#289] fix Ticket Links: ------------ https://sourceforge.net/p/moneymanagerex/bugs/289 Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2014-01-28 07:21:54 UTC (rev 6050) +++ trunk/src/mmcheckingpanel.cpp 2014-01-28 10:04:35 UTC (rev 6051) @@ -209,11 +209,15 @@ reconciled_balance_ += transaction_amount; if (transFilterActive_) + { if (!transFilterDlg_->checkAll(tran, m_AccountID)) continue; + } else + { if (!Model_Checking::TRANSDATE(tran).IsBetween(quickFilterBeginDate_, quickFilterEndDate_)) continue; + } if (!m_listCtrlAccount->showDeletedTransactions_ && Model_Checking::status(tran) == Model_Checking::VOID_) continue; @@ -622,8 +626,10 @@ { mmDateRange* date_range = 0; - if (currentView_ == MENU_VIEW_ALLTRANSACTIONS) + if (transFilterActive_) date_range = new mmAllTime; + else if (currentView_ == MENU_VIEW_ALLTRANSACTIONS) + date_range = new mmAllTime; else if (currentView_ == MENU_VIEW_TODAY) date_range = new mmToday; else if (currentView_ == MENU_VIEW_CURRENTMONTH) @@ -647,10 +653,10 @@ { quickFilterBeginDate_ = date_range->start_date(); quickFilterEndDate_ = date_range->end_date(); - delete date_range; } } + void mmCheckingPanel::OnFilterResetToViewAll(wxMouseEvent& event) { if (currentView_ == VIEW_TRANS_ALL_STR) @@ -840,10 +846,11 @@ m_account = Model_Account::instance().get(accountID); if (m_account) m_currency = Model_Account::currency(m_account); + this->windowsFreezeThaw(); // prevent screen updates while controls being repopulated initViewTransactionsHeader(); - + initFilterSettings(); m_listCtrlAccount->m_selectedIndex = -1; m_listCtrlAccount->refreshVisualList(); showTips(); @@ -858,10 +865,10 @@ void mmCheckingPanel::SetTransactionFilterState(bool active) { - /*bitmapTransFilter_->Enable(active || transFilterActive_); - statTextTransFilter_->Enable(active || transFilterActive_); bitmapMainFilter_->Enable(!transFilterActive_); - stxtMainFilter_->Enable(!transFilterActive_);*/ + stxtMainFilter_->Enable(!transFilterActive_); + //bitmapTransFilter_->Enable(active || transFilterActive_); + //statTextTransFilter_->Enable(active || transFilterActive_); } void mmCheckingPanel::SetSelectedTransaction(int transID) This was sent by MMEX an easy to use, money management application. |
From: <vo...@us...> - 2014-02-02 21:05:49
|
Revision: 6073 http://sourceforge.net/p/moneymanagerex/code/6073 Author: vomikan Date: 2014-02-02 21:05:44 +0000 (Sun, 02 Feb 2014) Log Message: ----------- cleanup (m_cp->m_listCtrlAccount->) Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2014-02-02 11:35:33 UTC (rev 6072) +++ trunk/src/mmcheckingpanel.cpp 2014-02-02 21:05:44 UTC (rev 6073) @@ -952,10 +952,10 @@ m_cp->updateExtraTransactionData(m_selectedIndex); topItemIndex_ = GetTopItem() + GetCountPerPage() - 1; - if (m_cp->m_listCtrlAccount->GetSelectedItemCount()>1) + if (GetSelectedItemCount()>1) m_cp->btnEdit_->Enable(false); - m_cp->m_listCtrlAccount->m_selectedID = m_cp->m_trans[m_selectedIndex].TRANSID; + m_selectedID = m_cp->m_trans[m_selectedIndex].TRANSID; } //---------------------------------------------------------------------------- @@ -972,7 +972,7 @@ { int i = event.GetColumn(); wxString parameter_name = wxString::Format("CHECK_COL%d_WIDTH", i); - int current_width = m_cp->m_listCtrlAccount->GetColumnWidth(i); + int current_width = GetColumnWidth(i); Model_Setting::instance().Set(parameter_name, current_width); } @@ -980,7 +980,7 @@ { if (m_selectedIndex > -1) { - if (m_cp->m_listCtrlAccount->GetItemState(m_selectedIndex, wxLIST_STATE_SELECTED) == 0) + if (GetItemState(m_selectedIndex, wxLIST_STATE_SELECTED) == 0) m_cp->updateExtraTransactionData(-1); } event.Skip(); @@ -991,7 +991,7 @@ long selectedIndex = m_selectedIndex; if (m_selectedIndex > -1) { - if (m_cp->m_listCtrlAccount->GetItemState(m_selectedIndex, wxLIST_STATE_SELECTED) == 0) + if (GetItemState(m_selectedIndex, wxLIST_STATE_SELECTED) == 0) selectedIndex = -1; } @@ -1176,7 +1176,7 @@ Model_Setting::instance().Set("CHECK_ASC", (g_asc ? 1 : 0)); Model_Setting::instance().Set("CHECK_SORT_COL", g_sortcol); - m_cp->m_listCtrlAccount->refreshVisualList(m_selectedID, false); + refreshVisualList(m_selectedID, false); } //---------------------------------------------------------------------------- @@ -1409,7 +1409,7 @@ for (const auto& i : m_cp->m_trans) { long transID = i.TRANSID; - if (m_cp->m_listCtrlAccount->GetItemState(x, wxLIST_STATE_SELECTED) == wxLIST_STATE_SELECTED) + if (GetItemState(x, wxLIST_STATE_SELECTED) == wxLIST_STATE_SELECTED) { // remove also removes any split transactions Model_Checking::instance().remove(transID); This was sent by MMEX an easy to use, money management application. |
From: <vo...@us...> - 2014-02-03 03:25:43
|
Revision: 6075 http://sourceforge.net/p/moneymanagerex/code/6075 Author: vomikan Date: 2014-02-03 03:25:39 +0000 (Mon, 03 Feb 2014) Log Message: ----------- speedup Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2014-02-02 22:01:50 UTC (rev 6074) +++ trunk/src/mmcheckingpanel.cpp 2014-02-03 03:25:39 UTC (rev 6075) @@ -264,15 +264,18 @@ void mmCheckingPanel::markSelectedTransaction(int trans_id) { - long i = 0; - for (const auto & tran : m_trans) + if (trans_id > 0) { - if (trans_id == tran.TRANSID && trans_id > 0) + long i = 0; + for (const auto & tran : m_trans) { - m_listCtrlAccount->m_selectedIndex = i; - break; + if (trans_id == tran.TRANSID) + { + m_listCtrlAccount->m_selectedIndex = i; + break; + } + ++i; } - ++i; } if (!m_trans.empty() && m_listCtrlAccount->m_selectedIndex < 0) @@ -1469,8 +1472,10 @@ // decide whether top or down icon needs to be shown setColumnImage(g_sortcol, g_asc ? ICON_ASC : ICON_DESC); if (filter) m_cp->filterTable(); + SetItemCount(m_cp->m_trans.size()); + Show(); + Refresh(); m_cp->sortTable(); - SetItemCount(m_cp->m_trans.size()); m_cp->markSelectedTransaction(trans_id); if (topItemIndex_ >= (long)m_cp->m_trans.size()) @@ -1478,7 +1483,6 @@ if (m_selectedIndex > (long)m_cp->m_trans.size() - 1) m_selectedIndex = -1; if (topItemIndex_ < m_selectedIndex) topItemIndex_ = m_selectedIndex; - Refresh(); if (m_selectedIndex >= 0 && !m_cp->m_trans.empty()) { @@ -1489,10 +1493,10 @@ EnsureVisible(topItemIndex_); } - Show(); m_cp->setAccountSummary(); m_cp->updateExtraTransactionData(m_selectedIndex); this->SetEvtHandlerEnabled(true); + Refresh(); } void TransactionListCtrl::OnMoveTransaction(wxCommandEvent& /*event*/) This was sent by MMEX an easy to use, money management application. |
From: <gua...@us...> - 2014-02-11 23:39:34
|
Revision: 6119 http://sourceforge.net/p/moneymanagerex/code/6119 Author: guanlisheng Date: 2014-02-11 23:39:31 +0000 (Tue, 11 Feb 2014) Log Message: ----------- [bugs:#281] remove redundant logic and code Ticket Links: ------------ https://sourceforge.net/p/moneymanagerex/bugs/281 Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2014-02-11 22:19:53 UTC (rev 6118) +++ trunk/src/mmcheckingpanel.cpp 2014-02-11 23:39:31 UTC (rev 6119) @@ -205,8 +205,7 @@ filteredBalance_ = 0.0; const auto splits = Model_Splittransaction::instance().get_all(); - const auto& trans = Model_Account::transaction(this->m_account); - for (const auto& tran : trans) + for (const auto& tran : Model_Account::transaction(this->m_account)) { double transaction_amount = Model_Checking::amount(tran, m_AccountID); if (Model_Checking::status(tran) != Model_Checking::VOID_) @@ -231,14 +230,7 @@ } Model_Checking::Full_Data full_tran(tran, splits); - - if (Model_Checking::TRANSFER == Model_Checking::type(tran)) - { - if (tran.ACCOUNTID == m_AccountID) - full_tran.PAYEENAME = "> " + full_tran.TOACCOUNTNAME; - else - full_tran.PAYEENAME = "< " + full_tran.ACCOUNTNAME; - } + full_tran.PAYEENAME = full_tran.real_payee_name(m_AccountID); full_tran.BALANCE = account_balance_; full_tran.AMOUNT = transaction_amount; filteredBalance_ += transaction_amount; This was sent by MMEX an easy to use, money management application. |
From: <vo...@us...> - 2014-02-25 05:52:37
|
Revision: 6170 http://sourceforge.net/p/moneymanagerex/code/6170 Author: vomikan Date: 2014-02-25 05:52:32 +0000 (Tue, 25 Feb 2014) Log Message: ----------- fix Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2014-02-24 21:27:36 UTC (rev 6169) +++ trunk/src/mmcheckingpanel.cpp 2014-02-25 05:52:32 UTC (rev 6170) @@ -829,7 +829,8 @@ //First of all any items should be unselected long cursel = m_listCtrlAccount->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); if (cursel != wxNOT_FOUND) - m_listCtrlAccount->SetItemState(cursel, !wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED); + m_listCtrlAccount->SetItemState(cursel, 0, wxLIST_STATE_SELECTED | wxLIST_STATE_FOCUSED); + //Then finded item will be selected m_listCtrlAccount->SetItemState(selectedItem, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED); m_listCtrlAccount->EnsureVisible(selectedItem); This was sent by MMEX an easy to use, money management application. |
From: <vo...@us...> - 2014-04-09 14:28:23
|
Revision: 6292 http://sourceforge.net/p/moneymanagerex/code/6292 Author: vomikan Date: 2014-04-09 14:28:20 +0000 (Wed, 09 Apr 2014) Log Message: ----------- cleanup Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2014-04-09 08:32:10 UTC (rev 6291) +++ trunk/src/mmcheckingpanel.cpp 2014-04-09 14:28:20 UTC (rev 6292) @@ -60,7 +60,7 @@ EVT_BUTTON(wxID_EDIT, mmCheckingPanel::OnEditTransaction) EVT_BUTTON(wxID_REMOVE, mmCheckingPanel::OnDeleteTransaction) EVT_BUTTON(wxID_DUPLICATE, mmCheckingPanel::OnDuplicateTransaction) - EVT_BUTTON(wxID_FILE, mmCheckingPanel::OnOpenAttachment) + EVT_BUTTON(wxID_FILE, mmCheckingPanel::OnOpenAttachment) EVT_MENU(wxID_ANY, mmCheckingPanel::OnViewPopupSelected) EVT_SEARCHCTRL_SEARCH_BTN(wxID_FIND, mmCheckingPanel::OnSearchTxtEntered) EVT_TEXT_ENTER(wxID_FIND, mmCheckingPanel::OnSearchTxtEntered) @@ -98,7 +98,7 @@ EVT_MENU_RANGE(MENU_ON_SET_UDC0, MENU_ON_SET_UDC7, TransactionListCtrl::OnSetUserColour) EVT_MENU(MENU_TREEPOPUP_VIEW_SPLIT_CATEGORIES, TransactionListCtrl::OnViewSplitTransaction) - EVT_MENU(MENU_TREEPOPUP_ORGANIZE_ATTACHMENTS, TransactionListCtrl::OnOrganizeAttachments) + EVT_MENU(MENU_TREEPOPUP_ORGANIZE_ATTACHMENTS, TransactionListCtrl::OnOrganizeAttachments) EVT_CHAR(TransactionListCtrl::OnChar) @@ -490,10 +490,12 @@ itemButtonsSizer->Add(btnDuplicate_, 0, wxRIGHT, 5); btnDuplicate_->Enable(false); - btnAttachment_ = new wxBitmapButton(itemPanel12, wxID_FILE, wxBitmap(attachment_xpm)); - btnAttachment_->SetToolTip(_("Open attachments")); - itemButtonsSizer->Add(btnAttachment_, 0, wxRIGHT, 5); - btnDuplicate_->Enable(false); + btnAttachment_ = new wxBitmapButton(itemPanel12, wxID_FILE + , wxBitmap(attachment_xpm), wxDefaultPosition + , wxSize(btnDuplicate_->GetSize().GetY(), btnDuplicate_->GetSize().GetY())); + btnAttachment_->SetToolTip(_("Open attachments")); + itemButtonsSizer->Add(btnAttachment_, 0, wxRIGHT, 5); + btnDuplicate_->Enable(false); wxSearchCtrl* searchCtrl = new wxSearchCtrl(itemPanel12 , wxID_FIND, wxEmptyString, wxDefaultPosition @@ -559,14 +561,14 @@ btnEdit_->Enable(false); btnDelete_->Enable(true); btnDuplicate_->Enable(false); - btnAttachment_->Enable(false); + btnAttachment_->Enable(false); } else { btnEdit_->Enable(en); btnDelete_->Enable(en); btnDuplicate_->Enable(en); - btnAttachment_->Enable(en); + btnAttachment_->Enable(en); } } //---------------------------------------------------------------------------- @@ -624,6 +626,7 @@ void mmCheckingPanel::OnEditTransaction(wxCommandEvent& event) { m_listCtrlAccount->OnEditTransaction(event); + m_listCtrlAccount->SetFocus(); } //---------------------------------------------------------------------------- @@ -641,7 +644,8 @@ void mmCheckingPanel::OnOpenAttachment(wxCommandEvent& event) { - m_listCtrlAccount->OnOpenAttachment(event); + m_listCtrlAccount->OnOpenAttachment(event); + m_listCtrlAccount->SetFocus(); } //---------------------------------------------------------------------------- @@ -732,7 +736,7 @@ { // remove also removes any split transactions Model_Checking::instance().remove(tran.TRANSID); - mmAttachmentManage::DeleteAllAttachments(Model_Attachment::reftype_desc(Model_Attachment::TRANSACTION), tran.TRANSID); + mmAttachmentManage::DeleteAllAttachments(Model_Attachment::reftype_desc(Model_Attachment::TRANSACTION), tran.TRANSID); if (m_listCtrlAccount->m_selectedForCopy == tran.TRANSID) m_listCtrlAccount->m_selectedForCopy = -1; } } @@ -745,7 +749,7 @@ { // remove also removes any split transactions Model_Checking::instance().remove(tran.TRANSID); - mmAttachmentManage::DeleteAllAttachments(Model_Attachment::reftype_desc(Model_Attachment::TRANSACTION), tran.TRANSID); + mmAttachmentManage::DeleteAllAttachments(Model_Attachment::reftype_desc(Model_Attachment::TRANSACTION), tran.TRANSID); if (m_listCtrlAccount->m_selectedForCopy == tran.TRANSID) m_listCtrlAccount->m_selectedForCopy = -1; } } @@ -1071,9 +1075,9 @@ if (hide_menu_item || have_category) menu.Enable(MENU_TREEPOPUP_VIEW_SPLIT_CATEGORIES, false); - menu.Append(MENU_TREEPOPUP_ORGANIZE_ATTACHMENTS, _("&Organize Attachments")); - if (hide_menu_item) - menu.Enable(MENU_TREEPOPUP_ORGANIZE_ATTACHMENTS, false); + menu.Append(MENU_TREEPOPUP_ORGANIZE_ATTACHMENTS, _("&Organize Attachments")); + if (hide_menu_item) + menu.Enable(MENU_TREEPOPUP_ORGANIZE_ATTACHMENTS, false); menu.AppendSeparator(); @@ -1380,29 +1384,29 @@ void TransactionListCtrl::OnOpenAttachment(wxCommandEvent& event) { - if (m_selectedIndex < 0) return; - int transaction_id = m_cp->m_trans[m_selectedIndex].TRANSID; - int AttachmentsNr = 0; - wxString RefType = Model_Attachment::reftype_desc(Model_Attachment::TRANSACTION); - int VariableWithoutUse = 0; + if (m_selectedIndex < 0) return; + int transaction_id = m_cp->m_trans[m_selectedIndex].TRANSID; + int AttachmentsNr = 0; + wxString RefType = Model_Attachment::reftype_desc(Model_Attachment::TRANSACTION); + int VariableWithoutUse = 0; - Model_Attachment::Data_Set attachments = Model_Attachment::instance().FilterAttachments(RefType, transaction_id); - for (const auto &entry : attachments) - { - VariableWithoutUse = entry.ATTACHMENTID; - AttachmentsNr++; - } + Model_Attachment::Data_Set attachments = Model_Attachment::instance().FilterAttachments(RefType, transaction_id); + for (const auto &entry : attachments) + { + VariableWithoutUse = entry.ATTACHMENTID; + AttachmentsNr++; + } - if (AttachmentsNr == 1) - { - wxString attachmentFilePath = mmAttachmentManage::GetAttachmentsFolder() + wxFileName::GetPathSeparator() + attachments[0].REFTYPE + wxFileName::GetPathSeparator() + attachments[0].FILENAME; - mmAttachmentManage::OpenAttachment(attachmentFilePath); - } - else - { - mmAttachmentDialog dlg(this, RefType, transaction_id); - dlg.ShowModal(); - } + if (AttachmentsNr == 1) + { + wxString attachmentFilePath = mmAttachmentManage::GetAttachmentsFolder() + wxFileName::GetPathSeparator() + attachments[0].REFTYPE + wxFileName::GetPathSeparator() + attachments[0].FILENAME; + mmAttachmentManage::OpenAttachment(attachmentFilePath); + } + else + { + mmAttachmentDialog dlg(this, RefType, transaction_id); + dlg.ShowModal(); + } } //---------------------------------------------------------------------------- @@ -1480,7 +1484,7 @@ { // remove also removes any split transactions Model_Checking::instance().remove(transID); - mmAttachmentManage::DeleteAllAttachments(Model_Attachment::reftype_desc(Model_Attachment::TRANSACTION), transID); + mmAttachmentManage::DeleteAllAttachments(Model_Attachment::reftype_desc(Model_Attachment::TRANSACTION), transID); if (x <= topItemIndex_) topItemIndex_--; if (!m_cp->m_trans.empty() && m_selectedIndex > 0) m_selectedIndex--; if (m_selectedForCopy == transID) m_selectedForCopy = -1; @@ -1612,12 +1616,12 @@ //---------------------------------------------------------------------------- void TransactionListCtrl::OnOrganizeAttachments(wxCommandEvent& /*event*/) { - if (m_selectedIndex < 0) return; + if (m_selectedIndex < 0) return; - wxString RefType = Model_Attachment::reftype_desc(Model_Attachment::TRANSACTION); - int RefId = m_cp->m_trans[m_selectedIndex].TRANSID; - mmAttachmentDialog dlg(this, RefType, RefId); - dlg.ShowModal(); + wxString RefType = Model_Attachment::reftype_desc(Model_Attachment::TRANSACTION); + int RefId = m_cp->m_trans[m_selectedIndex].TRANSID; + mmAttachmentDialog dlg(this, RefType, RefId); + dlg.ShowModal(); } This was sent by MMEX an easy to use, money management application. |
From: <gua...@us...> - 2014-04-22 07:01:50
|
Revision: 6388 http://sourceforge.net/p/moneymanagerex/code/6388 Author: guanlisheng Date: 2014-04-22 07:01:47 +0000 (Tue, 22 Apr 2014) Log Message: ----------- cleanup checking search code Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2014-04-22 05:58:45 UTC (rev 6387) +++ trunk/src/mmcheckingpanel.cpp 2014-04-22 07:01:47 UTC (rev 6388) @@ -820,24 +820,11 @@ } } -void mmCheckingPanel::OnSearchTxtEntered(wxCommandEvent& /*event*/) +void mmCheckingPanel::OnSearchTxtEntered(wxCommandEvent& event) { - //event.GetString() does not working. It seems wxWidgets issue - //wxString searchString = event.GetString(); - - wxSearchCtrl* st = (wxSearchCtrl*)FindWindow(wxID_FIND); - wxString search_string = st->GetValue().Lower(); + wxString search_string = event.GetString(); if (search_string.IsEmpty()) return; - double amount= 0, deposit = 0, withdrawal = 0; - bool valid_amount = Model_Currency::fromString(search_string, amount, Model_Account::currency(Model_Account::instance().get(this->m_AccountID))); - bool withdrawal_only = false; - if (valid_amount && amount < 0) - { - amount = -amount; - withdrawal_only = true; - } - long last = m_listCtrlAccount->GetItemCount(); long selectedItem = m_listCtrlAccount->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); if (selectedItem < 0) //nothing selected @@ -848,11 +835,7 @@ { m_listCtrlAccount->g_asc ? selectedItem-- : selectedItem++; const wxString t = getItem(selectedItem, m_listCtrlAccount->COL_NOTES); - if (valid_amount) Model_Currency::fromString(getItem(selectedItem, m_listCtrlAccount->COL_DEPOSIT), deposit, 0); - if (valid_amount) Model_Currency::fromString(getItem(selectedItem, m_listCtrlAccount->COL_WITHDRAWAL), withdrawal, 0); - if (t.Lower().Matches(search_string) - || (valid_amount && amount == deposit && !withdrawal_only) - || (valid_amount && amount == withdrawal)) + if (t.Lower().Matches(search_string)) { //First of all any items should be unselected long cursel = m_listCtrlAccount->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); This was sent by MMEX an easy to use, money management application. |
From: <vo...@us...> - 2014-05-05 14:49:37
|
Revision: 6515 http://sourceforge.net/p/moneymanagerex/code/6515 Author: vomikan Date: 2014-05-05 14:49:33 +0000 (Mon, 05 May 2014) Log Message: ----------- fix for Search Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2014-05-05 11:16:26 UTC (rev 6514) +++ trunk/src/mmcheckingpanel.cpp 2014-05-05 14:49:33 UTC (rev 6515) @@ -503,7 +503,7 @@ wxSearchCtrl* searchCtrl = new wxSearchCtrl(itemPanel12 , wxID_FIND, wxEmptyString, wxDefaultPosition , wxSize(100, btnDuplicate_->GetSize().GetHeight()) - , wxTE_PROCESS_ENTER | wxTE_PROCESS_TAB, wxDefaultValidator, _("Search")); + , wxTE_PROCESS_ENTER, wxDefaultValidator, _("Search")); searchCtrl->SetHint(_("Search")); itemButtonsSizer->Add(searchCtrl, 0, wxCENTER, 1); searchCtrl->SetToolTip(_("Enter any string to find it in the nearest transaction notes")); @@ -822,7 +822,7 @@ void mmCheckingPanel::OnSearchTxtEntered(wxCommandEvent& event) { - wxString search_string = event.GetString(); + wxString search_string = event.GetString().Lower(); if (search_string.IsEmpty()) return; long last = m_listCtrlAccount->GetItemCount(); @@ -834,8 +834,8 @@ while (selectedItem >= 0 && selectedItem <= last) { m_listCtrlAccount->g_asc ? selectedItem-- : selectedItem++; - const wxString t = getItem(selectedItem, m_listCtrlAccount->COL_NOTES); - if (t.Lower().Matches(search_string)) + const wxString t = getItem(selectedItem, m_listCtrlAccount->COL_NOTES).Lower(); + if (t.Matches(search_string)) { //First of all any items should be unselected long cursel = m_listCtrlAccount->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); This was sent by MMEX an easy to use, money management application. |
From: <gua...@us...> - 2014-05-18 02:48:43
|
Revision: 6603 http://sourceforge.net/p/moneymanagerex/code/6603 Author: guanlisheng Date: 2014-05-18 02:48:38 +0000 (Sun, 18 May 2014) Log Message: ----------- cleanup Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2014-05-18 01:03:25 UTC (rev 6602) +++ trunk/src/mmcheckingpanel.cpp 2014-05-18 02:48:38 UTC (rev 6603) @@ -133,7 +133,8 @@ { if (transFilterDlg_) delete transFilterDlg_; - m_frame->SetCheckingAccountPageInactive(); + if (m_frame) + m_frame->SetCheckingAccountPageInactive(); } bool mmCheckingPanel::Create( This was sent by MMEX an easy to use, money management application. |