From: <vo...@us...> - 2013-10-23 14:45:47
|
Revision: 4959 http://sourceforge.net/p/moneymanagerex/code/4959 Author: vomikan Date: 2013-10-23 14:45:45 +0000 (Wed, 23 Oct 2013) Log Message: ----------- fixes for split dialogs Modified Paths: -------------- trunk/src/mmcheckingpanel.cpp trunk/src/splittransactionsdialog.cpp trunk/src/transdialog.cpp trunk/src/transdialog.h Modified: trunk/src/mmcheckingpanel.cpp =================================================================== --- trunk/src/mmcheckingpanel.cpp 2013-10-23 06:55:17 UTC (rev 4958) +++ trunk/src/mmcheckingpanel.cpp 2013-10-23 14:45:45 UTC (rev 4959) @@ -41,10 +41,10 @@ //---------------------------------------------------------------------------- BEGIN_EVENT_TABLE(mmCheckingPanel, wxPanel) - EVT_BUTTON(mmID_NEW, mmCheckingPanel::OnNewTransaction) - EVT_BUTTON(mmID_EDIT, mmCheckingPanel::OnEditTransaction) - EVT_BUTTON(mmID_DELETE, mmCheckingPanel::OnDeleteTransaction) - EVT_BUTTON(mmID_DUPLICATE, mmCheckingPanel::OnDuplicateTransaction) + EVT_BUTTON(wxID_NEW, mmCheckingPanel::OnNewTransaction) + EVT_BUTTON(wxID_EDIT, mmCheckingPanel::OnEditTransaction) + EVT_BUTTON(wxID_DELETE, mmCheckingPanel::OnDeleteTransaction) + EVT_BUTTON(wxID_DUPLICATE, mmCheckingPanel::OnDuplicateTransaction) EVT_MENU(wxID_ANY, mmCheckingPanel::OnViewPopupSelected) EVT_SEARCHCTRL_SEARCH_BTN(wxID_FIND, mmCheckingPanel::OnSearchTxtEntered) EVT_TEXT_ENTER(wxID_FIND, mmCheckingPanel::OnSearchTxtEntered) @@ -499,21 +499,21 @@ wxBoxSizer* itemButtonsSizer = new wxBoxSizer(wxHORIZONTAL); itemBoxSizer4->Add(itemButtonsSizer, flags); - btnNew_ = new wxButton(itemPanel12, mmID_NEW, _("&New")); + btnNew_ = new wxButton(itemPanel12, wxID_NEW, _("&New ")); btnNew_->SetToolTip(_("New Transaction")); itemButtonsSizer->Add(btnNew_, 0, wxRIGHT, 5); - btnEdit_ = new wxButton(itemPanel12, mmID_EDIT, _("&Edit")); + btnEdit_ = new wxButton(itemPanel12, wxID_EDIT, _("&Edit ")); btnEdit_->SetToolTip(_("Edit selected transaction")); itemButtonsSizer->Add(btnEdit_, 0, wxRIGHT, 5); btnEdit_->Enable(false); - btnDelete_ = new wxButton(itemPanel12, mmID_DELETE, _("&Delete")); + btnDelete_ = new wxButton(itemPanel12, wxID_DELETE, _("&Delete ")); btnDelete_->SetToolTip(_("Delete selected transaction")); itemButtonsSizer->Add(btnDelete_, 0, wxRIGHT, 5); btnDelete_->Enable(false); - btnDuplicate_ = new wxButton(itemPanel12, mmID_DUPLICATE, _("D&uplicate")); + btnDuplicate_ = new wxButton(itemPanel12, wxID_DUPLICATE, _("D&uplicate ")); btnDuplicate_->SetToolTip(_("Duplicate selected transaction")); itemButtonsSizer->Add(btnDuplicate_, 0, wxRIGHT, 5); btnDuplicate_->Enable(false); Modified: trunk/src/splittransactionsdialog.cpp =================================================================== --- trunk/src/splittransactionsdialog.cpp 2013-10-23 06:55:17 UTC (rev 4958) +++ trunk/src/splittransactionsdialog.cpp 2013-10-23 14:45:45 UTC (rev 4959) @@ -51,7 +51,9 @@ , mmSplitTransactionEntries* splt) : m_splits(splits) { - std::copy(this->m_splits->begin(), this->m_splits->end(), this->m_local_splits.begin()); + //std::copy(m_splits->begin(), m_splits->end(), m_local_splits.begin()); + for (const auto &item : *m_splits) m_local_splits.push_back(item); + transType_ = transType; selectedIndex_ = 0; if (transType_ == DEF_TRANSFER) @@ -146,15 +148,15 @@ mainButtonSizer->Add(bottomRowButtonSizer, 0, wxALIGN_RIGHT|wxALL, 0); dialogMainSizerV->Add(mainButtonSizer, 0, wxALIGN_RIGHT|wxALL, 10); - itemButtonNew_ = new wxButton( this, wxID_ADD); - itemButtonEdit_ = new wxButton( this, wxID_EDIT); + itemButtonNew_ = new wxButton( this, wxID_ADD, _("&Add ")); + itemButtonEdit_ = new wxButton( this, wxID_EDIT, _("&Edit ")); itemButtonDelete_ = new wxButton( this, wxID_REMOVE); topRowButtonSizer->Add(itemButtonNew_, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 5); topRowButtonSizer->Add(itemButtonEdit_, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 5); topRowButtonSizer->Add(itemButtonDelete_, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 0); - itemButtonOK_ = new wxButton( this, wxID_OK); - wxButton* itemButtonCancel = new wxButton( this, wxID_CANCEL); + itemButtonOK_ = new wxButton( this, wxID_OK, _("&OK ")); + wxButton* itemButtonCancel = new wxButton( this, wxID_CANCEL, _("&Cancel ")); itemButtonCancel->SetFocus(); bottomRowButtonSizer->Add(itemButtonOK_, 0, wxALIGN_RIGHT|wxTOP|wxRIGHT, 5); @@ -182,6 +184,8 @@ { // finally this->m_splits->swap(this->m_local_splits); + EndModal(wxID_OK); + } void SplitTransactionDialog::OnButtonRemoveClick( wxCommandEvent& event ) Modified: trunk/src/transdialog.cpp =================================================================== --- trunk/src/transdialog.cpp 2013-10-23 06:55:17 UTC (rev 4958) +++ trunk/src/transdialog.cpp 2013-10-23 14:45:45 UTC (rev 4959) @@ -225,10 +225,10 @@ bCategory_->SetLabel(resetCategoryString()); } - SetTransferControls(transfer); + updateControlsForTransType2(transfer); } -void mmTransDialog::SetTransferControls(bool transfer) +void mmTransDialog::updateControlsForTransType2(bool transfer) { //Advanced @@ -307,7 +307,7 @@ if (!cbPayee_ -> SetStringSelection(dataStr)) cbPayee_ -> SetValue(dataStr); - SetSplitState(); + cbPayee_ -> SetEvtHandlerEnabled(true); cbAccount_ -> SetEvtHandlerEnabled(true); } @@ -902,10 +902,9 @@ transaction_->TOTRANSAMOUNT = transaction_->TRANSAMOUNT; } - amountStr = CurrencyFormatter::float2String(transaction_->TOTRANSAMOUNT); - toTextAmount_->SetValue(amountStr); + toTextAmount_->SetValue(transaction_->TOTRANSAMOUNT); - SetTransferControls(); + updateControlsForTransType2(); } void mmTransDialog::OnCategs(wxCommandEvent& /*event*/) Modified: trunk/src/transdialog.h =================================================================== --- trunk/src/transdialog.h 2013-10-23 06:55:17 UTC (rev 4958) +++ trunk/src/transdialog.h 2013-10-23 14:45:45 UTC (rev 4959) @@ -95,7 +95,7 @@ void changeFocus(wxChildFocusEvent& event); void onTextEntered(wxCommandEvent& event); void OnAdvanceChecked(wxCommandEvent& event); - void SetTransferControls(bool transfer = true); + void updateControlsForTransType2(bool transfer = true); void activateSplitTransactionsDlg(); void SetSplitState(); bool validateData(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |