From: <vo...@us...> - 2013-06-14 04:09:07
|
Revision: 4074 http://sourceforge.net/p/moneymanagerex/code/4074 Author: vomikan Date: 2013-06-14 04:09:03 +0000 (Fri, 14 Jun 2013) Log Message: ----------- std::reverse Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-06-14 02:47:10 UTC (rev 4073) +++ trunk/src/mmcheckingpanel.cpp 2013-06-14 04:09:03 UTC (rev 4074) @@ -283,96 +283,53 @@ void mmCheckingPanel::sortTable() { std::sort(this->m_trans.begin(), this->m_trans.end()); // default sorter - if (g_sortcol == COL_DATE_OR_TRANSACTION_ID && g_asc) + if (g_sortcol == COL_DATE_OR_TRANSACTION_ID) { std::stable_sort(this->m_trans.begin(), this->m_trans.end() , [] (const mmBankTransaction* x, const mmBankTransaction* y) { return x->date_ < y->date_; }); } - else if (g_sortcol == COL_DATE_OR_TRANSACTION_ID && !g_asc) + else if (g_sortcol == COL_TRANSACTION_NUMBER) { std::stable_sort(this->m_trans.begin(), this->m_trans.end() - , [] (const mmBankTransaction* x, const mmBankTransaction* y) { return x->date_ > y->date_; }); - } - else if (g_sortcol == COL_TRANSACTION_NUMBER && g_asc) - { - std::stable_sort(this->m_trans.begin(), this->m_trans.end() , [] (const mmBankTransaction* x, const mmBankTransaction* y) { return x->transNum_ < y->transNum_; }); } - else if (g_sortcol == COL_TRANSACTION_NUMBER && !g_asc) + else if (g_sortcol == COL_PAYEE_STR) { std::stable_sort(this->m_trans.begin(), this->m_trans.end() - , [] (const mmBankTransaction* x, const mmBankTransaction* y) { return x->transNum_ > y->transNum_; }); - } - else if (g_sortcol == COL_PAYEE_STR && g_asc) - { - std::stable_sort(this->m_trans.begin(), this->m_trans.end() , [] (const mmBankTransaction* x, const mmBankTransaction* y) { return x->payeeStr_ < y->payeeStr_; }); } - else if (g_sortcol == COL_PAYEE_STR && !g_asc) + else if (g_sortcol == COL_STATUS) { std::stable_sort(this->m_trans.begin(), this->m_trans.end() - , [] (const mmBankTransaction* x, const mmBankTransaction* y) { return x->payeeStr_ > y->payeeStr_; }); - } - else if (g_sortcol == COL_STATUS && g_asc) - { - std::stable_sort(this->m_trans.begin(), this->m_trans.end() , [] (const mmBankTransaction* x, const mmBankTransaction* y) { return x->status_ < y->status_; }); } - else if (g_sortcol == COL_STATUS && !g_asc) + else if (g_sortcol == COL_CATEGORY) { std::stable_sort(this->m_trans.begin(), this->m_trans.end() - , [] (const mmBankTransaction* x, const mmBankTransaction* y) { return x->status_ > y->status_; }); - } - else if (g_sortcol == COL_CATEGORY && g_asc) - { - std::stable_sort(this->m_trans.begin(), this->m_trans.end() , [] (const mmBankTransaction* x, const mmBankTransaction* y) { return x->fullCatStr_ < y->fullCatStr_; }); } - else if (g_sortcol == COL_CATEGORY && !g_asc) + /*else if (g_sortcol == COL_WITHDRAWAL) { std::stable_sort(this->m_trans.begin(), this->m_trans.end() - , [] (const mmBankTransaction* x, const mmBankTransaction* y) { return x->fullCatStr_ > y->fullCatStr_; }); - } - /*else if (g_sortcol == COL_WITHDRAWAL && g_asc) - { - std::stable_sort(this->m_trans.begin(), this->m_trans.end() , [] (const mmBankTransaction* x, const mmBankTransaction* y) { return x->balance_ < y->balance_; }); } - else if (g_sortcol == COL_WITHDRAWAL && !g_asc) + else if (g_sortcol == COL_DEPOSIT) { std::stable_sort(this->m_trans.begin(), this->m_trans.end() - , [] (const mmBankTransaction* x, const mmBankTransaction* y) { return x->balance_ > y->balance_; }); - } - else if (g_sortcol == COL_DEPOSIT && g_asc) - { - std::stable_sort(this->m_trans.begin(), this->m_trans.end() , [] (const mmBankTransaction* x, const mmBankTransaction* y) { return x->balance_ < y->balance_; }); - } - else if (g_sortcol == COL_DEPOSIT && !g_asc) - { - std::stable_sort(this->m_trans.begin(), this->m_trans.end() - , [] (const mmBankTransaction* x, const mmBankTransaction* y) { return x->balance_ > y->balance_; }); }*/ - else if (g_sortcol == COL_BALANCE && g_asc) + else if (g_sortcol == COL_BALANCE) { std::stable_sort(this->m_trans.begin(), this->m_trans.end() , [] (const mmBankTransaction* x, const mmBankTransaction* y) { return x->balance_ < y->balance_; }); } - else if (g_sortcol == COL_BALANCE && !g_asc) + else if (g_sortcol == COL_NOTES) { std::stable_sort(this->m_trans.begin(), this->m_trans.end() - , [] (const mmBankTransaction* x, const mmBankTransaction* y) { return x->balance_ > y->balance_; }); - } - else if (g_sortcol == COL_NOTES && g_asc) - { - std::stable_sort(this->m_trans.begin(), this->m_trans.end() , [] (const mmBankTransaction* x, const mmBankTransaction* y) { return x->notes_ < y->notes_; }); } - else if (g_sortcol == COL_NOTES && !g_asc) - { - std::stable_sort(this->m_trans.begin(), this->m_trans.end() - , [] (const mmBankTransaction* x, const mmBankTransaction* y) { return x->notes_ > y->notes_; }); - } + + if (!g_asc) std::reverse(this->m_trans.begin(), this->m_trans.end()); } //---------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gua...@us...> - 2013-06-15 06:50:42
|
Revision: 4089 http://sourceforge.net/p/moneymanagerex/code/4089 Author: guanlisheng Date: 2013-06-15 06:50:39 +0000 (Sat, 15 Jun 2013) Log Message: ----------- mmListCtrl Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-06-15 06:34:01 UTC (rev 4088) +++ trunk/src/mmcheckingpanel.cpp 2013-06-15 06:50:39 UTC (rev 4089) @@ -1398,14 +1398,12 @@ mmBankTransaction *tr = ok ? m_cp->m_trans[idx] : 0; bool in_the_future = tr && tr->date_.GetDateOnly() > wxDateTime::Now().GetDateOnly(); - TransactionListCtrl &self = *const_cast<TransactionListCtrl*>(this); - if (in_the_future) // apply alternating background pattern { - return item % 2 ? &self.m_attr3 : &self.m_attr4; + return item % 2 ? (wxListItemAttr*)&m_attr3 : (wxListItemAttr*)&m_attr4; } - return item % 2 ? &self.m_attr1 : &self.m_attr2; + return item % 2 ? (wxListItemAttr*)&m_attr1 : (wxListItemAttr*)&m_attr2; } //---------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-06-15 09:55:00
|
Revision: 4091 http://sourceforge.net/p/moneymanagerex/code/4091 Author: vomikan Date: 2013-06-15 09:54:55 +0000 (Sat, 15 Jun 2013) Log Message: ----------- simplification Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-06-15 07:41:02 UTC (rev 4090) +++ trunk/src/mmcheckingpanel.cpp 2013-06-15 09:54:55 UTC (rev 4091) @@ -753,10 +753,10 @@ /********************************************************************************** Stage 1 For the account being viewed, we need to get: - 1. All entries for the account to determine account balances. [ v_transPtr ] + 1. All entries for the account to determine account balances. [ account_transPtr ] 2. All entries for the account to be displayed. [ m_trans ] **********************************************************************************/ - int numTransactions = 0; + int numTransactions = 0; std::vector<mmBankTransaction*> account_transPtr; for (const auto& pBankTransaction: core_->bTransactionList_.transactions_) { @@ -831,16 +831,10 @@ visible_transPtr = m_trans; } - for (size_t i = 0; i < visible_transPtr.size(); ++i) + for (const auto& i : visible_transPtr) { - bool ok = visible_transPtr[i] != 0; - wxASSERT(ok); - - if (!ok) continue; - - mmBankTransaction* transPtr = visible_transPtr[i]; - initBalance = getBalance( transPtr, initBalance); - setBalance( transPtr, initBalance); + initBalance = getBalance( i, initBalance); + setBalance( i, initBalance); } /********************************************************************************** @@ -862,7 +856,7 @@ if (m_listCtrlAccount->m_selectedIndex > -1) { long i = 0; - for (const auto & pTrans : m_trans) + for (const auto & pTrans : visible_transPtr) { if (trans_id == pTrans->transactionID() && trans_id > 0) { m_listCtrlAccount->m_selectedIndex = i; @@ -879,6 +873,10 @@ else m_listCtrlAccount->EnsureVisible(0); } + else if (m_trans.size() > 0) + { + m_listCtrlAccount->EnsureVisible(m_listCtrlAccount->m_selectedIndex); + } else { enableEditDeleteButtons(false); @@ -1088,6 +1086,8 @@ if (m_cp->m_listCtrlAccount->GetSelectedItemCount()>1) m_cp->btnEdit_->Enable(false); + //TODO: transaction id should be stored to provide proper line selection + //m_cp->m_listCtrlAccount->SetSelectedTransactionId(m_cp->m_listCtrlAccount->GetItem...); } //---------------------------------------------------------------------------- @@ -1255,7 +1255,7 @@ { m_cp->core_->db_.get()->Begin(); - for (size_t i = 0; i < m_cp->m_trans.size(); ++i) + for (size_t i = 0; i < m_cp->m_trans.size(); ++i) { int transID = m_cp->m_trans[i]->transactionID(); if (mmDBWrapper::updateTransactionWithStatus(*m_cp->getDb(), transID, status)) @@ -1286,9 +1286,7 @@ setColumnImage(m_sortCol, m_asc ? ICON_ASC : ICON_DESC); - m_cp->sortTable(); - if (m_cp->m_trans.size() > 0) - RefreshItems(0, static_cast<long>(m_cp->m_trans.size()) - 1); // refresh everything + m_cp->initVirtualListControl(); m_cp->core_->iniSettings_->SetIntSetting("CHECK_SORT_COL", g_sortcol); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-06-17 08:56:27
|
Revision: 4108 http://sourceforge.net/p/moneymanagerex/code/4108 Author: vomikan Date: 2013-06-17 08:56:24 +0000 (Mon, 17 Jun 2013) Log Message: ----------- UI alignment Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-06-17 04:11:06 UTC (rev 4107) +++ trunk/src/mmcheckingpanel.cpp 2013-06-17 08:56:24 UTC (rev 4108) @@ -462,13 +462,18 @@ void mmCheckingPanel::CreateControls() { + int border = 1; + wxSizerFlags flags, flagsExpand; + flags.Align(wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL).Border(wxALL, border); + flagsExpand.Align(wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxEXPAND).Border(wxALL, border).Proportion(1); + wxBoxSizer* itemBoxSizer9 = new wxBoxSizer(wxVERTICAL); this->SetSizer(itemBoxSizer9); /* ---------------------- */ wxPanel* headerPanel = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL ); - itemBoxSizer9->Add(headerPanel, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 2); + itemBoxSizer9->Add(headerPanel, flags); wxBoxSizer* itemBoxSizerVHeader = new wxBoxSizer(wxVERTICAL); headerPanel->SetSizer(itemBoxSizerVHeader); @@ -479,7 +484,7 @@ header_text_ = new wxStaticText( headerPanel, wxID_STATIC, ""); int font_size = this->GetFont().GetPointSize() + 2; header_text_->SetFont(wxFont(font_size, wxSWISS, wxNORMAL, wxBOLD, FALSE, "")); - itemBoxSizerVHeader2->Add(header_text_); + itemBoxSizerVHeader2->Add(header_text_, flags); wxBoxSizer* itemBoxSizerHHeader2 = new wxBoxSizer(wxHORIZONTAL); wxFlexGridSizer* itemFlexGridSizerHHeader2 = new wxFlexGridSizer(5,1,1); @@ -489,24 +494,26 @@ wxBitmap itemStaticBitmap(rightarrow_xpm); bitmapMainFilter_ = new wxStaticBitmap( headerPanel, wxID_ANY, itemStaticBitmap); - itemFlexGridSizerHHeader2->Add(bitmapMainFilter_); - bitmapMainFilter_->Connect(wxID_ANY, wxEVT_RIGHT_DOWN, wxMouseEventHandler(mmCheckingPanel::OnFilterResetToViewAll), NULL, this); - bitmapMainFilter_->Connect(wxID_ANY, wxEVT_LEFT_DOWN, wxMouseEventHandler(mmCheckingPanel::OnMouseLeftDown), NULL, this); + itemFlexGridSizerHHeader2->Add(bitmapMainFilter_, flags); + bitmapMainFilter_->Connect(wxID_ANY, wxEVT_RIGHT_DOWN + , wxMouseEventHandler(mmCheckingPanel::OnFilterResetToViewAll), NULL, this); + bitmapMainFilter_->Connect(wxID_ANY, wxEVT_LEFT_DOWN + , wxMouseEventHandler(mmCheckingPanel::OnMouseLeftDown), NULL, this); - stxtMainFilter_ = new wxStaticText( headerPanel, wxID_ANY, ""); - itemFlexGridSizerHHeader2->Add(stxtMainFilter_, 0, wxCENTER); + stxtMainFilter_ = new wxStaticText( headerPanel, wxID_ANY, "", wxDefaultPosition, wxSize(200, -1)); + itemFlexGridSizerHHeader2->Add(stxtMainFilter_, flags); itemFlexGridSizerHHeader2->AddSpacer(20); bitmapTransFilter_ = new wxStaticBitmap( headerPanel, ID_PANEL_CHECKING_STATIC_BITMAP_FILTER, itemStaticBitmap); - itemFlexGridSizerHHeader2->Add(bitmapTransFilter_, 0, wxCENTER|wxLEFT, 150); + itemFlexGridSizerHHeader2->Add(bitmapTransFilter_, flags); bitmapTransFilter_->Connect(wxID_ANY, wxEVT_LEFT_DOWN, wxMouseEventHandler(mmCheckingPanel::OnFilterTransactions), NULL, this); bitmapTransFilter_->Connect(wxID_ANY, wxEVT_RIGHT_DOWN, wxMouseEventHandler(mmCheckingPanel::OnFilterTransactions), NULL, this); statTextTransFilter_ = new wxStaticText( headerPanel, wxID_ANY, _("Transaction Filter")); - itemFlexGridSizerHHeader2->Add(statTextTransFilter_, 0, wxCENTER); + itemFlexGridSizerHHeader2->Add(statTextTransFilter_, flags); SetTransactionFilterState(false); wxStaticText* itemStaticText12 = new wxStaticText( headerPanel, @@ -570,55 +577,57 @@ // -- m_listCtrlAccount->setSortColumn(g_sortcol); m_listCtrlAccount->setSortOrder(g_asc); - m_listCtrlAccount->setColumnImage(m_listCtrlAccount->getSortColumn(), m_listCtrlAccount->getSortOrder() ? ICON_ASC : ICON_DESC); // asc\desc sort mark (arrow) + m_listCtrlAccount->setColumnImage(m_listCtrlAccount->getSortColumn() + , m_listCtrlAccount->getSortOrder() ? ICON_ASC : ICON_DESC); // asc\desc sort mark (arrow) - wxPanel *itemPanel12 = new wxPanel(itemSplitterWindow10, ID_PANEL1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL); + wxPanel *itemPanel12 = new wxPanel(itemSplitterWindow10, ID_PANEL1 + , wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL); itemSplitterWindow10->SplitHorizontally(m_listCtrlAccount, itemPanel12); itemSplitterWindow10->SetMinimumPaneSize(100); itemSplitterWindow10->SetSashGravity(1.0); - itemBoxSizer9->Add(itemSplitterWindow10, 1, wxGROW|wxALL, 1); + itemBoxSizer9->Add(itemSplitterWindow10, flagsExpand); wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxVERTICAL); itemPanel12->SetSizer(itemBoxSizer4); - wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxHORIZONTAL); - itemBoxSizer4->Add(itemBoxSizer5, 0, wxALIGN_LEFT|wxALL, 5); + wxBoxSizer* itemButtonsSizer = new wxBoxSizer(wxHORIZONTAL); + itemBoxSizer4->Add(itemButtonsSizer, flags); btnNew_ = new wxButton(itemPanel12, wxID_NEW, _("&New")); btnNew_->SetToolTip(_("New Transaction")); - itemBoxSizer5->Add(btnNew_, 0, wxRIGHT, 5); + itemButtonsSizer->Add(btnNew_, 0, wxRIGHT, 5); btnEdit_ = new wxButton(itemPanel12, wxID_EDIT, _("&Edit")); btnEdit_->SetToolTip(_("Edit selected transaction")); - itemBoxSizer5->Add(btnEdit_, 0, wxRIGHT, 5); + itemButtonsSizer->Add(btnEdit_, 0, wxRIGHT, 5); btnEdit_->Enable(false); btnDelete_ = new wxButton(itemPanel12, wxID_DELETE, _("&Delete")); btnDelete_->SetToolTip(_("Delete selected transaction")); - itemBoxSizer5->Add(btnDelete_, 0, wxRIGHT, 5); + itemButtonsSizer->Add(btnDelete_, 0, wxRIGHT, 5); btnDelete_->Enable(false); btnDuplicate_ = new wxButton(itemPanel12, wxID_DUPLICATE, _("D&uplicate")); btnDuplicate_->SetToolTip(_("Duplicate selected transaction")); - itemBoxSizer5->Add(btnDuplicate_, 0, wxRIGHT, 5); + itemButtonsSizer->Add(btnDuplicate_, 0, wxRIGHT, 5); btnDuplicate_->Enable(false); wxSearchCtrl* searchCtrl = new wxSearchCtrl(itemPanel12 , wxID_FIND, wxEmptyString, wxDefaultPosition, wxSize(100,-1) , wxTE_PROCESS_ENTER|wxTE_PROCESS_TAB, wxDefaultValidator, _("Search")); - itemBoxSizer5->Add(searchCtrl, 0, wxTOP, 1); + itemButtonsSizer->Add(searchCtrl, 0, wxTOP, 1); searchCtrl->SetToolTip(_("Enter any string to find it in the nearest transaction notes")); //Infobar-mini info_panel_mini_ = new wxStaticText( itemPanel12, wxID_STATIC, ""); - itemBoxSizer5->Add(info_panel_mini_, 1, wxGROW|wxTOP|wxLEFT, 5); + itemButtonsSizer->Add(info_panel_mini_, 1, wxGROW|wxTOP|wxLEFT, 5); //Infobar info_panel_ = new wxStaticText( itemPanel12, wxID_STATIC, "", wxDefaultPosition, wxSize(200,-1), wxTE_MULTILINE|wxTE_WORDWRAP); - itemBoxSizer4->Add(info_panel_, 1, wxGROW|wxALL, 5); + itemBoxSizer4->Add(info_panel_, flagsExpand); //Show tips when no any transaction selected showTips(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-06-20 18:17:01
|
Revision: 4122 http://sourceforge.net/p/moneymanagerex/code/4122 Author: vomikan Date: 2013-06-20 18:16:59 +0000 (Thu, 20 Jun 2013) Log Message: ----------- mark currently focused transaction as selected Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-06-20 15:35:31 UTC (rev 4121) +++ trunk/src/mmcheckingpanel.cpp 2013-06-20 18:16:59 UTC (rev 4122) @@ -279,7 +279,6 @@ return true; } -//---------------------------------------------------------------------------- void mmCheckingPanel::sortTable() { @@ -392,7 +391,31 @@ void mmCheckingPanel::markSelectedTransaction(int trans_id) { - trans_id; + if (m_listCtrlAccount->m_selectedIndex > -1) + { + long i = 0; + for (const auto & pTrans : m_trans) + { + if (trans_id == pTrans->transactionID() && trans_id > 0) { + m_listCtrlAccount->m_selectedIndex = i; + break; + } + ++i; + } + } + + if (m_trans.size() > 0 && m_listCtrlAccount->m_selectedIndex < 0) + { + if (g_asc) + m_listCtrlAccount->EnsureVisible(static_cast<long>(m_trans.size()) - 1); + else + m_listCtrlAccount->EnsureVisible(0); + } + else + { + enableEditDeleteButtons(false); + showTips(); + } } //---------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-06-21 11:26:27
|
Revision: 4124 http://sourceforge.net/p/moneymanagerex/code/4124 Author: vomikan Date: 2013-06-21 11:26:25 +0000 (Fri, 21 Jun 2013) Log Message: ----------- fix for focus of selected item Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-06-21 10:52:05 UTC (rev 4123) +++ trunk/src/mmcheckingpanel.cpp 2013-06-21 11:26:25 UTC (rev 4124) @@ -391,17 +391,14 @@ void mmCheckingPanel::markSelectedTransaction(int trans_id) { - if (m_listCtrlAccount->m_selectedIndex > -1) + long i = 0; + for (const auto & pTrans : m_trans) { - long i = 0; - for (const auto & pTrans : m_trans) - { - if (trans_id == pTrans->transactionID() && trans_id > 0) { - m_listCtrlAccount->m_selectedIndex = i; - break; - } + if (trans_id == pTrans->transactionID() && trans_id > 0) { + m_listCtrlAccount->m_selectedIndex = i; + break; + } ++i; - } } if (m_trans.size() > 0 && m_listCtrlAccount->m_selectedIndex < 0) @@ -461,7 +458,7 @@ //---------------------------------------------------------------------------- -void mmCheckingPanel::initVirtualListControl(int trans_id) +void mmCheckingPanel::initVirtualListControl(int /*trans_id*/) { //Initialization core_->bTransactionList_.LoadAccountTransactions(m_AccountID); @@ -476,7 +473,6 @@ sortTable(); filterTable(); m_listCtrlAccount->SetItemCount(m_trans.size()); - markSelectedTransaction(trans_id); setAccountSummary(); } @@ -1558,8 +1554,10 @@ void TransactionListCtrl::refreshVisualList(int trans_id) { - m_cp->initVirtualListControl(trans_id); + m_cp->initVirtualListControl(); + m_cp->markSelectedTransaction(trans_id); + if (topItemIndex_ >= (long)m_cp->m_trans.size()) topItemIndex_ = g_asc ? (long)m_cp->m_trans.size() - 1 : 0; @@ -1569,7 +1567,7 @@ if (topItemIndex_ < m_selectedIndex) topItemIndex_ = m_selectedIndex; //debuger - //wxLogDebug(wxString("id:")<<trans_id<<"|top:"<<topItemIndex_<<"|selected:"<<m_selectedIndex); + wxLogDebug(wxString("id:")<<trans_id<<"|top:"<<topItemIndex_<<"|selected:"<<m_selectedIndex); if (m_cp->m_trans.size() > 0) { RefreshItems(0, m_cp->m_trans.size() - 1); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-06-21 18:08:26
|
Revision: 4127 http://sourceforge.net/p/moneymanagerex/code/4127 Author: vomikan Date: 2013-06-21 18:08:23 +0000 (Fri, 21 Jun 2013) Log Message: ----------- follow selected transaction if sort order changed Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-06-21 12:28:34 UTC (rev 4126) +++ trunk/src/mmcheckingpanel.cpp 2013-06-21 18:08:23 UTC (rev 4127) @@ -129,6 +129,7 @@ void OnViewSplitTransaction(wxCommandEvent& event); long m_selectedIndex; long m_selectedForCopy; + long m_selectedID; void refreshVisualList(int trans_id = -1); private: @@ -527,8 +528,10 @@ bitmapTransFilter_ = new wxStaticBitmap( headerPanel, ID_PANEL_CHECKING_STATIC_BITMAP_FILTER, itemStaticBitmap); itemFlexGridSizerHHeader2->Add(bitmapTransFilter_, flags); - bitmapTransFilter_->Connect(wxID_ANY, wxEVT_LEFT_DOWN, wxMouseEventHandler(mmCheckingPanel::OnFilterTransactions), NULL, this); - bitmapTransFilter_->Connect(wxID_ANY, wxEVT_RIGHT_DOWN, wxMouseEventHandler(mmCheckingPanel::OnFilterTransactions), NULL, this); + bitmapTransFilter_->Connect(wxID_ANY, wxEVT_LEFT_DOWN + , wxMouseEventHandler(mmCheckingPanel::OnFilterTransactions), NULL, this); + bitmapTransFilter_->Connect(wxID_ANY, wxEVT_RIGHT_DOWN + , wxMouseEventHandler(mmCheckingPanel::OnFilterTransactions), NULL, this); statTextTransFilter_ = new wxStaticText( headerPanel, wxID_ANY, _("Transaction Filter")); @@ -802,15 +805,14 @@ mmSplitTransactionEntries* splits = m_trans[selIndex]->splitEntries_.get(); m_trans[selIndex]->getSplitTransactions(splits); - for (int i = 0; i < (int)splits->entries_.size(); ++i) + for (const auto &i : splits->entries_) { - amount = splits->entries_[i]->splitAmount_; + amount = i->splitAmount_; if (m_trans[selIndex]->transType_ != TRANS_TYPE_DEPOSIT_STR) amount = -amount; amountStr = CurrencyFormatter::float2Money(amount); infoStr << core_->categoryList_.GetFullCategoryString( - splits->entries_[i]->categID_, splits->entries_[i]->subCategID_ - ) + i->categID_, i->subCategID_) << " = " << amountStr << "\n"; @@ -978,24 +980,24 @@ void mmCheckingPanel::DeleteViewedTransactions() { core_->db_.get()->Begin(); - for (size_t i = 0; i < m_trans.size(); ++i) + for (const auto& i : m_trans) { - if (m_listCtrlAccount->m_selectedForCopy == (long)m_trans[i]->transactionID()) + if (m_listCtrlAccount->m_selectedForCopy == (long)i->transactionID()) m_listCtrlAccount->m_selectedForCopy = -1; - core_->bTransactionList_.deleteTransaction(m_AccountID, m_trans[i]->transactionID()); + core_->bTransactionList_.deleteTransaction(m_AccountID, i->transactionID()); } core_->db_.get()->Commit(); } void mmCheckingPanel::DeleteFlaggedTransactions(const wxString& status) { - for (size_t i = 0; i < m_trans.size(); ++i) + for (const auto& i : m_trans) { - if (m_trans[i]->status_ == status) + if (i->status_ == status) { - if (m_listCtrlAccount->m_selectedForCopy == (long)m_trans[i]->transactionID()) + if (m_listCtrlAccount->m_selectedForCopy == (long)i->transactionID()) m_listCtrlAccount->m_selectedForCopy = -1; - core_->bTransactionList_.deleteTransaction(m_AccountID, m_trans[i]->transactionID()); + core_->bTransactionList_.deleteTransaction(m_AccountID, i->transactionID()); } } } @@ -1044,8 +1046,7 @@ if (m_cp->m_listCtrlAccount->GetSelectedItemCount()>1) m_cp->btnEdit_->Enable(false); - //TODO: transaction id should be stored to provide proper line selection - //m_cp->m_listCtrlAccount->SetSelectedTransactionId(m_cp->m_listCtrlAccount->GetItem...); + m_cp->m_listCtrlAccount->m_selectedID = m_cp->m_trans[m_selectedIndex]->transactionID(); } //---------------------------------------------------------------------------- @@ -1213,11 +1214,11 @@ { m_cp->core_->db_.get()->Begin(); - for (size_t i = 0; i < m_cp->m_trans.size(); ++i) + for (const auto& i : m_cp->m_trans) { - int transID = m_cp->m_trans[i]->transactionID(); + int transID = i->transactionID(); if (mmDBWrapper::updateTransactionWithStatus(*m_cp->getDb(), transID, status)) - m_cp->m_trans[i]->status_ = status; + i->status_ = status; } m_cp->core_->db_.get()->Commit(); @@ -1243,13 +1244,11 @@ g_sortcol = m_sortCol; setColumnImage(m_sortCol, m_asc ? ICON_ASC : ICON_DESC); + m_cp->core_->iniSettings_->SetIntSetting("CHECK_ASC", g_asc); + m_cp->core_->iniSettings_->SetIntSetting("CHECK_SORT_COL", g_sortcol); - m_cp->initVirtualListControl(); + m_cp->m_listCtrlAccount->refreshVisualList(m_selectedID); - m_cp->core_->iniSettings_->SetIntSetting("CHECK_SORT_COL", g_sortcol); - - // asc\desc sorting flag - m_cp->core_->iniSettings_->SetIntSetting("CHECK_ASC", g_asc); } //---------------------------------------------------------------------------- @@ -1567,7 +1566,7 @@ if (topItemIndex_ < m_selectedIndex) topItemIndex_ = m_selectedIndex; //debuger - wxLogDebug(wxString("id:")<<trans_id<<"|top:"<<topItemIndex_<<"|selected:"<<m_selectedIndex); + //wxLogDebug(wxString::Format("trx id:%ld | top:%ld | selected:%ld", trans_id, topItemIndex_, m_selectedIndex); if (m_cp->m_trans.size() > 0) { RefreshItems(0, m_cp->m_trans.size() - 1); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-06-22 05:59:40
|
Revision: 4133 http://sourceforge.net/p/moneymanagerex/code/4133 Author: vomikan Date: 2013-06-22 05:59:37 +0000 (Sat, 22 Jun 2013) Log Message: ----------- proper place for initfilter function Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-06-22 05:44:05 UTC (rev 4132) +++ trunk/src/mmcheckingpanel.cpp 2013-06-22 05:59:37 UTC (rev 4133) @@ -272,11 +272,10 @@ //TODO: Load currency settings for current account /* Set up the transaction filter. The transFilter dialog will be destroyed when the checking panel is destroyed. */ - transFilterActive_ = false; + transFilterActive_ = true; transFilterDlg_ = new mmFilterTransactionsDialog(core_, this); initViewTransactionsHeader(); - initFilterSettings(); initVirtualListControl(); windowsFreezeThaw(this); @@ -465,6 +464,7 @@ { //Initialization core_->bTransactionList_.LoadAccountTransactions(m_AccountID); + initFilterSettings(); filteredBalance_ = 0.0; // clear everything This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-06-24 09:08:16
|
Revision: 4156 http://sourceforge.net/p/moneymanagerex/code/4156 Author: vomikan Date: 2013-06-24 09:08:10 +0000 (Mon, 24 Jun 2013) Log Message: ----------- Fix for currency initialization Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-06-24 08:42:04 UTC (rev 4155) +++ trunk/src/mmcheckingpanel.cpp 2013-06-24 09:08:10 UTC (rev 4156) @@ -274,7 +274,6 @@ when the checking panel is destroyed. */ transFilterActive_ = false; transFilterDlg_ = new mmFilterTransactionsDialog(core_, this); - core_->accountList_.getCurrencySharedPtr(m_AccountID)->loadCurrencySettings(); initViewTransactionsHeader(); initFilterSettings(); @@ -461,6 +460,7 @@ void mmCheckingPanel::initVirtualListControl(int /*trans_id*/) { + setAccountSummary(); //Initialization core_->bTransactionList_.LoadAccountTransactions(m_AccountID); @@ -474,8 +474,6 @@ sortTable(); filterTable(); m_listCtrlAccount->SetItemCount(m_trans.size()); - - setAccountSummary(); } //---------------------------------------------------------------------------- @@ -658,6 +656,7 @@ void mmCheckingPanel::setAccountSummary() { mmAccount* pAccount = core_->accountList_.GetAccountSharedPtr(m_AccountID); + core_->accountList_.getCurrencySharedPtr(m_AccountID)->loadCurrencySettings(); header_text_->SetLabel(wxString::Format(_("Account View : %s"), pAccount->name_)); double checking_bal = core_->bTransactionList_.getBalance(m_AccountID); @@ -1177,7 +1176,6 @@ refreshVisualList(transID); //TODO: blinkings may be avoided //m_cp->m_listCtrlAccount->RefreshItems(m_selectedIndex, m_selectedIndex); - //m_cp->setAccountSummary(); } //---------------------------------------------------------------------------- @@ -1229,8 +1227,6 @@ } refreshVisualList(); - - m_cp->setAccountSummary(); } //---------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-06-24 10:38:55
|
Revision: 4158 http://sourceforge.net/p/moneymanagerex/code/4158 Author: vomikan Date: 2013-06-24 10:38:53 +0000 (Mon, 24 Jun 2013) Log Message: ----------- account view filter update Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-06-24 10:36:30 UTC (rev 4157) +++ trunk/src/mmcheckingpanel.cpp 2013-06-24 10:38:53 UTC (rev 4158) @@ -346,59 +346,56 @@ void mmCheckingPanel::filterTable() { - std::vector<mmBankTransaction*> filtered_trans; - bool toAdd = transFilterDlg_->somethingSelected(); - - if (transFilterActive_ && toAdd) + if (transFilterActive_ &&transFilterDlg_->somethingSelected()) { - for (const auto& pBankTransaction: m_trans) + std::vector<mmBankTransaction*>::iterator iter; + for (iter = m_trans.begin(); iter != m_trans.end(); ) { - toAdd = true; - - if (transFilterDlg_->getAccountCheckBox()) - toAdd = toAdd && (transFilterDlg_->getAccountID() == pBankTransaction->toAccountID_); - - if (transFilterDlg_->getDateRangeCheckBox()) - toAdd = toAdd && (transFilterDlg_->getFromDateCtrl().GetDateOnly() <= pBankTransaction->date_.GetDateOnly() - && transFilterDlg_->getToDateControl().GetDateOnly() >= pBankTransaction->date_.GetDateOnly()); - - if (transFilterDlg_->getPayeeCheckBox()) - toAdd = toAdd && (transFilterDlg_->userPayeeStr() == pBankTransaction->payeeStr_); - - if (transFilterDlg_->getCategoryCheckBox()) - toAdd = toAdd && (pBankTransaction->containsCategory(transFilterDlg_->getCategoryID(), - transFilterDlg_->getSubCategoryID(), transFilterDlg_->getSubCategoryID() < 0)); - - if (transFilterDlg_->getStatusCheckBox()) - toAdd = toAdd && (transFilterDlg_->getStatus() == pBankTransaction->status_); - - if (transFilterDlg_->getTypeCheckBox()) - toAdd = toAdd && (transFilterDlg_->getType().Contains(pBankTransaction->transType_)); - - if (transFilterDlg_->getAmountRangeCheckBox()) - toAdd = toAdd && (transFilterDlg_->getAmountMin() <= pBankTransaction->amt_ && transFilterDlg_->getAmountMax() >= pBankTransaction->amt_); - - if (transFilterDlg_->getNumberCheckBox()) - toAdd = toAdd && (transFilterDlg_->getNumber().Trim().Lower() == pBankTransaction->transNum_.Lower()); - - if (transFilterDlg_->getNotesCheckBox()) - toAdd = toAdd && (pBankTransaction->notes_.Lower().Matches(transFilterDlg_->getNotes().Trim().Lower())); - if (toAdd) - filtered_trans.push_back(pBankTransaction); + if (transFilterDlg_->getAccountCheckBox() + && transFilterDlg_->getAccountID() != (*iter)->toAccountID_) + iter = m_trans.erase(iter); + else if (transFilterDlg_->getDateRangeCheckBox() + && (transFilterDlg_->getFromDateCtrl().GetDateOnly() > (*iter)->date_.GetDateOnly() + && transFilterDlg_->getToDateControl().GetDateOnly() < (*iter)->date_.GetDateOnly())) + iter = m_trans.erase(iter); + else if (transFilterDlg_->getPayeeCheckBox() + && transFilterDlg_->userPayeeStr() != (*iter)->payeeStr_) + iter = m_trans.erase(iter); + else if (transFilterDlg_->getCategoryCheckBox() + && !(*iter)->containsCategory(transFilterDlg_->getCategoryID() + ,transFilterDlg_->getSubCategoryID(), transFilterDlg_->getSubCategoryID() < 0)) + iter = m_trans.erase(iter); + else if (transFilterDlg_->getStatusCheckBox() + && transFilterDlg_->getStatus() != (*iter)->status_) + iter = m_trans.erase(iter); + else if (transFilterDlg_->getTypeCheckBox() + && !transFilterDlg_->getType().Contains((*iter)->transType_)) + iter = m_trans.erase(iter); + else if (transFilterDlg_->getAmountRangeCheckBox() + && !(transFilterDlg_->getAmountMin() <= (*iter)->amt_ && transFilterDlg_->getAmountMax() >= (*iter)->amt_)) + iter = m_trans.erase(iter); + else if (transFilterDlg_->getNumberCheckBox() + && transFilterDlg_->getNumber().Trim().Lower() != (*iter)->transNum_.Lower()) + iter = m_trans.erase(iter); + else if (transFilterDlg_->getNotesCheckBox() + && !(*iter)->notes_.Lower().Matches(transFilterDlg_->getNotes().Trim().Lower())) + iter = m_trans.erase(iter); + else + ++iter; } } else { - for (const auto& pBankTransaction: m_trans) + std::vector<mmBankTransaction*>::iterator iter; + for (iter = m_trans.begin(); iter != m_trans.end(); ) { - if (quickFilterBeginDate_ <= pBankTransaction->date_.GetDateOnly() - && quickFilterEndDate_ >= pBankTransaction->date_.GetDateOnly()) - { - filtered_trans.push_back(pBankTransaction); - } + if (quickFilterBeginDate_ <= (*iter)->date_.GetDateOnly() + && quickFilterEndDate_ >= (*iter)->date_.GetDateOnly()) + ++iter; + else + iter = m_trans.erase(iter); } } - this->m_trans = filtered_trans; } void mmCheckingPanel::markSelectedTransaction(int trans_id) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-07-02 18:49:48
|
Revision: 4239 http://sourceforge.net/p/moneymanagerex/code/4239 Author: vomikan Date: 2013-07-02 18:49:45 +0000 (Tue, 02 Jul 2013) Log Message: ----------- fix for visible item if filter disabled Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-07-02 18:28:55 UTC (rev 4238) +++ trunk/src/mmcheckingpanel.cpp 2013-07-02 18:49:45 UTC (rev 4239) @@ -1009,10 +1009,7 @@ bitmapTransFilter_->SetBitmap(pic); SetTransactionFilterState(true); - initVirtualListControl(); - if (m_trans.size() > 0) - m_listCtrlAccount->RefreshItems(0, static_cast<long>(m_trans.size()) - 1); - + m_listCtrlAccount->refreshVisualList(); } //---------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-07-14 09:04:15
|
Revision: 4376 http://sourceforge.net/p/moneymanagerex/code/4376 Author: vomikan Date: 2013-07-14 09:04:08 +0000 (Sun, 14 Jul 2013) Log Message: ----------- ui aightment Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-07-14 05:26:35 UTC (rev 4375) +++ trunk/src/mmcheckingpanel.cpp 2013-07-14 09:04:08 UTC (rev 4376) @@ -629,9 +629,10 @@ btnDuplicate_->Enable(false); wxSearchCtrl* searchCtrl = new wxSearchCtrl(itemPanel12 - , wxID_FIND, wxEmptyString, wxDefaultPosition, wxSize(100,-1) + , wxID_FIND, wxEmptyString, wxDefaultPosition + , wxSize(100, btnDuplicate_->GetSize().GetHeight()) , wxTE_PROCESS_ENTER|wxTE_PROCESS_TAB, wxDefaultValidator, _("Search")); - itemButtonsSizer->Add(searchCtrl, 0, wxTOP, 1); + itemButtonsSizer->Add(searchCtrl, 0, wxCENTER, 1); searchCtrl->SetToolTip(_("Enter any string to find it in the nearest transaction notes")); //Infobar-mini This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-07-17 08:00:57
|
Revision: 4387 http://sourceforge.net/p/moneymanagerex/code/4387 Author: vomikan Date: 2013-07-17 08:00:50 +0000 (Wed, 17 Jul 2013) Log Message: ----------- move function not needed anymore for transfer transactions Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-07-16 11:57:48 UTC (rev 4386) +++ trunk/src/mmcheckingpanel.cpp 2013-07-17 08:00:50 UTC (rev 4387) @@ -1075,7 +1075,8 @@ menu.Append(MENU_ON_DUPLICATE_TRANSACTION, _("D&uplicate Transaction")); if (hide_menu_item) menu.Enable(MENU_ON_DUPLICATE_TRANSACTION, false); menu.Append(MENU_TREEPOPUP_MOVE, _("&Move Transaction")); - if (hide_menu_item || (m_cp->core_->accountList_.getNumBankAccounts() < 2)) + if (hide_menu_item || (m_cp->core_->accountList_.getNumBankAccounts() < 2) + || m_cp->m_trans[m_selectedIndex]->transType_ == TRANS_TYPE_TRANSFER_STR) menu.Enable(MENU_TREEPOPUP_MOVE, false); menu.Append(MENU_ON_PASTE_TRANSACTION, _("&Paste Transaction")); if (m_selectedForCopy < 0) menu.Enable(MENU_ON_PASTE_TRANSACTION, false); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-07-20 07:43:28
|
Revision: 4400 http://sourceforge.net/p/moneymanagerex/code/4400 Author: vomikan Date: 2013-07-20 07:43:25 +0000 (Sat, 20 Jul 2013) Log Message: ----------- fix for top visible item of list Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-07-20 05:14:55 UTC (rev 4399) +++ trunk/src/mmcheckingpanel.cpp 2013-07-20 07:43:25 UTC (rev 4400) @@ -1446,6 +1446,8 @@ { //check if a transaction is selected if (GetSelectedItemCount() < 1) return; + + topItemIndex_ = GetTopItem() + GetCountPerPage() -1; //ask if they really want to delete wxMessageDialog msgDlg(this @@ -1479,6 +1481,8 @@ void TransactionListCtrl::OnEditTransaction(wxCommandEvent& /*event*/) { if (m_selectedIndex < 0) return; + + topItemIndex_ = GetTopItem() + GetCountPerPage() -1; mmTransDialog dlg(m_cp->core_, m_cp->m_AccountID, m_cp->m_trans[m_selectedIndex], true, this); @@ -1492,6 +1496,8 @@ { mmTransDialog dlg(m_cp->core_, m_cp->m_AccountID, NULL, false, this); + topItemIndex_ = GetTopItem() + GetCountPerPage() -1; + if ( dlg.ShowModal() == wxID_OK ) { int transID = dlg.getTransID(); @@ -1504,6 +1510,8 @@ { if (m_selectedIndex < 0) return; + topItemIndex_ = GetTopItem() + GetCountPerPage() -1; + wxDateTime transTime = m_cp->m_trans[m_selectedIndex]->date_; mmTransDialog dlg(m_cp->core_, m_cp->m_AccountID, m_cp->m_trans[m_selectedIndex], true, this); @@ -1531,9 +1539,6 @@ if (topItemIndex_ < m_selectedIndex) topItemIndex_ = m_selectedIndex; - //debuger - //wxLogDebug(wxString::Format("trx id:%ld | top:%ld | selected:%ld", trans_id, topItemIndex_, m_selectedIndex); - if (m_cp->m_trans.size() > 0) { RefreshItems(0, m_cp->m_trans.size() - 1); } @@ -1548,6 +1553,8 @@ topItemIndex_ = m_selectedIndex; EnsureVisible(topItemIndex_); } + //debuger + //wxLogDebug(wxString::Format("+trx id:%ld | top:%ld | selected:%ld", trans_id, topItemIndex_, m_selectedIndex)); m_cp->updateExtraTransactionData(m_selectedIndex); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-07-27 07:07:53
|
Revision: 4425 http://sourceforge.net/p/moneymanagerex/code/4425 Author: vomikan Date: 2013-07-27 07:07:43 +0000 (Sat, 27 Jul 2013) Log Message: ----------- sort order improvements Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-07-26 16:28:28 UTC (rev 4424) +++ trunk/src/mmcheckingpanel.cpp 2013-07-27 07:07:43 UTC (rev 4425) @@ -286,7 +286,11 @@ { std::stable_sort(this->m_trans.begin(), this->m_trans.end() , [] (const mmBankTransaction* x, const mmBankTransaction* y) - { return x->date_ < y->date_; }); + { + if (x->date_ != y->date_) return x->date_ < y->date_; + else return x->transactionID() < y->transactionID(); + } + ); } else if (g_sortcol == COL_TRANSACTION_NUMBER) { @@ -298,19 +302,31 @@ { std::stable_sort(this->m_trans.begin(), this->m_trans.end() , [] (const mmBankTransaction* x, const mmBankTransaction* y) - { return x->payeeStr_ < y->payeeStr_; }); + { + if (x->payeeStr_ != y->payeeStr_) return x->payeeStr_ < y->payeeStr_; + else return x->date_ < y->date_; + } + ); } else if (g_sortcol == COL_STATUS) { std::stable_sort(this->m_trans.begin(), this->m_trans.end() , [] (const mmBankTransaction* x, const mmBankTransaction* y) - { return x->status_ < y->status_; }); + { + if (x->status_ != y->status_) return x->status_ < y->status_; + else return x->date_ < y->date_; + } + ); } else if (g_sortcol == COL_CATEGORY) { std::stable_sort(this->m_trans.begin(), this->m_trans.end() , [] (const mmBankTransaction* x, const mmBankTransaction* y) - { return x->fullCatStr_ < y->fullCatStr_; }); + { + if (x->fullCatStr_ != y->fullCatStr_) return x->fullCatStr_ < y->fullCatStr_; + else return x->date_ < y->date_; + } + ); } else if (g_sortcol == COL_WITHDRAWAL) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-09-07 08:06:21
|
Revision: 4451 http://sourceforge.net/p/moneymanagerex/code/4451 Author: vomikan Date: 2013-09-07 08:06:15 +0000 (Sat, 07 Sep 2013) Log Message: ----------- eol replacement to ' ' for the notes column Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-09-05 11:32:56 UTC (rev 4450) +++ trunk/src/mmcheckingpanel.cpp 2013-09-07 08:06:15 UTC (rev 4451) @@ -1287,7 +1287,11 @@ cell_value = (t.deposit_amt_ > 0) ? CurrencyFormatter::float2String(t.deposit_amt_) : ""; else if (column == COL_BALANCE) cell_value = CurrencyFormatter::float2String(t.balance_); - else if (column == COL_NOTES) cell_value = t.notes_; + else if (column == COL_NOTES) + { + cell_value = t.notes_; + cell_value.Replace("\n", " "); + } else wxASSERT(false); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-09-20 16:20:36
|
Revision: 4526 http://sourceforge.net/p/moneymanagerex/code/4526 Author: vomikan Date: 2013-09-20 16:20:33 +0000 (Fri, 20 Sep 2013) Log Message: ----------- delete for moved to trash transactions Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-09-20 15:09:36 UTC (rev 4525) +++ trunk/src/mmcheckingpanel.cpp 2013-09-20 16:20:33 UTC (rev 4526) @@ -1474,6 +1474,11 @@ wxCommandEvent evt(wxEVT_COMMAND_MENU_SELECTED, MENU_TREEPOPUP_MARKDELETE); OnMarkTransaction(evt); } + else if (wxGetKeyState(WXK_DELETE)|| wxGetKeyState(WXK_NUMPAD_DELETE)) + { + wxCommandEvent evt(wxEVT_COMMAND_MENU_SELECTED, MENU_TREEPOPUP_DELETE); + OnDeleteTransaction(evt); + } else { event.Skip(); return; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-09-21 06:52:55
|
Revision: 4529 http://sourceforge.net/p/moneymanagerex/code/4529 Author: vomikan Date: 2013-09-21 06:52:51 +0000 (Sat, 21 Sep 2013) Log Message: ----------- fix to don't change focus for selected transaction if view trash changed Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-09-21 04:44:29 UTC (rev 4528) +++ trunk/src/mmcheckingpanel.cpp 2013-09-21 06:52:51 UTC (rev 4529) @@ -1168,8 +1168,7 @@ void TransactionListCtrl::OnShowChbClick(wxCommandEvent& /*event*/) { showDeletedTransactions_ = !showDeletedTransactions_; - wxLogDebug("%i", showDeletedTransactions_); - refreshVisualList(); + refreshVisualList(m_selectedID); } void TransactionListCtrl::OnMarkTransaction(wxCommandEvent& event) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-09-23 09:24:38
|
Revision: 4556 http://sourceforge.net/p/moneymanagerex/code/4556 Author: vomikan Date: 2013-09-23 09:24:35 +0000 (Mon, 23 Sep 2013) Log Message: ----------- transaction alternate colour stage 1 Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-09-23 07:47:35 UTC (rev 4555) +++ trunk/src/mmcheckingpanel.cpp 2013-09-23 09:24:35 UTC (rev 4556) @@ -140,10 +140,17 @@ mmCheckingPanel *m_cp; - wxListItemAttr m_attr1; // style1 - wxListItemAttr m_attr2; // style2 - wxListItemAttr m_attr3; // style, for future dates - wxListItemAttr m_attr4; // style, for future dates + wxListItemAttr m_attr1; // style1 + wxListItemAttr m_attr2; // style2 + wxListItemAttr m_attr3; // style, for future dates + wxListItemAttr m_attr4; // style, for future dates + wxListItemAttr m_attr11; // user defined style 1 + wxListItemAttr m_attr12; // user defined style 2 + wxListItemAttr m_attr13; // user defined style 3 + wxListItemAttr m_attr14; // user defined style 4 + wxListItemAttr m_attr15; // user defined style 5 + wxListItemAttr m_attr16; // user defined style 6 + wxListItemAttr m_attr17; // user defined style 7 EColumn m_sortCol; bool m_asc; @@ -171,8 +178,9 @@ /* Sort Columns */ void OnColClick(wxListEvent& event); - /// Called when moving a transaction to a new account. + // Called when moving a transaction to a new account. int DestinationAccountID(); + //The topmost visible item long topItemIndex_; }; //---------------------------------------------------------------------------- @@ -1364,12 +1372,23 @@ mmBankTransaction *tr = ok ? m_cp->m_trans[idx] : 0; bool in_the_future = tr && tr->date_.GetDateOnly() > wxDateTime::Now().GetDateOnly(); - if (in_the_future) // apply alternating background pattern - { - return item % 2 ? (wxListItemAttr*)&m_attr3 : (wxListItemAttr*)&m_attr4; - } + // apply alternating background pattern + int user_colour_id = tr->followupID_; + if (user_colour_id < 0 ) user_colour_id = 0; + else if (user_colour_id > 7) user_colour_id = 0; - return item % 2 ? (wxListItemAttr*)&m_attr1 : (wxListItemAttr*)&m_attr2; + if (user_colour_id == 1) return (wxListItemAttr*)&m_attr11; + else if (user_colour_id == 2) return (wxListItemAttr*)&m_attr12; + else if (user_colour_id == 3) return (wxListItemAttr*)&m_attr13; + else if (user_colour_id == 4) return (wxListItemAttr*)&m_attr14; + else if (user_colour_id == 5) return (wxListItemAttr*)&m_attr15; + else if (user_colour_id == 6) return (wxListItemAttr*)&m_attr16; + else if (user_colour_id == 7) return (wxListItemAttr*)&m_attr17; + else if (in_the_future && item % 2) + return (wxListItemAttr*)&m_attr3; + else if (in_the_future) return (wxListItemAttr*)&m_attr4; + else if (item % 2) return (wxListItemAttr*)&m_attr1; + else return (wxListItemAttr*)&m_attr2; } //---------------------------------------------------------------------------- @@ -1441,8 +1460,8 @@ return; } - //find the topmost visible item - this will be used to set - // where to display the list again after refresh + /* find the topmost visible item - this will be used to set + where to display the list again after refresh */ topItemIndex_ = GetTopItem() + GetCountPerPage() -1; //Read status of the selected transaction @@ -1684,6 +1703,13 @@ m_attr2(*wxBLACK, mmColors::listAlternativeColor1, wxNullFont), m_attr3(mmColors::listFutureDateColor, mmColors::listAlternativeColor0, wxNullFont), m_attr4(mmColors::listFutureDateColor, mmColors::listAlternativeColor1, wxNullFont), + m_attr11(*wxBLACK, mmColors::userDefColor1, wxNullFont), + m_attr12(*wxBLACK, mmColors::userDefColor2, wxNullFont), + m_attr13(*wxBLACK, mmColors::userDefColor3, wxNullFont), + m_attr14(*wxBLACK, mmColors::userDefColor4, wxNullFont), + m_attr15(*wxBLACK, mmColors::userDefColor5, wxNullFont), + m_attr16(*wxBLACK, mmColors::userDefColor6, wxNullFont), + m_attr17(*wxBLACK, mmColors::userDefColor7, wxNullFont), m_sortCol(COL_DEF_SORT), m_asc(true), showDeletedTransactions_(false) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-09-23 11:11:55
|
Revision: 4558 http://sourceforge.net/p/moneymanagerex/code/4558 Author: vomikan Date: 2013-09-23 11:11:51 +0000 (Mon, 23 Sep 2013) Log Message: ----------- speedup for checking panel transaction status changes Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-09-23 10:41:15 UTC (rev 4557) +++ trunk/src/mmcheckingpanel.cpp 2013-09-23 11:11:51 UTC (rev 4558) @@ -1196,9 +1196,11 @@ int transID = OnMarkTransactionDB(status); - refreshVisualList(transID); - //TODO: blinkings may be avoided - //m_cp->m_listCtrlAccount->RefreshItems(m_selectedIndex, m_selectedIndex); + if ((m_cp->transFilterActive_ && m_cp->transFilterDlg_->getStatusCheckBox()) + || (status == "X" && !showDeletedTransactions_)) + refreshVisualList(transID); + else + RefreshItems(m_selectedIndex, m_selectedIndex); } //---------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-09-23 18:02:39
|
Revision: 4559 http://sourceforge.net/p/moneymanagerex/code/4559 Author: vomikan Date: 2013-09-23 18:02:34 +0000 (Mon, 23 Sep 2013) Log Message: ----------- update for OnGetItemAttr function Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-09-23 11:11:51 UTC (rev 4558) +++ trunk/src/mmcheckingpanel.cpp 2013-09-23 18:02:34 UTC (rev 4559) @@ -1371,30 +1371,33 @@ wxASSERT(m_cp); wxASSERT(item >= 0); - size_t idx = item; - bool ok = m_cp && idx < m_cp->m_trans.size(); + if (m_cp && item >= 0 && item < (long)m_cp->m_trans.size()) + { + bool in_the_future = false; + mmBankTransaction *transaction = m_cp->m_trans[item]; + if (transaction) + in_the_future = transaction->date_.GetDateOnly() > wxDateTime::Now().GetDateOnly(); - mmBankTransaction *tr = ok ? m_cp->m_trans[idx] : 0; - bool in_the_future = tr && tr->date_.GetDateOnly() > wxDateTime::Now().GetDateOnly(); + // apply alternating background pattern + int user_colour_id = transaction->followupID_; + if (user_colour_id < 0 ) user_colour_id = 0; + else if (user_colour_id > 7) user_colour_id = 0; - // apply alternating background pattern - int user_colour_id = tr->followupID_; - if (user_colour_id < 0 ) user_colour_id = 0; - else if (user_colour_id > 7) user_colour_id = 0; - - if (user_colour_id == 1) return (wxListItemAttr*)&m_attr11; - else if (user_colour_id == 2) return (wxListItemAttr*)&m_attr12; - else if (user_colour_id == 3) return (wxListItemAttr*)&m_attr13; - else if (user_colour_id == 4) return (wxListItemAttr*)&m_attr14; - else if (user_colour_id == 5) return (wxListItemAttr*)&m_attr15; - else if (user_colour_id == 6) return (wxListItemAttr*)&m_attr16; - else if (user_colour_id == 7) return (wxListItemAttr*)&m_attr17; - else if (in_the_future && item % 2) - return (wxListItemAttr*)&m_attr3; - else if (in_the_future) return (wxListItemAttr*)&m_attr4; - else if (item % 2) return (wxListItemAttr*)&m_attr1; - else return (wxListItemAttr*)&m_attr2; - + if (user_colour_id != 0) + { + if (user_colour_id == 1) return (wxListItemAttr*)&m_attr11; + else if (user_colour_id == 2) return (wxListItemAttr*)&m_attr12; + else if (user_colour_id == 3) return (wxListItemAttr*)&m_attr13; + else if (user_colour_id == 4) return (wxListItemAttr*)&m_attr14; + else if (user_colour_id == 5) return (wxListItemAttr*)&m_attr15; + else if (user_colour_id == 6) return (wxListItemAttr*)&m_attr16; + else if (user_colour_id == 7) return (wxListItemAttr*)&m_attr17; + } + else if (in_the_future && item % 2) return (wxListItemAttr*)&m_attr3; + else if (in_the_future) return (wxListItemAttr*)&m_attr4; + else if (item % 2) return (wxListItemAttr*)&m_attr1; + } + return (wxListItemAttr*)&m_attr2; } //---------------------------------------------------------------------------- // If any of these keys are encountered, the search for the event handler This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sie...@us...> - 2013-09-12 01:18:34
|
Revision: 4469 http://sourceforge.net/p/moneymanagerex/code/4469 Author: siena123 Date: 2013-09-12 01:18:31 +0000 (Thu, 12 Sep 2013) Log Message: ----------- fix to compile on msw vc Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-09-11 20:23:56 UTC (rev 4468) +++ trunk/src/mmcheckingpanel.cpp 2013-09-12 01:18:31 UTC (rev 4469) @@ -132,7 +132,7 @@ long m_selectedForCopy; long m_selectedID; void refreshVisualList(int trans_id = -1); - bool showDeletedTransactions_ = false; + bool showDeletedTransactions_; private: DECLARE_NO_COPY_CLASS(TransactionListCtrl) @@ -1681,7 +1681,8 @@ m_attr3(mmColors::listFutureDateColor, mmColors::listAlternativeColor0, wxNullFont), m_attr4(mmColors::listFutureDateColor, mmColors::listAlternativeColor1, wxNullFont), m_sortCol(COL_DEF_SORT), - m_asc(true) + m_asc(true), + showDeletedTransactions_(false) { wxASSERT(m_cp); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-10-04 17:29:40
|
Revision: 4689 http://sourceforge.net/p/moneymanagerex/code/4689 Author: vomikan Date: 2013-10-04 17:29:37 +0000 (Fri, 04 Oct 2013) Log Message: ----------- transaction dialog refactoring stage #03 Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-10-04 14:10:22 UTC (rev 4688) +++ trunk/src/mmcheckingpanel.cpp 2013-10-04 17:29:37 UTC (rev 4689) @@ -1603,16 +1603,16 @@ void TransactionListCtrl::OnDuplicateTransaction(wxCommandEvent& /*event*/) { - //TODO: Simplification needed return; if (m_selectedIndex < 0) return; int selected_transaction_id = m_cp->m_trans[m_selectedIndex]->transactionID(); - Model_Checking::Data *transaction = Model_Checking::instance().create(); - Model_Splittransaction::Data *split = Model_Splittransaction::instance().create(); Model_Checking::Data *source_transaction = Model_Checking::instance().get(selected_transaction_id); - Model_Splittransaction::Data *source_split = Model_Splittransaction::instance().get(selected_transaction_id); + Model_Splittransaction::Data_Set source_split = Model_Splittransaction::instance().find(Model_Splittransaction::COL_TRANSID, selected_transaction_id); + Model_Checking::Data *transaction = Model_Checking::instance().create(); + Model_Checking::instance().save(transaction); + transaction->ACCOUNTID = m_cp->m_AccountID; transaction->CATEGID = source_transaction->CATEGID; transaction->FOLLOWUPID = source_transaction->FOLLOWUPID; @@ -1625,22 +1625,25 @@ transaction->TRANSACTIONNUMBER = source_transaction->TRANSACTIONNUMBER; transaction->TRANSAMOUNT = source_transaction->TRANSAMOUNT; transaction->TRANSCODE = source_transaction->TRANSCODE; - //TODO: Now? - transaction->TRANSDATE = source_transaction->TRANSDATE; + transaction->TRANSDATE = wxDateTime::Now().FormatISODate(); - //TODO: Duplicate split entries - //Model_Splittransaction::instance().save(split); + for (const auto& entry: source_split) + { + wxLogDebug("%s", entry.to_json()); + Model_Splittransaction::Data *new_split = Model_Splittransaction::instance().create(); + new_split->CATEGID = entry.CATEGID; + new_split->SUBCATEGID = entry.SUBCATEGID; + new_split->SPLITTRANSAMOUNT = entry.SPLITTRANSAMOUNT; + new_split->TRANSID = transaction->TRANSID; + Model_Splittransaction::instance().save(new_split); + } Model_Checking::instance().save(transaction); - //wxDateTime transTime = m_cp->m_trans[m_selectedIndex]->date_; - //mmTransDialog dlg(transaction, split, this - // , m_cp->core_, m_cp->m_trans[m_selectedIndex], false); - //dlg.SetDialogToDuplicateTransaction(); - //dlg.SetDialogTitle(_("Duplicate Transaction")); + //TODO: + m_cp->core_->bTransactionList_.LoadTransactions(); - //TODO: - mmBankTransaction* pTransaction = m_cp->core_->bTransactionList_.getBankTransactionPtr(transaction->TRANSID); + /*mmBankTransaction* pTransaction = m_cp->core_->bTransactionList_.getBankTransactionPtr(transaction->TRANSID); pTransaction->accountID_ = transaction->ACCOUNTID; pTransaction->toAccountID_ = transaction->TOACCOUNTID; pTransaction->payeeID_ = transaction->PAYEEID; @@ -1657,14 +1660,10 @@ pTransaction->date_ = mmGetStorageStringAsDate(transaction->TRANSDATE); pTransaction->toAmt_ = transaction->TOTRANSAMOUNT; - m_cp->m_trans.push_back(pTransaction); + m_cp->m_trans.push_back(pTransaction);*/ topItemIndex_ = GetTopItem() + GetCountPerPage() -1; - //if ( dlg.ShowModal() == wxID_OK ) - //{ - //int transID = dlg.getTransID(); - refreshVisualList(transaction->TRANSID); - //} + refreshVisualList(transaction->TRANSID); } void TransactionListCtrl::OnSetUserColour(wxCommandEvent& event) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gua...@us...> - 2013-10-05 00:56:02
|
Revision: 4692 http://sourceforge.net/p/moneymanagerex/code/4692 Author: guanlisheng Date: 2013-10-05 00:55:59 +0000 (Sat, 05 Oct 2013) Log Message: ----------- cleanup and use method from model Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-10-04 20:56:09 UTC (rev 4691) +++ trunk/src/mmcheckingpanel.cpp 2013-10-05 00:55:59 UTC (rev 4692) @@ -1612,7 +1612,7 @@ int selected_transaction_id = m_cp->m_trans[m_selectedIndex]->transactionID(); Model_Checking::Data *source_transaction = Model_Checking::instance().get(selected_transaction_id); - Model_Splittransaction::Data_Set source_split = Model_Splittransaction::instance().find(Model_Splittransaction::COL_TRANSID, selected_transaction_id); + Model_Splittransaction::Data_Set source_split = Model_Checking::splittransaction(source_transaction); Model_Checking::Data *transaction = Model_Checking::instance().create(); Model_Checking::instance().save(transaction); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2013-10-08 07:07:04
|
Revision: 4798 http://sourceforge.net/p/moneymanagerex/code/4798 Author: vomikan Date: 2013-10-08 07:07:01 +0000 (Tue, 08 Oct 2013) Log Message: ----------- cleanup Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-10-08 06:44:59 UTC (rev 4797) +++ trunk/src/mmcheckingpanel.cpp 2013-10-08 07:07:01 UTC (rev 4798) @@ -1247,8 +1247,12 @@ if (m_selectedIndex < 0) return -1; int transID = m_cp->m_trans[m_selectedIndex]->transactionID(); - if (mmDBWrapper::updateTransactionWithStatus(*m_cp->getDb(), transID, status)) - m_cp->m_trans[m_selectedIndex]->status_ = status; + Model_Checking::Data *transaction = Model_Checking::instance().get(transID); + if (transaction) + { + transaction->STATUS = status; + Model_Checking::instance().save(transaction); + } return transID; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |