From: <oma...@us...> - 2009-11-12 18:50:26
|
Revision: 756 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=756&view=rev Author: omalleypat Date: 2009-11-12 18:50:20 +0000 (Thu, 12 Nov 2009) Log Message: ----------- The sql query being used for dataToControls was not returning any rows if the transaction being edited was a split. This would result in no values being populated into the dialog. Changing from a join to a left join on the category seems to fix this behavior and correctly populate the dialog. Modified Paths: -------------- trunk/mmex/src/transdialog.cpp Modified: trunk/mmex/src/transdialog.cpp =================================================================== --- trunk/mmex/src/transdialog.cpp 2009-11-12 16:34:45 UTC (rev 755) +++ trunk/mmex/src/transdialog.cpp 2009-11-12 18:50:20 UTC (rev 756) @@ -139,7 +139,7 @@ "left join PAYEE_V1 p " "on p.PAYEEID = ca.PAYEEID " - "join CATEGORY_V1 cat " + "left join CATEGORY_V1 cat " "on cat.CATEGID = ca.CATEGID " "left join SUBCATEGORY_V1 sc " This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2010-05-05 10:16:54
|
Revision: 907 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=907&view=rev Author: vomikan Date: 2010-05-05 10:16:48 +0000 (Wed, 05 May 2010) Log Message: ----------- sentence reversed "Amount to be recorded in To Account" & "To Account Amount Entry" Modified Paths: -------------- trunk/mmex/src/transdialog.cpp Modified: trunk/mmex/src/transdialog.cpp =================================================================== --- trunk/mmex/src/transdialog.cpp 2010-05-05 10:06:39 UTC (rev 906) +++ trunk/mmex/src/transdialog.cpp 2010-05-05 10:16:48 UTC (rev 907) @@ -613,8 +613,8 @@ { mmex::formatDoubleToCurrencyEdit(toTransAmount_, dispString); } - wxTextEntryDialog* dlg = new wxTextEntryDialog(this, _("To Account Amount Entry"), - _("Amount to be recorded in To Account"), dispString); + wxTextEntryDialog* dlg = new wxTextEntryDialog(this, _("Amount to be recorded in To Account"), + _("To Account Amount Entry"), dispString); if ( dlg->ShowModal() == wxID_OK ) { wxString currText = dlg->GetValue().Trim(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2010-12-02 11:59:23
|
Revision: 1014 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1014&view=rev Author: vomikan Date: 2010-12-02 11:59:16 +0000 (Thu, 02 Dec 2010) Log Message: ----------- Do not close Transaction Dialog window when Escape button pressed (for Chinese typing support) Modified Paths: -------------- trunk/mmex/src/transdialog.cpp Modified: trunk/mmex/src/transdialog.cpp =================================================================== --- trunk/mmex/src/transdialog.cpp 2010-12-02 09:04:24 UTC (rev 1013) +++ trunk/mmex/src/transdialog.cpp 2010-12-02 11:59:16 UTC (rev 1014) @@ -39,6 +39,7 @@ BEGIN_EVENT_TABLE( mmTransDialog, wxDialog ) EVT_BUTTON(ID_DIALOG_TRANS_BUTTON_OK, mmTransDialog::OnOk) + EVT_BUTTON(ID_DIALOG_TRANS_BUTTON_CANCEL, mmTransDialog::OnCancel) EVT_BUTTON(ID_DIALOG_TRANS_BUTTONCATEGS, mmTransDialog::OnCategs) EVT_BUTTON(ID_DIALOG_TRANS_BUTTONPAYEE, mmTransDialog::OnPayee) EVT_BUTTON(ID_DIALOG_TRANS_BUTTONTO, mmTransDialog::OnTo) @@ -426,7 +427,9 @@ itemBoxSizer26->Add(itemButton27, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); wxButton* itemButton28 = new wxButton( itemPanel25, - wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); + // Do not close window when Escape button pressed + // wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); + ID_DIALOG_TRANS_BUTTON_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer26->Add(itemButton28, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2010-12-02 13:10:29
|
Revision: 1015 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1015&view=rev Author: vomikan Date: 2010-12-02 13:10:22 +0000 (Thu, 02 Dec 2010) Log Message: ----------- Buttons style tuning Modified Paths: -------------- trunk/mmex/src/transdialog.cpp Modified: trunk/mmex/src/transdialog.cpp =================================================================== --- trunk/mmex/src/transdialog.cpp 2010-12-02 11:59:16 UTC (rev 1014) +++ trunk/mmex/src/transdialog.cpp 2010-12-02 13:10:22 UTC (rev 1015) @@ -264,6 +264,9 @@ wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxHORIZONTAL); itemBoxSizer3->Add(itemBoxSizer4, 0, wxALIGN_LEFT|wxALL, 5); + wxSizerFlags flags; + flags.Border(); + wxStaticText* itemStaticText5 = new wxStaticText( itemDialog1, wxID_STATIC, _("Transaction Type"), wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer4->Add(itemStaticText5, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); @@ -281,10 +284,10 @@ choiceTrans_->SetSelection(0); choiceTrans_->SetToolTip(_("Specify the type of transactions to be created.")); - bAdvanced_ = new wxButton( itemDialog1, ID_DIALOG_TRANS_BUTTONADVANCED, _("Advanced"), - wxDefaultPosition, wxSize(100, -1), 0 ); + bAdvanced_ = new wxButton( itemDialog1, ID_DIALOG_TRANS_BUTTONADVANCED, _("Advanced")); bAdvanced_->Enable(false); - itemBoxSizer4->Add(bAdvanced_, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5); + wxFont fnt = itemDialog1->GetFont(); + itemBoxSizer4->Add(bAdvanced_, flags); // bAdvanced_->SetToolTip(_("Specify advanced settings for transaction")); bAdvanced_->SetToolTip(_("Specify the transfer amount in the To Account")); @@ -386,7 +389,7 @@ _("Reconciled"), _("Void"), _("Follow up"), - _("Duplicate") + _("Duplicate") }; choiceStatus_ = new wxChoice( itemPanel7, ID_DIALOG_TRANS_STATUS, wxDefaultPosition, @@ -411,26 +414,39 @@ textAmount_ = new wxTextCtrl( itemPanel7, ID_DIALOG_TRANS_TEXTAMOUNT, wxT(""), wxDefaultPosition, wxDefaultSize, 0 ); - itemFlexGridSizer8->Add(textAmount_, 0, + itemFlexGridSizer8->Add(textAmount_, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5); textAmount_->SetToolTip(_("Specify the amount for this transaction")); - wxPanel* itemPanel25 = new wxPanel( itemDialog1, wxID_ANY, + wxPanel* itemPanel25 = new wxPanel( itemDialog1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); itemBoxSizer3->Add(itemPanel25, 0, wxALIGN_RIGHT|wxALL, 5); wxBoxSizer* itemBoxSizer26 = new wxBoxSizer(wxHORIZONTAL); itemPanel25->SetSizer(itemBoxSizer26); - wxButton* itemButton27 = new wxButton( itemPanel25, - ID_DIALOG_TRANS_BUTTON_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer26->Add(itemButton27, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + wxButton* itemButton27 = new wxButton( itemPanel25, ID_DIALOG_TRANS_BUTTON_OK, _("OK")); + fnt.SetWeight(wxFONTWEIGHT_NORMAL); + fnt.SetPointSize(fnt.GetPointSize()); + itemButton27->SetFont(fnt); + itemButton27->SetForegroundColour(wxColour(wxT("FOREST GREEN"))); + itemBoxSizer26->Add(itemButton27, flags); +<<<<<<< .mine + wxButton* itemButton28 = new wxButton( itemPanel25, ID_DIALOG_TRANS_BUTTON_CANCEL, _("Cancel")); + fnt.SetWeight(wxFONTWEIGHT_NORMAL); + fnt.SetPointSize(fnt.GetPointSize()); + itemButton28->SetFont(fnt); + itemButton28->SetForegroundColour(wxColour(wxT("RED"))); + itemBoxSizer26->Add(itemButton28, flags); + +======= wxButton* itemButton28 = new wxButton( itemPanel25, // Do not close window when Escape button pressed // wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); ID_DIALOG_TRANS_BUTTON_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer26->Add(itemButton28, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); +>>>>>>> .r1014 } void mmTransDialog::OnCancel(wxCommandEvent& /*event*/) @@ -964,3 +980,4 @@ } } + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2011-01-09 19:45:32
|
Revision: 1081 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1081&view=rev Author: vomikan Date: 2011-01-09 19:45:26 +0000 (Sun, 09 Jan 2011) Log Message: ----------- Determine most frequently used payee name for current account when new transaction is entering Modified Paths: -------------- trunk/mmex/src/transdialog.cpp Modified: trunk/mmex/src/transdialog.cpp =================================================================== --- trunk/mmex/src/transdialog.cpp 2011-01-09 19:41:38 UTC (rev 1080) +++ trunk/mmex/src/transdialog.cpp 2011-01-09 19:45:26 UTC (rev 1081) @@ -32,7 +32,7 @@ enum { DEF_WITHDRAWAL, DEF_DEPOSIT, DEF_TRANSFER }; // Defines for Transaction Status -enum { DEF_STATUS_NONE, DEF_STATUS_RECONCILED, DEF_STATUS_VOID, DEF_STATUS_FOLLOWUP, DEF_STATUS_DUPLICATE }; +enum { DEF_STATUS_RECONCILED, DEF_STATUS_VOID, DEF_STATUS_FOLLOWUP, DEF_STATUS_DUPLICATE, DEF_STATUS_NONE }; IMPLEMENT_DYNAMIC_CLASS( mmTransDialog, wxDialog ) @@ -189,12 +189,12 @@ { choiceStatus_->SetSelection(DEF_STATUS_FOLLOWUP); } - else if (statusString == wxT("D")) + else if (statusString == wxT("D")) { choiceStatus_->SetSelection(DEF_STATUS_DUPLICATE); } - if (transTypeString == wxT("Withdrawal")) + if (transTypeString == wxT("Withdrawal")) choiceTrans_->SetSelection(DEF_WITHDRAWAL); else if (transTypeString == wxT("Deposit")) choiceTrans_->SetSelection(DEF_DEPOSIT); @@ -309,36 +309,83 @@ wxFlexGridSizer* itemFlexGridSizer8 = new wxFlexGridSizer(4, 4, 0, 0); itemPanel7->SetSizer(itemFlexGridSizer8); - // ----------------------------------------------- + // Payee button ----------------------------------- begin wxStaticText* itemStaticText9 = new wxStaticText( itemPanel7, ID_DIALOG_TRANS_STATIC_PAYEE, _("Payee"), wxDefaultPosition, wxDefaultSize, 0 ); itemFlexGridSizer8->Add(itemStaticText9, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); - bPayee_ = new wxButton( itemPanel7, ID_DIALOG_TRANS_BUTTONPAYEE, - _("Select Payee"), wxDefaultPosition, wxSize(200, -1), 0 ); + // Determine most frequently used payee name for current account + static const char sql[] = + "select count (*) c, " + "cat.categname CATEGNAME, sc.subcategname SUBCATEGNAME, " + "ca.categid, ca.subcategid, " + "ca.payeeid, p.payeename PAYEENAME " + "from CHECKINGACCOUNT_V1 ca, payee_v1 p " + "left join CATEGORY_V1 cat " + "on cat.CATEGID = ca.CATEGID " + + "left join SUBCATEGORY_V1 sc " + "on sc.CATEGID = ca.CATEGID and " + "sc.SUBCATEGID = ca.SUBCATEGID " + + "where ca.payeeid=p.payeeid " + "and ca.transcode<>'Transfer' " + "and ca.accountid = ? " + "group by ca.payeeid, ca.transdate, ca.categid, ca.subcategid " + "order by ca.transdate desc, ca.transid desc, c desc " + "limit 1"; + + wxSQLite3Statement st = db_->PrepareStatement(sql); + st.Bind(1, accountID_); + wxSQLite3ResultSet q1 = st.ExecuteQuery(sql); + wxString payeeName = q1.GetString(wxT("PAYEENAME")); + payeeID_ = q1.GetInt(wxT("PAYEEID")); + wxString categString = q1.GetString(wxT("CATEGNAME")); + wxString subcategName = q1.GetString(wxT("SUBCATEGNAME")); + categID_ = q1.GetInt(wxT("CATEGID")); + subcategID_ = q1.GetInt(wxT("SUBCATEGID")); + + //if some values is missing - set defaults + if (payeeName == wxT("")) + { + payeeName = _("Select Payee"); + payeeID_ = -1; + } + if (categString == wxT("")) + { + categString = _("Select Category"); + } + else + { + if (subcategName != wxT("")) + { + categString += wxT(" : "); + categString += subcategName; + } + } + + st.Finalize(); + bPayee_ = new wxButton( itemPanel7, ID_DIALOG_TRANS_BUTTONPAYEE, payeeName, wxDefaultPosition, wxSize(200, -1), 0 ); itemFlexGridSizer8->Add(bPayee_, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5); bPayee_->SetToolTip(_("Specify to whom the transaction is going to or coming from ")); - // ----------------------------------- - - wxStaticText* itemStaticText11 = new wxStaticText( itemPanel7, wxID_STATIC, - _("Number"), wxDefaultPosition, wxDefaultSize, 0 ); + // Payee button ----------------------------------- end + + //=========================================================== + wxStaticText* itemStaticText11 = new wxStaticText( itemPanel7, wxID_STATIC, _("Number"), wxDefaultPosition, wxDefaultSize, 0 ); itemFlexGridSizer8->Add(itemStaticText11, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); - //=========================================================== wxBoxSizer* itemBoxSizer550 = new wxBoxSizer(wxHORIZONTAL); itemFlexGridSizer8->Add(itemBoxSizer550, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5); - textNumber_ = new wxTextCtrl( itemPanel7, ID_DIALOG_TRANS_TEXTNUMBER, wxT(""), - wxDefaultPosition, wxSize(50, -1), 0 ); + textNumber_ = new wxTextCtrl( itemPanel7, ID_DIALOG_TRANS_TEXTNUMBER, wxT(""), wxDefaultPosition, wxSize(50, -1), 0 ); itemBoxSizer550->Add(textNumber_, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5); textNumber_->SetToolTip(_("Specify any associated check number or transaction number")); - bAuto_ = new wxButton( itemPanel7, ID_DIALOG_TRANS_BUTTONTRANSNUM, wxT(".."), - wxDefaultPosition, wxSize(30, -1), 0 ); + bAuto_ = new wxButton( itemPanel7, ID_DIALOG_TRANS_BUTTONTRANSNUM, wxT(".."), wxDefaultPosition, wxSize(30, -1), 0 ); itemBoxSizer550->Add(bAuto_, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); bAuto_->SetToolTip(_("Populate Transaction #")); @@ -346,8 +393,7 @@ wxStaticText* itemStaticText13 = new wxStaticText( itemPanel7, ID_DIALOG_TRANS_STATIC_FROM, _("To"), wxDefaultPosition, wxDefaultSize, 0 ); - itemFlexGridSizer8->Add(itemStaticText13, 0, - wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); + itemFlexGridSizer8->Add(itemStaticText13, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); itemStaticText13->Show(false); bTo_ = new wxButton( itemPanel7, ID_DIALOG_TRANS_BUTTONTO, _("Select To Acct"), @@ -361,25 +407,22 @@ itemFlexGridSizer8->Add(itemStaticText15, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); - dpc_ = new wxDatePickerCtrl( itemPanel7, ID_DIALOG_TRANS_BUTTONDATE, wxDefaultDateTime, - wxDefaultPosition, wxSize(100, -1), wxDP_DROPDOWN); + dpc_ = new wxDatePickerCtrl( itemPanel7, ID_DIALOG_TRANS_BUTTONDATE, wxDefaultDateTime, wxDefaultPosition, wxSize(100, -1), wxDP_DROPDOWN); itemFlexGridSizer8->Add(dpc_, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5); dpc_->SetToolTip(_("Specify the date of the transaction")); - wxStaticText* itemStaticText17 = new wxStaticText( itemPanel7, - wxID_STATIC, _("Category"), wxDefaultPosition, wxDefaultSize, 0 ); - itemFlexGridSizer8->Add(itemStaticText17, 0, - wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); + // Category ******************************** begin // + wxStaticText* itemStaticText17 = new wxStaticText( itemPanel7, wxID_STATIC, _("Category"), wxDefaultPosition, wxDefaultSize, 0 ); + itemFlexGridSizer8->Add(itemStaticText17, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); - // ******************************** // wxBoxSizer* itemBoxSizer18 = new wxBoxSizer(wxHORIZONTAL); itemFlexGridSizer8->Add(itemBoxSizer18, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5); bCategory_ = new wxButton( itemPanel7, - ID_DIALOG_TRANS_BUTTONCATEGS, _("Select Category"), - wxDefaultPosition, wxSize(200, -1), 0 ); + ID_DIALOG_TRANS_BUTTONCATEGS, categString, wxDefaultPosition, wxSize(200, -1), 0 ); itemBoxSizer18->Add(bCategory_, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5); bCategory_->SetToolTip(_("Specify the category for this transaction")); + // Category ******************************** end // cSplit_ = new wxCheckBox( itemPanel7, ID_DIALOG_TRANS_SPLITCHECKBOX, _("Split"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE ); @@ -388,18 +431,17 @@ //////////////////////////////////////////// - wxStaticText* itemStaticText51 = new wxStaticText( itemPanel7, wxID_STATIC, - _("Status"), wxDefaultPosition, wxDefaultSize, 0 ); + wxStaticText* itemStaticText51 = new wxStaticText( itemPanel7, wxID_STATIC, _("Status"), wxDefaultPosition, wxDefaultSize, 0 ); itemFlexGridSizer8->Add(itemStaticText51, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); wxString itemChoice7Strings[] = { - _("None"), _("Reconciled"), _("Void"), _("Follow up"), - _("Duplicate") + _("Duplicate"), + _("None"), }; choiceStatus_ = new wxChoice( itemPanel7, ID_DIALOG_TRANS_STATUS, wxDefaultPosition, @@ -412,24 +454,19 @@ wxID_STATIC, _("Notes"), wxDefaultPosition, wxDefaultSize, 0 ); itemFlexGridSizer8->Add(itemStaticText21, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); - textNotes_ = new wxTextCtrl( itemPanel7, - ID_DIALOG_TRANS_TEXTNOTES, wxT(""), wxDefaultPosition, wxSize(200, 75), wxTE_MULTILINE ); + textNotes_ = new wxTextCtrl( itemPanel7, ID_DIALOG_TRANS_TEXTNOTES, wxT(""), wxDefaultPosition, wxSize(200, 75), wxTE_MULTILINE ); itemFlexGridSizer8->Add(textNotes_, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5); textNotes_->SetToolTip(_("Specify any text notes you want to add to this transaction.")); - - wxStaticText* itemStaticText23 = new wxStaticText( itemPanel7, wxID_STATIC, - _("Amount"), wxDefaultPosition, wxDefaultSize, 0 ); - itemFlexGridSizer8->Add(itemStaticText23, 0, - wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); - - textAmount_ = new wxTextCtrl( itemPanel7, ID_DIALOG_TRANS_TEXTAMOUNT, - wxT(""), wxDefaultPosition, wxDefaultSize, 0 ); - itemFlexGridSizer8->Add(textAmount_, 0, - wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5); + + wxStaticText* itemStaticText23 = new wxStaticText( itemPanel7, wxID_STATIC, _("Amount"), wxDefaultPosition, wxDefaultSize, 0 ); + itemFlexGridSizer8->Add(itemStaticText23, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); + + textAmount_ = new wxTextCtrl( itemPanel7, ID_DIALOG_TRANS_TEXTAMOUNT, wxT(""), wxDefaultPosition, wxDefaultSize, 0 ); + itemFlexGridSizer8->Add(textAmount_, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5); textAmount_->SetToolTip(_("Specify the amount for this transaction")); + textAmount_->SetFocus(); - wxPanel* itemPanel25 = new wxPanel( itemDialog1, wxID_ANY, - wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxPanel* itemPanel25 = new wxPanel( itemDialog1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); itemBoxSizer3->Add(itemPanel25, 0, wxALIGN_RIGHT|wxALL, 5); wxBoxSizer* itemBoxSizer26 = new wxBoxSizer(wxHORIZONTAL); @@ -773,9 +810,9 @@ return; } } - else + else // if payee just has been created categid still null { - if (categID_ == -1) + if (categID_ < 1) { mmShowErrorMessageInvalid(this, _("Category ")); return; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ste...@us...> - 2011-02-04 13:49:18
|
Revision: 1141 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1141&view=rev Author: stef145g Date: 2011-02-04 13:49:12 +0000 (Fri, 04 Feb 2011) Log Message: ----------- Fix: Change of payee when transaction has split category Modified Paths: -------------- trunk/mmex/src/transdialog.cpp Modified: trunk/mmex/src/transdialog.cpp =================================================================== --- trunk/mmex/src/transdialog.cpp 2011-02-04 01:16:07 UTC (rev 1140) +++ trunk/mmex/src/transdialog.cpp 2011-02-04 13:49:12 UTC (rev 1141) @@ -524,19 +524,19 @@ q1.Finalize(); wxSingleChoiceDialog scd(0, _("Choose Bank Account or Term Account"), _("Select Account"), as); - if (scd.ShowModal() == wxID_OK) + if (scd.ShowModal() == wxID_OK) { - wxString acctName = scd.GetStringSelection(); + wxString acctName = scd.GetStringSelection(); payeeID_ = mmDBWrapper::getAccountID(db_.get(), acctName); bPayee_->SetLabel(acctName); - } - } - else - { - mmPayeeDialog dlg(this, core_); + } + } + else + { + mmPayeeDialog dlg(this, core_); - if ( dlg.ShowModal() == wxID_OK ) - { + if ( dlg.ShowModal() == wxID_OK ) + { payeeID_ = dlg.getPayeeId(); if (payeeID_ == -1) { @@ -544,28 +544,25 @@ return; } - // ... If this is a Split Transaction, ignore the Payee change - if (split_->numEntries()) - return; - int tempCategID = -1; int tempSubCategID = -1; - wxString payeeName = mmDBWrapper::getPayee(db_.get(), - payeeID_, tempCategID, tempSubCategID); + wxString payeeName = mmDBWrapper::getPayee(db_.get(), payeeID_, tempCategID, tempSubCategID); bPayee_->SetLabel(mmReadyDisplayString(payeeName)); - if (tempCategID == -1) - { + // If this is a Split Transaction, ignore displaying last category for payee + if (split_->numEntries()) return; - } - + + // if payee has no memory of category then ignore displaying last category for payee + if (tempCategID == -1) + return; + wxString catName = mmDBWrapper::getCategoryName(db_.get(), tempCategID); wxString categString = catName; if (tempSubCategID != -1) { - wxString subcatName = mmDBWrapper::getSubCategoryName(db_.get(), - tempCategID, tempSubCategID); + wxString subcatName = mmDBWrapper::getSubCategoryName(db_.get(), tempCategID, tempSubCategID); categString += wxT(" : "); categString += subcatName; } @@ -576,8 +573,7 @@ } else { - wxString payeeName = mmDBWrapper::getPayee(db_.get(), - payeeID_, categID_, subcategID_); + wxString payeeName = mmDBWrapper::getPayee(db_.get(), payeeID_, categID_, subcategID_); if (payeeName.IsEmpty()) { payeeID_ = -1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ste...@us...> - 2011-03-08 02:33:04
|
Revision: 1178 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1178&view=rev Author: stef145g Date: 2011-03-08 02:32:58 +0000 (Tue, 08 Mar 2011) Log Message: ----------- parameters reset until proper solution found Modified Paths: -------------- trunk/mmex/src/transdialog.cpp Modified: trunk/mmex/src/transdialog.cpp =================================================================== --- trunk/mmex/src/transdialog.cpp 2011-03-06 06:44:30 UTC (rev 1177) +++ trunk/mmex/src/transdialog.cpp 2011-03-08 02:32:58 UTC (rev 1178) @@ -519,22 +519,24 @@ { if (choiceTrans_->GetSelection() == DEF_TRANSFER) { - //It's should be passible transfer from or to Investment accounts too - static const char sql[] = + //It should be possible to transfer from or to Investment accounts as too. + static const char sql[] = "select ACCOUNTNAME " "from ACCOUNTLIST_V1 " - "where /*(ACCOUNTTYPE = 'Checking' or ACCOUNTTYPE = 'Term') and*/ STATUS <> 'Closed' " +// "where /*(ACCOUNTTYPE = 'Checking' or ACCOUNTTYPE = 'Term') and*/ STATUS <> 'Closed' " +// restored to previous order until a proper solution is found. + "where (ACCOUNTTYPE = 'Checking' or ACCOUNTTYPE = 'Term') and STATUS <> 'Closed' " "order by ACCOUNTNAME"; - + wxArrayString as; - + wxSQLite3ResultSet q1 = db_->ExecuteQuery(sql); while (q1.NextRow()) { as.Add(q1.GetString(wxT("ACCOUNTNAME"))); } q1.Finalize(); - + wxSingleChoiceDialog scd(0, _("Account name"), _("Select Account"), as); if (scd.ShowModal() == wxID_OK) { @@ -555,7 +557,7 @@ bPayee_->SetLabel(wxT("Select Payee")); return; } - + int tempCategID = -1; int tempSubCategID = -1; wxString payeeName = mmDBWrapper::getPayee(db_.get(), payeeID_, tempCategID, tempSubCategID); @@ -565,13 +567,13 @@ if (split_->numEntries()) return; - // if payee has no memory of category then ignore displaying last category for payee + // if payee has no memory of category then ignore displaying last category for payee if (tempCategID == -1) return; wxString catName = mmDBWrapper::getCategoryName(db_.get(), tempCategID); wxString categString = catName; - + if (tempSubCategID != -1) { wxString subcatName = mmDBWrapper::getSubCategoryName(db_.get(), tempCategID, tempSubCategID); @@ -599,7 +601,7 @@ { bPayee_->SetLabel(payeeName); } - + } } } @@ -607,28 +609,30 @@ { int mID = mmDBWrapper::getTransIDByDate(db_.get(), dpc_->GetValue().FormatISODate(), accountID_); wxString wxIDstr = wxString::Format(wxT( "%d" ), (int) mID); - textNumber_->SetValue( wxIDstr ); + textNumber_->SetValue( wxIDstr ); } void mmTransDialog::OnTo(wxCommandEvent& /*event*/) -{ +{ // This should only get called if we are in a transfer - static const char sql[] = + static const char sql[] = "select ACCOUNTNAME " "from ACCOUNTLIST_V1 " - "where STATUS <> 'Closed' " +// "where STATUS <> 'Closed' " +// restored to previous order until a proper solution is found. + "where (ACCOUNTTYPE = 'Checking' or ACCOUNTTYPE = 'Term') and STATUS <> 'Closed' " "order by ACCOUNTNAME"; - + wxArrayString as; - + wxSQLite3ResultSet q1 = db_->ExecuteQuery(sql); while (q1.NextRow()) { as.Add(q1.GetString(wxT("ACCOUNTNAME"))); } q1.Finalize(); - + wxSingleChoiceDialog scd(0, _("Account name"), _("Select Account"), as); if (scd.ShowModal() == wxID_OK) { @@ -749,9 +753,9 @@ void mmTransDialog::updateControlsForTransType() { wxStaticText* stp = (wxStaticText*)FindWindow(ID_DIALOG_TRANS_STATIC_PAYEE); - + if (choiceTrans_->GetSelection() == DEF_WITHDRAWAL) { - + fillControls(); displayControlsToolTips(DEF_WITHDRAWAL); stp->SetLabel(_("Payee")); @@ -771,7 +775,7 @@ } else if (choiceTrans_->GetSelection() == DEF_TRANSFER) { displayControlsToolTips(DEF_TRANSFER, true); - stp->SetLabel(_("From")); + stp->SetLabel(_("From")); bTo_->SetLabel(_("Select To Account")); toID_ = -1; @@ -863,7 +867,7 @@ mmShowErrorMessageInvalid(this, _("To Account ")); return; } - + if (payeeID_ == toID_) { mmShowErrorMessage(this, _("From and To Account cannot be the same."), _("Error")); @@ -905,13 +909,13 @@ } else { - // Since to trans amount is not set, + // Since to trans amount is not set, // we use the original currency rate to calculate // toTransAmount toTransAmount_ = edit_currency_rate * amount; } } - + wxString transNum = textNumber_->GetValue(); wxString notes = textNotes_->GetValue(); wxString status = wxT(""); // nothing yet @@ -920,27 +924,27 @@ { status = wxT(""); // nothing yet if (mmIniOptions::transStatusReconciled_) // This changed the selection order - status = wxT("R"); + status = wxT("R"); } else if (choiceStatus_->GetSelection() == DEF_STATUS_RECONCILED) { - status = wxT("R"); + status = wxT("R"); if (mmIniOptions::transStatusReconciled_) // This changed the selection order - status = wxT(""); + status = wxT(""); } else if (choiceStatus_->GetSelection() == DEF_STATUS_VOID) { - status = wxT("V"); + status = wxT("V"); } else if (choiceStatus_->GetSelection() == DEF_STATUS_FOLLOWUP) { - status = wxT("F"); + status = wxT("F"); } else if (choiceStatus_->GetSelection() == DEF_STATUS_DUPLICATE) { - status = wxT("D"); + status = wxT("D"); } - + wxString date1 = dpc_->GetValue().FormatISODate(); boost::shared_ptr<mmBankTransaction> pTransaction; @@ -956,7 +960,7 @@ boost::shared_ptr<mmCurrency> pCurrencyPtr = core_->accountList_.getCurrencyWeakPtr(fromAccountID).lock(); wxASSERT(pCurrencyPtr); - + pTransaction->accountID_ = fromAccountID; pTransaction->toAccountID_ = toAccountID; pTransaction->payee_ = core_->payeeList_.getPayeeSharedPtr(payeeID_); @@ -971,7 +975,7 @@ *pTransaction->splitEntries_.get() = *split_.get(); pTransaction->updateAllData(core_, fromAccountID, pCurrencyPtr, true); - + if (!edit_) { core_->bTransactionList_.addTransaction(core_, pTransaction); @@ -981,8 +985,8 @@ { core_->bTransactionList_.updateTransaction(pTransaction); } - + EndModal(wxID_OK); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2011-04-09 05:39:06
|
Revision: 1220 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1220&view=rev Author: vomikan Date: 2011-04-09 05:39:00 +0000 (Sat, 09 Apr 2011) Log Message: ----------- Most friquently used category for new transfer transaction will provided Modified Paths: -------------- trunk/mmex/src/transdialog.cpp Modified: trunk/mmex/src/transdialog.cpp =================================================================== --- trunk/mmex/src/transdialog.cpp 2011-04-09 01:36:41 UTC (rev 1219) +++ trunk/mmex/src/transdialog.cpp 2011-04-09 05:39:00 UTC (rev 1220) @@ -527,7 +527,7 @@ "from ACCOUNTLIST_V1 " // "where /*(ACCOUNTTYPE = 'Checking' or ACCOUNTTYPE = 'Term') and*/ STATUS <> 'Closed' " // restored to previous order until a proper solution is found. - "where (ACCOUNTTYPE = 'Checking' or ACCOUNTTYPE = 'Term') and STATUS <> 'Closed' " + "where ACCOUNTTYPE IN ('Checking', 'Term') and STATUS <> 'Closed' " "order by ACCOUNTNAME"; wxArrayString as; @@ -796,6 +796,57 @@ bPayee_->SetLabel(acctName); payeeID_ = accountID_; +//////////////////// + // Determine most frequently used category name for current account for transfer + static const char sql[] = + "select count (*) c, " + "cat.categname CATEGNAME, sc.subcategname SUBCATEGNAME, " + "ca.categid, ca.subcategid " + "from CHECKINGACCOUNT_V1 ca " + "left join CATEGORY_V1 cat " + "on cat.CATEGID = ca.CATEGID " + + "left join SUBCATEGORY_V1 sc " + "on sc.CATEGID = ca.CATEGID and " + "sc.SUBCATEGID = ca.SUBCATEGID " + + "where ca.transcode = 'Transfer' " + "and ca.accountid = ? " + "group by ca.payeeid, ca.transdate, ca.categid, ca.subcategid " + "order by ca.transdate desc, ca.transid desc, c desc " + "limit 1"; + + wxSQLite3Statement st = db_->PrepareStatement(sql); + st.Bind(1, accountID_); + wxSQLite3ResultSet q1 = st.ExecuteQuery(); + wxString categString = q1.GetString(wxT("CATEGNAME")); + wxString subcategName = q1.GetString(wxT("SUBCATEGNAME")); + categID_ = q1.GetInt(wxT("CATEGID")); + subcategID_ = q1.GetInt(wxT("SUBCATEGID")); + + //if some values is missing - set defaults + if (categString == wxT("")) + { + categString = _("Select Category"); + categID_ = -1; + subcategID_ = -1; + + } + else + { + if (subcategName != wxT("")) + { + categString += wxT(" : "); + categString += subcategName; + } + } + + st.Finalize(); + + wxStaticText* stc = (wxStaticText*)FindWindow(ID_DIALOG_TRANS_BUTTONCATEGS); + stc->SetLabel(categString); + + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2011-04-09 05:51:14
|
Revision: 1221 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1221&view=rev Author: vomikan Date: 2011-04-09 05:51:08 +0000 (Sat, 09 Apr 2011) Log Message: ----------- toaccount will used to for determin most used category for transfer Modified Paths: -------------- trunk/mmex/src/transdialog.cpp Modified: trunk/mmex/src/transdialog.cpp =================================================================== --- trunk/mmex/src/transdialog.cpp 2011-04-09 05:39:00 UTC (rev 1220) +++ trunk/mmex/src/transdialog.cpp 2011-04-09 05:51:08 UTC (rev 1221) @@ -796,7 +796,6 @@ bPayee_->SetLabel(acctName); payeeID_ = accountID_; -//////////////////// // Determine most frequently used category name for current account for transfer static const char sql[] = "select count (*) c, " @@ -811,13 +810,14 @@ "sc.SUBCATEGID = ca.SUBCATEGID " "where ca.transcode = 'Transfer' " - "and ca.accountid = ? " + "and ca.accountid = ? or ca.toaccountid = ?" "group by ca.payeeid, ca.transdate, ca.categid, ca.subcategid " "order by ca.transdate desc, ca.transid desc, c desc " "limit 1"; wxSQLite3Statement st = db_->PrepareStatement(sql); st.Bind(1, accountID_); + st.Bind(2, accountID_); wxSQLite3ResultSet q1 = st.ExecuteQuery(); wxString categString = q1.GetString(wxT("CATEGNAME")); wxString subcategName = q1.GetString(wxT("SUBCATEGNAME")); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ste...@us...> - 2011-07-15 13:22:48
|
Revision: 1387 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1387&view=rev Author: stef145g Date: 2011-07-15 13:22:42 +0000 (Fri, 15 Jul 2011) Log Message: ----------- Fix category selection when payee sets category for new transaction Modified Paths: -------------- trunk/mmex/src/transdialog.cpp Modified: trunk/mmex/src/transdialog.cpp =================================================================== --- trunk/mmex/src/transdialog.cpp 2011-07-13 22:07:03 UTC (rev 1386) +++ trunk/mmex/src/transdialog.cpp 2011-07-15 13:22:42 UTC (rev 1387) @@ -520,10 +520,11 @@ if (tempCategID != -1) { wxString categString = mmDBWrapper::getCategoryName(db_.get(), tempCategID); - + categoryName_ = categString; if (tempSubCategID != -1) { wxString subcatName = mmDBWrapper::getSubCategoryName(db_.get(), tempCategID, tempSubCategID); + subCategoryName_ = subcatName; categString += wxT(" : "); categString += subcatName; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ste...@us...> - 2011-10-15 06:29:42
|
Revision: 1485 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1485&view=rev Author: stef145g Date: 2011-10-15 06:29:36 +0000 (Sat, 15 Oct 2011) Log Message: ----------- Addition of Tool Tip on check boxes Modified Paths: -------------- trunk/mmex/src/transdialog.cpp Modified: trunk/mmex/src/transdialog.cpp =================================================================== --- trunk/mmex/src/transdialog.cpp 2011-10-15 05:05:46 UTC (rev 1484) +++ trunk/mmex/src/transdialog.cpp 2011-10-15 06:29:36 UTC (rev 1485) @@ -331,6 +331,7 @@ choiceTrans_->SetToolTip(_("Specify the type of transactions to be created.")); cAdvanced_ = new wxCheckBox( itemPanel7, ID_DIALOG_TRANS_BUTTONADVANCED, _("Advanced"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE ); cAdvanced_->SetValue(FALSE); + cAdvanced_->SetToolTip(_("Allows the setting of different amounts in the FROM and TO accounts.")); wxBoxSizer* typeSizer = new wxBoxSizer(wxHORIZONTAL); typeSizer->Add(choiceTrans_, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 0); @@ -403,6 +404,7 @@ // Split Category ------------------------------------------- cSplit_ = new wxCheckBox( itemPanel7, ID_DIALOG_TRANS_SPLITCHECKBOX, _("Split"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE ); cSplit_->SetValue(FALSE); + cSplit_->SetToolTip(_("Use split Categories")); itemFlexGridSizer8->AddSpacer(20); // Fill empty space. itemFlexGridSizer8->Add(cSplit_, 0, wxALIGN_BOTTOM|wxALIGN_LEFT|wxALL, 0); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ste...@us...> - 2011-10-15 14:02:49
|
Revision: 1486 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1486&view=rev Author: stef145g Date: 2011-10-15 14:02:40 +0000 (Sat, 15 Oct 2011) Log Message: ----------- Correcting incompatible parameters. Modified Paths: -------------- trunk/mmex/src/transdialog.cpp Modified: trunk/mmex/src/transdialog.cpp =================================================================== --- trunk/mmex/src/transdialog.cpp 2011-10-15 06:29:36 UTC (rev 1485) +++ trunk/mmex/src/transdialog.cpp 2011-10-15 14:02:40 UTC (rev 1486) @@ -286,10 +286,8 @@ // Date -------------------------------------------- wxStaticText* itemStaticText15 = new wxStaticText( itemPanel7, wxID_STATIC, _("Date")); - if (true) - dpc_ = new wxDatePickerCtrl( itemPanel7, ID_DIALOG_TRANS_BUTTONDATE, wxDefaultDateTime, wxDefaultPosition, wxSize(110, -1), wxDP_DROPDOWN | wxDP_SHOWCENTURY|wxCAL_MONDAY_FIRST); - else - dpc_ = new wxDatePickerCtrl( itemPanel7, ID_DIALOG_TRANS_BUTTONDATE, wxDefaultDateTime, wxDefaultPosition, wxSize(110, -1), wxDP_DROPDOWN | wxDP_SHOWCENTURY|wxCAL_SUNDAY_FIRST); + dpc_ = new wxDatePickerCtrl( itemPanel7, ID_DIALOG_TRANS_BUTTONDATE, wxDefaultDateTime, + wxDefaultPosition, wxSize(110, -1), wxDP_DROPDOWN | wxDP_SHOWCENTURY); dpc_->SetToolTip(_("Specify the date of the transaction")); spinCtrl_ = new wxSpinButton(itemPanel7,ID_DIALOG_TRANS_SPINNER,wxDefaultPosition, wxSize(16,24),wxSP_VERTICAL|wxSP_ARROW_KEYS|wxSP_WRAP); spinCtrl_ -> SetRange (-32768, 32768); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2011-10-16 12:09:58
|
Revision: 1488 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1488&view=rev Author: vomikan Date: 2011-10-16 12:09:52 +0000 (Sun, 16 Oct 2011) Log Message: ----------- Fix for frequently used notes menu if ampersand used in notes Modified Paths: -------------- trunk/mmex/src/transdialog.cpp Modified: trunk/mmex/src/transdialog.cpp =================================================================== --- trunk/mmex/src/transdialog.cpp 2011-10-15 14:14:39 UTC (rev 1487) +++ trunk/mmex/src/transdialog.cpp 2011-10-16 12:09:52 UTC (rev 1488) @@ -1165,7 +1165,7 @@ char sql[] = "select max (TRANSDATE) as TRANSDATE , count (notes) COUNT, " "(case when accountid = ? then '1' else '2' end) as ACC " - ",replace (substr (notes, 1, 20), x'0A', ' ')||(case when length(notes)>20 then '...' else '' end) as NOTE, " + ",replace(replace (substr (notes, 1, 20), x'0A', ' '), '&', '&&')||(case when length(notes)>20 then '...' else '' end) as NOTE, " "notes as NOTES " "from checkingaccount_v1 ca " "where notes is not '' " This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ste...@us...> - 2011-12-04 01:57:33
|
Revision: 1550 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1550&view=rev Author: stef145g Date: 2011-12-04 01:57:26 +0000 (Sun, 04 Dec 2011) Log Message: ----------- Fix the initialisation of Day of week in dialog. - Also fixes the wxWidgets Debug alert. Modified Paths: -------------- trunk/mmex/src/transdialog.cpp Modified: trunk/mmex/src/transdialog.cpp =================================================================== --- trunk/mmex/src/transdialog.cpp 2011-12-04 01:36:05 UTC (rev 1549) +++ trunk/mmex/src/transdialog.cpp 2011-12-04 01:57:26 UTC (rev 1550) @@ -297,9 +297,12 @@ dpc_ = new wxDatePickerCtrl( itemPanel7, ID_DIALOG_TRANS_BUTTONDATE, wxDefaultDateTime, wxDefaultPosition, wxSize(110, -1), wxDP_DROPDOWN | wxDP_SHOWCENTURY); dpc_->SetToolTip(_("Specify the date of the transaction")); - wxDateEvent dateEvent(dpc_, wxDefaultDateTime, wxEVT_DATE_CHANGED); - GetEventHandler()->ProcessEvent(dateEvent); + // Display the day of the week + wxString dateStr = mmGetNiceDateString(dpc_->GetValue()); + dateStr = dateStr.substr(0,dateStr.Find(wxT(","))); + itemStaticTextWeek->SetLabel(dateStr); + // change properties depending on system parameters wxSize spinCtrlSize = wxSize(16,-1); int spinCtrlDirection = wxSP_VERTICAL; @@ -1239,7 +1242,7 @@ { int i = event.GetId(); if (i>0) - textNotes_->SetValue (freqnotes.Item (i-1)) ; + textNotes_->SetValue (freqnotes.Item (i-1)) ; } void mmTransDialog::changeFocus(wxChildFocusEvent& event) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2012-01-02 07:36:34
|
Revision: 1587 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1587&view=rev Author: vomikan Date: 2012-01-02 07:36:28 +0000 (Mon, 02 Jan 2012) Log Message: ----------- Added: New function to change payee by up and down keys. Modified Paths: -------------- trunk/mmex/src/transdialog.cpp Modified: trunk/mmex/src/transdialog.cpp =================================================================== --- trunk/mmex/src/transdialog.cpp 2012-01-02 07:34:31 UTC (rev 1586) +++ trunk/mmex/src/transdialog.cpp 2012-01-02 07:36:28 UTC (rev 1587) @@ -27,6 +27,7 @@ #include "splittransactionsdialog.h" #include "defs.h" #include "paths.h" +#include <wx/event.h> #include <sstream> @@ -253,7 +254,8 @@ wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL); itemDialog1->SetSizer(itemBoxSizer2); - + itemDialog1->SetBackgroundColour(mmColors::listBackColor); + wxStaticBox* itemStaticBoxSizer4Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Transaction Details")); wxStaticBoxSizer* itemStaticBoxSizer4 = new wxStaticBoxSizer(itemStaticBoxSizer4Static, wxVERTICAL); itemBoxSizer2->Add(itemStaticBoxSizer4, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxTOP|wxRIGHT, 10); @@ -266,6 +268,7 @@ wxFlexGridSizer* itemFlexGridSizer8 = new wxFlexGridSizer(5, 2, 10, 10); itemPanel7->SetSizer(itemFlexGridSizer8); + itemPanel7->SetBackgroundColour(mmColors::listBackColor); wxSizerFlags flags; flags.Border(0); @@ -278,11 +281,12 @@ dpc_ = new wxDatePickerCtrl( itemPanel7, ID_DIALOG_TRANS_BUTTONDATE, wxDefaultDateTime, wxDefaultPosition, wxSize(110, -1), wxDP_DROPDOWN | wxDP_SHOWCENTURY); dpc_->SetToolTip(_("Specify the date of the transaction")); + dpc_->SetBackgroundColour(mmColors::listDetailsPanelColor); // Display the day of the week wxString dateStr = mmGetNiceDateString(dpc_->GetValue()); dateStr = dateStr.substr(0,dateStr.Find(wxT(","))); - itemStaticTextWeek->SetLabel(dateStr); + itemStaticTextWeek->SetLabel(dateStr); // change properties depending on system parameters wxSize spinCtrlSize = wxSize(16,-1); @@ -339,10 +343,12 @@ //use wxTE_PROCESS_ENTER flag when creating the control to generate EVT_TEXT_ENTER events wxALIGN_RIGHT|wxTE_PROCESS_ENTER , doubleValidator() ); textAmount_->SetToolTip(amountNormalTip_); + textAmount_->SetBackgroundColour(mmColors::listDetailsPanelColor); toTextAmount_ = new wxTextCtrl( itemPanel7, ID_DIALOG_TRANS_TEXTAMOUNT, wxT(""), wxDefaultPosition, wxSize(110, -1), wxALIGN_RIGHT, doubleValidator() ); toTextAmount_->SetToolTip(_("Specify the transfer amount in the To Account")); + toTextAmount_->SetBackgroundColour(mmColors::listDetailsPanelColor); wxBoxSizer* amountSizer = new wxBoxSizer(wxHORIZONTAL); amountSizer->Add(textAmount_, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 0); @@ -381,6 +387,7 @@ payeeWithdrawalTip_ = _("Specify where the transaction is going to"); payeeDepositTip_ = _("Specify where the transaction is coming from"); bPayee_->SetToolTip(payeeWithdrawalTip_); + bPayee_->Connect(wxEVT_CHAR, wxKeyEventHandler(mmTransDialog::OnChoicePayeeChar), NULL, this); itemFlexGridSizer8->Add(itemStaticText9, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 0); itemFlexGridSizer8->Add(bPayee_, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 0); @@ -404,7 +411,7 @@ // Category ------------------------------------------------- wxStaticText* itemStaticText17 = new wxStaticText( itemPanel7, wxID_STATIC, _("Category") ); bCategory_ = new wxButton( itemPanel7, ID_DIALOG_TRANS_BUTTONCATEGS, categString, wxDefaultPosition, wxSize(225, -1), 0 ); - //bCategory_->SetToolTip(_("Specify the category for this transaction")); + bCategory_->SetToolTip(_("Specify the category for this transaction")); itemFlexGridSizer8->Add(itemStaticText17, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 0); itemFlexGridSizer8->Add(bCategory_, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 0); @@ -413,6 +420,7 @@ wxStaticText* itemStaticText11 = new wxStaticText( itemPanel7, wxID_STATIC, _("Number"), wxDefaultPosition, wxDefaultSize, 0 ); textNumber_ = new wxTextCtrl( itemPanel7, ID_DIALOG_TRANS_TEXTNUMBER, wxT(""), wxDefaultPosition, wxSize(185, -1), 0 ); textNumber_->SetToolTip(_("Specify any associated check number or transaction number")); + textNumber_->SetBackgroundColour(mmColors::listDetailsPanelColor); bAuto_ = new wxButton( itemPanel7, ID_DIALOG_TRANS_BUTTONTRANSNUM, wxT("..."), wxDefaultPosition, wxSize(40, -1), 0 ); bAuto_->SetToolTip(_("Populate Transaction #")); @@ -428,6 +436,7 @@ textNotes_ = new wxTextCtrl( itemPanel7, ID_DIALOG_TRANS_TEXTNOTES, wxT(""), wxDefaultPosition, wxSize(225,80), wxTE_MULTILINE ); textNotes_->SetToolTip(_("Specify any text notes you want to add to this transaction.")); + textNotes_->SetBackgroundColour(mmColors::listDetailsPanelColor); bFrequentUsedNotes_ = new wxButton( itemPanel7, ID_DIALOG_TRANS_BUTTON_FREQENTNOTES, wxT(">>"), wxDefaultPosition, wxSize(40, -1), 0 ); bFrequentUsedNotes_->SetToolTip(_("Select one of the frequently used notes")); @@ -448,6 +457,7 @@ wxStdDialogButtonSizer* itemStdDialogButtonSizer1 = new wxStdDialogButtonSizer; itemPanel25->SetSizer(itemStdDialogButtonSizer1); + itemPanel25->SetBackgroundColour(mmColors::listBackColor); wxButton* itemButtonOK = new wxButton( itemPanel25, wxID_OK, _("&OK")); itemStdDialogButtonSizer1->Add(itemButtonOK, flags); @@ -473,21 +483,9 @@ { if (choiceTrans_->GetSelection() == DEF_TRANSFER) { - static const char sql[] = - "select ACCOUNTNAME " - "from ACCOUNTLIST_V1 " - "where ACCOUNTTYPE IN ('Checking', 'Term') and STATUS <> 'Closed' " - "order by ACCOUNTNAME"; - wxArrayString as; + wxArrayString as = mmDBWrapper::getAccountsName(db_.get()); - wxSQLite3ResultSet q1 = db_->ExecuteQuery(sql); - while (q1.NextRow()) - { - as.Add(q1.GetString(wxT("ACCOUNTNAME"))); - } - q1.Finalize(); - wxSingleChoiceDialog scd(0, _("Account name"), _("Select Account"), as); if (scd.ShowModal() == wxID_OK) { @@ -555,21 +553,8 @@ { // This should only get called if we are in a transfer - static const char sql[] = - "select ACCOUNTNAME " - "from ACCOUNTLIST_V1 " - "where (ACCOUNTTYPE = 'Checking' or ACCOUNTTYPE = 'Term') and STATUS <> 'Closed' " - "order by ACCOUNTNAME"; + wxArrayString as = mmDBWrapper::getAccountsName(db_.get()); - wxArrayString as; - - wxSQLite3ResultSet q1 = db_->ExecuteQuery(sql); - while (q1.NextRow()) - { - as.Add(q1.GetString(wxT("ACCOUNTNAME"))); - } - q1.Finalize(); - wxSingleChoiceDialog scd(0, _("Account name"), _("Select Account"), as); if (scd.ShowModal() == wxID_OK) { @@ -608,11 +593,11 @@ void mmTransDialog::OnDateChanged(wxDateEvent& event) { - //get weekday name - wxString dateStr = mmGetNiceDateString(event.GetDate()); - dateStr = dateStr.substr(0,dateStr.Find(wxT(","))); - itemStaticTextWeek->SetLabel(dateStr); - event.Skip(); + //get weekday name + wxString dateStr = mmGetNiceDateString(event.GetDate()); + dateStr = dateStr.substr(0,dateStr.Find(wxT(","))); + itemStaticTextWeek->SetLabel(dateStr); + event.Skip(); } void mmTransDialog::OnAdvanceChecked(wxCommandEvent& /*event*/) @@ -1020,39 +1005,10 @@ toTransAmount_ = amount; } } - // else - // { - // // Since to trans amount is not set, - // // we use the original currency rate to calculate - // // toTransAmount - // toTransAmount_ = edit_currency_rate * amount; - // } } wxString transNum = textNumber_->GetValue(); wxString notes = textNotes_->GetValue(); - //wxString status = wxT(""); // nothing yet - - /*if (choiceStatus_->GetSelection() == DEF_STATUS_NONE) - { - status = wxT(""); // nothing yet - } - else if (choiceStatus_->GetSelection() == DEF_STATUS_RECONCILED) - { - status = wxT("R"); - } - else if (choiceStatus_->GetSelection() == DEF_STATUS_VOID) - { - status = wxT("V"); - } - else if (choiceStatus_->GetSelection() == DEF_STATUS_FOLLOWUP) - { - status = wxT("F"); - } - else if (choiceStatus_->GetSelection() == DEF_STATUS_DUPLICATE) - { - status = wxT("D"); - }*/ wxString status = getTransformedTrxStatus(choiceStatus_->GetSelection()); wxString date1 = dpc_->GetValue().FormatISODate(); @@ -1214,20 +1170,20 @@ void mmTransDialog::changeFocus(wxChildFocusEvent& event) { - wxWindow *w = event.GetWindow(); - if ( w ) - { - richText = (w->GetId() == ID_DIALOG_TRANS_TEXTNOTES ? true : false); - } - + wxWindow *w = event.GetWindow(); + if ( w ) + { + richText = (w->GetId() == ID_DIALOG_TRANS_TEXTNOTES ? true : false); + } + } void mmTransDialog::OnCancel(wxCommandEvent& /*event*/) { if (richText){ - return; - } else { - EndModal(wxID_CANCEL); + return; + } else { + EndModal(wxID_CANCEL); } } @@ -1236,7 +1192,7 @@ //In case if ENTER pressed when amount entered set focus to OK button wxButton* btnOk = static_cast<wxButton*>(FindWindow(wxID_OK)); wxASSERT(btnOk); - btnOk->SetFocus(); + btnOk->SetFocus(); event.Skip(); } @@ -1254,4 +1210,32 @@ textAmount_->SetValue(dispAmount); } } - +void mmTransDialog::OnChoicePayeeChar(wxKeyEvent& event) +{ + //it's for debuging + //wxSafeShowMessage(wxT(":"), wxString::Format(wxT("%i"), event.GetUnicodeKey())); + if (event.GetKeyCode()==WXK_DOWN || event.GetKeyCode()==WXK_UP) { + wxArrayString filtd = mmDBWrapper::filterPayees(db_.get(), wxT("")); + wxString currentPayeeName = bPayee_->GetLabel(); + int c = 0; + if (currentPayeeName != _("Select Payee")) { + + for (int i = 0; i < filtd.GetCount(); ++i) { + if (filtd.Item(i) == currentPayeeName) { + c=i; + break; + } + } + } else { + bPayee_->SetLabel(filtd.Item(c)); + } + if (event.GetKeyCode()==WXK_DOWN) { + if (c < (filtd.GetCount()-1)) + bPayee_->SetLabel(filtd.Item(++c)); + } else if (event.GetKeyCode()==WXK_UP){ + if (c > 0) + bPayee_->SetLabel(filtd.Item(--c)); + } + } + event.Skip(); +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Lisheng G. <gua...@gm...> - 2012-01-02 13:09:48
|
hi, I think you forgot to declare the function mmTransDialog::OnChoicePayeeChar. This code change broke the mmex compile. Lisheng 2012/1/2 <vo...@us...>: > Revision: 1587 > http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1587&view=rev > Author: vomikan > Date: 2012-01-02 07:36:28 +0000 (Mon, 02 Jan 2012) > Log Message: > ----------- > Added: New function to change payee by up and down keys. > > Modified Paths: > -------------- > trunk/mmex/src/transdialog.cpp > > Modified: trunk/mmex/src/transdialog.cpp > =================================================================== > --- trunk/mmex/src/transdialog.cpp 2012-01-02 07:34:31 UTC (rev 1586) > +++ trunk/mmex/src/transdialog.cpp 2012-01-02 07:36:28 UTC (rev 1587) > @@ -27,6 +27,7 @@ > #include "splittransactionsdialog.h" > #include "defs.h" > #include "paths.h" > +#include <wx/event.h> > > #include <sstream> > > @@ -253,7 +254,8 @@ > > wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL); > itemDialog1->SetSizer(itemBoxSizer2); > - > + itemDialog1->SetBackgroundColour(mmColors::listBackColor); > + > wxStaticBox* itemStaticBoxSizer4Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Transaction Details")); > wxStaticBoxSizer* itemStaticBoxSizer4 = new wxStaticBoxSizer(itemStaticBoxSizer4Static, wxVERTICAL); > itemBoxSizer2->Add(itemStaticBoxSizer4, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxTOP|wxRIGHT, 10); > @@ -266,6 +268,7 @@ > > wxFlexGridSizer* itemFlexGridSizer8 = new wxFlexGridSizer(5, 2, 10, 10); > itemPanel7->SetSizer(itemFlexGridSizer8); > + itemPanel7->SetBackgroundColour(mmColors::listBackColor); > > wxSizerFlags flags; > flags.Border(0); > @@ -278,11 +281,12 @@ > dpc_ = new wxDatePickerCtrl( itemPanel7, ID_DIALOG_TRANS_BUTTONDATE, wxDefaultDateTime, > wxDefaultPosition, wxSize(110, -1), wxDP_DROPDOWN | wxDP_SHOWCENTURY); > dpc_->SetToolTip(_("Specify the date of the transaction")); > + dpc_->SetBackgroundColour(mmColors::listDetailsPanelColor); > > // Display the day of the week > wxString dateStr = mmGetNiceDateString(dpc_->GetValue()); > dateStr = dateStr.substr(0,dateStr.Find(wxT(","))); > - itemStaticTextWeek->SetLabel(dateStr); > + itemStaticTextWeek->SetLabel(dateStr); > > // change properties depending on system parameters > wxSize spinCtrlSize = wxSize(16,-1); > @@ -339,10 +343,12 @@ > //use wxTE_PROCESS_ENTER flag when creating the control to generate EVT_TEXT_ENTER events > wxALIGN_RIGHT|wxTE_PROCESS_ENTER , doubleValidator() ); > textAmount_->SetToolTip(amountNormalTip_); > + textAmount_->SetBackgroundColour(mmColors::listDetailsPanelColor); > > toTextAmount_ = new wxTextCtrl( itemPanel7, ID_DIALOG_TRANS_TEXTAMOUNT, wxT(""), wxDefaultPosition, wxSize(110, -1), > wxALIGN_RIGHT, doubleValidator() ); > toTextAmount_->SetToolTip(_("Specify the transfer amount in the To Account")); > + toTextAmount_->SetBackgroundColour(mmColors::listDetailsPanelColor); > > wxBoxSizer* amountSizer = new wxBoxSizer(wxHORIZONTAL); > amountSizer->Add(textAmount_, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 0); > @@ -381,6 +387,7 @@ > payeeWithdrawalTip_ = _("Specify where the transaction is going to"); > payeeDepositTip_ = _("Specify where the transaction is coming from"); > bPayee_->SetToolTip(payeeWithdrawalTip_); > + bPayee_->Connect(wxEVT_CHAR, wxKeyEventHandler(mmTransDialog::OnChoicePayeeChar), NULL, this); > > itemFlexGridSizer8->Add(itemStaticText9, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 0); > itemFlexGridSizer8->Add(bPayee_, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 0); > @@ -404,7 +411,7 @@ > // Category ------------------------------------------------- > wxStaticText* itemStaticText17 = new wxStaticText( itemPanel7, wxID_STATIC, _("Category") ); > bCategory_ = new wxButton( itemPanel7, ID_DIALOG_TRANS_BUTTONCATEGS, categString, wxDefaultPosition, wxSize(225, -1), 0 ); > - //bCategory_->SetToolTip(_("Specify the category for this transaction")); > + bCategory_->SetToolTip(_("Specify the category for this transaction")); > > itemFlexGridSizer8->Add(itemStaticText17, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 0); > itemFlexGridSizer8->Add(bCategory_, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 0); > @@ -413,6 +420,7 @@ > wxStaticText* itemStaticText11 = new wxStaticText( itemPanel7, wxID_STATIC, _("Number"), wxDefaultPosition, wxDefaultSize, 0 ); > textNumber_ = new wxTextCtrl( itemPanel7, ID_DIALOG_TRANS_TEXTNUMBER, wxT(""), wxDefaultPosition, wxSize(185, -1), 0 ); > textNumber_->SetToolTip(_("Specify any associated check number or transaction number")); > + textNumber_->SetBackgroundColour(mmColors::listDetailsPanelColor); > > bAuto_ = new wxButton( itemPanel7, ID_DIALOG_TRANS_BUTTONTRANSNUM, wxT("..."), wxDefaultPosition, wxSize(40, -1), 0 ); > bAuto_->SetToolTip(_("Populate Transaction #")); > @@ -428,6 +436,7 @@ > > textNotes_ = new wxTextCtrl( itemPanel7, ID_DIALOG_TRANS_TEXTNOTES, wxT(""), wxDefaultPosition, wxSize(225,80), wxTE_MULTILINE ); > textNotes_->SetToolTip(_("Specify any text notes you want to add to this transaction.")); > + textNotes_->SetBackgroundColour(mmColors::listDetailsPanelColor); > > bFrequentUsedNotes_ = new wxButton( itemPanel7, ID_DIALOG_TRANS_BUTTON_FREQENTNOTES, wxT(">>"), wxDefaultPosition, wxSize(40, -1), 0 ); > bFrequentUsedNotes_->SetToolTip(_("Select one of the frequently used notes")); > @@ -448,6 +457,7 @@ > > wxStdDialogButtonSizer* itemStdDialogButtonSizer1 = new wxStdDialogButtonSizer; > itemPanel25->SetSizer(itemStdDialogButtonSizer1); > + itemPanel25->SetBackgroundColour(mmColors::listBackColor); > > wxButton* itemButtonOK = new wxButton( itemPanel25, wxID_OK, _("&OK")); > itemStdDialogButtonSizer1->Add(itemButtonOK, flags); > @@ -473,21 +483,9 @@ > { > if (choiceTrans_->GetSelection() == DEF_TRANSFER) > { > - static const char sql[] = > - "select ACCOUNTNAME " > - "from ACCOUNTLIST_V1 " > - "where ACCOUNTTYPE IN ('Checking', 'Term') and STATUS <> 'Closed' " > - "order by ACCOUNTNAME"; > > - wxArrayString as; > + wxArrayString as = mmDBWrapper::getAccountsName(db_.get()); > > - wxSQLite3ResultSet q1 = db_->ExecuteQuery(sql); > - while (q1.NextRow()) > - { > - as.Add(q1.GetString(wxT("ACCOUNTNAME"))); > - } > - q1.Finalize(); > - > wxSingleChoiceDialog scd(0, _("Account name"), _("Select Account"), as); > if (scd.ShowModal() == wxID_OK) > { > @@ -555,21 +553,8 @@ > { > // This should only get called if we are in a transfer > > - static const char sql[] = > - "select ACCOUNTNAME " > - "from ACCOUNTLIST_V1 " > - "where (ACCOUNTTYPE = 'Checking' or ACCOUNTTYPE = 'Term') and STATUS <> 'Closed' " > - "order by ACCOUNTNAME"; > + wxArrayString as = mmDBWrapper::getAccountsName(db_.get()); > > - wxArrayString as; > - > - wxSQLite3ResultSet q1 = db_->ExecuteQuery(sql); > - while (q1.NextRow()) > - { > - as.Add(q1.GetString(wxT("ACCOUNTNAME"))); > - } > - q1.Finalize(); > - > wxSingleChoiceDialog scd(0, _("Account name"), _("Select Account"), as); > if (scd.ShowModal() == wxID_OK) > { > @@ -608,11 +593,11 @@ > > void mmTransDialog::OnDateChanged(wxDateEvent& event) > { > - //get weekday name > - wxString dateStr = mmGetNiceDateString(event.GetDate()); > - dateStr = dateStr.substr(0,dateStr.Find(wxT(","))); > - itemStaticTextWeek->SetLabel(dateStr); > - event.Skip(); > + //get weekday name > + wxString dateStr = mmGetNiceDateString(event.GetDate()); > + dateStr = dateStr.substr(0,dateStr.Find(wxT(","))); > + itemStaticTextWeek->SetLabel(dateStr); > + event.Skip(); > } > > void mmTransDialog::OnAdvanceChecked(wxCommandEvent& /*event*/) > @@ -1020,39 +1005,10 @@ > toTransAmount_ = amount; > } > } > - // else > - // { > - // // Since to trans amount is not set, > - // // we use the original currency rate to calculate > - // // toTransAmount > - // toTransAmount_ = edit_currency_rate * amount; > - // } > } > > wxString transNum = textNumber_->GetValue(); > wxString notes = textNotes_->GetValue(); > - //wxString status = wxT(""); // nothing yet > - > - /*if (choiceStatus_->GetSelection() == DEF_STATUS_NONE) > - { > - status = wxT(""); // nothing yet > - } > - else if (choiceStatus_->GetSelection() == DEF_STATUS_RECONCILED) > - { > - status = wxT("R"); > - } > - else if (choiceStatus_->GetSelection() == DEF_STATUS_VOID) > - { > - status = wxT("V"); > - } > - else if (choiceStatus_->GetSelection() == DEF_STATUS_FOLLOWUP) > - { > - status = wxT("F"); > - } > - else if (choiceStatus_->GetSelection() == DEF_STATUS_DUPLICATE) > - { > - status = wxT("D"); > - }*/ > wxString status = getTransformedTrxStatus(choiceStatus_->GetSelection()); > > wxString date1 = dpc_->GetValue().FormatISODate(); > @@ -1214,20 +1170,20 @@ > > void mmTransDialog::changeFocus(wxChildFocusEvent& event) > { > - wxWindow *w = event.GetWindow(); > - if ( w ) > - { > - richText = (w->GetId() == ID_DIALOG_TRANS_TEXTNOTES ? true : false); > - } > - > + wxWindow *w = event.GetWindow(); > + if ( w ) > + { > + richText = (w->GetId() == ID_DIALOG_TRANS_TEXTNOTES ? true : false); > + } > + > } > > void mmTransDialog::OnCancel(wxCommandEvent& /*event*/) > { > if (richText){ > - return; > - } else { > - EndModal(wxID_CANCEL); > + return; > + } else { > + EndModal(wxID_CANCEL); > } > } > > @@ -1236,7 +1192,7 @@ > //In case if ENTER pressed when amount entered set focus to OK button > wxButton* btnOk = static_cast<wxButton*>(FindWindow(wxID_OK)); > wxASSERT(btnOk); > - btnOk->SetFocus(); > + btnOk->SetFocus(); > > event.Skip(); > } > @@ -1254,4 +1210,32 @@ > textAmount_->SetValue(dispAmount); > } > } > - > +void mmTransDialog::OnChoicePayeeChar(wxKeyEvent& event) > +{ > + //it's for debuging > + //wxSafeShowMessage(wxT(":"), wxString::Format(wxT("%i"), event.GetUnicodeKey())); > + if (event.GetKeyCode()==WXK_DOWN || event.GetKeyCode()==WXK_UP) { > + wxArrayString filtd = mmDBWrapper::filterPayees(db_.get(), wxT("")); > + wxString currentPayeeName = bPayee_->GetLabel(); > + int c = 0; > + if (currentPayeeName != _("Select Payee")) { > + > + for (int i = 0; i < filtd.GetCount(); ++i) { > + if (filtd.Item(i) == currentPayeeName) { > + c=i; > + break; > + } > + } > + } else { > + bPayee_->SetLabel(filtd.Item(c)); > + } > + if (event.GetKeyCode()==WXK_DOWN) { > + if (c < (filtd.GetCount()-1)) > + bPayee_->SetLabel(filtd.Item(++c)); > + } else if (event.GetKeyCode()==WXK_UP){ > + if (c > 0) > + bPayee_->SetLabel(filtd.Item(--c)); > + } > + } > + event.Skip(); > +} > > This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. > > > ------------------------------------------------------------------------------ > Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex > infrastructure or vast IT resources to deliver seamless, secure access to > virtual desktops. With this all-in-one solution, easily deploy virtual > desktops for less than the cost of PCs and save 60% on VDI infrastructure > costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox > _______________________________________________ > Moneymanagerex-commits mailing list > Mon...@li... > https://lists.sourceforge.net/lists/listinfo/moneymanagerex-commits -- 关立胜 |
From: <vo...@us...> - 2012-01-02 13:03:40
|
Revision: 1589 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1589&view=rev Author: vomikan Date: 2012-01-02 13:03:34 +0000 (Mon, 02 Jan 2012) Log Message: ----------- Fix for transfer transaction Modified Paths: -------------- trunk/mmex/src/transdialog.cpp Modified: trunk/mmex/src/transdialog.cpp =================================================================== --- trunk/mmex/src/transdialog.cpp 2012-01-02 08:22:56 UTC (rev 1588) +++ trunk/mmex/src/transdialog.cpp 2012-01-02 13:03:34 UTC (rev 1589) @@ -1214,12 +1214,16 @@ { //it's for debuging //wxSafeShowMessage(wxT(":"), wxString::Format(wxT("%i"), event.GetUnicodeKey())); - if (event.GetKeyCode()==WXK_DOWN || event.GetKeyCode()==WXK_UP) { - wxArrayString filtd = mmDBWrapper::filterPayees(db_.get(), wxT("")); + if (event.GetKeyCode() != WXK_DOWN && event.GetKeyCode()!=WXK_UP) { + event.Skip(); + return; + } + int c = 0; wxString currentPayeeName = bPayee_->GetLabel(); - int c = 0; - if (currentPayeeName != _("Select Payee")) { - + wxArrayString filtd; + if (choiceTrans_->GetSelection() != DEF_TRANSFER) { + filtd = mmDBWrapper::filterPayees(db_.get(), wxT("")); + if (currentPayeeName != _("Select Payee")) { for (int i = 0; i < filtd.GetCount(); ++i) { if (filtd.Item(i) == currentPayeeName) { c=i; @@ -1229,13 +1233,20 @@ } else { bPayee_->SetLabel(filtd.Item(c)); } - if (event.GetKeyCode()==WXK_DOWN) { - if (c < (filtd.GetCount()-1)) - bPayee_->SetLabel(filtd.Item(++c)); - } else if (event.GetKeyCode()==WXK_UP){ - if (c > 0) - bPayee_->SetLabel(filtd.Item(--c)); + } else { + filtd = mmDBWrapper::getAccountsName(db_.get()); + for (int i = 0; i < filtd.GetCount(); ++i) { + if (filtd.Item(i) == currentPayeeName) { + c=i; + break; + } } } - event.Skip(); + if (event.GetKeyCode()==WXK_DOWN) { + if (c < (filtd.GetCount()-1)) + bPayee_->SetLabel(filtd.Item(++c)); + } else if (event.GetKeyCode()==WXK_UP){ + if (c > 0) + bPayee_->SetLabel(filtd.Item(--c)); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2012-01-02 15:31:09
|
Revision: 1591 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1591&view=rev Author: vomikan Date: 2012-01-02 15:31:03 +0000 (Mon, 02 Jan 2012) Log Message: ----------- Updated Modified Paths: -------------- trunk/mmex/src/transdialog.cpp Modified: trunk/mmex/src/transdialog.cpp =================================================================== --- trunk/mmex/src/transdialog.cpp 2012-01-02 14:47:36 UTC (rev 1590) +++ trunk/mmex/src/transdialog.cpp 2012-01-02 15:31:03 UTC (rev 1591) @@ -1234,9 +1234,13 @@ break; } } + } else { - bPayee_->SetLabel(filtd.Item(c)); + c = 0; } + + //wxSafeShowMessage(currentPayeeName, wxString::Format(wxT("%i"), payeeID_)); + } else { filtd = mmDBWrapper::getAccountsName(db_.get()); for (int i = 0; i < filtd.GetCount(); ++i) { @@ -1248,11 +1252,16 @@ } if (event.GetKeyCode()==WXK_DOWN) { if (c < (filtd.GetCount()-1)) - bPayee_->SetLabel(filtd.Item(++c)); + currentPayeeName = filtd.Item(++c); + bPayee_->SetLabel(currentPayeeName); } else if (event.GetKeyCode()==WXK_UP){ if (c > 0) - bPayee_->SetLabel(filtd.Item(--c)); + currentPayeeName = filtd.Item(--c); + bPayee_->SetLabel(currentPayeeName); } + currentPayeeName = filtd.Item(c); + bPayee_->SetLabel(currentPayeeName); + payeeID_ = core_->payeeList_.getPayeeID(currentPayeeName); } void mmTransDialog::onChoiceTransChar(wxKeyEvent& event) @@ -1303,14 +1312,18 @@ } } } else { - c=0; - } + c = 0; + toAccountName = filtd.Item(c); + } if (event.GetKeyCode()==WXK_DOWN) { if (c < (filtd.GetCount()-1)) - bTo_->SetLabel(filtd.Item(++c)); + toAccountName = filtd.Item(++c); + bTo_->SetLabel(toAccountName); } else if (event.GetKeyCode()==WXK_UP){ if (c > 0) - bTo_->SetLabel(filtd.Item(--c)); + toAccountName = filtd.Item(--c); + bTo_->SetLabel(toAccountName); } + toID_ = mmDBWrapper::getAccountID(db_.get(), toAccountName); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2012-01-03 07:49:56
|
Revision: 1594 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1594&view=rev Author: vomikan Date: 2012-01-03 07:49:50 +0000 (Tue, 03 Jan 2012) Log Message: ----------- fixes Modified Paths: -------------- trunk/mmex/src/transdialog.cpp Modified: trunk/mmex/src/transdialog.cpp =================================================================== --- trunk/mmex/src/transdialog.cpp 2012-01-02 16:26:35 UTC (rev 1593) +++ trunk/mmex/src/transdialog.cpp 2012-01-03 07:49:50 UTC (rev 1594) @@ -1222,40 +1222,45 @@ event.Skip(); return; } - int c = 0; + size_t c = 0; wxString currentPayeeName = bPayee_->GetLabel(); wxArrayString filtd; if (choiceTrans_->GetSelection() != DEF_TRANSFER) { filtd = mmDBWrapper::filterPayees(db_.get(), wxT("")); - if (currentPayeeName != _("Select Payee")) { - for (int i = 0; i < filtd.GetCount(); ++i) { + if (filtd.IsEmpty()) { + //No payee present. Should be added one as minimum + return; + } + if (currentPayeeName == _("Select Payee")) { + c = 0; + } else { + for (size_t i = 0; i < (size_t)filtd.GetCount(); ++i) { if (filtd.Item(i) == currentPayeeName) { - c=i; + c = i; break; } } - - } else { - c = 0; } } else { filtd = mmDBWrapper::getAccountsName(db_.get()); - for (int i = 0; i < filtd.GetCount(); ++i) { + if (filtd.IsEmpty()) { + //No accounts present. Should be added one as minimum + return; + } + for (size_t i = 0; i < (size_t)filtd.GetCount(); ++i) { if (filtd.Item(i) == currentPayeeName) { - c=i; + c = i; break; } } } if (event.GetKeyCode()==WXK_DOWN) { - if (c < (filtd.GetCount()-1)) + if ((c + 1) < (size_t)filtd.GetCount()) currentPayeeName = filtd.Item(++c); - bPayee_->SetLabel(currentPayeeName); } else if (event.GetKeyCode()==WXK_UP){ if (c > 0) currentPayeeName = filtd.Item(--c); - bPayee_->SetLabel(currentPayeeName); } currentPayeeName = filtd.Item(c); @@ -1271,7 +1276,7 @@ void mmTransDialog::onChoiceTransChar(wxKeyEvent& event) { wxChoice* choice = (wxChoice*)FindWindow(ID_DIALOG_TRANS_TYPE); - int i = choice->GetSelection(); + int i = (int)choice->GetSelection(); if (event.GetKeyCode()==WXK_DOWN) { if (i < DEF_TRANSFER) choice->SetSelection(++i); @@ -1303,13 +1308,13 @@ return; } - int c = 0; + size_t c = 1; wxString toAccountName = bTo_->GetLabel(); wxArrayString filtd; filtd = mmDBWrapper::getAccountsName(db_.get()); if (toAccountName != _("Select To Acct")) { - for (int i = 0; i < filtd.GetCount(); ++i) { + for (size_t i = 0; i < (size_t)filtd.GetCount(); ++i) { if (filtd.Item(i) == toAccountName) { c=i; break; @@ -1321,7 +1326,7 @@ } if (event.GetKeyCode()==WXK_DOWN) { - if (c < (filtd.GetCount()-1)) + if ((c+1) < (size_t)(filtd.GetCount())) toAccountName = filtd.Item(++c); bTo_->SetLabel(toAccountName); } else if (event.GetKeyCode()==WXK_UP){ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ste...@us...> - 2012-01-03 08:46:42
|
Revision: 1595 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1595&view=rev Author: stef145g Date: 2012-01-03 08:46:36 +0000 (Tue, 03 Jan 2012) Log Message: ----------- Fix up/down key selection Modified Paths: -------------- trunk/mmex/src/transdialog.cpp Modified: trunk/mmex/src/transdialog.cpp =================================================================== --- trunk/mmex/src/transdialog.cpp 2012-01-03 07:49:50 UTC (rev 1594) +++ trunk/mmex/src/transdialog.cpp 2012-01-03 08:46:36 UTC (rev 1595) @@ -1200,6 +1200,7 @@ event.Skip(); } + void mmTransDialog::activateSplitTransactionsDlg() { SplitTransactionDialog dlg(core_, split_.get(), choiceTrans_->GetSelection(), this); @@ -1214,6 +1215,7 @@ textAmount_->SetValue(dispAmount); } } + void mmTransDialog:: OnButtonPayeeChar(wxKeyEvent& event) { //it's for debuging @@ -1276,26 +1278,27 @@ void mmTransDialog::onChoiceTransChar(wxKeyEvent& event) { wxChoice* choice = (wxChoice*)FindWindow(ID_DIALOG_TRANS_TYPE); - int i = (int)choice->GetSelection(); + int i = choice->GetSelection(); if (event.GetKeyCode()==WXK_DOWN) { - if (i < DEF_TRANSFER) + if (i < DEF_WITHDRAWAL) choice->SetSelection(++i); } else if (event.GetKeyCode()==WXK_UP){ - if (i > DEF_WITHDRAWAL) + if (i > DEF_TRANSFER) choice->SetSelection(--i); } updateControlsForTransType(); event.Skip(); } + void mmTransDialog::onChoiceStatusChar(wxKeyEvent& event) { wxChoice* choice = (wxChoice*)FindWindow(ID_DIALOG_TRANS_STATUS); int i = choice->GetSelection(); if (event.GetKeyCode()==WXK_DOWN) { - if (i < DEF_STATUS_DUPLICATE) + if (i < DEF_STATUS_NONE) choice->SetSelection(++i); } else if (event.GetKeyCode()==WXK_UP){ - if (i > DEF_STATUS_NONE) + if (i > DEF_STATUS_DUPLICATE) choice->SetSelection(--i); } event.Skip(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ste...@us...> - 2012-01-03 12:45:48
|
Revision: 1596 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1596&view=rev Author: stef145g Date: 2012-01-03 12:45:42 +0000 (Tue, 03 Jan 2012) Log Message: ----------- Fix up/down key selection Modified Paths: -------------- trunk/mmex/src/transdialog.cpp Modified: trunk/mmex/src/transdialog.cpp =================================================================== --- trunk/mmex/src/transdialog.cpp 2012-01-03 08:46:36 UTC (rev 1595) +++ trunk/mmex/src/transdialog.cpp 2012-01-03 12:45:42 UTC (rev 1596) @@ -1280,11 +1280,11 @@ wxChoice* choice = (wxChoice*)FindWindow(ID_DIALOG_TRANS_TYPE); int i = choice->GetSelection(); if (event.GetKeyCode()==WXK_DOWN) { - if (i < DEF_WITHDRAWAL) - choice->SetSelection(++i); + if (i < DEF_TRANSFER) + choice->SetSelection(i++); } else if (event.GetKeyCode()==WXK_UP){ - if (i > DEF_TRANSFER) - choice->SetSelection(--i); + if (i > DEF_WITHDRAWAL) + choice->SetSelection(i--); } updateControlsForTransType(); event.Skip(); @@ -1295,11 +1295,11 @@ wxChoice* choice = (wxChoice*)FindWindow(ID_DIALOG_TRANS_STATUS); int i = choice->GetSelection(); if (event.GetKeyCode()==WXK_DOWN) { - if (i < DEF_STATUS_NONE) - choice->SetSelection(++i); + if (i < DEF_STATUS_DUPLICATE) + choice->SetSelection(i++); } else if (event.GetKeyCode()==WXK_UP){ - if (i > DEF_STATUS_DUPLICATE) - choice->SetSelection(--i); + if (i > DEF_STATUS_NONE) + choice->SetSelection(i--); } event.Skip(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2012-01-03 13:42:05
|
Revision: 1597 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1597&view=rev Author: vomikan Date: 2012-01-03 13:41:56 +0000 (Tue, 03 Jan 2012) Log Message: ----------- update Modified Paths: -------------- trunk/mmex/src/transdialog.cpp Modified: trunk/mmex/src/transdialog.cpp =================================================================== --- trunk/mmex/src/transdialog.cpp 2012-01-03 12:45:42 UTC (rev 1596) +++ trunk/mmex/src/transdialog.cpp 2012-01-03 13:41:56 UTC (rev 1597) @@ -1280,11 +1280,15 @@ wxChoice* choice = (wxChoice*)FindWindow(ID_DIALOG_TRANS_TYPE); int i = choice->GetSelection(); if (event.GetKeyCode()==WXK_DOWN) { - if (i < DEF_TRANSFER) - choice->SetSelection(i++); + if (i < DEF_TRANSFER) { + i++; + choice->SetSelection(i); + } } else if (event.GetKeyCode()==WXK_UP){ - if (i > DEF_WITHDRAWAL) - choice->SetSelection(i--); + if (i > DEF_WITHDRAWAL) { + i--; + choice->SetSelection(i); + } } updateControlsForTransType(); event.Skip(); @@ -1295,11 +1299,15 @@ wxChoice* choice = (wxChoice*)FindWindow(ID_DIALOG_TRANS_STATUS); int i = choice->GetSelection(); if (event.GetKeyCode()==WXK_DOWN) { - if (i < DEF_STATUS_DUPLICATE) - choice->SetSelection(i++); + if (i < DEF_STATUS_DUPLICATE) { + i++; + choice->SetSelection(i++); + } } else if (event.GetKeyCode()==WXK_UP){ - if (i > DEF_STATUS_NONE) - choice->SetSelection(i--); + if (i > DEF_STATUS_NONE) { + i--; + choice->SetSelection(i); + } } event.Skip(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ste...@us...> - 2012-01-03 14:11:03
|
Revision: 1598 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1598&view=rev Author: stef145g Date: 2012-01-03 14:10:57 +0000 (Tue, 03 Jan 2012) Log Message: ----------- Fix up/down key selection Modified Paths: -------------- trunk/mmex/src/transdialog.cpp Modified: trunk/mmex/src/transdialog.cpp =================================================================== --- trunk/mmex/src/transdialog.cpp 2012-01-03 13:41:56 UTC (rev 1597) +++ trunk/mmex/src/transdialog.cpp 2012-01-03 14:10:57 UTC (rev 1598) @@ -1276,40 +1276,38 @@ } void mmTransDialog::onChoiceTransChar(wxKeyEvent& event) -{ +{ wxChoice* choice = (wxChoice*)FindWindow(ID_DIALOG_TRANS_TYPE); int i = choice->GetSelection(); if (event.GetKeyCode()==WXK_DOWN) { - if (i < DEF_TRANSFER) { - i++; - choice->SetSelection(i); - } + if (i < DEF_TRANSFER) { + choice->SetSelection(++i); + } } else if (event.GetKeyCode()==WXK_UP){ - if (i > DEF_WITHDRAWAL) { - i--; - choice->SetSelection(i); - } + if (i > DEF_WITHDRAWAL){ + choice->SetSelection(--i); + } + } else { + event.Skip(); } updateControlsForTransType(); - event.Skip(); } void mmTransDialog::onChoiceStatusChar(wxKeyEvent& event) -{ +{ wxChoice* choice = (wxChoice*)FindWindow(ID_DIALOG_TRANS_STATUS); int i = choice->GetSelection(); if (event.GetKeyCode()==WXK_DOWN) { if (i < DEF_STATUS_DUPLICATE) { - i++; - choice->SetSelection(i++); + choice->SetSelection(++i); } - } else if (event.GetKeyCode()==WXK_UP){ - if (i > DEF_STATUS_NONE) { - i--; - choice->SetSelection(i); - } + } else if (event.GetKeyCode()==WXK_UP) { + if (i > DEF_STATUS_NONE) { + choice->SetSelection(--i); } - event.Skip(); + } else { + event.Skip(); + } } void mmTransDialog::OnButtonToAccountChar(wxKeyEvent& event) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2012-01-03 20:04:56
|
Revision: 1601 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1601&view=rev Author: vomikan Date: 2012-01-03 20:04:50 +0000 (Tue, 03 Jan 2012) Log Message: ----------- minor fix Modified Paths: -------------- trunk/mmex/src/transdialog.cpp Modified: trunk/mmex/src/transdialog.cpp =================================================================== --- trunk/mmex/src/transdialog.cpp 2012-01-03 20:00:06 UTC (rev 1600) +++ trunk/mmex/src/transdialog.cpp 2012-01-03 20:04:50 UTC (rev 1601) @@ -279,7 +279,7 @@ itemStaticTextWeek = new wxStaticText( itemPanel7, ID_DIALOG_TRANS_WEEK, wxT("")); dpc_ = new wxDatePickerCtrl( itemPanel7, ID_DIALOG_TRANS_BUTTONDATE, wxDefaultDateTime, - wxDefaultPosition, wxSize(110, -1), wxDP_DROPDOWN | wxDP_SHOWCENTURY, doubleValidator()); + wxDefaultPosition, wxSize(110, -1), wxDP_DROPDOWN | wxDP_SHOWCENTURY); dpc_->SetToolTip(_("Specify the date of the transaction")); dpc_->SetBackgroundColour(mmColors::listDetailsPanelColor); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2012-01-05 10:46:14
|
Revision: 1606 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=1606&view=rev Author: vomikan Date: 2012-01-05 08:56:03 +0000 (Thu, 05 Jan 2012) Log Message: ----------- >From Account button enabled for editing Modified Paths: -------------- trunk/mmex/src/transdialog.cpp Modified: trunk/mmex/src/transdialog.cpp =================================================================== --- trunk/mmex/src/transdialog.cpp 2012-01-04 21:36:57 UTC (rev 1605) +++ trunk/mmex/src/transdialog.cpp 2012-01-05 08:56:03 UTC (rev 1606) @@ -747,7 +747,8 @@ wxString acctName = mmDBWrapper::getAccountName(db_.get(), accountID_); bPayee_->SetLabel(acctName); payeeID_ = accountID_; - bPayee_->Enable(false); + //from account button should be available for editing + bPayee_->Enable(edit_); if (!edit_) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |