From: <vo...@us...> - 2012-06-29 12:14:15
|
Revision: 2675 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=2675&view=rev Author: vomikan Date: 2012-06-29 12:14:05 +0000 (Fri, 29 Jun 2012) Log Message: ----------- fix, cleanup, update Modified Paths: -------------- branches/0.9.9.0/mmex/src/budgetingpanel.cpp branches/0.9.9.0/mmex/src/budgetingpanel.h Modified: branches/0.9.9.0/mmex/src/budgetingpanel.cpp =================================================================== --- branches/0.9.9.0/mmex/src/budgetingpanel.cpp 2012-06-28 09:53:32 UTC (rev 2674) +++ branches/0.9.9.0/mmex/src/budgetingpanel.cpp 2012-06-29 12:14:05 UTC (rev 2675) @@ -38,18 +38,12 @@ /*******************************************************/ BEGIN_EVENT_TABLE(mmBudgetingPanel, wxPanel) EVT_LEFT_DOWN( mmBudgetingPanel::OnMouseLeftDown ) - - EVT_MENU(MENU_VIEW_ALLBUDGETENTRIES, mmBudgetingPanel::OnViewPopupSelected) - EVT_MENU(MENU_VIEW_NONZEROBUDGETENTRIES, mmBudgetingPanel::OnViewPopupSelected) - EVT_MENU(MENU_VIEW_INCOMEBUDGETENTRIES, mmBudgetingPanel::OnViewPopupSelected) - EVT_MENU(MENU_VIEW_EXPENSEBUDGETENTRIES, mmBudgetingPanel::OnViewPopupSelected) - EVT_MENU(MENU_VIEW_SUMMARYBUDGETENTRIES, mmBudgetingPanel::OnViewPopupSelected) + EVT_MENU(wxID_ANY, mmBudgetingPanel::OnViewPopupSelected) END_EVENT_TABLE() /*******************************************************/ BEGIN_EVENT_TABLE(budgetingListCtrl, wxListCtrl) EVT_LIST_ITEM_SELECTED(ID_PANEL_CHECKING_LISTCTRL_ACCT, budgetingListCtrl::OnListItemSelected) EVT_LIST_ITEM_ACTIVATED(ID_PANEL_CHECKING_LISTCTRL_ACCT, budgetingListCtrl::OnListItemActivated) - END_EVENT_TABLE() /*******************************************************/ mmBudgetingPanel::mmBudgetingPanel(wxSQLite3Database* db, wxSQLite3Database* inidb, mmCoreDB* core, mmGUIFrame* mainFrame, int budgetYearID, wxWindow *parent, @@ -58,18 +52,18 @@ ) : mmPanelBase(db, inidb, core), m_imageList(), - listCtrlAccount_(), + listCtrlBudget_(), budgetYearID_(budgetYearID), mainFrame_(mainFrame) { Create(parent, winid, pos, size, style, name); - currentView_ = wxT("View All Budget Categories"); } bool mmBudgetingPanel::Create( wxWindow *parent, wxWindowID winid, const wxPoint& pos, const wxSize& size,long style, const wxString& name ) { + currentView_ = wxT("View All Budget Categories"); SetExtraStyle(GetExtraStyle()|wxWS_EX_BLOCK_EVENTS); wxPanel::Create(parent, winid, pos, size, style, name); @@ -88,28 +82,13 @@ { if (m_imageList) delete m_imageList; - long col0, col1, col2, col3, col4, col5; - col0 = listCtrlAccount_->GetColumnWidth(0); - col1 = listCtrlAccount_->GetColumnWidth(1); - col2 = listCtrlAccount_->GetColumnWidth(2); - col3 = listCtrlAccount_->GetColumnWidth(3); - col4 = listCtrlAccount_->GetColumnWidth(4); - col5 = listCtrlAccount_->GetColumnWidth(5); - - wxString col0Str = wxString::Format(wxT("%d"), col0); - wxString col1Str = wxString::Format(wxT("%d"), col1); - wxString col2Str = wxString::Format(wxT("%d"), col2); - wxString col3Str = wxString::Format(wxT("%d"), col3); - wxString col4Str = wxString::Format(wxT("%d"), col4); - wxString col5Str = wxString::Format(wxT("%d"), col5); - inidb_->Begin(); - mmDBWrapper::setINISettingValue(inidb_, wxT("BUDGET_COL0_WIDTH"), col0Str); - mmDBWrapper::setINISettingValue(inidb_, wxT("BUDGET_COL1_WIDTH"), col1Str); - mmDBWrapper::setINISettingValue(inidb_, wxT("BUDGET_COL2_WIDTH"), col2Str); - mmDBWrapper::setINISettingValue(inidb_, wxT("BUDGET_COL3_WIDTH"), col3Str); - mmDBWrapper::setINISettingValue(inidb_, wxT("BUDGET_COL4_WIDTH"), col4Str); - mmDBWrapper::setINISettingValue(inidb_, wxT("BUDGET_COL5_WIDTH"), col5Str); + for (int i = 0; i < listCtrlBudget_->GetColumnCount(); ++i) + { + mmDBWrapper::setINISettingValue(inidb_, + wxString::Format(wxT("BUDGET_COL%d_WIDTH"), i), + wxString::Format(wxT("%d"), listCtrlBudget_->GetColumnWidth(i))); + } inidb_->Commit(); } @@ -118,38 +97,23 @@ int evt = event.GetId(); wxStaticText* header = (wxStaticText*)FindWindow(ID_PANEL_CHECKING_STATIC_PANELVIEW); if (evt == MENU_VIEW_ALLBUDGETENTRIES) - { - header->SetLabel(_("View All Budget Categories")); - currentView_ = wxT("View All Budget Categories"); - } + currentView_ = wxTRANSLATE("View All Budget Categories"); else if (evt == MENU_VIEW_NONZEROBUDGETENTRIES) - { - header->SetLabel(_("View Non-Zero Budget Categories")); - currentView_ = wxT("View Non-Zero Budget Categories"); - } + currentView_ = wxTRANSLATE("View Non-Zero Budget Categories"); else if (evt == MENU_VIEW_INCOMEBUDGETENTRIES) - { - header->SetLabel(_("View Income Budget Categories")); - currentView_ = wxT("View Income Budget Categories"); - } + currentView_ = wxTRANSLATE("View Income Budget Categories"); else if (evt == MENU_VIEW_EXPENSEBUDGETENTRIES) - { - header->SetLabel(_("View Expense Budget Categories")); - currentView_ = wxT("View Expense Budget Categories"); - } + currentView_ = wxTRANSLATE("View Expense Budget Categories"); else if (evt == MENU_VIEW_SUMMARYBUDGETENTRIES) - { - header->SetLabel(_("View Budget Category Summary")); - currentView_ = wxT("View Budget Category Summary"); - } + currentView_ = wxTRANSLATE("View Budget Category Summary"); else - { wxASSERT(false); - } - listCtrlAccount_->DeleteAllItems(); + header->SetLabel(wxGetTranslation(wxT("View Budget Category Summary"))); + + listCtrlBudget_->DeleteAllItems(); initVirtualListControl(); - listCtrlAccount_->RefreshItems(0, ((int)trans_.size()) - 1); + listCtrlBudget_->RefreshItems(0, ((int)trans_.size()) - 1); } void mmBudgetingPanel::OnMouseLeftDown( wxMouseEvent& event ) @@ -175,6 +139,9 @@ void mmBudgetingPanel::CreateControls() { + wxSizerFlags flags; + flags.Align(wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL).Border(wxLEFT|wxTOP, 4); + wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL); this->SetSizer(itemBoxSizer2); @@ -205,14 +172,15 @@ yearStr = wxString() << _("Month: ") << yearStr; } wxStaticText* itemStaticText9 = new wxStaticText( itemPanel3, ID_PANEL_REPORTS_STATIC_HEADER, - _("Budget Setup for ") + yearStr, wxDefaultPosition, wxDefaultSize, 0 ); - itemStaticText9->SetFont(wxFont(12, wxSWISS, wxNORMAL, wxBOLD, FALSE, wxT(""))); + _("Budget Setup for ") + yearStr); + const int font_size = this->GetFont().GetPointSize(); + itemStaticText9->SetFont(wxFont(font_size+2, wxSWISS, wxNORMAL, wxBOLD, FALSE, wxT(""))); itemBoxSizerVHeader->Add(itemStaticText9, 0, wxALL, 1); wxBoxSizer* itemBoxSizerHHeader2 = new wxBoxSizer(wxHORIZONTAL); itemBoxSizerVHeader->Add(itemBoxSizerHHeader2, 0, wxALL, 1); - wxBitmap itemStaticBitmap3Bitmap(rightarrow_xpm); + wxBitmap itemStaticBitmap3Bitmap(wxBitmap(wxImage(rightarrow_xpm).Scale(16,16))); wxStaticBitmap* itemStaticBitmap3 = new wxStaticBitmap( itemPanel3, ID_PANEL_BUDGETENTRY_STATIC_BITMAP_VIEW, itemStaticBitmap3Bitmap, wxDefaultPosition, wxSize(16, 16), 0 ); @@ -221,26 +189,22 @@ wxStaticText* itemStaticText18 = new wxStaticText( itemPanel3, ID_PANEL_CHECKING_STATIC_PANELVIEW, - _("Viewing All Budget Categories"), wxDefaultPosition, wxDefaultSize, 0 ); + _("Viewing All Budget Categories")); itemBoxSizerHHeader2->Add(itemStaticText18, 0, wxALL, 1); - wxSize distSize(170, 20); + wxSize distSize(250, 20); wxStaticText* itemStaticText100 = new wxStaticText( itemPanel3, wxID_ANY, _("Income......."), wxDefaultPosition, wxSize(75, 20), 0 ); - itemStaticText100->SetFont(wxFont(10, wxSWISS, wxNORMAL, wxNORMAL, FALSE, wxT(""))); wxStaticText* itemStaticText101 = new wxStaticText( itemPanel3, ID_DIALOG_BUDGETENTRY_SUMMARY_INCOME_EST, _("Estimated: "), wxDefaultPosition, distSize, 0); - itemStaticText101->SetFont(wxFont(10, wxSWISS, wxNORMAL, wxNORMAL, FALSE, wxT(""))); wxStaticText* itemStaticText102 = new wxStaticText( itemPanel3, ID_DIALOG_BUDGETENTRY_SUMMARY_INCOME_ACT, _("Actual: "), wxDefaultPosition, distSize, 0); - itemStaticText102->SetFont(wxFont(10, wxSWISS, wxNORMAL, wxNORMAL, FALSE, wxT(""))); wxStaticText* itemStaticText103 = new wxStaticText( itemPanel3, ID_DIALOG_BUDGETENTRY_SUMMARY_INCOME_DIF, _("Difference: "), wxDefaultPosition, distSize, 0); - itemStaticText103->SetFont(wxFont(10, wxSWISS, wxNORMAL, wxNORMAL, FALSE, wxT(""))); wxBoxSizer* itemIncomeSizer = new wxBoxSizer(wxHORIZONTAL); itemIncomeSizer->Add(itemStaticText100, 0, wxALL, 0); @@ -251,19 +215,15 @@ wxStaticText* itemStaticText200 = new wxStaticText( itemPanel3, wxID_ANY, _("Expenses..."), wxDefaultPosition, wxSize(75, 20), 0 ); - itemStaticText200->SetFont(wxFont(10, wxSWISS, wxNORMAL, wxNORMAL, FALSE, wxT(""))); wxStaticText* itemStaticText201 = new wxStaticText( itemPanel3, ID_DIALOG_BUDGETENTRY_SUMMARY_EXPENSES_EST, _("Estimated: "), wxDefaultPosition, distSize, 0); - itemStaticText201->SetFont(wxFont(10, wxSWISS, wxNORMAL, wxNORMAL, FALSE, wxT(""))); wxStaticText* itemStaticText202 = new wxStaticText( itemPanel3, ID_DIALOG_BUDGETENTRY_SUMMARY_EXPENSES_ACT, _("Actual: "), wxDefaultPosition, distSize, 0); - itemStaticText202->SetFont(wxFont(10, wxSWISS, wxNORMAL, wxNORMAL, FALSE, wxT(""))); wxStaticText* itemStaticText203 = new wxStaticText( itemPanel3, ID_DIALOG_BUDGETENTRY_SUMMARY_EXPENSES_DIF, _("Difference: "), wxDefaultPosition, distSize, 0); - itemStaticText203->SetFont(wxFont(10, wxSWISS, wxNORMAL, wxNORMAL, FALSE, wxT(""))); wxBoxSizer* itemExpenseSizer = new wxBoxSizer(wxHORIZONTAL); itemExpenseSizer->Add(itemStaticText200, 0, wxALL, 0); @@ -280,44 +240,27 @@ m_imageList->Add(wxBitmap(flag_xpm)); m_imageList->Add(wxBitmap(empty_xpm)); - listCtrlAccount_ = new budgetingListCtrl( this, this, + listCtrlBudget_ = new budgetingListCtrl( this, this, ID_PANEL_CHECKING_LISTCTRL_ACCT, wxDefaultPosition, wxDefaultSize, wxLC_REPORT | wxLC_HRULES | wxLC_VRULES | wxLC_VIRTUAL | wxLC_SINGLE_SEL ); - //listCtrlAccount_->SetBackgroundColour(mmColors::listBackColor); - listCtrlAccount_->SetImageList(m_imageList, wxIMAGE_LIST_SMALL); - listCtrlAccount_->InsertColumn(0, _("Category ")); - listCtrlAccount_->InsertColumn(1, _("Sub Category")); - listCtrlAccount_->InsertColumn(2, _("Frequency")); - wxListItem itemCol; - itemCol.SetImage(-1); - itemCol.SetAlign(wxLIST_FORMAT_RIGHT); - itemCol.SetText(_("Amount")); - listCtrlAccount_->InsertColumn(3, itemCol); + listCtrlBudget_->SetImageList(m_imageList, wxIMAGE_LIST_SMALL); + listCtrlBudget_->InsertColumn(0, _("Category")); + listCtrlBudget_->InsertColumn(1, _("Sub Category")); + listCtrlBudget_->InsertColumn(2, _("Frequency")); + listCtrlBudget_->InsertColumn(3, _("Amount"), wxLIST_FORMAT_RIGHT); + listCtrlBudget_->InsertColumn(4, _("Estimated"), wxLIST_FORMAT_RIGHT); + listCtrlBudget_->InsertColumn(5, _("Actual"), wxLIST_FORMAT_RIGHT); - itemCol.SetText(_("Estimated")); - listCtrlAccount_->InsertColumn(4, itemCol); + /* Get data from inidb */ + for (int i = 0; i < listCtrlBudget_->GetColumnCount(); ++i) + { + long col; + mmDBWrapper::getINISettingValue(inidb_, wxString::Format(wxT("BUDGET_COL%d_WIDTH"), i), wxT("80")).ToLong(&col); + listCtrlBudget_->SetColumnWidth(i, col); + } - itemCol.SetText(_("Actual")); - listCtrlAccount_->InsertColumn(5, itemCol); - - /* See if we can get data from inidb */ - long col0, col1, col2, col3, col4, col5; - mmDBWrapper::getINISettingValue(inidb_, wxT("BUDGET_COL0_WIDTH"), wxT("80")).ToLong(&col0); - mmDBWrapper::getINISettingValue(inidb_, wxT("BUDGET_COL1_WIDTH"), wxT("80")).ToLong(&col1); - mmDBWrapper::getINISettingValue(inidb_, wxT("BUDGET_COL2_WIDTH"), wxT("80")).ToLong(&col2); - mmDBWrapper::getINISettingValue(inidb_, wxT("BUDGET_COL3_WIDTH"), wxT("80")).ToLong(&col3); - mmDBWrapper::getINISettingValue(inidb_, wxT("BUDGET_COL4_WIDTH"), wxT("80")).ToLong(&col4); - mmDBWrapper::getINISettingValue(inidb_, wxT("BUDGET_COL5_WIDTH"), wxT("80")).ToLong(&col5); - - listCtrlAccount_->SetColumnWidth(0, col0); - listCtrlAccount_->SetColumnWidth(1, col1); - listCtrlAccount_->SetColumnWidth(2, col2); - listCtrlAccount_->SetColumnWidth(3, col3); - listCtrlAccount_->SetColumnWidth(4, col4); - listCtrlAccount_->SetColumnWidth(5, col5); - - itemBoxSizer2->Add(listCtrlAccount_, 1, wxGROW | wxALL, 1); + itemBoxSizer2->Add(listCtrlBudget_, 1, wxGROW | wxALL, 1); } bool mmBudgetingPanel::displayEntryAllowed(mmBudgetEntryHolder& budgetEntry) @@ -325,25 +268,15 @@ bool result = false; if (currentView_ == wxT("View Non-Zero Budget Categories")) - { - if ((budgetEntry.estimated_ != 0.0) || (budgetEntry.actual_ != 0.0)) result = true; - } + result =((budgetEntry.estimated_ != 0.0) || (budgetEntry.actual_ != 0.0)); else if (currentView_ == wxT("View Income Budget Categories")) - { - if ((budgetEntry.estimated_ > 0.0) || (budgetEntry.actual_ > 0.0)) result = true; - } + result = ((budgetEntry.estimated_ > 0.0) || (budgetEntry.actual_ > 0.0)); else if (currentView_ == wxT("View Expense Budget Categories")) - { - if ((budgetEntry.estimated_ < 0.0) || (budgetEntry.actual_ < 0.0)) result = true; - } - else if (currentView_ == _("View Budget Category Summary")) - { - if ((budgetEntry.id_ < 0.0)) result = true; - } + result = ((budgetEntry.estimated_ < 0.0) || (budgetEntry.actual_ < 0.0)); + else if (currentView_ == wxT("View Budget Category Summary")) + result = ((budgetEntry.id_ < 0.0)); else - { result = true; - } return result; } @@ -517,14 +450,14 @@ { trans_.push_back(catTotals); int transCatTotalIndex = (int)trans_.size()-1; - listCtrlAccount_->RefreshItem(transCatTotalIndex); + listCtrlBudget_->RefreshItem(transCatTotalIndex); } } st_sub.Finalize(); st.Finalize(); - listCtrlAccount_->SetItemCount((int)trans_.size()); + listCtrlBudget_->SetItemCount((int)trans_.size()); wxString estIncomeStr, actIncomeStr, estExpensesStr, actExpensesStr; mmex::formatDoubleToCurrency(estIncome, estIncomeStr); @@ -539,24 +472,24 @@ wxString differenceStr; wxStaticText* header = (wxStaticText*)FindWindow(ID_DIALOG_BUDGETENTRY_SUMMARY_INCOME_EST); - header->SetLabel( wxString() << _("Estimated: ") << estIncomeStr); + header->SetLabel( _("Estimated: ") + estIncomeStr); header = (wxStaticText*)FindWindow(ID_DIALOG_BUDGETENTRY_SUMMARY_INCOME_ACT); - header->SetLabel( wxString() << _("Actual: ") << actIncomeStr); + header->SetLabel( _("Actual: ") + actIncomeStr); - mmex::formatDoubleToCurrency(estIncome -actIncome, differenceStr); + mmex::formatDoubleToCurrency(estIncome - actIncome, differenceStr); header = (wxStaticText*)FindWindow(ID_DIALOG_BUDGETENTRY_SUMMARY_INCOME_DIF); - header->SetLabel( wxString() << _("Difference: ") << differenceStr); + header->SetLabel( _("Difference: ") + differenceStr); header = (wxStaticText*)FindWindow(ID_DIALOG_BUDGETENTRY_SUMMARY_EXPENSES_EST); - header->SetLabel( wxString() <<_("Estimated: ") << estExpensesStr); + header->SetLabel( _("Estimated: ") + estExpensesStr); header = (wxStaticText*)FindWindow(ID_DIALOG_BUDGETENTRY_SUMMARY_EXPENSES_ACT); - header->SetLabel( wxString() << _("Actual: ") << actExpensesStr); + header->SetLabel( _("Actual: ") + actExpensesStr); mmex::formatDoubleToCurrency(estExpenses -actExpenses, differenceStr); header = (wxStaticText*)FindWindow(ID_DIALOG_BUDGETENTRY_SUMMARY_EXPENSES_DIF); - header->SetLabel( wxString() << _("Difference: ") << differenceStr); + header->SetLabel( _("Difference: ") + differenceStr); } /*******************************************************/ Modified: branches/0.9.9.0/mmex/src/budgetingpanel.h =================================================================== --- branches/0.9.9.0/mmex/src/budgetingpanel.h 2012-06-28 09:53:32 UTC (rev 2674) +++ branches/0.9.9.0/mmex/src/budgetingpanel.h 2012-06-29 12:14:05 UTC (rev 2675) @@ -129,7 +129,7 @@ public: wxImageList* m_imageList; - budgetingListCtrl* listCtrlAccount_; + budgetingListCtrl* listCtrlBudget_; wxString currentView_; int budgetYearID_; mmGUIFrame* mainFrame_; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2012-07-02 07:35:31
|
Revision: 2679 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=2679&view=rev Author: vomikan Date: 2012-07-02 07:35:25 +0000 (Mon, 02 Jul 2012) Log Message: ----------- update Modified Paths: -------------- branches/0.9.9.0/mmex/src/transdialog.cpp branches/0.9.9.0/mmex/src/transdialog.h Modified: branches/0.9.9.0/mmex/src/transdialog.cpp =================================================================== --- branches/0.9.9.0/mmex/src/transdialog.cpp 2012-07-02 07:34:56 UTC (rev 2678) +++ branches/0.9.9.0/mmex/src/transdialog.cpp 2012-07-02 07:35:25 UTC (rev 2679) @@ -250,137 +250,135 @@ void mmTransDialog::CreateControls() { - wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL); - this->SetSizer(itemBoxSizer2); - //this->SetBackgroundColour(mmColors::listBackColor); - - wxStaticBox* itemStaticBoxSizer4Static = new wxStaticBox(this, wxID_ANY, _("Transaction Details")); - wxStaticBoxSizer* itemStaticBoxSizer4 = new wxStaticBoxSizer(itemStaticBoxSizer4Static, wxVERTICAL); - itemBoxSizer2->Add(itemStaticBoxSizer4, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxTOP|wxRIGHT, 10); + wxSizerFlags flags, flagsExpand; + flags.Align(wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL).Border(wxALL, 5); + flagsExpand.Align(wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL).Border(wxALL, 5).Expand(); - /************************************************************************************************************ - ItemPanel7 controlled by ItemFlexGridSizer8 - contained in the TransDetailsStaticSizer. (itemStaticBoxSizer4) - *************************************************************************************************************/ - wxPanel* itemPanel7 = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - itemStaticBoxSizer4->Add(itemPanel7, 0, wxGROW|wxALL, 10); + wxBoxSizer* box_sizer1 = new wxBoxSizer(wxVERTICAL); + this->SetSizer(box_sizer1); + wxBoxSizer* box_sizer2 = new wxBoxSizer(wxVERTICAL); + box_sizer1->Add(box_sizer2, flags); - wxFlexGridSizer* itemFlexGridSizer8 = new wxFlexGridSizer(5, 2, 10, 10); - itemPanel7->SetSizer(itemFlexGridSizer8); - //itemPanel7->SetBackgroundColour(mmColors::listBackColor); + wxStaticBox* static_box = new wxStaticBox(this, wxID_ANY, _("Transaction Details")); + wxStaticBoxSizer* box_sizer = new wxStaticBoxSizer(static_box, wxVERTICAL); + box_sizer2->Add(box_sizer, flags); - wxSizerFlags flags; - flags.Border(0); + wxFlexGridSizer* flex_sizer = new wxFlexGridSizer(0, 2, 0, 0); + box_sizer->Add(flex_sizer, flags); // Date -------------------------------------------- - wxStaticText* itemStaticText15 = new wxStaticText( itemPanel7, wxID_STATIC, _("Date")); + wxStaticText* text_date = new wxStaticText(this, wxID_STATIC, _("Date")); //Text field for day of the week - itemStaticTextWeek = new wxStaticText( itemPanel7, ID_DIALOG_TRANS_WEEK, wxT("")); + itemStaticTextWeek_ = new wxStaticText(this, ID_DIALOG_TRANS_WEEK, wxT("")); - wxDateTime trx_date_ = mmGetStorageStringAsDate(getLastTrxDate()); - dpc_ = new wxDatePickerCtrl( itemPanel7, ID_DIALOG_TRANS_BUTTONDATE, trx_date_, - wxDefaultPosition, wxSize(110, -1), wxDP_DROPDOWN | wxDP_SHOWCENTURY); + wxDateTime trx_date = mmGetStorageStringAsDate(getLastTrxDate()); + dpc_ = new wxDatePickerCtrl( this, ID_DIALOG_TRANS_BUTTONDATE, trx_date, + wxDefaultPosition, wxSize(130, -1), + wxDP_DROPDOWN|wxDP_SHOWCENTURY|wxDP_ALLOWNONE); 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(mmGetNiceDateString(trx_date).substr(0,3)); -// change properties depending on system parameters wxSize spinCtrlSize = wxSize(18,22); int spinCtrlDirection = wxSP_VERTICAL; - int interval = 4; #ifdef __WXGTK__ - spinCtrlSize = wxSize(16,-1); - interval = 0; - //In linux by default nothing in focus therefore keystrokes does not working - dpc_ -> SetFocus(); - //Another events does not working - dpc_->Connect(ID_DIALOG_TRANS_BUTTONDATE, wxEVT_KEY_UP, wxKeyEventHandler(mmTransDialog::OnButtonDateChar), NULL, this); + dpc_->Connect(ID_DIALOG_TRANS_BUTTONDATE, wxEVT_KEY_DOWN, + wxKeyEventHandler(mmTransDialog::OnButtonDateChar), NULL, this); #endif - spinCtrl_ = new wxSpinButton(itemPanel7,ID_DIALOG_TRANS_SPINNER,wxDefaultPosition,spinCtrlSize,spinCtrlDirection|wxSP_ARROW_KEYS|wxSP_WRAP); + spinCtrl_ = new wxSpinButton(this, ID_DIALOG_TRANS_SPINNER, + wxDefaultPosition,wxSize(18,22), spinCtrlDirection|wxSP_ARROW_KEYS|wxSP_WRAP); spinCtrl_ -> SetRange (-32768, 32768); spinCtrl_->SetToolTip(_("Retard or advance the date of the transaction")); - itemFlexGridSizer8->Add(itemStaticText15, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 0); + flex_sizer->Add(text_date, flags); wxBoxSizer* itemBoxSizer118 = new wxBoxSizer(wxHORIZONTAL); - itemFlexGridSizer8->Add(itemBoxSizer118, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 0); - itemBoxSizer118->Add(dpc_, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 0); - itemBoxSizer118->Add(spinCtrl_, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, interval); - itemBoxSizer118->Add(itemStaticTextWeek, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxTOP|wxLEFT, 5); + flex_sizer->Add(itemBoxSizer118); + itemBoxSizer118->Add(dpc_, flags); + itemBoxSizer118->Add(spinCtrl_, flags); + itemBoxSizer118->Add(itemStaticTextWeek_, flags); // Status -------------------------------------------- - wxStaticText* itemStaticText51 = new wxStaticText( itemPanel7, wxID_STATIC, _("Status")); - wxArrayString choiceStatusStrings; - choiceStatusStrings.Add(_("None")); - choiceStatusStrings.Add(_("Reconciled")); - choiceStatusStrings.Add(_("Void")); - choiceStatusStrings.Add(_("Follow up")); - choiceStatusStrings.Add(_("Duplicate")); + wxStaticText* text_status = new wxStaticText(this, wxID_STATIC, _("Status")); + choiceStatus_ = new wxChoice(this, ID_DIALOG_TRANS_STATUS); + wxString transaction_status[] = + { + wxTRANSLATE("None"), + wxTRANSLATE("Reconciled"), + wxTRANSLATE("Void"), + wxTRANSLATE("Follow up"), + wxTRANSLATE("Duplicate") + }; + for(size_t i = 0; i < sizeof(transaction_status)/sizeof(wxString); ++i) + choiceStatus_->Append(wxGetTranslation(transaction_status[i]), + new wxStringClientData(transaction_status[i])); + choiceStatus_->SetSelection(mmIniOptions::instance().transStatusReconciled_); - choiceStatus_ = new wxChoice( itemPanel7, ID_DIALOG_TRANS_STATUS, wxDefaultPosition, wxSize(110, -1), choiceStatusStrings); - choiceStatus_->SetSelection(mmIniOptions::instance().transStatusReconciled_); choiceStatus_->SetToolTip(_("Specify the status for the transaction")); - choiceStatus_->Connect(ID_DIALOG_TRANS_STATUS, wxEVT_CHAR, wxKeyEventHandler(mmTransDialog::onChoiceStatusChar), NULL, this); - itemFlexGridSizer8->Add(itemStaticText51, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 0); - itemFlexGridSizer8->Add(choiceStatus_, 0, wxALIGN_CENTER_VERTICAL|wxALL, 0); + flex_sizer->Add(text_status, flags); + flex_sizer->Add(choiceStatus_, flags); // Type -------------------------------------------- - wxStaticText* itemStaticText5 = new wxStaticText( itemPanel7, wxID_STATIC, _("Type"), wxDefaultPosition, wxDefaultSize, 0 ); + wxStaticText* text_type = new wxStaticText(this, + wxID_STATIC, _("Type")); + choiceTrans_ = new wxChoice(this, ID_DIALOG_TRANS_TYPE); + wxString transaction_type[] = + { + wxTRANSLATE("Withdrawal"), + wxTRANSLATE("Deposit"), + wxTRANSLATE("Transfer") + }; // Restrict choise if accounts number less than 2 - wxArrayString choiceTypeStrings; - choiceTypeStrings.Add(_("Withdrawal")); - choiceTypeStrings.Add(_("Deposit")); - if (core_->getNumBankAccounts() > 1) choiceTypeStrings.Add(_("Transfer")); - choiceTrans_ = new wxChoice(itemPanel7, ID_DIALOG_TRANS_TYPE, wxDefaultPosition, wxSize(110, -1),choiceTypeStrings); - + size_t size = sizeof(transaction_type)/sizeof(wxString); + if (core_->getNumBankAccounts() < 2) size--; + for(size_t i = 0; i < size; ++i) + choiceTrans_->Append(wxGetTranslation(transaction_type[i]), + new wxStringClientData(transaction_type[i])); + choiceTrans_->SetSelection(0); choiceTrans_->SetToolTip(_("Specify the type of transactions to be created.")); - choiceTrans_->Connect(ID_DIALOG_TRANS_TYPE, wxEVT_CHAR, wxKeyEventHandler(mmTransDialog::onChoiceTransChar), NULL, this); - cAdvanced_ = new wxCheckBox( itemPanel7, ID_DIALOG_TRANS_ADVANCED_CHECKBOX, _("Advanced"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE ); + cAdvanced_ = new wxCheckBox(this, + ID_DIALOG_TRANS_ADVANCED_CHECKBOX, _("Adv."), + 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); - typeSizer->Add(cAdvanced_, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxALL, 5); + typeSizer->Add(choiceTrans_, flags); + typeSizer->Add(cAdvanced_, flags); - itemFlexGridSizer8->Add(itemStaticText5, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 0); - itemFlexGridSizer8->Add(typeSizer, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 0); + flex_sizer->Add(text_type, flags); + flex_sizer->Add(typeSizer); // Amount Fields -------------------------------------------- amountNormalTip_ = _("Specify the amount for this transaction"); amountTransferTip_ = _("Specify the amount to be transfered"); - wxStaticText* amountStaticText = new wxStaticText( itemPanel7, wxID_STATIC, _("Amount")); + wxStaticText* text_amount = new wxStaticText( this, wxID_STATIC, _("Amount")); - textAmount_ = new wxTextCtrl( itemPanel7, ID_DIALOG_TRANS_TEXTAMOUNT, wxT(""), wxDefaultPosition, wxSize(110, -1), - //use wxTE_PROCESS_ENTER flag when creating the control to generate EVT_TEXT_ENTER events - wxALIGN_RIGHT|wxTE_PROCESS_ENTER , doubleValidator() ); + textAmount_ = new wxTextCtrl( this, + ID_DIALOG_TRANS_TEXTAMOUNT, wxT(""), wxDefaultPosition, wxSize(110, -1), + wxALIGN_RIGHT); textAmount_->SetToolTip(amountNormalTip_); - //textAmount_->SetBackgroundColour(mmColors::listDetailsPanelColor); - textAmount_->Connect(ID_DIALOG_TRANS_TEXTAMOUNT, wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler(mmTransDialog::onTextEntered), NULL, this); - toTextAmount_ = new wxTextCtrl( itemPanel7, ID_DIALOG_TRANS_TOTEXTAMOUNT, wxT(""), wxDefaultPosition, wxSize(110, -1), - wxALIGN_RIGHT|wxTE_PROCESS_ENTER, doubleValidator() ); + toTextAmount_ = new wxTextCtrl( this, + ID_DIALOG_TRANS_TOTEXTAMOUNT, wxT(""), wxDefaultPosition, wxSize(110, -1), + wxALIGN_RIGHT); toTextAmount_->SetToolTip(_("Specify the transfer amount in the To Account")); - //toTextAmount_->SetBackgroundColour(mmColors::listDetailsPanelColor); - toTextAmount_->Connect(ID_DIALOG_TRANS_TOTEXTAMOUNT, wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler(mmTransDialog::onTextEntered), NULL, this); wxBoxSizer* amountSizer = new wxBoxSizer(wxHORIZONTAL); - amountSizer->Add(textAmount_, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 0); - amountSizer->Add(toTextAmount_, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 5); + amountSizer->Add(textAmount_, flags); + amountSizer->Add(toTextAmount_, flags); - itemFlexGridSizer8->Add(amountStaticText, 0, wxALIGN_LEFT|wxALL, 0); - itemFlexGridSizer8->Add(amountSizer, 0, wxALIGN_CENTER_VERTICAL|wxALL, 0); + flex_sizer->Add(text_amount, flags); + flex_sizer->Add(amountSizer); // Payee --------------------------------------------- - wxStaticText* itemStaticText9 = new wxStaticText(itemPanel7, ID_DIALOG_TRANS_STATIC_PAYEE, _("Payee"), wxDefaultPosition, wxDefaultSize, 0 ); + wxStaticText* text_payee = new wxStaticText(this, ID_DIALOG_TRANS_STATIC_PAYEE, _("Payee")); wxString payeeName = resetPayeeString(); wxString categString; @@ -400,103 +398,108 @@ } if ( mmIniOptions::instance().transCategorySelectionNone_== 0 || categString.IsEmpty() ) - { categString = resetCategoryString(); - } } - bPayee_ = new wxButton( itemPanel7, ID_DIALOG_TRANS_BUTTONPAYEE, payeeName, wxDefaultPosition, wxSize(225, -1), 0 ); + bPayee_ = new wxButton( this, ID_DIALOG_TRANS_BUTTONPAYEE, payeeName, + wxDefaultPosition, wxSize(230, -1)); 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::OnButtonPayeeChar), NULL, this); bPayee_->Connect(wxEVT_MOUSEWHEEL, wxMouseEventHandler(mmTransDialog::OnButtonPayeeMouse), NULL, this); - itemFlexGridSizer8->Add(itemStaticText9, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 0); - itemFlexGridSizer8->Add(bPayee_, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 0); + flex_sizer->Add(text_payee, flags); + flex_sizer->Add(bPayee_, flags); // Payee Alternate ------------------------------------------------ - wxStaticText* itemStaticText13 = new wxStaticText( itemPanel7, ID_DIALOG_TRANS_STATIC_FROM, wxT(" "), wxDefaultPosition, wxDefaultSize, 0 ); - bTo_ = new wxButton( itemPanel7, ID_DIALOG_TRANS_BUTTONTO, _("Select To Acct"), wxDefaultPosition, wxSize(225, -1), 0 ); + wxStaticText* text_to = new wxStaticText(this, + ID_DIALOG_TRANS_STATIC_FROM, wxT(" "), wxDefaultPosition, + wxSize(-1, wxSize(bPayee_->GetSize()).GetHeight())); + bTo_ = new wxButton( this, ID_DIALOG_TRANS_BUTTONTO, _("Select To Acct"), + wxDefaultPosition, wxSize(bPayee_->GetSize())); bTo_->SetToolTip(_("Specify which account the transfer is going to")); bTo_->Connect(wxEVT_CHAR, wxKeyEventHandler(mmTransDialog::OnButtonToAccountChar), NULL, this); bTo_->Connect(wxEVT_MOUSEWHEEL, wxMouseEventHandler(mmTransDialog::OnButtonToAccountMouse), NULL, this); - itemFlexGridSizer8->Add(itemStaticText13, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxUP, 0); - itemFlexGridSizer8->Add(bTo_, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxUP, 0); + flex_sizer->Add(text_to, flags); + flex_sizer->Add(bTo_, flags); // Split Category ------------------------------------------- - cSplit_ = new wxCheckBox( itemPanel7, ID_DIALOG_TRANS_SPLITCHECKBOX, _("Split"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE ); + cSplit_ = new wxCheckBox(this, 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); + flex_sizer->AddSpacer(20); // Fill empty space. + flex_sizer->Add(cSplit_, flags); // Category ------------------------------------------------- - wxStaticText* itemStaticText17 = new wxStaticText( itemPanel7, wxID_STATIC, _("Category") ); - bCategory_ = new wxButton( itemPanel7, ID_DIALOG_TRANS_BUTTONCATEGS, categString, wxDefaultPosition, wxSize(225, -1), 0 ); + wxStaticText* text_category = new wxStaticText(this, wxID_STATIC, _("Category")); + bCategory_ = new wxButton(this, ID_DIALOG_TRANS_BUTTONCATEGS, categString, + wxDefaultPosition, wxSize(bPayee_->GetSize())); 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); + flex_sizer->Add(text_category, flags); + flex_sizer->Add(bCategory_, flags); // Number --------------------------------------------- - wxStaticText* itemStaticText11 = new wxStaticText( itemPanel7, wxID_STATIC, _("Number"), wxDefaultPosition, wxDefaultSize, 0 ); - textNumber_ = new wxTextCtrl( itemPanel7, ID_DIALOG_TRANS_TEXTNUMBER, wxT(""), wxDefaultPosition, wxSize(185, -1), wxTE_PROCESS_ENTER ); + wxStaticText* text_number = new wxStaticText(this, wxID_STATIC, _("Number")); + textNumber_ = new wxTextCtrl(this, + ID_DIALOG_TRANS_TEXTNUMBER, wxT(""), wxDefaultPosition, + wxSize(180, -1), wxTE_PROCESS_ENTER); textNumber_->SetToolTip(_("Specify any associated check number or transaction number")); - //textNumber_->SetBackgroundColour(mmColors::listDetailsPanelColor); - textNumber_->Connect(ID_DIALOG_TRANS_TEXTNUMBER, wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler(mmTransDialog::onTextEntered), NULL, this); - bAuto_ = new wxButton( itemPanel7, ID_DIALOG_TRANS_BUTTONTRANSNUM, wxT("..."), wxDefaultPosition, wxSize(40, -1), 0 ); + bAuto_ = new wxButton(this, + ID_DIALOG_TRANS_BUTTONTRANSNUM, wxT("..."), wxDefaultPosition, wxSize(40, -1)); bAuto_->SetToolTip(_("Populate Transaction #")); - bAuto_ -> Connect(ID_DIALOG_TRANS_BUTTONTRANSNUM, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(mmTransDialog::OnAutoTransNum), NULL, this); + bAuto_ -> Connect(ID_DIALOG_TRANS_BUTTONTRANSNUM, + wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(mmTransDialog::OnAutoTransNum), NULL, this); - itemFlexGridSizer8->Add(itemStaticText11, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 0); + flex_sizer->Add(text_number, flags); wxBoxSizer* itemBoxSizer550 = new wxBoxSizer(wxHORIZONTAL); - itemFlexGridSizer8->Add(itemBoxSizer550, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 0); - itemBoxSizer550->Add(textNumber_, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 0); - itemBoxSizer550->Add(bAuto_, 0, wxALIGN_CENTER_VERTICAL|wxALL, 0); + flex_sizer->Add(itemBoxSizer550); + itemBoxSizer550->Add(textNumber_, flags); + itemBoxSizer550->Add(bAuto_, flags); // Notes --------------------------------------------- - wxStaticText* notesStaticText = new wxStaticText( itemPanel7, wxID_STATIC, _("Notes"), wxDefaultPosition, wxDefaultSize, 0 ); + wxStaticText* text_notes = new wxStaticText(this, + wxID_STATIC, _("Notes")); - 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_ = new wxButton(this, + ID_DIALOG_TRANS_BUTTON_FREQENTNOTES, wxT("..."), wxDefaultPosition, wxSize(40, -1)); bFrequentUsedNotes_->SetToolTip(_("Select one of the frequently used notes")); - bFrequentUsedNotes_ -> Connect(ID_DIALOG_TRANS_BUTTON_FREQENTNOTES, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(mmTransDialog::OnFrequentUsedNotes), NULL, this); + bFrequentUsedNotes_ -> Connect(ID_DIALOG_TRANS_BUTTON_FREQENTNOTES, + wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(mmTransDialog::OnFrequentUsedNotes), NULL, this); - wxBoxSizer* itemBoxSizer56 = new wxBoxSizer(wxVERTICAL); + textNotes_ = new wxTextCtrl(this, + ID_DIALOG_TRANS_TEXTNOTES, wxT(""), wxDefaultPosition, wxSize(-1,80), wxTE_MULTILINE); + textNotes_->SetToolTip(_("Specify any text notes you want to add to this transaction.")); - itemFlexGridSizer8->Add(itemBoxSizer56, 0, wxGROW|wxALIGN_RIGHT|wxALIGN_TOP|wxALL, 0); - itemBoxSizer56->Add(notesStaticText, 0, wxALIGN_LEFT|wxALIGN_TOP|wxALL|wxADJUST_MINSIZE, 0); - itemBoxSizer56->Add(bFrequentUsedNotes_, 0, wxALIGN_RIGHT|wxALIGN_TOP|wxALL|wxADJUST_MINSIZE, 10); - itemFlexGridSizer8->Add(textNotes_, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxEAST, 0); + flex_sizer->Add(text_notes, flags); + flex_sizer->Add(bFrequentUsedNotes_, flags.Right()); + box_sizer->Add(textNotes_, flagsExpand.Border(wxLEFT|wxRIGHT|wxBOTTOM, 10)); SetTransferControls(); // hide appropriate fields /********************************************************************************************** Button Panel with OK and Cancel Buttons ***********************************************************************************************/ - wxPanel* itemPanel25 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - itemBoxSizer2->Add(itemPanel25, 5, wxALIGN_RIGHT|wxTOP|wxDOWN, 10); + wxPanel* itemPanel25 = new wxPanel(this, wxID_ANY); + box_sizer1->Add(itemPanel25, flags.Right().Border(0)); - wxStdDialogButtonSizer* itemStdDialogButtonSizer1 = new wxStdDialogButtonSizer; - itemPanel25->SetSizer(itemStdDialogButtonSizer1); - //itemPanel25->SetBackgroundColour(mmColors::listBackColor); + wxStdDialogButtonSizer* buttons_sizer = new wxStdDialogButtonSizer; + itemPanel25->SetSizer(buttons_sizer); - wxButton* itemButtonOK = new wxButton( itemPanel25, wxID_OK, _("&OK")); - itemStdDialogButtonSizer1->Add(itemButtonOK, flags); + wxButton* itemButtonOK = new wxButton( itemPanel25, wxID_OK); + buttons_sizer->Add(itemButtonOK, flags.Border(wxLEFT|wxBOTTOM, 10)); - wxButton* itemButtonCancel = new wxButton( itemPanel25, wxID_CANCEL, _("&Cancel")); - itemStdDialogButtonSizer1->Add(itemButtonCancel, 0, wxALIGN_RIGHT|wxLEFT|wxRIGHT, 10); + wxButton* itemButtonCancel = new wxButton( itemPanel25, wxID_CANCEL); + buttons_sizer->Add(itemButtonCancel, flags); if (edit_) itemButtonCancel->SetFocus(); - itemStdDialogButtonSizer1->Realize(); + buttons_sizer->Realize(); //If nothing in focus Alt+C should close the window richText_ = false; @@ -621,8 +624,9 @@ { //get weekday name wxString dateStr = mmGetNiceDateString(event.GetDate()); - dateStr = dateStr.substr(0,dateStr.Find(wxT(","))); - itemStaticTextWeek->SetLabel(dateStr); + //FIXME: + dateStr = dateStr.substr(0, 3/*dateStr.Find(wxT(","))*/); + itemStaticTextWeek_->SetLabel(dateStr); event.Skip(); } Modified: branches/0.9.9.0/mmex/src/transdialog.h =================================================================== --- branches/0.9.9.0/mmex/src/transdialog.h 2012-07-02 07:34:56 UTC (rev 2678) +++ branches/0.9.9.0/mmex/src/transdialog.h 2012-07-02 07:35:25 UTC (rev 2679) @@ -122,7 +122,7 @@ wxDatePickerCtrl* dpc_; wxSpinButton *spinCtrl_; - wxStaticText* itemStaticTextWeek; + wxStaticText* itemStaticTextWeek_; int categID_; int subcategID_; int payeeID_; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2012-07-02 08:36:34
|
Revision: 2681 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=2681&view=rev Author: vomikan Date: 2012-07-02 08:36:25 +0000 (Mon, 02 Jul 2012) Log Message: ----------- update Modified Paths: -------------- branches/0.9.9.0/mmex/src/transdialog.cpp branches/0.9.9.0/mmex/src/transdialog.h Modified: branches/0.9.9.0/mmex/src/transdialog.cpp =================================================================== --- branches/0.9.9.0/mmex/src/transdialog.cpp 2012-07-02 08:14:57 UTC (rev 2680) +++ branches/0.9.9.0/mmex/src/transdialog.cpp 2012-07-02 08:36:25 UTC (rev 2681) @@ -182,7 +182,7 @@ } choiceStatus_->SetSelection(wxString(wxT("NRVFD")).Find(statusString)); - choiceTrans_->SetStringSelection(wxGetTranslation(transTypeString)); + transaction_type_->SetStringSelection(wxGetTranslation(transTypeString)); updateControlsForTransType(); payeeID_ = q1.GetInt(wxT("PAYEEID")); @@ -319,7 +319,7 @@ wxStaticText* text_type = new wxStaticText(this, wxID_STATIC, _("Type")); - choiceTrans_ = new wxChoice(this, ID_DIALOG_TRANS_TYPE); + transaction_type_ = new wxChoice(this, ID_DIALOG_TRANS_TYPE); wxString transaction_type[] = { wxTRANSLATE("Withdrawal"), @@ -330,11 +330,11 @@ size_t size = sizeof(transaction_type)/sizeof(wxString); if (core_->getNumBankAccounts() < 2) size--; for(size_t i = 0; i < size; ++i) - choiceTrans_->Append(wxGetTranslation(transaction_type[i]), + transaction_type_->Append(wxGetTranslation(transaction_type[i]), new wxStringClientData(transaction_type[i])); - choiceTrans_->SetSelection(0); - choiceTrans_->SetToolTip(_("Specify the type of transactions to be created.")); + transaction_type_->SetSelection(0); + transaction_type_->SetToolTip(_("Specify the type of transactions to be created.")); cAdvanced_ = new wxCheckBox(this, ID_DIALOG_TRANS_ADVANCED_CHECKBOX, _("Adv."), @@ -343,7 +343,7 @@ cAdvanced_->SetToolTip(_("Allows the setting of different amounts in the FROM and TO accounts.")); wxBoxSizer* typeSizer = new wxBoxSizer(wxHORIZONTAL); - typeSizer->Add(choiceTrans_, flags); + typeSizer->Add(transaction_type_, flags); typeSizer->Add(cAdvanced_, flags); flex_sizer->Add(text_type, flags); @@ -502,7 +502,7 @@ void mmTransDialog::OnPayee(wxCommandEvent& /*event*/) { - if (choiceTrans_->GetSelection() == DEF_TRANSFER) + if (transaction_type_->GetSelection() == DEF_TRANSFER) { wxArrayString as = core_->getAccountsName(); @@ -718,7 +718,7 @@ wxStaticText* stp = (wxStaticText*)FindWindow(ID_DIALOG_TRANS_STATIC_PAYEE); wxStaticText* itemStaticText13 = (wxStaticText*)FindWindow(ID_DIALOG_TRANS_STATIC_FROM); - if (choiceTrans_->GetSelection() == DEF_WITHDRAWAL) + if (transaction_type_->GetSelection() == DEF_WITHDRAWAL) { displayControlsToolTips(DEF_WITHDRAWAL); SetTransferControls(); @@ -730,7 +730,7 @@ bPayee_->Enable(true); } - else if (choiceTrans_->GetSelection() == DEF_DEPOSIT) + else if (transaction_type_->GetSelection() == DEF_DEPOSIT) { displayControlsToolTips(DEF_DEPOSIT); SetTransferControls(); @@ -742,7 +742,7 @@ bPayee_->Enable(true); } - else if (choiceTrans_->GetSelection() == DEF_TRANSFER) + else if (transaction_type_->GetSelection() == DEF_TRANSFER) { displayControlsToolTips(DEF_TRANSFER, true); SetTransferControls(true); @@ -954,13 +954,13 @@ void mmTransDialog::OnOk(wxCommandEvent& /*event*/) { - wxString transCode = wxT(""); - wxStringClientData* type_obj = (wxStringClientData *)choiceStatus_->GetClientObject(choiceTrans_->GetSelection()); - if (type_obj) transCode = type_obj->GetData().Left(1); + wxString transaction_type = wxT(""); + wxStringClientData* type_obj = (wxStringClientData *)choiceStatus_->GetClientObject(transaction_type_->GetSelection()); + if (type_obj) transaction_type = type_obj->GetData(); if (payeeID_ == -1) { - if (transCode != TRANS_TYPE_TRANSFER_STR) + if (transaction_type != TRANS_TYPE_TRANSFER_STR) mmShowErrorMessageInvalid(this, _("Payee")); else mmShowErrorMessageInvalid(this, _("From Account ")); @@ -990,7 +990,7 @@ amount = split_->getTotalSplits(); if (amount < 0.0) { - if (choiceTrans_->GetSelection() == DEF_TRANSFER) { + if (transaction_type == TRANS_TYPE_TRANSFER_STR) { if (amount < 0) amount = - amount; } else { @@ -1029,7 +1029,7 @@ int toAccountID = -1; int fromAccountID = accountID_; - if (transCode == TRANS_TYPE_TRANSFER_STR) + if (transaction_type == TRANS_TYPE_TRANSFER_STR) { if (toID_ == -1) { @@ -1105,7 +1105,7 @@ pTransaction->accountID_ = fromAccountID; pTransaction->toAccountID_ = toAccountID; pTransaction->payee_ = core_->getPayeeSharedPtr(payeeID_); - pTransaction->transType_ = transCode; + pTransaction->transType_ = transaction_type; pTransaction->amt_ = amount; pTransaction->status_ = status; pTransaction->transNum_ = transNum; @@ -1305,11 +1305,11 @@ void mmTransDialog::activateSplitTransactionsDlg() { - SplitTransactionDialog dlg(core_, split_.get(), choiceTrans_->GetSelection(), this); + SplitTransactionDialog dlg(core_, split_.get(), transaction_type_->GetSelection(), this); if (dlg.ShowModal() == wxID_OK) { double amount = split_->getTotalSplits(); - if (choiceTrans_->GetSelection() == DEF_TRANSFER && amount < 0) + if (transaction_type_->GetSelection() == DEF_TRANSFER && amount < 0) amount = - amount; wxString dispAmount; mmex::formatDoubleToCurrencyEdit(amount, dispAmount); @@ -1329,7 +1329,7 @@ size_t c = 0; wxString currentPayeeName = bPayee_->GetLabel(); wxArrayString filtd; - if (choiceTrans_->GetSelection() != DEF_TRANSFER) + if (transaction_type_->GetSelection() != DEF_TRANSFER) { filtd = mmDBWrapper::filterPayees(db_.get(), wxT("")); if (filtd.IsEmpty()) //No payee present. Should be added one as minimum @@ -1377,7 +1377,7 @@ currentPayeeName = filtd.Item(c); bPayee_->SetLabel(currentPayeeName); - if (choiceTrans_->GetSelection() == DEF_TRANSFER) + if (transaction_type_->GetSelection() == DEF_TRANSFER) payeeID_ = core_->getAccountID(currentPayeeName); else payeeID_ = core_->getPayeeID(currentPayeeName); @@ -1408,19 +1408,19 @@ void mmTransDialog::onChoiceTransChar(wxKeyEvent& event) { - int i = choiceTrans_->GetSelection(); + int i = transaction_type_->GetSelection(); if (event.GetKeyCode()==WXK_DOWN) { if (i < (core_->getNumBankAccounts() > 1 ? DEF_TRANSFER : DEF_DEPOSIT)) { - choiceTrans_->SetSelection(++i); + transaction_type_->SetSelection(++i); } } else if (event.GetKeyCode()==WXK_UP) { if (i > DEF_WITHDRAWAL) { - choiceTrans_->SetSelection(--i); + transaction_type_->SetSelection(--i); } } else @@ -1546,7 +1546,7 @@ size_t c = 0; wxString currentPayeeName = bPayee_->GetLabel(); wxArrayString filtd; - if (choiceTrans_->GetSelection() == DEF_TRANSFER) + if (transaction_type_->GetSelection() == DEF_TRANSFER) { filtd = core_->getAccountsName(); if (filtd.IsEmpty()) @@ -1596,7 +1596,7 @@ currentPayeeName = filtd.Item(c); bPayee_->SetLabel(currentPayeeName); - if (choiceTrans_->GetSelection() == DEF_TRANSFER) + if (transaction_type_->GetSelection() == DEF_TRANSFER) payeeID_ = core_->getAccountID(currentPayeeName); else payeeID_ = core_->getPayeeID(currentPayeeName); Modified: branches/0.9.9.0/mmex/src/transdialog.h =================================================================== --- branches/0.9.9.0/mmex/src/transdialog.h 2012-07-02 08:14:57 UTC (rev 2680) +++ branches/0.9.9.0/mmex/src/transdialog.h 2012-07-02 08:36:25 UTC (rev 2681) @@ -117,7 +117,7 @@ wxString subCategoryName_; wxChoice* choiceStatus_; - wxChoice* choiceTrans_; + wxChoice* transaction_type_; bool edit_; wxDatePickerCtrl* dpc_; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2012-07-02 11:43:58
|
Revision: 2682 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=2682&view=rev Author: vomikan Date: 2012-07-02 11:43:46 +0000 (Mon, 02 Jul 2012) Log Message: ----------- update Modified Paths: -------------- branches/0.9.9.0/mmex/src/mmaccount.cpp branches/0.9.9.0/mmex/src/mmaccount.h branches/0.9.9.0/mmex/src/transdialog.cpp Modified: branches/0.9.9.0/mmex/src/mmaccount.cpp =================================================================== --- branches/0.9.9.0/mmex/src/mmaccount.cpp 2012-07-02 08:36:25 UTC (rev 2681) +++ branches/0.9.9.0/mmex/src/mmaccount.cpp 2012-07-02 11:43:46 UTC (rev 2682) @@ -246,7 +246,7 @@ return wxEmptyString; } -wxArrayString mmAccountList::getAccountsName(int except_id) const +wxArrayString mmAccountList::getAccountsName(const int except_id) const { wxArrayString as; for (const_iterator it = accounts_.begin(); it != accounts_.end(); ++ it) Modified: branches/0.9.9.0/mmex/src/mmaccount.h =================================================================== --- branches/0.9.9.0/mmex/src/mmaccount.h 2012-07-02 08:36:25 UTC (rev 2681) +++ branches/0.9.9.0/mmex/src/mmaccount.h 2012-07-02 11:43:46 UTC (rev 2682) @@ -84,7 +84,7 @@ boost::weak_ptr<mmCurrency> getCurrencyWeakPtr(int accountID) const; double getAccountBaseCurrencyConvRate(int accountID) const; wxString getName(int accountID) const; - wxArrayString getAccountsName(int except_id = -1) const; + wxArrayString getAccountsName(const int except_id = -1) const; wxString getAccountCurrencyDecimalChar(int accountID) const; wxString getAccountCurrencyGroupChar(int accountID) const; wxString getAccountCurrencyName(int accountID) const; Modified: branches/0.9.9.0/mmex/src/transdialog.cpp =================================================================== --- branches/0.9.9.0/mmex/src/transdialog.cpp 2012-07-02 08:36:25 UTC (rev 2681) +++ branches/0.9.9.0/mmex/src/transdialog.cpp 2012-07-02 11:43:46 UTC (rev 2682) @@ -579,7 +579,7 @@ if (as.IsEmpty()){ return; } - wxSingleChoiceDialog scd(0, _("Account name"), _("Select Account"), as); + wxSingleChoiceDialog scd(this, _("Account name"), _("Select Account"), as); if (scd.ShowModal() == wxID_OK) { wxString acctName = scd.GetStringSelection(); @@ -716,7 +716,7 @@ void mmTransDialog::updateControlsForTransType() { wxStaticText* stp = (wxStaticText*)FindWindow(ID_DIALOG_TRANS_STATIC_PAYEE); - wxStaticText* itemStaticText13 = (wxStaticText*)FindWindow(ID_DIALOG_TRANS_STATIC_FROM); + wxStaticText* text_to = (wxStaticText*)FindWindow(ID_DIALOG_TRANS_STATIC_FROM); if (transaction_type_->GetSelection() == DEF_WITHDRAWAL) { @@ -724,7 +724,7 @@ SetTransferControls(); stp->SetLabel(_("Payee")); bPayee_->SetToolTip(payeeWithdrawalTip_); - itemStaticText13->SetLabel(wxT("")); + text_to->SetLabel(wxT("")); if (payeeUnknown_) bPayee_->SetLabel(resetPayeeString()); bPayee_->Enable(true); @@ -736,7 +736,7 @@ SetTransferControls(); stp->SetLabel(_("From")); bPayee_->SetToolTip(payeeDepositTip_); - itemStaticText13->SetLabel(wxT("")); + text_to->SetLabel(wxT("")); if (payeeUnknown_) bPayee_->SetLabel(resetPayeeString()); bPayee_->Enable(true); @@ -751,12 +751,11 @@ stp->SetLabel(_("From")); bTo_->SetLabel(_("Select To Account")); - itemStaticText13->SetLabel(_("To")); + text_to->SetLabel(_("To")); toID_ = -1; payeeUnknown_ = true; - wxString acctName = core_->getAccountName(accountID_); - bPayee_->SetLabel(acctName); + bPayee_->SetLabel(core_->getAccountName(accountID_)); payeeID_ = accountID_; //from account button should be available for editing bPayee_->Enable(edit_); @@ -769,8 +768,7 @@ else categString = getMostFrequentlyUsedCategory(); - wxStaticText* stc = (wxStaticText*)FindWindow(ID_DIALOG_TRANS_BUTTONCATEGS); - stc->SetLabel(categString); + bCategory_->SetLabel(categString); } } } @@ -795,7 +793,7 @@ wxString mmTransDialog::resetCategoryString() { - wxString catStr = _("Select Category"); + const wxString catStr = _("Select Category"); categID_ = -1; subcategID_ = -1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2012-07-06 07:48:08
|
Revision: 2697 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=2697&view=rev Author: vomikan Date: 2012-07-06 07:47:57 +0000 (Fri, 06 Jul 2012) Log Message: ----------- update Modified Paths: -------------- branches/0.9.9.0/mmex/src/optionsdialog.cpp branches/0.9.9.0/mmex/src/univcsvdialog.cpp branches/0.9.9.0/mmex/src/util.cpp branches/0.9.9.0/mmex/src/util.h Modified: branches/0.9.9.0/mmex/src/optionsdialog.cpp =================================================================== --- branches/0.9.9.0/mmex/src/optionsdialog.cpp 2012-07-06 06:30:42 UTC (rev 2696) +++ branches/0.9.9.0/mmex/src/optionsdialog.cpp 2012-07-06 07:47:57 UTC (rev 2697) @@ -230,10 +230,8 @@ generalPanelSizer->Add(dateFormatStaticBoxSizer, 0, wxALIGN_LEFT|wxGROW|wxALL, 5); dateFormatStaticBoxSizer->Add(dateFormatSettingStaticBoxSizerGrid); - wxArrayString itemChoice7Strings = itemChoiceStrings(); - choiceDateFormat_ = new wxComboBox(generalPanel, ID_DIALOG_OPTIONS_DATE_FORMAT, wxT(""), - wxDefaultPosition, wxSize(140, -1), itemChoice7Strings); + wxDefaultPosition, wxSize(140, -1), date_format()); dateFormatSettingStaticBoxSizerGrid->Add(choiceDateFormat_, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); choiceDateFormat_->SetToolTip(_("Specify the date format for display")); choiceDateFormat_->SetValue(FormatDate2DisplayDate(dateFormat_)); Modified: branches/0.9.9.0/mmex/src/univcsvdialog.cpp =================================================================== --- branches/0.9.9.0/mmex/src/univcsvdialog.cpp 2012-07-06 06:30:42 UTC (rev 2696) +++ branches/0.9.9.0/mmex/src/univcsvdialog.cpp 2012-07-06 07:47:57 UTC (rev 2697) @@ -122,6 +122,10 @@ void mmUnivCSVDialog::CreateControls() { + wxSizerFlags flags, flagsExpand; + flags.Align(wxALIGN_LEFT|wxALIGN_TOP).Border(wxLEFT|wxRIGHT|wxTOP, 5); + flagsExpand.Align(wxALIGN_LEFT|wxALIGN_TOP).Border(wxLEFT|wxRIGHT|wxTOP, 5); + // Define the staticBox font and set it as wxFONTWEIGHT_BOLD wxFont staticBoxFontSetting = this->GetFont(); staticBoxFontSetting.SetWeight(wxFONTWEIGHT_BOLD); @@ -134,8 +138,8 @@ itemBoxSizer1->Add(itemBoxSizer11, 5, wxGROW|wxALL, 5); wxStaticText* itemStaticText3 = new wxStaticText(this, wxID_STATIC, - _("Specify the order of fields in the CSV file"), wxDefaultPosition, wxDefaultSize, 0); - itemBoxSizer2->Add(itemStaticText3, 0, wxGROW|wxALL|wxADJUST_MINSIZE, 5); + _("Specify the order of fields in the CSV file")); + itemBoxSizer2->Add(itemStaticText3, flags); itemStaticText3->SetFont(staticBoxFontSetting); wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxHORIZONTAL); @@ -151,21 +155,24 @@ //Add Remove Area wxPanel* itemPanel_AddRemove = new wxPanel(this, ID_PANEL10, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL); - itemBoxSizer3->Add(itemPanel_AddRemove, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 1); + itemBoxSizer3->Add(itemPanel_AddRemove, flags); wxBoxSizer* itemBoxSizer_AddRemove = new wxBoxSizer(wxVERTICAL); itemPanel_AddRemove->SetSizer(itemBoxSizer_AddRemove); //Add button - m_button_add_= new wxButton(itemPanel_AddRemove, wxID_ADD, _("Add"), - wxDefaultPosition, wxDefaultSize, 0); - itemBoxSizer_AddRemove->Add(m_button_add_, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + m_button_add_= new wxButton(itemPanel_AddRemove, wxID_ADD); + itemBoxSizer_AddRemove->Add(m_button_add_, flags); //Remove button - m_button_remove_ = new wxButton(itemPanel_AddRemove, wxID_REMOVE, _("Remove"), - wxDefaultPosition, wxDefaultSize, 0); - itemBoxSizer_AddRemove->Add(m_button_remove_, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + m_button_remove_ = new wxButton(itemPanel_AddRemove, wxID_REMOVE); + itemBoxSizer_AddRemove->Add(m_button_remove_, flags); + //Standard MMEX CSV + wxButton* itemButton_standard = new wxButton(itemPanel_AddRemove, wxID_STANDARD, _("&MMEX format")); + itemBoxSizer_AddRemove->Add(itemButton_standard, flags); + itemButton_standard->SetToolTip(_("MMEX standard format")); + //ListBox of attribute order csvListBox_ = new wxListBox(this, ID_LISTBOX, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_SINGLE|wxLB_NEEDED_SB); @@ -180,37 +187,27 @@ itemPanel_Arranger->SetSizer(itemBoxSizer_Arranger); //Move Up button - wxButton* itemButton_MoveUp = new wxButton(itemPanel_Arranger, wxID_UP, _("&Up"), - wxDefaultPosition, wxDefaultSize, 0); - itemBoxSizer_Arranger->Add(itemButton_MoveUp, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + wxButton* itemButton_MoveUp = new wxButton(itemPanel_Arranger, wxID_UP, _("&Up")); + itemBoxSizer_Arranger->Add(itemButton_MoveUp, flags); itemButton_MoveUp -> SetToolTip (_("Move Up")); //Move down button - wxButton* itemButton_MoveDown = new wxButton(itemPanel_Arranger, wxID_DOWN, _("&Down"), - wxDefaultPosition, wxDefaultSize, 0); - itemBoxSizer_Arranger->Add(itemButton_MoveDown, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + wxButton* itemButton_MoveDown = new wxButton(itemPanel_Arranger, wxID_DOWN, _("&Down")); + itemBoxSizer_Arranger->Add(itemButton_MoveDown, flags); itemButton_MoveDown -> SetToolTip (_("Move &Down")); - - //Standard MMEX CSV - wxButton* itemButton_standard = new wxButton(itemPanel_Arranger, wxID_STANDARD, _("&MMEX format"), - wxDefaultPosition, wxDefaultSize, 0); - itemBoxSizer_Arranger->Add(itemButton_standard, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - itemButton_standard->SetToolTip(_("MMEX standard format")); //Load Template button - wxButton* itemButton_Load = new wxButton(itemPanel_Arranger, wxID_OPEN, _("&Open"), - wxDefaultPosition, wxDefaultSize, 0); - itemBoxSizer_Arranger->Add(itemButton_Load, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + wxButton* itemButton_Load = new wxButton(itemPanel_Arranger, wxID_OPEN, _("&Open")); + itemBoxSizer_Arranger->Add(itemButton_Load, flags); itemButton_Load -> SetToolTip (_("Load Template")); //Save As Template button - wxButton* itemButton_Save = new wxButton(itemPanel_Arranger, wxID_SAVEAS, _("Save As..."), - wxDefaultPosition, wxDefaultSize, 0); - itemBoxSizer_Arranger->Add(itemButton_Save, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + wxButton* itemButton_Save = new wxButton(itemPanel_Arranger, wxID_SAVEAS, _("Save As...")); + itemBoxSizer_Arranger->Add(itemButton_Save, flags); itemButton_Save -> SetToolTip (_("Save Template")); wxStaticLine* m_staticline1 = new wxStaticLine(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - itemBoxSizer2->Add(m_staticline1, 0, wxEXPAND | wxALL, 5 ); + itemBoxSizer2->Add(m_staticline1, flagsExpand ); if (this->is_importer_) { @@ -222,7 +219,7 @@ itemPanel6->SetSizer(itemBoxSizer7); wxStaticText* itemStaticText5 = new wxStaticText(itemPanel6, wxID_ANY, _("File Name:"), wxDefaultPosition, wxDefaultSize, 0); - itemBoxSizer7->Add(itemStaticText5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + itemBoxSizer7->Add(itemStaticText5, flags); itemStaticText5->SetFont(staticBoxFontSetting); m_text_ctrl_ = new wxTextCtrl(itemPanel6, ID_FILE_NAME, wxEmptyString, wxDefaultPosition, wxSize(300, -1), wxTE_PROCESS_ENTER ); @@ -231,7 +228,7 @@ m_text_ctrl_->Connect(ID_FILE_NAME, wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler(mmUnivCSVDialog::OnFileNameEntered), NULL, this); wxButton* button_search = new wxButton(itemPanel6, wxID_SEARCH, _("&Search")); - itemBoxSizer7->Add(button_search, 0, wxALIGN_RIGHT|wxALL, 5); + itemBoxSizer7->Add(button_search, flags); } // account to import or export @@ -243,36 +240,32 @@ //TODO replace to _("Account: ") wxStaticText* itemStaticText6 = new wxStaticText(itemPanel7, wxID_ANY, _("Account :"), wxDefaultPosition, wxDefaultSize, 0); - itemBoxSizer8->Add(itemStaticText6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + itemBoxSizer8->Add(itemStaticText6, flags.Align(wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL)); itemStaticText6->SetFont(staticBoxFontSetting); wxArrayString as = core_->getAccountsName(); m_choice_account_ = new wxChoice(itemPanel7, wxID_ACCOUNT, wxDefaultPosition, wxSize(210, -1), as, 0); m_choice_account_->SetSelection(0); - itemBoxSizer8->Add(m_choice_account_, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5); + itemBoxSizer8->Add(m_choice_account_, flags); wxStaticLine* m_staticline2 = new wxStaticLine(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - itemBoxSizer2->Add(m_staticline2, 0, wxEXPAND | wxALL, 5 ); + itemBoxSizer2->Add(m_staticline2, flagsExpand ); - wxStaticText* itemStaticText66 = new wxStaticText(itemPanel7, wxID_ANY, wxString() << wxT(" ") << _("Date Format") << wxT(": "), wxDefaultPosition, wxDefaultSize, 0); - itemBoxSizer8->Add(itemStaticText66, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + wxStaticText* itemStaticText66 = new wxStaticText(itemPanel7, wxID_ANY, wxString(_("Date Format")) << wxT(": ")); + itemBoxSizer8->AddSpacer(10); + itemBoxSizer8->Add(itemStaticText66, flags); itemStaticText66->SetFont(staticBoxFontSetting); //itemStaticText66->Enable(!this->is_importer_); - wxArrayString itemChoice7Strings = itemChoiceStrings(); - wxArrayString DateFormat = DateFormats(); wxString default_date_format = mmDBWrapper::getInfoSettingValue(db_, wxT("DATEFORMAT"), mmex::DEFDATEFORMAT); - size_t i=0; - for(i; i<DateFormat.Count(); i++) + choiceDateFormat_ = new wxChoice(itemPanel7, ID_DIALOG_OPTIONS_DATE_FORMAT); + for(size_t i = 0; i < date_format_mask().Count(); ++i) { - if(default_date_format == DateFormat[i]) - break; + choiceDateFormat_->Append(date_format()[i], new wxStringClientData(date_format_mask()[i])); + if (default_date_format == date_format_mask()[i]) choiceDateFormat_->SetSelection(i); } - choiceDateFormat_ = new wxChoice(itemPanel7, ID_DIALOG_OPTIONS_DATE_FORMAT, wxDefaultPosition, wxSize(140, -1), itemChoice7Strings, 0); - choiceDateFormat_->SetSelection(i); - //choiceDateFormat_->Enable(!this->is_importer_); - itemBoxSizer8->Add(choiceDateFormat_, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5); + itemBoxSizer8->Add(choiceDateFormat_, flags); // CSV Delimiter wxString choices[] = { _("Comma"), _("Semicolon"), _("TAB"), _("User Defined")}; Modified: branches/0.9.9.0/mmex/src/util.cpp =================================================================== --- branches/0.9.9.0/mmex/src/util.cpp 2012-07-06 06:30:42 UTC (rev 2696) +++ branches/0.9.9.0/mmex/src/util.cpp 2012-07-06 07:47:57 UTC (rev 2697) @@ -1053,84 +1053,70 @@ wxString DisplayDate2FormatDate(wxString strDate) { - wxArrayString DateFormat = DateFormats(); - wxArrayString itemChoice7Strings = itemChoiceStrings(); - - for(size_t i=0; i<DateFormat.Count(); i++) - { - if(strDate == itemChoice7Strings[i]) - return DateFormat[i]; - } - - return DateFormat[0]; + if (int i = date_format().Index(strDate)) + return date_format_mask()[i]; + return date_format_mask()[0]; } wxString FormatDate2DisplayDate(wxString strDate) { - wxArrayString DateFormat = DateFormats(); - wxArrayString itemChoice7Strings = itemChoiceStrings(); - - for(size_t i=0; i<DateFormat.Count(); i++) - { - if(strDate == DateFormat[i]) - return itemChoice7Strings[i]; - } - - return itemChoice7Strings[0]; + if (int i = date_format_mask().Index(strDate)) + return date_format()[i]; + return date_format()[0]; } -wxArrayString DateFormats() { +const wxArrayString date_format_mask() { - wxArrayString DateFormat; + wxArrayString mask; - DateFormat.Add(wxT("%d/%m/%y")); - DateFormat.Add(wxT("%d/%m/%Y")); - DateFormat.Add(wxT("%d-%m-%y")); - DateFormat.Add(wxT("%d-%m-%Y")); - DateFormat.Add(wxT("%d.%m.%y")); - DateFormat.Add(wxT("%d.%m.%Y")); - DateFormat.Add(wxT("%d,%m,%y")); - DateFormat.Add(wxT("%d/%m'%Y")); - DateFormat.Add(wxT("%d/%m %Y")); - DateFormat.Add(wxT("%m/%d/%y")); - DateFormat.Add(wxT("%m/%d/%Y")); - DateFormat.Add(wxT("%m-%d-%y")); - DateFormat.Add(wxT("%m-%d-%Y")); - DateFormat.Add(wxT("%m/%d'%Y")); - DateFormat.Add(wxT("%y/%m/%d")); - DateFormat.Add(wxT("%y-%m-%d")); - DateFormat.Add(wxT("%Y/%m/%d")); - DateFormat.Add(wxT("%Y-%m-%d")); - DateFormat.Add(wxT("%Y.%m.%d")); - DateFormat.Add(wxT("%Y%m%d")); + mask.Add(wxT("%d/%m/%y")); + mask.Add(wxT("%d/%m/%Y")); + mask.Add(wxT("%d-%m-%y")); + mask.Add(wxT("%d-%m-%Y")); + mask.Add(wxT("%d.%m.%y")); + mask.Add(wxT("%d.%m.%Y")); + mask.Add(wxT("%d,%m,%y")); + mask.Add(wxT("%d/%m'%Y")); + mask.Add(wxT("%d/%m %Y")); + mask.Add(wxT("%m/%d/%y")); + mask.Add(wxT("%m/%d/%Y")); + mask.Add(wxT("%m-%d-%y")); + mask.Add(wxT("%m-%d-%Y")); + mask.Add(wxT("%m/%d'%Y")); + mask.Add(wxT("%y/%m/%d")); + mask.Add(wxT("%y-%m-%d")); + mask.Add(wxT("%Y/%m/%d")); + mask.Add(wxT("%Y-%m-%d")); + mask.Add(wxT("%Y.%m.%d")); + mask.Add(wxT("%Y%m%d")); - return DateFormat; + return mask; } -wxArrayString itemChoiceStrings() { +const wxArrayString date_format() { - wxArrayString itemChoice7Strings; + wxArrayString date_format; - itemChoice7Strings.Add(wxT("DD/MM/YY")); - itemChoice7Strings.Add(wxT("DD/MM/YYYY")); - itemChoice7Strings.Add(wxT("DD-MM-YY")); - itemChoice7Strings.Add(wxT("DD-MM-YYYY")); - itemChoice7Strings.Add(wxT("DD.MM.YY")); - itemChoice7Strings.Add(wxT("DD.MM.YYYY")); - itemChoice7Strings.Add(wxT("DD,MM,YY")); - itemChoice7Strings.Add(wxT("DD/MM'YYYY")); - itemChoice7Strings.Add(wxT("DD/MM YYYY")); - itemChoice7Strings.Add(wxT("MM/DD/YY")); - itemChoice7Strings.Add(wxT("MM/DD/YYYY")); - itemChoice7Strings.Add(wxT("MM-DD-YY")); - itemChoice7Strings.Add(wxT("MM-DD-YYYY")); - itemChoice7Strings.Add(wxT("MM/DD'YYYY")); - itemChoice7Strings.Add(wxT("YY/MM/DD")); - itemChoice7Strings.Add(wxT("YY-MM-DD")); - itemChoice7Strings.Add(wxT("YYYY/MM/DD")); - itemChoice7Strings.Add(wxT("YYYY-MM-DD")); - itemChoice7Strings.Add(wxT("YYYY.MM.DD")); - itemChoice7Strings.Add(wxT("YYYYMMDD")); + date_format.Add(wxT("DD/MM/YY")); + date_format.Add(wxT("DD/MM/YYYY")); + date_format.Add(wxT("DD-MM-YY")); + date_format.Add(wxT("DD-MM-YYYY")); + date_format.Add(wxT("DD.MM.YY")); + date_format.Add(wxT("DD.MM.YYYY")); + date_format.Add(wxT("DD,MM,YY")); + date_format.Add(wxT("DD/MM'YYYY")); + date_format.Add(wxT("DD/MM YYYY")); + date_format.Add(wxT("MM/DD/YY")); + date_format.Add(wxT("MM/DD/YYYY")); + date_format.Add(wxT("MM-DD-YY")); + date_format.Add(wxT("MM-DD-YYYY")); + date_format.Add(wxT("MM/DD'YYYY")); + date_format.Add(wxT("YY/MM/DD")); + date_format.Add(wxT("YY-MM-DD")); + date_format.Add(wxT("YYYY/MM/DD")); + date_format.Add(wxT("YYYY-MM-DD")); + date_format.Add(wxT("YYYY.MM.DD")); + date_format.Add(wxT("YYYYMMDD")); - return itemChoice7Strings; + return date_format; } Modified: branches/0.9.9.0/mmex/src/util.h =================================================================== --- branches/0.9.9.0/mmex/src/util.h 2012-07-06 06:30:42 UTC (rev 2696) +++ branches/0.9.9.0/mmex/src/util.h 2012-07-06 07:47:57 UTC (rev 2697) @@ -122,10 +122,10 @@ wxString mmGetNiceMonthName( int month ); wxString mmGetNiceShortMonthName( int month ); wxString mmGetNiceWeekDayName( int week_day ); -wxString DisplayDate2FormatDate(wxString strDate); -wxString FormatDate2DisplayDate(wxString strDate); -wxArrayString DateFormats(); -wxArrayString itemChoiceStrings(); +wxString DisplayDate2FormatDate(const wxString strDate); +wxString FormatDate2DisplayDate(const wxString strDate); +const wxArrayString date_format(); +const wxArrayString date_format_mask(); wxString inQuotes(wxString label, wxString& delimiter); wxString csv2tab_separated_values(wxString line, wxString& delimit); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2012-07-06 10:53:30
|
Revision: 2699 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=2699&view=rev Author: vomikan Date: 2012-07-06 10:53:24 +0000 (Fri, 06 Jul 2012) Log Message: ----------- performance improvements for save account settings Modified Paths: -------------- branches/0.9.9.0/mmex/src/mmcheckingpanel.cpp branches/0.9.9.0/mmex/src/mmcheckingpanel.h Modified: branches/0.9.9.0/mmex/src/mmcheckingpanel.cpp =================================================================== --- branches/0.9.9.0/mmex/src/mmcheckingpanel.cpp 2012-07-06 09:42:58 UTC (rev 2698) +++ branches/0.9.9.0/mmex/src/mmcheckingpanel.cpp 2012-07-06 10:53:24 UTC (rev 2699) @@ -500,6 +500,7 @@ /* Set up the transaction filter. The transFilter dialog will be destroyed when the checking panel is destroyed. */ transFilterActive_ = false; + settings_change_ = false; transFilterDlg_ = new TransFilterDialog(core_, this); initVirtualListControl(); @@ -515,29 +516,37 @@ */ void mmCheckingPanel::saveSettings() { - int cols = m_listCtrlAccount->GetColumnCount(); - - inidb_->Begin(); + bool transaction_start = false; + if (settings_change_) { - for (int i = 0; i < cols; ++i) - { - wxString name = wxString::Format(wxT("CHECK_COL%d_WIDTH"), i); - int width = m_listCtrlAccount->GetColumnWidth(i); - - mmDBWrapper::setINISettingValue(inidb_, name, wxString() << width); - } - // sorting column index + transaction_start = true; + inidb_->Begin(); mmDBWrapper::setINISettingValue(inidb_, wxT("CHECK_SORT_COL"), wxString() << g_sortcol); - + // asc\desc sorting flag mmDBWrapper::setINISettingValue(inidb_, wxT("CHECK_ASC"), wxString() << g_asc); - + mmDBWrapper::setInfoSettingValue(core_->db_.get(), wxString::Format(wxT("CHECK_FILTER_ID_%ld"), m_AccountID), m_currentView); } - inidb_->Commit(); + + //FIXME: avoid reading data if nothing changed. Use events, other words + for (int i = 0; i < m_listCtrlAccount->GetColumnCount(); ++i) + { + wxString parameter_name = wxString::Format(wxT("CHECK_COL%d_WIDTH"), i); + int current_width = m_listCtrlAccount->GetColumnWidth(i); + long stored_width = 0; + mmDBWrapper::getINISettingValue(inidb_, parameter_name, wxT("0")).ToLong(&stored_width); + if ((int)stored_width != current_width) + { + if (!transaction_start) {transaction_start = true; inidb_->Begin();}; + mmDBWrapper::setINISettingValue(inidb_, parameter_name, wxString()<<current_width); + } + } + + if (transaction_start) inidb_->Commit(); } //---------------------------------------------------------------------------- @@ -1242,6 +1251,7 @@ } bool show_filter_ = false; + settings_change_ = true; if (evt == MENU_VIEW_ALLTRANSACTIONS) { @@ -1392,7 +1402,8 @@ m_listCtrlAccount->DeleteAllItems(); initVirtualListControl(); - m_listCtrlAccount->RefreshItems(0, static_cast<long>(m_trans.size()) - 1); + if (m_trans.size() > 0) + m_listCtrlAccount->RefreshItems(0, static_cast<long>(m_trans.size()) - 1); } @@ -1404,6 +1415,8 @@ return; } + settings_change_ = true; + itemStaticTextMainFilter_->SetLabel(_("Viewing all transactions")); m_currentView = VIEW_TRANS_ALL_STR; itemStaticBitmap31_->Enable(true); @@ -1411,7 +1424,8 @@ m_listCtrlAccount->DeleteAllItems(); initVirtualListControl(); - m_listCtrlAccount->RefreshItems(0, static_cast<long>(m_trans.size()) - 1); + if (m_trans.size() > 0) + m_listCtrlAccount->RefreshItems(0, static_cast<long>(m_trans.size()) - 1); } @@ -1583,7 +1597,10 @@ setColumnImage(m_sortCol, m_asc ? ICON_ASC : ICON_DESC); m_cp->sortTable(); - RefreshItems(0, static_cast<long>(m_cp->m_trans.size()) - 1); // refresh everything + if (m_cp->m_trans.size() > 0) + RefreshItems(0, static_cast<long>(m_cp->m_trans.size()) - 1); // refresh everything + m_cp->settings_change_ = true; + wxSafeShowMessage(wxT("--"), wxT("--")); } //---------------------------------------------------------------------------- @@ -2007,7 +2024,8 @@ if ( dlg.ShowModal() == wxID_OK ) { m_cp->initVirtualListControl(); - RefreshItems(0, static_cast<long>(m_cp->m_trans.size()) - 1); + if (m_cp->m_trans.size() > 0) + RefreshItems(0, static_cast<long>(m_cp->m_trans.size()) - 1); if (m_selectedIndex != -1) { SetItemState(m_selectedIndex, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED); Modified: branches/0.9.9.0/mmex/src/mmcheckingpanel.h =================================================================== --- branches/0.9.9.0/mmex/src/mmcheckingpanel.h 2012-07-06 09:42:58 UTC (rev 2698) +++ branches/0.9.9.0/mmex/src/mmcheckingpanel.h 2012-07-06 10:53:24 UTC (rev 2699) @@ -104,6 +104,7 @@ TransFilterDialog* transFilterDlg_; bool transFilterActive_; double filteredBalance_; + bool settings_change_; TransactionListCtrl *m_listCtrlAccount; const int m_AccountID; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2012-07-06 12:23:59
|
Revision: 2700 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=2700&view=rev Author: vomikan Date: 2012-07-06 12:23:53 +0000 (Fri, 06 Jul 2012) Log Message: ----------- wxArrayInt used for remember columns width. If values did't changed - don't update settings Modified Paths: -------------- branches/0.9.9.0/mmex/src/mmcheckingpanel.cpp branches/0.9.9.0/mmex/src/mmcheckingpanel.h Modified: branches/0.9.9.0/mmex/src/mmcheckingpanel.cpp =================================================================== --- branches/0.9.9.0/mmex/src/mmcheckingpanel.cpp 2012-07-06 10:53:24 UTC (rev 2699) +++ branches/0.9.9.0/mmex/src/mmcheckingpanel.cpp 2012-07-06 12:23:53 UTC (rev 2700) @@ -94,7 +94,7 @@ /* Adds columns to list controls and setup their initial widths. */ -void createColumns(wxSQLite3Database *inidb_, wxListCtrl &lst) +void createColumns(wxSQLite3Database *inidb_, wxListCtrl &lst, wxArrayInt &columns_width_) { wxASSERT(inidb_); @@ -137,6 +137,7 @@ long width = -1; if (val.ToLong(&width)) lst.SetColumnWidth(i, width); + columns_width_.Add(width); } } //---------------------------------------------------------------------------- @@ -537,9 +538,8 @@ { wxString parameter_name = wxString::Format(wxT("CHECK_COL%d_WIDTH"), i); int current_width = m_listCtrlAccount->GetColumnWidth(i); - long stored_width = 0; - mmDBWrapper::getINISettingValue(inidb_, parameter_name, wxT("0")).ToLong(&stored_width); - if ((int)stored_width != current_width) + + if (columns_width_[i] != current_width) { if (!transaction_start) {transaction_start = true; inidb_->Begin();}; mmDBWrapper::setINISettingValue(inidb_, parameter_name, wxString()<<current_width); @@ -691,22 +691,21 @@ m_listCtrlAccount->setSortColumn(g_sortcol); m_listCtrlAccount->SetFocus(); - createColumns(inidb_, *m_listCtrlAccount); + createColumns(inidb_, *m_listCtrlAccount, columns_width_); - { // load the global variables - long val = COL_DEF_SORT; - wxString strVal = mmDBWrapper::getINISettingValue(inidb_, wxT("CHECK_SORT_COL"), wxString() << val); - if (strVal.ToLong(&val)) g_sortcol = toEColumn(val); - // -- - val = 1; // asc sorting default - strVal = mmDBWrapper::getINISettingValue(inidb_, wxT("CHECK_ASC"), wxString() << val); - if (strVal.ToLong(&val)) g_asc = val != 0; + // load the global variables + long val = COL_DEF_SORT; + wxString strVal = mmDBWrapper::getINISettingValue(inidb_, wxT("CHECK_SORT_COL"), wxString() << val); + if (strVal.ToLong(&val)) g_sortcol = toEColumn(val); + // -- + val = 1; // asc sorting default + strVal = mmDBWrapper::getINISettingValue(inidb_, wxT("CHECK_ASC"), wxString() << val); + if (strVal.ToLong(&val)) g_asc = val != 0; - // -- - 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->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) wxPanel *itemPanel12 = new wxPanel(itemSplitterWindow10, ID_PANEL1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL); Modified: branches/0.9.9.0/mmex/src/mmcheckingpanel.h =================================================================== --- branches/0.9.9.0/mmex/src/mmcheckingpanel.h 2012-07-06 10:53:24 UTC (rev 2699) +++ branches/0.9.9.0/mmex/src/mmcheckingpanel.h 2012-07-06 12:23:53 UTC (rev 2700) @@ -104,7 +104,6 @@ TransFilterDialog* transFilterDlg_; bool transFilterActive_; double filteredBalance_; - bool settings_change_; TransactionListCtrl *m_listCtrlAccount; const int m_AccountID; @@ -146,6 +145,8 @@ void showTips(); void updateExtraTransactionData(int selIndex); void saveSettings(); + bool settings_change_; + wxArrayInt columns_width_; /* Getter for Virtual List Control */ wxString getItem(long item, long column) const; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2012-07-06 13:04:53
|
Revision: 2701 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=2701&view=rev Author: vomikan Date: 2012-07-06 13:04:42 +0000 (Fri, 06 Jul 2012) Log Message: ----------- EVT_LIST_COL_END_DRAG usage Modified Paths: -------------- branches/0.9.9.0/mmex/src/mmcheckingpanel.cpp branches/0.9.9.0/mmex/src/mmcheckingpanel.h Modified: branches/0.9.9.0/mmex/src/mmcheckingpanel.cpp =================================================================== --- branches/0.9.9.0/mmex/src/mmcheckingpanel.cpp 2012-07-06 12:23:53 UTC (rev 2700) +++ branches/0.9.9.0/mmex/src/mmcheckingpanel.cpp 2012-07-06 13:04:42 UTC (rev 2701) @@ -94,7 +94,7 @@ /* Adds columns to list controls and setup their initial widths. */ -void createColumns(wxSQLite3Database *inidb_, wxListCtrl &lst, wxArrayInt &columns_width_) +void createColumns(wxSQLite3Database *inidb_, wxListCtrl &lst) { wxASSERT(inidb_); @@ -137,7 +137,6 @@ long width = -1; if (val.ToLong(&width)) lst.SetColumnWidth(i, width); - columns_width_.Add(width); } } //---------------------------------------------------------------------------- @@ -373,6 +372,7 @@ virtual wxListItemAttr *OnGetItemAttr(long item) const; void OnItemRightClick(wxListEvent& event); + void OnItemResize(wxListEvent& event); void OnListItemSelected(wxListEvent& event); void OnListItemDeselected(wxListEvent& event); void OnListItemActivated(wxListEvent& event); @@ -410,6 +410,7 @@ EVT_LIST_ITEM_DESELECTED(ID_PANEL_CHECKING_LISTCTRL_ACCT, TransactionListCtrl::OnListItemDeselected) EVT_LIST_ITEM_ACTIVATED(ID_PANEL_CHECKING_LISTCTRL_ACCT, TransactionListCtrl::OnListItemActivated) EVT_LIST_ITEM_RIGHT_CLICK(ID_PANEL_CHECKING_LISTCTRL_ACCT, TransactionListCtrl::OnItemRightClick) + EVT_LIST_COL_END_DRAG(ID_PANEL_CHECKING_LISTCTRL_ACCT, TransactionListCtrl::OnItemResize) EVT_MENU(MENU_TREEPOPUP_MARKRECONCILED, TransactionListCtrl::OnMarkTransaction) EVT_MENU(MENU_TREEPOPUP_MARKUNRECONCILED, TransactionListCtrl::OnMarkTransaction) @@ -517,11 +518,9 @@ */ void mmCheckingPanel::saveSettings() { - bool transaction_start = false; if (settings_change_) { // sorting column index - transaction_start = true; inidb_->Begin(); mmDBWrapper::setINISettingValue(inidb_, wxT("CHECK_SORT_COL"), wxString() << g_sortcol); @@ -531,22 +530,8 @@ mmDBWrapper::setInfoSettingValue(core_->db_.get(), wxString::Format(wxT("CHECK_FILTER_ID_%ld"), m_AccountID), m_currentView); + inidb_->Commit(); } - - //FIXME: avoid reading data if nothing changed. Use events, other words - for (int i = 0; i < m_listCtrlAccount->GetColumnCount(); ++i) - { - wxString parameter_name = wxString::Format(wxT("CHECK_COL%d_WIDTH"), i); - int current_width = m_listCtrlAccount->GetColumnWidth(i); - - if (columns_width_[i] != current_width) - { - if (!transaction_start) {transaction_start = true; inidb_->Begin();}; - mmDBWrapper::setINISettingValue(inidb_, parameter_name, wxString()<<current_width); - } - } - - if (transaction_start) inidb_->Commit(); } //---------------------------------------------------------------------------- @@ -691,7 +676,7 @@ m_listCtrlAccount->setSortColumn(g_sortcol); m_listCtrlAccount->SetFocus(); - createColumns(inidb_, *m_listCtrlAccount, columns_width_); + createColumns(inidb_, *m_listCtrlAccount); // load the global variables long val = COL_DEF_SORT; @@ -1443,6 +1428,15 @@ m_cp->updateExtraTransactionData(m_selectedIndex); } +void TransactionListCtrl::OnItemResize(wxListEvent& event) +{ + int i = event.GetColumn(); + wxString parameter_name = wxString::Format(wxT("CHECK_COL%d_WIDTH"), i); + int current_width = m_cp->m_listCtrlAccount->GetColumnWidth(i); + m_cp->inidb_->Begin(); + mmDBWrapper::setINISettingValue(m_cp->inidb_, parameter_name, wxString()<<current_width); + m_cp->inidb_->Commit(); +} void TransactionListCtrl::OnItemRightClick(wxListEvent& event) { m_selectedIndex = event.GetIndex(); @@ -1599,7 +1593,6 @@ if (m_cp->m_trans.size() > 0) RefreshItems(0, static_cast<long>(m_cp->m_trans.size()) - 1); // refresh everything m_cp->settings_change_ = true; - wxSafeShowMessage(wxT("--"), wxT("--")); } //---------------------------------------------------------------------------- Modified: branches/0.9.9.0/mmex/src/mmcheckingpanel.h =================================================================== --- branches/0.9.9.0/mmex/src/mmcheckingpanel.h 2012-07-06 12:23:53 UTC (rev 2700) +++ branches/0.9.9.0/mmex/src/mmcheckingpanel.h 2012-07-06 13:04:42 UTC (rev 2701) @@ -146,7 +146,6 @@ void updateExtraTransactionData(int selIndex); void saveSettings(); bool settings_change_; - wxArrayInt columns_width_; /* Getter for Virtual List Control */ wxString getItem(long item, long column) const; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2012-07-06 13:39:29
|
Revision: 2702 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=2702&view=rev Author: vomikan Date: 2012-07-06 13:39:20 +0000 (Fri, 06 Jul 2012) Log Message: ----------- EVT_LIST_COL_END_DRAG event used for write columns width if changed Modified Paths: -------------- branches/0.9.9.0/mmex/src/assetspanel.cpp branches/0.9.9.0/mmex/src/assetspanel.h Modified: branches/0.9.9.0/mmex/src/assetspanel.cpp =================================================================== --- branches/0.9.9.0/mmex/src/assetspanel.cpp 2012-07-06 13:04:42 UTC (rev 2701) +++ branches/0.9.9.0/mmex/src/assetspanel.cpp 2012-07-06 13:39:20 UTC (rev 2702) @@ -61,6 +61,7 @@ EVT_LIST_ITEM_RIGHT_CLICK(IDC_PANEL_STOCKS_LISTCTRL, assetsListCtrl::OnItemRightClick) EVT_LIST_ITEM_SELECTED(IDC_PANEL_STOCKS_LISTCTRL, assetsListCtrl::OnListItemSelected) EVT_LIST_ITEM_DESELECTED(IDC_PANEL_STOCKS_LISTCTRL, assetsListCtrl::OnListItemDeselected) + EVT_LIST_COL_END_DRAG(IDC_PANEL_STOCKS_LISTCTRL, assetsListCtrl::OnItemResize) EVT_MENU(MENU_TREEPOPUP_NEW, assetsListCtrl::OnNewAsset) EVT_MENU(MENU_TREEPOPUP_EDIT, assetsListCtrl::OnEditAsset) @@ -97,29 +98,22 @@ mmAssetsPanel::~mmAssetsPanel() { - try { - destroy(); - } catch (...) { - wxASSERT(false); - } } -void mmAssetsPanel::destroy() +void assetsListCtrl::OnItemResize(wxListEvent& event) { - inidb_->Begin(); - for (int i = 0; i < COL_MAX-1; ++i) - { - int width = m_listCtrlAssets->GetColumnWidth(i); - mmDBWrapper::setINISettingValue(inidb_, wxString::Format(wxT("ASSETS_COL%d_WIDTH"), i), wxString() << width); - } - inidb_->Commit(); + int i = event.GetColumn(); + m_cp->inidb_->Begin(); + int width = m_cp->m_listCtrlAssets->GetColumnWidth(i); + mmDBWrapper::setINISettingValue(m_cp->inidb_, + wxString::Format(wxT("ASSETS_COL%d_WIDTH"), i), wxString::Format(wxT("%d"), width)); + m_cp->inidb_->Commit(); } void mmAssetsPanel::CreateControls() { wxBoxSizer* itemBoxSizer9 = new wxBoxSizer(wxVERTICAL); this->SetSizer(itemBoxSizer9); - //this->SetBackgroundColour(mmColors::listBackColor); /* ---------------------- */ wxPanel* headerPanel = new wxPanel( this, wxID_ANY, wxDefaultPosition, Modified: branches/0.9.9.0/mmex/src/assetspanel.h =================================================================== --- branches/0.9.9.0/mmex/src/assetspanel.h 2012-07-06 13:04:42 UTC (rev 2701) +++ branches/0.9.9.0/mmex/src/assetspanel.h 2012-07-06 13:39:20 UTC (rev 2702) @@ -64,6 +64,7 @@ void OnListItemSelected(wxListEvent& event); void OnListItemDeselected(wxListEvent& event); void doRefreshItems(); + void OnItemResize(wxListEvent& event); }; /* Holds a single transaction */ @@ -95,9 +96,9 @@ wxSQLite3Database* getDb() const { return db_; } const std::vector<mmAssetHolder>& getTrans() const { return m_trans; } void updateExtraAssetData(int selIndex); + assetsListCtrl* m_listCtrlAssets; private: - assetsListCtrl* m_listCtrlAssets; boost::scoped_ptr<wxImageList> m_imageList; std::vector<mmAssetHolder> m_trans; @@ -111,7 +112,6 @@ void OnViewPopupSelected(wxCommandEvent& event); void sortTable(); - void destroy(); }; #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2012-07-06 15:36:04
|
Revision: 2703 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=2703&view=rev Author: vomikan Date: 2012-07-06 15:35:57 +0000 (Fri, 06 Jul 2012) Log Message: ----------- improvements Modified Paths: -------------- branches/0.9.9.0/mmex/src/mmyahoo.cpp branches/0.9.9.0/mmex/src/stockspanel.cpp branches/0.9.9.0/mmex/src/stockspanel.h branches/0.9.9.0/mmex/src/yahoosettingsdialog.cpp branches/0.9.9.0/mmex/src/yahoosettingsdialog.h Modified: branches/0.9.9.0/mmex/src/mmyahoo.cpp =================================================================== --- branches/0.9.9.0/mmex/src/mmyahoo.cpp 2012-07-06 13:39:20 UTC (rev 2702) +++ branches/0.9.9.0/mmex/src/mmyahoo.cpp 2012-07-06 15:35:57 UTC (rev 2703) @@ -71,6 +71,7 @@ /// ------------------------------------------------------------------ void mmYahoo::WriteSettings() { + inidb_->Begin(); // Status - Save to mmexini.db3 mmDBWrapper::setINISettingValue(inidb_, wxT("STOCKS_REFRESH_ENABLED"), wxString::Format(wxT("%d"),UpdatingEnabled_)); @@ -86,5 +87,7 @@ // Server mmDBWrapper::setInfoSettingValue(db_,wxT("HTTP_YAHOO_SERVER"),Server_); mmDBWrapper::setInfoSettingValue(db_,wxT("HTTP_YAHOO_SUFFIX"),Suffix_); + inidb_->Commit(); } + Modified: branches/0.9.9.0/mmex/src/stockspanel.cpp =================================================================== --- branches/0.9.9.0/mmex/src/stockspanel.cpp 2012-07-06 13:39:20 UTC (rev 2702) +++ branches/0.9.9.0/mmex/src/stockspanel.cpp 2012-07-06 15:35:57 UTC (rev 2703) @@ -132,35 +132,30 @@ delete StatusRefreshTimer_; } + //FIXME: that function very slow + //yahoo settings should be writed from yahoosettingsdialog if (yahoo_) delete yahoo_; + if (m_LED) delete m_LED; - long col0, col1, col2, col3, col4, col5, col6; - col0 = listCtrlAccount_->GetColumnWidth(COL_DATE); - col1 = listCtrlAccount_->GetColumnWidth(COL_NAME); - col2 = listCtrlAccount_->GetColumnWidth(COL_NUMBER); - col3 = listCtrlAccount_->GetColumnWidth(COL_VALUE); - col4 = listCtrlAccount_->GetColumnWidth(COL_GAIN_LOSS); - col5 = listCtrlAccount_->GetColumnWidth(COL_CURRENT); - col6 = listCtrlAccount_->GetColumnWidth(COL_NOTES); + //FIXME: write changes in OnItemResize(wxListEvent& event) function + if (true) + { + inidb_->Begin(); + for (int i = 0; i < COL_MAX; ++i) + { + int col_x = listCtrlAccount_->GetColumnWidth(i); + mmDBWrapper::setINISettingValue(inidb_, + wxString::Format(wxT("STOCKS_COL%d_WIDTH"), i), + wxString::Format(wxT("%d"),col_x)); + } + inidb_->Commit(); + } +} - wxString col0Str = wxString::Format(wxT("%d"), col0); - wxString col1Str = wxString::Format(wxT("%d"), col1); - wxString col2Str = wxString::Format(wxT("%d"), col2); - wxString col3Str = wxString::Format(wxT("%d"), col3); - wxString col4Str = wxString::Format(wxT("%d"), col4); - wxString col5Str = wxString::Format(wxT("%d"), col5); - wxString col6Str = wxString::Format(wxT("%d"), col6); - - inidb_->Begin(); - mmDBWrapper::setINISettingValue(inidb_, wxT("STOCKS_COL0_WIDTH"), col0Str); - mmDBWrapper::setINISettingValue(inidb_, wxT("STOCKS_COL1_WIDTH"), col1Str); - mmDBWrapper::setINISettingValue(inidb_, wxT("STOCKS_COL2_WIDTH"), col2Str); - mmDBWrapper::setINISettingValue(inidb_, wxT("STOCKS_COL3_WIDTH"), col3Str); - mmDBWrapper::setINISettingValue(inidb_, wxT("STOCKS_COL4_WIDTH"), col4Str); - mmDBWrapper::setINISettingValue(inidb_, wxT("STOCKS_COL5_WIDTH"), col5Str); - mmDBWrapper::setINISettingValue(inidb_, wxT("STOCKS_COL6_WIDTH"), col6Str); - inidb_->Commit(); +void stocksListCtrl::OnItemResize(wxListEvent& event) +{ + int i = event.GetColumn(); } void mmStocksPanel::CreateControls() @@ -218,50 +213,25 @@ listCtrlAccount_->InsertColumn(COL_DATE, _("Purchase Date")); wxListItem itemCol; itemCol.SetImage(-1); - //itemCol.SetAlign(wxLIST_FORMAT_LEFT); - itemCol.SetText(_("Share Name")); - listCtrlAccount_->InsertColumn(COL_NAME, itemCol); - itemCol.SetAlign(wxLIST_FORMAT_RIGHT); - itemCol.SetText(_("Number of Shares")); + const wxChar* columns[] = { _("Purchase Date"), + _("Share Name"), + _("Number of Shares"), + _("Gain/Loss"), + _("Value"), + _("Current"), + _("Notes")}; - listCtrlAccount_->InsertColumn(COL_NUMBER, itemCol); + for (int i = 0; i < COL_MAX; ++i) + { + itemCol.SetText(wxString() << columns[i]); + listCtrlAccount_->InsertColumn(i, columns[i], (i<2 || i>5 ? wxLIST_FORMAT_LEFT : wxLIST_FORMAT_RIGHT)); - itemCol.SetAlign(wxLIST_FORMAT_RIGHT); - itemCol.SetText(_("Gain/Loss")); + long col_x = -2; + mmDBWrapper::getINISettingValue(inidb_, wxString::Format(wxT("STOCKS_COL%d_WIDTH"), i), wxT("-2")).ToLong(&col_x); + listCtrlAccount_->SetColumnWidth(i, col_x); + } - listCtrlAccount_->InsertColumn(COL_GAIN_LOSS, itemCol); - - itemCol.SetAlign(wxLIST_FORMAT_RIGHT); - itemCol.SetText(_("Value")); - listCtrlAccount_->InsertColumn(COL_VALUE, itemCol); - - itemCol.SetAlign(wxLIST_FORMAT_RIGHT); - itemCol.SetText(_("Current")); - listCtrlAccount_->InsertColumn(COL_CURRENT, itemCol); - - itemCol.SetAlign(wxLIST_FORMAT_LEFT); - itemCol.SetText(_("Notes")); - listCtrlAccount_->InsertColumn(COL_NOTES, itemCol); - - /* See if we can get data from inidb */ - long col0, col1, col2, col3, col4, col5, col6; - mmDBWrapper::getINISettingValue(inidb_, wxT("STOCKS_COL0_WIDTH"), wxT("150")).ToLong(&col0); - mmDBWrapper::getINISettingValue(inidb_, wxT("STOCKS_COL1_WIDTH"), wxT("-2")).ToLong(&col1); - mmDBWrapper::getINISettingValue(inidb_, wxT("STOCKS_COL2_WIDTH"), wxT("-2")).ToLong(&col2); - mmDBWrapper::getINISettingValue(inidb_, wxT("STOCKS_COL3_WIDTH"), wxT("-2")).ToLong(&col3); - mmDBWrapper::getINISettingValue(inidb_, wxT("STOCKS_COL4_WIDTH"), wxT("-2")).ToLong(&col4); - mmDBWrapper::getINISettingValue(inidb_, wxT("STOCKS_COL5_WIDTH"), wxT("-2")).ToLong(&col5); - mmDBWrapper::getINISettingValue(inidb_, wxT("STOCKS_COL6_WIDTH"), wxT("-2")).ToLong(&col6); - - listCtrlAccount_->SetColumnWidth(COL_DATE, col0); - listCtrlAccount_->SetColumnWidth(COL_NAME, col1); - listCtrlAccount_->SetColumnWidth(COL_NUMBER, col2); - listCtrlAccount_->SetColumnWidth(COL_VALUE, col3); - listCtrlAccount_->SetColumnWidth(COL_GAIN_LOSS, col4); - listCtrlAccount_->SetColumnWidth(COL_CURRENT, col5); - listCtrlAccount_->SetColumnWidth(COL_NOTES, col6); - wxPanel* itemPanel12 = new wxPanel(itemSplitterWindow10, ID_PANEL1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL); Modified: branches/0.9.9.0/mmex/src/stockspanel.h =================================================================== --- branches/0.9.9.0/mmex/src/stockspanel.h 2012-07-06 13:39:20 UTC (rev 2702) +++ branches/0.9.9.0/mmex/src/stockspanel.h 2012-07-06 15:35:57 UTC (rev 2703) @@ -60,6 +60,7 @@ void OnListKeyDown(wxListEvent& event); void OnListItemSelected(wxListEvent& event); void OnListItemDeselected(wxListEvent& event); + void OnItemResize(wxListEvent& event); void OnNewStocks(wxCommandEvent& event); void OnDeleteStocks(wxCommandEvent& event); Modified: branches/0.9.9.0/mmex/src/yahoosettingsdialog.cpp =================================================================== --- branches/0.9.9.0/mmex/src/yahoosettingsdialog.cpp 2012-07-06 13:39:20 UTC (rev 2702) +++ branches/0.9.9.0/mmex/src/yahoosettingsdialog.cpp 2012-07-06 15:35:57 UTC (rev 2703) @@ -32,6 +32,7 @@ /////////////////////////////////////////////////////////////////////////// BEGIN_EVENT_TABLE( YahooSettingsDialog, wxDialog ) + EVT_BUTTON(wxID_OK, YahooSettingsDialog::OnButtonOK ) END_EVENT_TABLE() YahooSettingsDialog::YahooSettingsDialog( mmYahoo* myp, @@ -44,42 +45,39 @@ : wxDialog( parent, id, title, pos, size, style ), m_yahoopointer(myp) { - wxBoxSizer* bSizer1000; - bSizer1000 = new wxBoxSizer( wxVERTICAL ); + wxBoxSizer* bSizer_main = new wxBoxSizer( wxVERTICAL ); + this->SetSizer( bSizer_main ); - wxBoxSizer* bSizer1100; - bSizer1100 = new wxBoxSizer( wxVERTICAL ); + wxBoxSizer* bSizer1100 = new wxBoxSizer( wxVERTICAL ); + bSizer_main->Add(bSizer1100, 1, wxEXPAND | wxALL, 5); - wxFlexGridSizer* fgSizer_main; - fgSizer_main = new wxFlexGridSizer( 4, 2, 0, 0 ); - //fgSizer_main->AddGrowableCol( 2 ); - //fgSizer_main->SetFlexibleDirection( wxHORIZONTAL ); - //fgSizer_main->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + wxFlexGridSizer* fgSizer_flex = new wxFlexGridSizer( 0, 2, 0, 0 ); + bSizer1100->Add(fgSizer_flex, 1, wxEXPAND, 5); m_staticText34 = new wxStaticText( this, wxID_ANY, _("Yahoo Server"), wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer_main->Add( m_staticText34, 0, wxALIGN_RIGHT|wxALL, 5 ); + fgSizer_flex->Add( m_staticText34, 0, wxALIGN_RIGHT|wxALL, 5 ); m_YahooServer = new wxTextCtrl( this, idYahooServer, _("finance.au.yahoo.com"), wxDefaultPosition, wxDefaultSize, 0 ); m_YahooServer->SetToolTip( _("Do not enter anything except the server name (or IP address, if you're feeling lucky)") ); m_YahooServer->SetValue(m_yahoopointer->Server_); - fgSizer_main->Add( m_YahooServer, 0, wxALL|wxEXPAND, 5 ); + fgSizer_flex->Add( m_YahooServer, 0, wxALL|wxEXPAND, 5 ); m_staticText2 = new wxStaticText( this, wxID_ANY, _("Yahoo Suffix"), wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer_main->Add( m_staticText2, 0, wxALIGN_RIGHT|wxALL, 5 ); + fgSizer_flex->Add( m_staticText2, 0, wxALIGN_RIGHT|wxALL, 5 ); m_YahooSuffix = new wxTextCtrl( this, idYahooSuffix, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_YahooSuffix->SetToolTip( _("Enter the suffix used by Yahoo for the market of your stocks. \nIf your stocks are in multiple markets, leave this blank and add the suffix to each symbol in your portfolio.") ); m_YahooSuffix->SetValue(m_yahoopointer->Suffix_); - fgSizer_main->Add( m_YahooSuffix, 0, wxALL|wxEXPAND, 5 ); + fgSizer_flex->Add( m_YahooSuffix, 0, wxALL|wxEXPAND, 5 ); m_staticText3 = new wxStaticText( this, wxID_ANY, _("Market open from"), wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer_main->Add( m_staticText3, 0, wxALIGN_RIGHT|wxALL, 5 ); + fgSizer_flex->Add( m_staticText3, 0, wxALIGN_RIGHT|wxALL, 5 ); wxFlexGridSizer* fgSizer5; fgSizer5 = new wxFlexGridSizer( 1, 3, 0, 0 ); @@ -104,10 +102,10 @@ fgSizer5->Add( m_MarketOpenMinute, 0, wxALL, 5 ); - fgSizer_main->Add( fgSizer5, 1, wxEXPAND, 5 ); + fgSizer_flex->Add( fgSizer5, 1, wxEXPAND, 5 ); m_staticText4 = new wxStaticText( this, wxID_ANY, _("to"), wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer_main->Add( m_staticText4, 0, wxALIGN_RIGHT|wxALL, 5 ); + fgSizer_flex->Add( m_staticText4, 0, wxALIGN_RIGHT|wxALL, 5 ); wxFlexGridSizer* fgSizer6; fgSizer6 = new wxFlexGridSizer( 1, 3, 0, 0 ); @@ -132,13 +130,13 @@ fgSizer6->Add( m_MarketCloseMinute, 0, wxALL, 5 ); - fgSizer_main->Add( fgSizer6, 1, wxEXPAND, 5 ); + fgSizer_flex->Add( fgSizer6, 1, wxEXPAND, 5 ); m_checkBoxRefreshPrices = new wxCheckBox( this, idCBDoRefresh, _("&Refresh prices every"), wxDefaultPosition, wxDefaultSize, 0 ); m_checkBoxRefreshPrices->SetValue(m_yahoopointer->UpdatingEnabled_ ? true : false); - fgSizer_main->Add( m_checkBoxRefreshPrices, 0, wxALIGN_RIGHT|wxALL, 5 ); + fgSizer_flex->Add( m_checkBoxRefreshPrices, 0, wxALIGN_RIGHT|wxALL, 5 ); wxBoxSizer* bSizer29; bSizer29 = new wxBoxSizer( wxHORIZONTAL ); @@ -154,32 +152,36 @@ bSizer30->Add( m_RefreshInterval, 0, wxALL, 5 ); bSizer29->Add( bSizer30, 1, wxEXPAND, 5 ); - wxBoxSizer* bSizer31; - bSizer31 = new wxBoxSizer( wxVERTICAL ); + wxBoxSizer* bSizer31 = new wxBoxSizer( wxVERTICAL ); m_staticText6 = new wxStaticText( this, wxID_ANY, - _("minutes while market is open"), wxDefaultPosition, wxDefaultSize, 0 ); + _("minutes while market is open")); bSizer30->Add( m_staticText6, 0, wxALL, 5 ); - fgSizer_main->Add( bSizer29, 2, wxEXPAND, 5 ); + fgSizer_flex->Add( bSizer29, 2, wxEXPAND, 5 ); - bSizer1100->Add(fgSizer_main, 1, wxEXPAND, 5); - bSizer1000->Add(bSizer1100, 1, wxEXPAND | wxALL, 5); + wxPanel* buttonPanel = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + bSizer_main->Add(buttonPanel, 0, wxALIGN_RIGHT|wxALL, 5); - m_sdbSettings = new wxStdDialogButtonSizer(); - - wxButton* itemButton7 = new wxButton( this, wxID_OK , _("&OK"), wxDefaultPosition, wxDefaultSize, 0); - itemButton7->SetFocus(); + wxBoxSizer* buttonPanelSizer = new wxBoxSizer(wxHORIZONTAL); + buttonPanel->SetSizer(buttonPanelSizer); - bSizer1100->Add(itemButton7, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 1); - + wxButton* btnOK = new wxButton( buttonPanel, wxID_OK); + btnOK->SetToolTip(_("Activates the filter: Will add selected items to display")); + buttonPanelSizer->Add(btnOK, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - m_sdbSettings->Realize(); - bSizer1000->Add( m_sdbSettings, 0, wxEXPAND, 10 ); + wxButton* btnCancel = new wxButton( buttonPanel, wxID_CANCEL); + btnCancel->SetToolTip(_("Deactivates the filter")); + buttonPanelSizer->Add(btnCancel, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + btnCancel->SetFocus(); - this->SetSizer( bSizer1000 ); - GetSizer()->Fit(this); GetSizer()->SetSizeHints(this); Centre(); } + +void YahooSettingsDialog::OnButtonOK( wxCommandEvent& /*event*/ ) +{ + //TODO: save config here + EndModal(wxID_OK); +} Modified: branches/0.9.9.0/mmex/src/yahoosettingsdialog.h =================================================================== --- branches/0.9.9.0/mmex/src/yahoosettingsdialog.h 2012-07-06 13:39:20 UTC (rev 2702) +++ branches/0.9.9.0/mmex/src/yahoosettingsdialog.h 2012-07-06 15:35:57 UTC (rev 2703) @@ -35,79 +35,79 @@ /////////////////////////////////////////////////////////////////////////////// class YahooSettingsDialog : public wxDialog { - DECLARE_EVENT_TABLE() - private: + DECLARE_EVENT_TABLE() + private: - protected: - public: - enum - { - idYahooSettingsDialog = 1000, - idSettingsNotebook, - idHTTPSettingsPanel, - idYahooSuffix, - idYahooServer, - idMarketOpenHour, - idMarketOpenMinute, - idMarketCloseHour, - idMarketCloseMinute, - idCBDoRefresh, - idRefreshInterval, - idWebProxyBox, - idProxySettingsPanel, - idProxyHost, - idProxyPort, - idProxyAuthentication, - idProxyUser, - idProxyPassword, - idSaveProxyPassword, - idProxyExceptions, - }; + protected: + public: + enum + { + idYahooSettingsDialog = 1000, + idSettingsNotebook, + idHTTPSettingsPanel, + idYahooSuffix, + idYahooServer, + idMarketOpenHour, + idMarketOpenMinute, + idMarketCloseHour, + idMarketCloseMinute, + idCBDoRefresh, + idRefreshInterval, + idWebProxyBox, + idProxySettingsPanel, + idProxyHost, + idProxyPort, + idProxyAuthentication, + idProxyUser, + idProxyPassword, + idSaveProxyPassword, + idProxyExceptions, + }; - wxPanel* m_HTTPSettingsPanel; - wxStaticText* m_staticText2; - wxTextCtrl* m_YahooSuffix; - wxStaticText* m_staticText3; - wxSpinCtrl* m_MarketOpenHour; - wxStaticText* m_staticText20; - wxSpinCtrl* m_MarketOpenMinute; - wxStaticText* m_staticText4; - wxSpinCtrl* m_MarketCloseHour; - wxStaticText* m_staticText201; - wxSpinCtrl* m_MarketCloseMinute; - wxCheckBox* m_checkBoxRefreshPrices; - wxSpinCtrl* m_RefreshInterval; - wxStaticText* m_staticText6; - wxRadioBox* m_WebProxy; - wxPanel* m_ProxySettingsPanel; - wxStaticText* m_staticText12; - wxTextCtrl* m_ProxyHost; - wxStaticText* m_staticText13; - wxTextCtrl* m_ProxyPort; + wxPanel* m_HTTPSettingsPanel; + wxStaticText* m_staticText2; + wxTextCtrl* m_YahooSuffix; + wxStaticText* m_staticText3; + wxSpinCtrl* m_MarketOpenHour; + wxStaticText* m_staticText20; + wxSpinCtrl* m_MarketOpenMinute; + wxStaticText* m_staticText4; + wxSpinCtrl* m_MarketCloseHour; + wxStaticText* m_staticText201; + wxSpinCtrl* m_MarketCloseMinute; + wxCheckBox* m_checkBoxRefreshPrices; + wxSpinCtrl* m_RefreshInterval; + wxStaticText* m_staticText6; + wxRadioBox* m_WebProxy; + wxPanel* m_ProxySettingsPanel; + wxStaticText* m_staticText12; + wxTextCtrl* m_ProxyHost; + wxStaticText* m_staticText13; + wxTextCtrl* m_ProxyPort; - wxCheckBox* m_ProxyAuthentication; - wxStaticText* m_staticText14; - wxTextCtrl* m_ProxyUser; - wxStaticText* m_staticText15; - wxTextCtrl* m_ProxyPassword; + wxCheckBox* m_ProxyAuthentication; + wxStaticText* m_staticText14; + wxTextCtrl* m_ProxyUser; + wxStaticText* m_staticText15; + wxTextCtrl* m_ProxyPassword; - wxCheckBox* m_SaveProxyPassword; - wxStaticText* m_staticText16; - wxTextCtrl* m_ProxyExceptions; - wxStaticText* m_staticText17; - wxStdDialogButtonSizer* m_sdbSettings; - wxStaticText* m_staticText34; - wxTextCtrl* m_YahooServer; + wxCheckBox* m_SaveProxyPassword; + wxStaticText* m_staticText16; + wxTextCtrl* m_ProxyExceptions; + wxStaticText* m_staticText17; + wxStaticText* m_staticText34; + wxTextCtrl* m_YahooServer; - wxButton* m_proxySettingsButton; + wxButton* m_proxySettingsButton; mmYahoo* m_yahoopointer; + void OnButtonOK( wxCommandEvent& event ); - public: - YahooSettingsDialog( mmYahoo* myp, wxWindow* parent, - int id = idYahooSettingsDialog, - wxString title = _("Options"), - wxPoint pos = wxDefaultPosition, - wxSize size = wxDefaultSize, + public: + YahooSettingsDialog( mmYahoo* myp, wxWindow* parent, + int id = idYahooSettingsDialog, + wxString title = _("Options"), + wxPoint pos = wxDefaultPosition, + wxSize size = wxDefaultSize, int style = wxDEFAULT_DIALOG_STYLE ); }; #endif //_YahooSettingsDialog_H_ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ste...@us...> - 2012-07-08 05:52:29
|
Revision: 2707 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=2707&view=rev Author: stef145g Date: 2012-07-08 05:52:18 +0000 (Sun, 08 Jul 2012) Log Message: ----------- Branch 0.9.9.0: Addition of SVN Properties: Author and Revision, to src branch Property Changed: ---------------- branches/0.9.9.0/mmex/src/aboutdialog.cpp branches/0.9.9.0/mmex/src/aboutdialog.h branches/0.9.9.0/mmex/src/appstartdialog.cpp branches/0.9.9.0/mmex/src/appstartdialog.h branches/0.9.9.0/mmex/src/assetdialog.cpp branches/0.9.9.0/mmex/src/assetdialog.h branches/0.9.9.0/mmex/src/assetspanel.cpp branches/0.9.9.0/mmex/src/assetspanel.h branches/0.9.9.0/mmex/src/billsdepositsdialog.cpp branches/0.9.9.0/mmex/src/billsdepositsdialog.h branches/0.9.9.0/mmex/src/billsdepositspanel.cpp branches/0.9.9.0/mmex/src/billsdepositspanel.h branches/0.9.9.0/mmex/src/budgetentrydialog.cpp branches/0.9.9.0/mmex/src/budgetentrydialog.h branches/0.9.9.0/mmex/src/budgetingpanel.cpp branches/0.9.9.0/mmex/src/budgetingpanel.h branches/0.9.9.0/mmex/src/budgetyeardialog.cpp branches/0.9.9.0/mmex/src/budgetyeardialog.h branches/0.9.9.0/mmex/src/budgetyearentrydialog.cpp branches/0.9.9.0/mmex/src/budgetyearentrydialog.h branches/0.9.9.0/mmex/src/categdialog.cpp branches/0.9.9.0/mmex/src/categdialog.h branches/0.9.9.0/mmex/src/chart.cpp branches/0.9.9.0/mmex/src/chart.h branches/0.9.9.0/mmex/src/constants.cpp branches/0.9.9.0/mmex/src/constants.h branches/0.9.9.0/mmex/src/currencydialog.cpp branches/0.9.9.0/mmex/src/currencydialog.h branches/0.9.9.0/mmex/src/customreportdialog.cpp branches/0.9.9.0/mmex/src/customreportdialog.h branches/0.9.9.0/mmex/src/customreportdisplay.cpp branches/0.9.9.0/mmex/src/customreportdisplay.h branches/0.9.9.0/mmex/src/customreportindex.cpp branches/0.9.9.0/mmex/src/customreportindex.h branches/0.9.9.0/mmex/src/dbwrapper.cpp branches/0.9.9.0/mmex/src/dbwrapper.h branches/0.9.9.0/mmex/src/defs.h branches/0.9.9.0/mmex/src/fileviewerdialog.cpp branches/0.9.9.0/mmex/src/fileviewerdialog.h branches/0.9.9.0/mmex/src/filtertransdialog.cpp branches/0.9.9.0/mmex/src/filtertransdialog.h branches/0.9.9.0/mmex/src/guiid.cpp branches/0.9.9.0/mmex/src/guiid.h branches/0.9.9.0/mmex/src/htmlbuilder.cpp branches/0.9.9.0/mmex/src/htmlbuilder.h branches/0.9.9.0/mmex/src/led.cpp branches/0.9.9.0/mmex/src/led.h branches/0.9.9.0/mmex/src/mac/platfdep.cpp branches/0.9.9.0/mmex/src/maincurrencydialog.cpp branches/0.9.9.0/mmex/src/maincurrencydialog.h branches/0.9.9.0/mmex/src/mm_Scriptable_Objects.h branches/0.9.9.0/mmex/src/mmaccount.cpp branches/0.9.9.0/mmex/src/mmaccount.h branches/0.9.9.0/mmex/src/mmcategory.cpp branches/0.9.9.0/mmex/src/mmcategory.h branches/0.9.9.0/mmex/src/mmcheckingpanel.cpp branches/0.9.9.0/mmex/src/mmcheckingpanel.h branches/0.9.9.0/mmex/src/mmcoredb.cpp branches/0.9.9.0/mmex/src/mmcoredb.h branches/0.9.9.0/mmex/src/mmcurrency.cpp branches/0.9.9.0/mmex/src/mmcurrency.h branches/0.9.9.0/mmex/src/mmex.cpp branches/0.9.9.0/mmex/src/mmex.h branches/0.9.9.0/mmex/src/mmgraphgenerator.cpp branches/0.9.9.0/mmex/src/mmgraphgenerator.h branches/0.9.9.0/mmex/src/mmgraphincexpensesmonth.cpp branches/0.9.9.0/mmex/src/mmgraphincexpensesmonth.h branches/0.9.9.0/mmex/src/mmgraphpie.cpp branches/0.9.9.0/mmex/src/mmgraphpie.h branches/0.9.9.0/mmex/src/mmgraphtopcategories.cpp branches/0.9.9.0/mmex/src/mmgraphtopcategories.h branches/0.9.9.0/mmex/src/mmhelppanel.cpp branches/0.9.9.0/mmex/src/mmhelppanel.h branches/0.9.9.0/mmex/src/mmhomepagepanel.cpp branches/0.9.9.0/mmex/src/mmhomepagepanel.h branches/0.9.9.0/mmex/src/mmpanelbase.h branches/0.9.9.0/mmex/src/mmpayee.cpp branches/0.9.9.0/mmex/src/mmpayee.h branches/0.9.9.0/mmex/src/mmreportspanel.cpp branches/0.9.9.0/mmex/src/mmreportspanel.h branches/0.9.9.0/mmex/src/mmtransaction.cpp branches/0.9.9.0/mmex/src/mmtransaction.h branches/0.9.9.0/mmex/src/mmyahoo.cpp branches/0.9.9.0/mmex/src/mmyahoo.h branches/0.9.9.0/mmex/src/newacctdialog.cpp branches/0.9.9.0/mmex/src/newacctdialog.h branches/0.9.9.0/mmex/src/ofximport.cpp.new branches/0.9.9.0/mmex/src/ofximport.h.new branches/0.9.9.0/mmex/src/optionsdialog.cpp branches/0.9.9.0/mmex/src/optionsdialog.h branches/0.9.9.0/mmex/src/paths.cpp branches/0.9.9.0/mmex/src/paths.h branches/0.9.9.0/mmex/src/payeedialog.cpp branches/0.9.9.0/mmex/src/payeedialog.h branches/0.9.9.0/mmex/src/platfdep.h branches/0.9.9.0/mmex/src/qifimport.cpp branches/0.9.9.0/mmex/src/recentfiles.cpp branches/0.9.9.0/mmex/src/recentfiles.h branches/0.9.9.0/mmex/src/relocatecategorydialog.cpp branches/0.9.9.0/mmex/src/relocatecategorydialog.h branches/0.9.9.0/mmex/src/relocatepayeedialog.cpp branches/0.9.9.0/mmex/src/relocatepayeedialog.h branches/0.9.9.0/mmex/src/reportbase.h branches/0.9.9.0/mmex/src/reportbudget.cpp branches/0.9.9.0/mmex/src/reportbudget.h branches/0.9.9.0/mmex/src/reportbudgetcategorysummary.cpp branches/0.9.9.0/mmex/src/reportbudgetcategorysummary.h branches/0.9.9.0/mmex/src/reportbudgetingperf.cpp branches/0.9.9.0/mmex/src/reportbudgetingperf.h branches/0.9.9.0/mmex/src/reportcashflow.cpp branches/0.9.9.0/mmex/src/reportcashflow.h branches/0.9.9.0/mmex/src/reportcategexp.cpp branches/0.9.9.0/mmex/src/reportcategexp.h branches/0.9.9.0/mmex/src/reportcategovertimeperf.cpp branches/0.9.9.0/mmex/src/reportcategovertimeperf.h branches/0.9.9.0/mmex/src/reportincexpenses.cpp branches/0.9.9.0/mmex/src/reportincexpenses.h branches/0.9.9.0/mmex/src/reportincexpensesfinancialperiod.cpp branches/0.9.9.0/mmex/src/reportincexpensesfinancialperiod.h branches/0.9.9.0/mmex/src/reportincexpesestime.cpp branches/0.9.9.0/mmex/src/reportincexpesestime.h branches/0.9.9.0/mmex/src/reportpayee.cpp branches/0.9.9.0/mmex/src/reportpayee.h branches/0.9.9.0/mmex/src/reportsummary.cpp branches/0.9.9.0/mmex/src/reportsummary.h branches/0.9.9.0/mmex/src/reportsummaryassets.cpp branches/0.9.9.0/mmex/src/reportsummaryassets.h branches/0.9.9.0/mmex/src/reportsummarystocks.cpp branches/0.9.9.0/mmex/src/reportsummarystocks.h branches/0.9.9.0/mmex/src/reporttransactions.cpp branches/0.9.9.0/mmex/src/reporttransactions.h branches/0.9.9.0/mmex/src/reporttransstats.cpp branches/0.9.9.0/mmex/src/reporttransstats.h branches/0.9.9.0/mmex/src/resource.h branches/0.9.9.0/mmex/src/splitdetailsdialog.cpp branches/0.9.9.0/mmex/src/splitdetailsdialog.h branches/0.9.9.0/mmex/src/splittransactionsdialog.cpp branches/0.9.9.0/mmex/src/splittransactionsdialog.h branches/0.9.9.0/mmex/src/sql/tables_v1.sql branches/0.9.9.0/mmex/src/stockdialog.cpp branches/0.9.9.0/mmex/src/stockdialog.h branches/0.9.9.0/mmex/src/stockspanel.cpp branches/0.9.9.0/mmex/src/stockspanel.h branches/0.9.9.0/mmex/src/tests/Makefile.in branches/0.9.9.0/mmex/src/tests/dbwrapper_test.cpp branches/0.9.9.0/mmex/src/tests/mmex_tests.bkl branches/0.9.9.0/mmex/src/tests/mmex_tests.cpp branches/0.9.9.0/mmex/src/tests/mmex_tests.rc branches/0.9.9.0/mmex/src/tests/resource.h branches/0.9.9.0/mmex/src/tests/util_test.cpp branches/0.9.9.0/mmex/src/tests/utils.cpp branches/0.9.9.0/mmex/src/tests/utils.h branches/0.9.9.0/mmex/src/transactionfilterdialog.cpp branches/0.9.9.0/mmex/src/transactionfilterdialog.h branches/0.9.9.0/mmex/src/transdialog.cpp branches/0.9.9.0/mmex/src/transdialog.h branches/0.9.9.0/mmex/src/univcsvdialog.cpp branches/0.9.9.0/mmex/src/univcsvdialog.h branches/0.9.9.0/mmex/src/unix/platfdep.cpp branches/0.9.9.0/mmex/src/util.cpp branches/0.9.9.0/mmex/src/util.h branches/0.9.9.0/mmex/src/win/platfdep.cpp branches/0.9.9.0/mmex/src/yahoosettingsdialog.cpp branches/0.9.9.0/mmex/src/yahoosettingsdialog.h Property changes on: branches/0.9.9.0/mmex/src/aboutdialog.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/aboutdialog.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/appstartdialog.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/appstartdialog.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/assetdialog.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/assetdialog.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/assetspanel.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/assetspanel.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/billsdepositsdialog.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/billsdepositsdialog.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/billsdepositspanel.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/billsdepositspanel.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/budgetentrydialog.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/budgetentrydialog.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/budgetingpanel.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/budgetingpanel.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/budgetyeardialog.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/budgetyeardialog.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/budgetyearentrydialog.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/budgetyearentrydialog.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/categdialog.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/categdialog.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/chart.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/chart.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/constants.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/constants.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/currencydialog.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/currencydialog.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/customreportdialog.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/customreportdialog.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/customreportdisplay.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/customreportdisplay.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/customreportindex.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/customreportindex.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/dbwrapper.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/dbwrapper.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/defs.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/fileviewerdialog.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/fileviewerdialog.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/filtertransdialog.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/filtertransdialog.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/guiid.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/guiid.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/htmlbuilder.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/htmlbuilder.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/led.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/led.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/mac/platfdep.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/maincurrencydialog.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/maincurrencydialog.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/mm_Scriptable_Objects.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/mmaccount.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/mmaccount.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/mmcategory.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/mmcategory.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/mmcheckingpanel.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/mmcheckingpanel.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/mmcoredb.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/mmcoredb.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/mmcurrency.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/mmcurrency.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/mmex.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/mmex.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/mmgraphgenerator.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/mmgraphgenerator.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/mmgraphincexpensesmonth.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/mmgraphincexpensesmonth.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/mmgraphpie.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/mmgraphpie.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/mmgraphtopcategories.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/mmgraphtopcategories.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/mmhelppanel.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/mmhelppanel.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/mmhomepagepanel.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/mmhomepagepanel.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/mmpanelbase.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/mmpayee.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/mmpayee.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/mmreportspanel.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/mmreportspanel.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/mmtransaction.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/mmtransaction.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/mmyahoo.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/mmyahoo.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/newacctdialog.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/newacctdialog.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/ofximport.cpp.new ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/ofximport.h.new ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/optionsdialog.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/optionsdialog.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/paths.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/paths.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/payeedialog.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/payeedialog.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/platfdep.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/qifimport.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/recentfiles.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/recentfiles.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/relocatecategorydialog.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/relocatecategorydialog.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/relocatepayeedialog.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/relocatepayeedialog.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/reportbase.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/reportbudget.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/reportbudget.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/reportbudgetcategorysummary.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/reportbudgetcategorysummary.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/reportbudgetingperf.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/reportbudgetingperf.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/reportcashflow.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/reportcashflow.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/reportcategexp.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/reportcategexp.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/reportcategovertimeperf.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/reportcategovertimeperf.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/reportincexpenses.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/reportincexpenses.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/reportincexpensesfinancialperiod.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/reportincexpensesfinancialperiod.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/reportincexpesestime.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/reportincexpesestime.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/reportpayee.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/reportpayee.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/reportsummary.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/reportsummary.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/reportsummaryassets.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/reportsummaryassets.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/reportsummarystocks.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/reportsummarystocks.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/reporttransactions.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/reporttransactions.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/reporttransstats.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/reporttransstats.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/resource.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/splitdetailsdialog.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/splitdetailsdialog.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/splittransactionsdialog.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/splittransactionsdialog.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/sql/tables_v1.sql ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/stockdialog.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/stockdialog.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/stockspanel.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/stockspanel.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/tests/Makefile.in ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/tests/dbwrapper_test.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/tests/mmex_tests.bkl ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/tests/mmex_tests.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/tests/mmex_tests.rc ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/tests/resource.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/tests/util_test.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/tests/utils.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/tests/utils.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/transactionfilterdialog.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/transactionfilterdialog.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/transdialog.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/transdialog.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/univcsvdialog.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/univcsvdialog.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/unix/platfdep.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/util.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/util.h ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/win/platfdep.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/yahoosettingsdialog.cpp ___________________________________________________________________ Added: svn:keywords + Author Revision Property changes on: branches/0.9.9.0/mmex/src/yahoosettingsdialog.h ___________________________________________________________________ Added: svn:keywords + Author Revision This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2012-07-08 10:45:50
|
Revision: 2708 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=2708&view=rev Author: vomikan Date: 2012-07-08 10:45:44 +0000 (Sun, 08 Jul 2012) Log Message: ----------- update for settings storage Modified Paths: -------------- branches/0.9.9.0/mmex/src/mmyahoo.cpp branches/0.9.9.0/mmex/src/stockspanel.cpp branches/0.9.9.0/mmex/src/stockspanel.h branches/0.9.9.0/mmex/src/yahoosettingsdialog.cpp Modified: branches/0.9.9.0/mmex/src/mmyahoo.cpp =================================================================== --- branches/0.9.9.0/mmex/src/mmyahoo.cpp 2012-07-08 05:52:18 UTC (rev 2707) +++ branches/0.9.9.0/mmex/src/mmyahoo.cpp 2012-07-08 10:45:44 UTC (rev 2708) @@ -28,7 +28,7 @@ } mmYahoo::~mmYahoo() { - WriteSettings(); + } /// ------------------------------------------------------------------ @@ -72,12 +72,14 @@ void mmYahoo::WriteSettings() { inidb_->Begin(); + db_->Begin(); // Status - Save to mmexini.db3 mmDBWrapper::setINISettingValue(inidb_, wxT("STOCKS_REFRESH_ENABLED"), wxString::Format(wxT("%d"),UpdatingEnabled_)); // Save to user database mmDBWrapper::setInfoSettingValue(db_, wxT("STOCKS_MARKET_OPEN_TIME"), OpenTimeStr_) ; mmDBWrapper::setInfoSettingValue(db_, wxT("STOCKS_MARKET_CLOSE_TIME"), CloseTimeStr_) ; + if (LastRefreshDT_.IsValid() ) { mmDBWrapper::setInfoSettingValue(db_, wxT("STOCKS_LAST_REFRESH_DATETIME"), wxString::Format(wxT("%s %s"), @@ -88,6 +90,7 @@ mmDBWrapper::setInfoSettingValue(db_,wxT("HTTP_YAHOO_SERVER"),Server_); mmDBWrapper::setInfoSettingValue(db_,wxT("HTTP_YAHOO_SUFFIX"),Suffix_); inidb_->Commit(); + db_->Commit(); } Modified: branches/0.9.9.0/mmex/src/stockspanel.cpp =================================================================== --- branches/0.9.9.0/mmex/src/stockspanel.cpp 2012-07-08 05:52:18 UTC (rev 2707) +++ branches/0.9.9.0/mmex/src/stockspanel.cpp 2012-07-08 10:45:44 UTC (rev 2708) @@ -63,6 +63,7 @@ EVT_LIST_ITEM_RIGHT_CLICK(ID_PANEL_STOCKS_LISTCTRL, stocksListCtrl::OnItemRightClick) EVT_LIST_ITEM_SELECTED(ID_PANEL_STOCKS_LISTCTRL, stocksListCtrl::OnListItemSelected) EVT_LIST_ITEM_DESELECTED(ID_PANEL_STOCKS_LISTCTRL, stocksListCtrl::OnListItemDeselected) + EVT_LIST_COL_END_DRAG(ID_PANEL_STOCKS_LISTCTRL, stocksListCtrl::OnItemResize) EVT_MENU(MENU_TREEPOPUP_NEW, stocksListCtrl::OnNewStocks) EVT_MENU(MENU_TREEPOPUP_EDIT, stocksListCtrl::OnEditStocks) @@ -138,31 +139,29 @@ if (m_LED) delete m_LED; - //FIXME: write changes in OnItemResize(wxListEvent& event) function - if (true) - { - inidb_->Begin(); - for (int i = 0; i < COL_MAX; ++i) - { - int col_x = listCtrlAccount_->GetColumnWidth(i); - mmDBWrapper::setINISettingValue(inidb_, - wxString::Format(wxT("STOCKS_COL%d_WIDTH"), i), - wxString::Format(wxT("%d"),col_x)); - } - inidb_->Commit(); - } } +void mmStocksPanel::save_column_width(const int width) +{ + int i = width; + inidb_->Begin(); + int col_x = listCtrlAccount_->GetColumnWidth(i); + mmDBWrapper::setINISettingValue(inidb_, + wxString::Format(wxT("STOCKS_COL%d_WIDTH"), i), + wxString::Format(wxT("%d"),col_x)); + inidb_->Commit(); +} + void stocksListCtrl::OnItemResize(wxListEvent& event) { int i = event.GetColumn(); + cp_->save_column_width(i); } void mmStocksPanel::CreateControls() { wxBoxSizer* itemBoxSizer9 = new wxBoxSizer(wxVERTICAL); this->SetSizer(itemBoxSizer9); - //this->SetBackgroundColour(mmColors::listBackColor); /* ---------------------- */ wxPanel* headerPanel = new wxPanel(this, wxID_ANY, wxDefaultPosition, @@ -208,11 +207,8 @@ listCtrlAccount_ = new stocksListCtrl(this, itemSplitterWindow10, ID_PANEL_STOCKS_LISTCTRL, wxDefaultPosition, wxDefaultSize, wxLC_REPORT | wxLC_HRULES | wxLC_VRULES | wxLC_VIRTUAL | wxLC_SINGLE_SEL); - //listCtrlAccount_->SetBackgroundColour(mmColors::listDetailsPanelColor); listCtrlAccount_->SetImageList(m_imageList, wxIMAGE_LIST_SMALL); - listCtrlAccount_->InsertColumn(COL_DATE, _("Purchase Date")); wxListItem itemCol; - itemCol.SetImage(-1); const wxChar* columns[] = { _("Purchase Date"), _("Share Name"), @@ -242,38 +238,34 @@ wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxVERTICAL); itemPanel12->SetSizer(itemBoxSizer4); - //itemPanel12->SetBackgroundColour(mmColors::listBackColor); wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxHORIZONTAL); itemBoxSizer4->Add(itemBoxSizer5, 0, wxALIGN_LEFT|wxALL, 5); - wxButton* itemButton6 = new wxButton(itemPanel12, wxID_NEW, _("&New")); + wxButton* itemButton6 = new wxButton(itemPanel12, wxID_NEW); itemButton6->SetToolTip(_("New Stock Investment")); itemBoxSizer5->Add(itemButton6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 4); - wxButton* itemButton81 = new wxButton(itemPanel12, wxID_EDIT, _("&Edit")); + wxButton* itemButton81 = new wxButton(itemPanel12, wxID_EDIT); itemButton81->SetToolTip(_("Edit Stock Investment")); itemBoxSizer5->Add(itemButton81, 0, wxALIGN_CENTER_VERTICAL|wxALL, 4); itemButton81->Enable(false); - wxButton* itemButton7 = new wxButton(itemPanel12, wxID_DELETE, _("&Delete")); + wxButton* itemButton7 = new wxButton(itemPanel12, wxID_DELETE); itemButton7->SetToolTip(_("Delete Stock Investment")); itemBoxSizer5->Add(itemButton7, 0, wxALIGN_CENTER_VERTICAL|wxALL, 4); itemButton7->Enable(false); - wxButton* itemButton8 = new wxButton(itemPanel12, wxID_REFRESH, _("&Refresh"), - wxDefaultPosition, wxDefaultSize, 0); + wxButton* itemButton8 = new wxButton(itemPanel12, wxID_REFRESH); itemButton8->SetToolTip(_("Refresh Stock Prices from Yahoo")); itemBoxSizer5->Add(itemButton8, 0, wxALIGN_CENTER_VERTICAL|wxALL, 4); - wxButton* itemButton9 = new wxButton(itemPanel12, wxID_SETUP, _("&Settings"), - wxDefaultPosition, wxDefaultSize, 0); + wxButton* itemButton9 = new wxButton(itemPanel12, wxID_SETUP, _("&Settings")); itemButton9->SetToolTip(_("Change settings for automatic refresh")); itemBoxSizer5->Add(itemButton9, 0, wxALIGN_CENTER_VERTICAL|wxALL, 4); //Infobar-mini - wxStaticText* itemStaticText44 = new wxStaticText(itemPanel12, ID_PANEL_STOCKS_STATIC_DETAILS_MINI, wxT(""), - wxDefaultPosition, wxDefaultSize, 0); + wxStaticText* itemStaticText44 = new wxStaticText(itemPanel12, ID_PANEL_STOCKS_STATIC_DETAILS_MINI, wxT("")); itemBoxSizer5->Add(itemStaticText44, 1, wxGROW|wxTOP, 12); //Infobar wxStaticText* itemStaticText33 = new wxStaticText(itemPanel12, Modified: branches/0.9.9.0/mmex/src/stockspanel.h =================================================================== --- branches/0.9.9.0/mmex/src/stockspanel.h 2012-07-08 05:52:18 UTC (rev 2707) +++ branches/0.9.9.0/mmex/src/stockspanel.h 2012-07-08 10:45:44 UTC (rev 2708) @@ -139,9 +139,9 @@ void OnHTTPSettings(wxCommandEvent& event); void enableEditDeleteButtons(bool en); void updateExtraStocksData(int selIndex); + void save_column_width(const int width); + //void OnViewPopupSelected(wxCommandEvent& event); - void OnViewPopupSelected(wxCommandEvent& event); - /* Helper Functions/data */ std::vector<mmStockTransactionHolder> trans_; void sortTable(); Modified: branches/0.9.9.0/mmex/src/yahoosettingsdialog.cpp =================================================================== --- branches/0.9.9.0/mmex/src/yahoosettingsdialog.cpp 2012-07-08 05:52:18 UTC (rev 2707) +++ branches/0.9.9.0/mmex/src/yahoosettingsdialog.cpp 2012-07-08 10:45:44 UTC (rev 2708) @@ -59,14 +59,14 @@ fgSizer_flex->Add( m_staticText34, 0, wxALIGN_RIGHT|wxALL, 5 ); m_YahooServer = new wxTextCtrl( this, idYahooServer, - _("finance.au.yahoo.com"), wxDefaultPosition, wxDefaultSize, 0 ); + _("finance.au.yahoo.com")); m_YahooServer->SetToolTip( _("Do not enter anything except the server name (or IP address, if you're feeling lucky)") ); m_YahooServer->SetValue(m_yahoopointer->Server_); fgSizer_flex->Add( m_YahooServer, 0, wxALL|wxEXPAND, 5 ); m_staticText2 = new wxStaticText( this, wxID_ANY, - _("Yahoo Suffix"), wxDefaultPosition, wxDefaultSize, 0 ); + _("Yahoo Suffix")); fgSizer_flex->Add( m_staticText2, 0, wxALIGN_RIGHT|wxALL, 5 ); m_YahooSuffix = new wxTextCtrl( this, @@ -76,15 +76,15 @@ fgSizer_flex->Add( m_YahooSuffix, 0, wxALL|wxEXPAND, 5 ); - m_staticText3 = new wxStaticText( this, wxID_ANY, _("Market open from"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText3 = new wxStaticText( this, wxID_ANY, _("Market open from")); fgSizer_flex->Add( m_staticText3, 0, wxALIGN_RIGHT|wxALL, 5 ); - wxFlexGridSizer* fgSizer5; - fgSizer5 = new wxFlexGridSizer( 1, 3, 0, 0 ); + wxFlexGridSizer* fgSizer5 = new wxFlexGridSizer( 1, 3, 0, 0 ); fgSizer5->SetFlexibleDirection( wxBOTH ); fgSizer5->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - m_MarketOpenHour = new wxSpinCtrl( this, idMarketOpenHour, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 10, 0); + m_MarketOpenHour = new wxSpinCtrl( this, idMarketOpenHour, wxEmptyString, + wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 10, 0); m_MarketOpenHour->SetToolTip( _("Allow for any delay in quotes") ); long LongTemp; m_yahoopointer->OpenTimeStr_.Mid(0,2).ToLong(&LongTemp); @@ -92,7 +92,7 @@ fgSizer5->Add( m_MarketOpenHour, 0, wxALL, 5 ); - m_staticText20 = new wxStaticText( this, wxID_ANY, _(":"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText20 = new wxStaticText( this, wxID_ANY, _(":")); fgSizer5->Add( m_staticText20, 0, wxBOTTOM|wxTOP, 5 ); m_MarketOpenMinute = new wxSpinCtrl( this, idMarketOpenMinute, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 59, 0); @@ -104,7 +104,7 @@ fgSizer_flex->Add( fgSizer5, 1, wxEXPAND, 5 ); - m_staticText4 = new wxStaticText( this, wxID_ANY, _("to"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText4 = new wxStaticText( this, wxID_ANY, _("to")); fgSizer_flex->Add( m_staticText4, 0, wxALIGN_RIGHT|wxALL, 5 ); wxFlexGridSizer* fgSizer6; @@ -113,14 +113,14 @@ fgSizer6->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); m_MarketCloseHour = new wxSpinCtrl( this, idMarketCloseHour, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 23, 0); - m_MarketCloseHour->SetToolTip( _("Allow for any delay in quotes") ); + m_MarketCloseHour->SetToolTip( _("Allow for any delay in quotes")); m_yahoopointer->CloseTimeStr_.Mid(0,2).ToLong(&LongTemp); m_MarketCloseHour->SetValue( LongTemp ); fgSizer6->Add( m_MarketCloseHour, 0, wxALL, 5 ); m_staticText201 = new wxStaticText( this, - wxID_ANY, _(":"), wxDefaultPosition, wxDefaultSize, 0 ); + wxID_ANY, _(":")); fgSizer6->Add( m_staticText201, 0, wxBOTTOM|wxTOP, 5 ); m_MarketCloseMinute = new wxSpinCtrl( this, idMarketCloseMinute, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 59, 0); @@ -133,7 +133,7 @@ fgSizer_flex->Add( fgSizer6, 1, wxEXPAND, 5 ); m_checkBoxRefreshPrices = new wxCheckBox( this, - idCBDoRefresh, _("&Refresh prices every"), wxDefaultPosition, wxDefaultSize, 0 ); + idCBDoRefresh, _("&Refresh prices every")); m_checkBoxRefreshPrices->SetValue(m_yahoopointer->UpdatingEnabled_ ? true : false); fgSizer_flex->Add( m_checkBoxRefreshPrices, 0, wxALIGN_RIGHT|wxALL, 5 ); @@ -152,8 +152,6 @@ bSizer30->Add( m_RefreshInterval, 0, wxALL, 5 ); bSizer29->Add( bSizer30, 1, wxEXPAND, 5 ); - wxBoxSizer* bSizer31 = new wxBoxSizer( wxVERTICAL ); - m_staticText6 = new wxStaticText( this, wxID_ANY, _("minutes while market is open")); bSizer30->Add( m_staticText6, 0, wxALL, 5 ); @@ -167,11 +165,9 @@ buttonPanel->SetSizer(buttonPanelSizer); wxButton* btnOK = new wxButton( buttonPanel, wxID_OK); - btnOK->SetToolTip(_("Activates the filter: Will add selected items to display")); buttonPanelSizer->Add(btnOK, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); wxButton* btnCancel = new wxButton( buttonPanel, wxID_CANCEL); - btnCancel->SetToolTip(_("Deactivates the filter")); buttonPanelSizer->Add(btnCancel, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); btnCancel->SetFocus(); @@ -182,6 +178,14 @@ void YahooSettingsDialog::OnButtonOK( wxCommandEvent& /*event*/ ) { - //TODO: save config here + m_yahoopointer->Server_ = m_YahooServer->GetValue(); + m_yahoopointer->Suffix_ = m_YahooSuffix->GetValue(); + + m_yahoopointer->OpenTimeStr_ = wxString::Format(wxT("%02d:%02d:00"), + m_MarketOpenHour->GetValue(), m_MarketOpenMinute->GetValue()); + m_yahoopointer->CloseTimeStr_ = wxString::Format(wxT("%02d:%02d:00"), + m_MarketCloseHour->GetValue(), m_MarketCloseMinute->GetValue()); + m_yahoopointer->UpdateIntervalMinutes_ = m_RefreshInterval->GetValue(); + m_yahoopointer->WriteSettings(); EndModal(wxID_OK); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2012-07-08 20:42:40
|
Revision: 2710 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=2710&view=rev Author: vomikan Date: 2012-07-08 20:42:33 +0000 (Sun, 08 Jul 2012) Log Message: ----------- update Modified Paths: -------------- branches/0.9.9.0/mmex/src/mmcheckingpanel.cpp branches/0.9.9.0/mmex/src/mmcheckingpanel.h Modified: branches/0.9.9.0/mmex/src/mmcheckingpanel.cpp =================================================================== --- branches/0.9.9.0/mmex/src/mmcheckingpanel.cpp 2012-07-08 10:50:29 UTC (rev 2709) +++ branches/0.9.9.0/mmex/src/mmcheckingpanel.cpp 2012-07-08 20:42:33 UTC (rev 2710) @@ -474,11 +474,6 @@ */ mmCheckingPanel::~mmCheckingPanel() { - try { - saveSettings(); - } catch (...) { - wxASSERT(false); - } } //---------------------------------------------------------------------------- @@ -502,7 +497,6 @@ /* Set up the transaction filter. The transFilter dialog will be destroyed when the checking panel is destroyed. */ transFilterActive_ = false; - settings_change_ = false; transFilterDlg_ = new TransFilterDialog(core_, this); initVirtualListControl(); @@ -513,28 +507,6 @@ } //---------------------------------------------------------------------------- -/* - Save data to ini database. -*/ -void mmCheckingPanel::saveSettings() -{ - if (settings_change_) - { - // sorting column index - inidb_->Begin(); - mmDBWrapper::setINISettingValue(inidb_, wxT("CHECK_SORT_COL"), wxString() << g_sortcol); - - // asc\desc sorting flag - mmDBWrapper::setINISettingValue(inidb_, wxT("CHECK_ASC"), wxString() << g_asc); - - mmDBWrapper::setInfoSettingValue(core_->db_.get(), - wxString::Format(wxT("CHECK_FILTER_ID_%ld"), m_AccountID), m_currentView); - - inidb_->Commit(); - } -} -//---------------------------------------------------------------------------- - void mmCheckingPanel::sortTable() { std::sort(m_trans.begin(), m_trans.end(), TransSort(g_sortcol, g_asc)); @@ -1220,7 +1192,26 @@ } } //---------------------------------------------------------------------------- +void mmCheckingPanel::OnFilterResetToViewAll(wxMouseEvent& event) { + if (m_currentView == VIEW_TRANS_ALL_STR) + { + event.Skip(); + return; + } + + itemStaticTextMainFilter_->SetLabel(_("Viewing all transactions")); + m_currentView = VIEW_TRANS_ALL_STR; + itemStaticBitmap31_->Enable(true); + statTextTransFilter_->Enable(true); + + m_listCtrlAccount->DeleteAllItems(); + initVirtualListControl(); + if (m_trans.size() > 0) + m_listCtrlAccount->RefreshItems(0, static_cast<long>(m_trans.size()) - 1); + +} + void mmCheckingPanel::OnViewPopupSelected(wxCommandEvent& event) { int evt = event.GetId(); @@ -1235,7 +1226,6 @@ } bool show_filter_ = false; - settings_change_ = true; if (evt == MENU_VIEW_ALLTRANSACTIONS) { @@ -1315,6 +1305,12 @@ m_listCtrlAccount->DeleteAllItems(); initVirtualListControl(); + + core_->db_.get()->Begin(); + mmDBWrapper::setInfoSettingValue(core_->db_.get(), + wxString::Format(wxT("CHECK_FILTER_ID_%ld"), m_AccountID), m_currentView); + core_->db_.get()->Commit(); + } void mmCheckingPanel::DeleteViewedTransactions() @@ -1391,28 +1387,6 @@ } -void mmCheckingPanel::OnFilterResetToViewAll(wxMouseEvent& event) { - - if (m_currentView == VIEW_TRANS_ALL_STR) - { - event.Skip(); - return; - } - - settings_change_ = true; - - itemStaticTextMainFilter_->SetLabel(_("Viewing all transactions")); - m_currentView = VIEW_TRANS_ALL_STR; - itemStaticBitmap31_->Enable(true); - statTextTransFilter_->Enable(true); - - m_listCtrlAccount->DeleteAllItems(); - initVirtualListControl(); - if (m_trans.size() > 0) - m_listCtrlAccount->RefreshItems(0, static_cast<long>(m_trans.size()) - 1); - -} - //---------------------------------------------------------------------------- void TransactionListCtrl::OnListItemSelected(wxListEvent& event) @@ -1592,7 +1566,15 @@ 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->settings_change_ = true; + + m_cp->inidb_->Begin(); + mmDBWrapper::setINISettingValue(m_cp->inidb_, wxT("CHECK_SORT_COL"), wxString() << g_sortcol); + + // asc\desc sorting flag + mmDBWrapper::setINISettingValue(m_cp->inidb_, wxT("CHECK_ASC"), wxString() << g_asc); + + m_cp->inidb_->Commit(); + } //---------------------------------------------------------------------------- @@ -2085,7 +2067,7 @@ double amount= 0, deposit = 0, withdrawal = 0; bool valid_amount = mmex::formatCurrencyToDouble(search_string, amount); bool withdrawal_only = false; - if (valid_amount && amount <0) + if (valid_amount && amount <0) { amount = -amount; withdrawal_only = true; Modified: branches/0.9.9.0/mmex/src/mmcheckingpanel.h =================================================================== --- branches/0.9.9.0/mmex/src/mmcheckingpanel.h 2012-07-08 10:50:29 UTC (rev 2709) +++ branches/0.9.9.0/mmex/src/mmcheckingpanel.h 2012-07-08 20:42:33 UTC (rev 2710) @@ -144,8 +144,6 @@ void initVirtualListControl(); void showTips(); void updateExtraTransactionData(int selIndex); - void saveSettings(); - bool settings_change_; /* Getter for Virtual List Control */ wxString getItem(long item, long column) const; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2012-07-09 07:27:33
|
Revision: 2711 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=2711&view=rev Author: vomikan Date: 2012-07-09 07:27:23 +0000 (Mon, 09 Jul 2012) Log Message: ----------- update Modified Paths: -------------- branches/0.9.9.0/mmex/src/budgetingpanel.cpp branches/0.9.9.0/mmex/src/budgetingpanel.h Modified: branches/0.9.9.0/mmex/src/budgetingpanel.cpp =================================================================== --- branches/0.9.9.0/mmex/src/budgetingpanel.cpp 2012-07-08 20:42:33 UTC (rev 2710) +++ branches/0.9.9.0/mmex/src/budgetingpanel.cpp 2012-07-09 07:27:23 UTC (rev 2711) @@ -44,6 +44,7 @@ BEGIN_EVENT_TABLE(budgetingListCtrl, wxListCtrl) EVT_LIST_ITEM_SELECTED(ID_PANEL_CHECKING_LISTCTRL_ACCT, budgetingListCtrl::OnListItemSelected) EVT_LIST_ITEM_ACTIVATED(ID_PANEL_CHECKING_LISTCTRL_ACCT, budgetingListCtrl::OnListItemActivated) + EVT_LIST_COL_END_DRAG(ID_PANEL_CHECKING_LISTCTRL_ACCT, budgetingListCtrl::OnItemResize) END_EVENT_TABLE() /*******************************************************/ mmBudgetingPanel::mmBudgetingPanel(wxSQLite3Database* db, wxSQLite3Database* inidb, mmCoreDB* core, mmGUIFrame* mainFrame, int budgetYearID, wxWindow *parent, @@ -81,22 +82,22 @@ mmBudgetingPanel::~mmBudgetingPanel() { if (m_imageList) delete m_imageList; +} +void mmBudgetingPanel::save_column_width(const int width) +{ inidb_->Begin(); - for (int i = 0; i < listCtrlBudget_->GetColumnCount(); ++i) - { - mmDBWrapper::setINISettingValue(inidb_, - wxString::Format(wxT("BUDGET_COL%d_WIDTH"), i), - wxString::Format(wxT("%d"), listCtrlBudget_->GetColumnWidth(i))); - } + int col_x = listCtrlBudget_->GetColumnWidth(width); + mmDBWrapper::setINISettingValue(inidb_, + wxString::Format(wxT("BUDGET_COL%d_WIDTH"), width), + wxString::Format(wxT("%d"),col_x)); inidb_->Commit(); } void mmBudgetingPanel::OnViewPopupSelected(wxCommandEvent& event) { int evt = event.GetId(); - wxStaticText* header = (wxStaticText*)FindWindow(ID_PANEL_CHECKING_STATIC_PANELVIEW); - if (evt == MENU_VIEW_ALLBUDGETENTRIES) + if (evt == MENU_VIEW_ALLBUDGETENTRIES) currentView_ = wxTRANSLATE("View All Budget Categories"); else if (evt == MENU_VIEW_NONZEROBUDGETENTRIES) currentView_ = wxTRANSLATE("View Non-Zero Budget Categories"); @@ -109,11 +110,13 @@ else wxASSERT(false); - header->SetLabel(wxGetTranslation(wxT("View Budget Category Summary"))); + wxStaticText* header = (wxStaticText*)FindWindow(ID_PANEL_CHECKING_STATIC_PANELVIEW); + header->SetLabel(wxGetTranslation(wxTRANSLATE("View Budget Category Summary"))); listCtrlBudget_->DeleteAllItems(); initVirtualListControl(); - listCtrlBudget_->RefreshItems(0, ((int)trans_.size()) - 1); + if (trans_.size()>0) + listCtrlBudget_->RefreshItems(0, (static_cast<long>(trans_.size()-1))); } void mmBudgetingPanel::OnMouseLeftDown( wxMouseEvent& event ) @@ -192,45 +195,43 @@ _("Viewing All Budget Categories")); itemBoxSizerHHeader2->Add(itemStaticText18, 0, wxALL, 1); - wxSize distSize(250, 20); + wxFlexGridSizer* itemIncomeSizer = new wxFlexGridSizer(0,8,5,10); + itemBoxSizerVHeader->Add(itemIncomeSizer); - wxStaticText* itemStaticText100 = new wxStaticText( itemPanel3, wxID_ANY, _("Income......."), - wxDefaultPosition, wxSize(75, 20), 0 ); + wxStaticText* itemStaticText11 = new wxStaticText( itemPanel3, + wxID_ANY, _("Income.......")); + wxStaticText* itemStaticText12 = new wxStaticText( itemPanel3, + ID_DIALOG_BUDGETENTRY_SUMMARY_INCOME_EST, _("Estimated: ")); + wxStaticText* itemStaticText13 = new wxStaticText( itemPanel3, + ID_DIALOG_BUDGETENTRY_SUMMARY_INCOME_ACT, _("Actual: ")); + wxStaticText* itemStaticText14 = new wxStaticText( itemPanel3, + ID_DIALOG_BUDGETENTRY_SUMMARY_INCOME_DIF, _("Difference: ")); - wxStaticText* itemStaticText101 = new wxStaticText( itemPanel3, - ID_DIALOG_BUDGETENTRY_SUMMARY_INCOME_EST, _("Estimated: "), wxDefaultPosition, distSize, 0); + wxStaticText* itemStaticText21 = new wxStaticText( itemPanel3, wxID_ANY, _("Expenses...")); + wxStaticText* itemStaticText22 = new wxStaticText( itemPanel3, + ID_DIALOG_BUDGETENTRY_SUMMARY_EXPENSES_EST, _("Estimated: ")); + wxStaticText* itemStaticText23 = new wxStaticText( itemPanel3, + ID_DIALOG_BUDGETENTRY_SUMMARY_EXPENSES_ACT, _("Actual: ")); + wxStaticText* itemStaticText24 = new wxStaticText( itemPanel3, + ID_DIALOG_BUDGETENTRY_SUMMARY_EXPENSES_DIF, _("Difference: ")); - wxStaticText* itemStaticText102 = new wxStaticText( itemPanel3, - ID_DIALOG_BUDGETENTRY_SUMMARY_INCOME_ACT, _("Actual: "), wxDefaultPosition, distSize, 0); + itemIncomeSizer->Add(itemStaticText11); + itemIncomeSizer->Add(itemStaticText12); + itemIncomeSizer->AddSpacer(20); + itemIncomeSizer->AddSpacer(20); + itemIncomeSizer->Add(itemStaticText13); + itemIncomeSizer->AddSpacer(20); + itemIncomeSizer->AddSpacer(20); + itemIncomeSizer->Add(itemStaticText14); - wxStaticText* itemStaticText103 = new wxStaticText( itemPanel3, - ID_DIALOG_BUDGETENTRY_SUMMARY_INCOME_DIF, _("Difference: "), wxDefaultPosition, distSize, 0); - - wxBoxSizer* itemIncomeSizer = new wxBoxSizer(wxHORIZONTAL); - itemIncomeSizer->Add(itemStaticText100, 0, wxALL, 0); - itemIncomeSizer->Add(itemStaticText101, 0, wxALL, 0); - itemIncomeSizer->Add(itemStaticText102, 0, wxALL, 0); - itemIncomeSizer->Add(itemStaticText103, 0, wxALL, 0); - itemBoxSizerVHeader->Add(itemIncomeSizer, 0, wxALL, 1); - - wxStaticText* itemStaticText200 = new wxStaticText( itemPanel3, wxID_ANY, _("Expenses..."), - wxDefaultPosition, wxSize(75, 20), 0 ); - - wxStaticText* itemStaticText201 = new wxStaticText( itemPanel3, - ID_DIALOG_BUDGETENTRY_SUMMARY_EXPENSES_EST, _("Estimated: "), wxDefaultPosition, distSize, 0); - - wxStaticText* itemStaticText202 = new wxStaticText( itemPanel3, - ID_DIALOG_BUDGETENTRY_SUMMARY_EXPENSES_ACT, _("Actual: "), wxDefaultPosition, distSize, 0); - - wxStaticText* itemStaticText203 = new wxStaticText( itemPanel3, - ID_DIALOG_BUDGETENTRY_SUMMARY_EXPENSES_DIF, _("Difference: "), wxDefaultPosition, distSize, 0); - - wxBoxSizer* itemExpenseSizer = new wxBoxSizer(wxHORIZONTAL); - itemExpenseSizer->Add(itemStaticText200, 0, wxALL, 0); - itemExpenseSizer->Add(itemStaticText201, 0, wxALL, 0); - itemExpenseSizer->Add(itemStaticText202, 0, wxALL, 0); - itemExpenseSizer->Add(itemStaticText203, 0, wxALL, 0); - itemBoxSizerVHeader->Add(itemExpenseSizer, 0, wxALL, 1); + itemIncomeSizer->Add(itemStaticText21); + itemIncomeSizer->Add(itemStaticText22); + itemIncomeSizer->AddSpacer(20); + itemIncomeSizer->AddSpacer(20); + itemIncomeSizer->Add(itemStaticText23); + itemIncomeSizer->AddSpacer(20); + itemIncomeSizer->AddSpacer(20); + itemIncomeSizer->Add(itemStaticText24); /* ---------------------- */ wxSize imageSize(16, 16); @@ -493,6 +494,11 @@ } /*******************************************************/ +void budgetingListCtrl::OnItemResize(wxListEvent& event) +{ + cp_->save_column_width(event.GetColumn()); +} + void budgetingListCtrl::OnListItemSelected(wxListEvent& event) { selectedIndex_ = event.GetIndex(); Modified: branches/0.9.9.0/mmex/src/budgetingpanel.h =================================================================== --- branches/0.9.9.0/mmex/src/budgetingpanel.h 2012-07-08 20:42:33 UTC (rev 2710) +++ branches/0.9.9.0/mmex/src/budgetingpanel.h 2012-07-09 07:27:23 UTC (rev 2711) @@ -59,9 +59,9 @@ void OnItemRightClick(wxListEvent& event); void OnListItemSelected(wxListEvent& event); void OnListItemActivated(wxListEvent& event); - private: + void OnItemResize(wxListEvent& event); wxListItemAttr attr1_; // style1 wxListItemAttr attr2_; // style2 wxListItemAttr attr3_; // style3 @@ -124,6 +124,7 @@ void OnEditTransaction(wxCommandEvent& event); void OnViewPopupSelected(wxCommandEvent& event); void OnMouseLeftDown( wxMouseEvent& event ); + void save_column_width(const int width); std::vector<mmBudgetEntryHolder> trans_; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2012-07-10 06:49:56
|
Revision: 2713 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=2713&view=rev Author: vomikan Date: 2012-07-10 06:49:46 +0000 (Tue, 10 Jul 2012) Log Message: ----------- update Modified Paths: -------------- branches/0.9.9.0/mmex/src/budgetingpanel.cpp branches/0.9.9.0/mmex/src/budgetingpanel.h branches/0.9.9.0/mmex/src/guiid.h branches/0.9.9.0/mmex/src/mmcheckingpanel.cpp branches/0.9.9.0/mmex/src/mmex.cpp branches/0.9.9.0/mmex/src/mmex.h branches/0.9.9.0/mmex/src/recentfiles.cpp branches/0.9.9.0/mmex/src/stockspanel.cpp Modified: branches/0.9.9.0/mmex/src/budgetingpanel.cpp =================================================================== --- branches/0.9.9.0/mmex/src/budgetingpanel.cpp 2012-07-09 10:43:52 UTC (rev 2712) +++ branches/0.9.9.0/mmex/src/budgetingpanel.cpp 2012-07-10 06:49:46 UTC (rev 2713) @@ -23,6 +23,8 @@ #include "dbwrapper.h" #include "mmex.h" #include "reportbudget.h" +#include "categdialog.h" +#include "mmaccount.h" /*******************************************************/ /* Include XPM Support */ @@ -111,7 +113,7 @@ wxASSERT(false); wxStaticText* header = (wxStaticText*)FindWindow(ID_PANEL_CHECKING_STATIC_PANELVIEW); - header->SetLabel(wxGetTranslation(wxTRANSLATE("View Budget Category Summary"))); + header->SetLabel(wxGetTranslation(currentView_)); listCtrlBudget_->DeleteAllItems(); initVirtualListControl(); @@ -195,43 +197,54 @@ _("Viewing All Budget Categories")); itemBoxSizerHHeader2->Add(itemStaticText18, 0, wxALL, 1); - wxFlexGridSizer* itemIncomeSizer = new wxFlexGridSizer(0,8,5,10); + wxFlexGridSizer* itemIncomeSizer = new wxFlexGridSizer(0,7,5,10); itemBoxSizerVHeader->Add(itemIncomeSizer); wxStaticText* itemStaticText11 = new wxStaticText( itemPanel3, - wxID_ANY, _("Income.......")); + wxID_STATIC, _("Income.......")); wxStaticText* itemStaticText12 = new wxStaticText( itemPanel3, - ID_DIALOG_BUDGETENTRY_SUMMARY_INCOME_EST, _("Estimated: ")); - wxStaticText* itemStaticText13 = new wxStaticText( itemPanel3, - ID_DIALOG_BUDGETENTRY_SUMMARY_INCOME_ACT, _("Actual: ")); + wxID_STATIC, _("Estimated: ")); + income_estimated_ = new wxStaticText( itemPanel3, + ID_DIALOG_BUDGETENTRY_SUMMARY_INCOME_EST, wxT("$"), wxDefaultPosition, wxSize(120, -1)); wxStaticText* itemStaticText14 = new wxStaticText( itemPanel3, - ID_DIALOG_BUDGETENTRY_SUMMARY_INCOME_DIF, _("Difference: ")); + wxID_STATIC, _("Actual: ")); + income_actual_ = new wxStaticText( itemPanel3, + ID_DIALOG_BUDGETENTRY_SUMMARY_INCOME_ACT, wxT("$"), wxDefaultPosition, wxSize(120, -1)); + wxStaticText* itemStaticText16 = new wxStaticText( itemPanel3, + wxID_STATIC, _("Difference: ")); + income_diff_ = new wxStaticText( itemPanel3, + ID_DIALOG_BUDGETENTRY_SUMMARY_INCOME_DIF, wxT("$")); - wxStaticText* itemStaticText21 = new wxStaticText( itemPanel3, wxID_ANY, _("Expenses...")); + wxStaticText* itemStaticText21 = new wxStaticText( itemPanel3, + wxID_STATIC, _("Expenses...")); wxStaticText* itemStaticText22 = new wxStaticText( itemPanel3, - ID_DIALOG_BUDGETENTRY_SUMMARY_EXPENSES_EST, _("Estimated: ")); - wxStaticText* itemStaticText23 = new wxStaticText( itemPanel3, - ID_DIALOG_BUDGETENTRY_SUMMARY_EXPENSES_ACT, _("Actual: ")); + wxID_STATIC, _("Estimated: ")); + expences_estimated_ = new wxStaticText( itemPanel3, + ID_DIALOG_BUDGETENTRY_SUMMARY_EXPENSES_EST, wxT("$"), wxDefaultPosition, wxSize(120, -1)); wxStaticText* itemStaticText24 = new wxStaticText( itemPanel3, - ID_DIALOG_BUDGETENTRY_SUMMARY_EXPENSES_DIF, _("Difference: ")); + wxID_STATIC, _("Actual: ")); + expences_actual_ = new wxStaticText( itemPanel3, + ID_DIALOG_BUDGETENTRY_SUMMARY_EXPENSES_ACT, wxT("$"), wxDefaultPosition, wxSize(120, -1)); + wxStaticText* itemStaticText26 = new wxStaticText( itemPanel3, + wxID_STATIC, _("Difference: ")); + expences_diff_ = new wxStaticText( itemPanel3, + ID_DIALOG_BUDGETENTRY_SUMMARY_EXPENSES_DIF, wxT("$")); itemIncomeSizer->Add(itemStaticText11); itemIncomeSizer->Add(itemStaticText12); - itemIncomeSizer->AddSpacer(20); - itemIncomeSizer->AddSpacer(20); - itemIncomeSizer->Add(itemStaticText13); - itemIncomeSizer->AddSpacer(20); - itemIncomeSizer->AddSpacer(20); + itemIncomeSizer->Add(income_estimated_); itemIncomeSizer->Add(itemStaticText14); + itemIncomeSizer->Add(income_actual_); + itemIncomeSizer->Add(itemStaticText16); + itemIncomeSizer->Add(income_diff_); itemIncomeSizer->Add(itemStaticText21); itemIncomeSizer->Add(itemStaticText22); - itemIncomeSizer->AddSpacer(20); - itemIncomeSizer->AddSpacer(20); - itemIncomeSizer->Add(itemStaticText23); - itemIncomeSizer->AddSpacer(20); - itemIncomeSizer->AddSpacer(20); + itemIncomeSizer->Add(expences_estimated_); itemIncomeSizer->Add(itemStaticText24); + itemIncomeSizer->Add(expences_actual_); + itemIncomeSizer->Add(itemStaticText26); + itemIncomeSizer->Add(expences_diff_); /* ---------------------- */ wxSize imageSize(16, 16); @@ -316,38 +329,16 @@ } mmDBWrapper::loadBaseCurrencySettings(db_); -//TODO: make it easier -/* - static const char categ_list_sql[] = - "select c.categname as CATEGNAME, s.subcategname as SUBCATEGNAME, " - "c.categid as CATEGID, s.subcategid as SUBCATEGID " - "from subcategory_v1 s " - "left join category_v1 c on c.categid=s.categid " - "union select categname, '', categid, -1 from category_v1 " - "order by CATEGNAME, SUBCATEGNAME "; -*/ - static const char sql[] = - "select CATEGID, CATEGNAME " - "from CATEGORY_V1 " - "order by CATEGNAME"; - static const char sql_sub[] = - "select SUBCATEGID, SUBCATEGNAME " - "from SUBCATEGORY_V1 " - "where CATEGID = ? " - "order by SUBCATEGNAME"; - - wxSQLite3Statement st = db_->PrepareStatement(sql); - wxSQLite3Statement st_sub = db_->PrepareStatement(sql_sub); - - wxSQLite3ResultSet q1 = st.ExecuteQuery(); - - while (q1.NextRow()) + std::pair<mmCategoryList::const_iterator, mmCategoryList::const_iterator> range = core_->rangeCategory(); + for (mmCategoryList::const_iterator it = range.first; it != range.second; ++ it) { + const boost::shared_ptr<mmCategory> category = *it; + mmBudgetEntryHolder th; budgetDetails.initBudgetEntryFields(th, budgetYearID_); - th.categID_ = q1.GetInt(wxT("CATEGID")); - th.catStr_ = q1.GetString(wxT("CATEGNAME")); + th.categID_ = category->categID_; + th.catStr_ = category->categName_; mmDBWrapper::getBudgetEntry(db_, budgetYearID_, th.categID_, th.subcategID_, th.period_, th.amt_); budgetDetails.setBudgetEstimate(th, monthlyBudget); @@ -394,19 +385,21 @@ trans_.push_back(th); } - st_sub.Bind(1, th.categID_); - wxSQLite3ResultSet q2 = st_sub.ExecuteQuery(); - - while(q2.NextRow()) + for (std::vector<boost::shared_ptr<mmCategory> >::const_iterator cit = category->children_.begin(); + cit != category->children_.end(); + ++ cit) { + const boost::shared_ptr<mmCategory> sub_category = *cit; + mmBudgetEntryHolder thsub; budgetDetails.initBudgetEntryFields(thsub, budgetYearID_); thsub.categID_ = th.categID_; thsub.catStr_ = th.catStr_; - thsub.subcategID_ = q2.GetInt(wxT("SUBCATEGID")); - thsub.subCatStr_ = q2.GetString(wxT("SUBCATEGNAME")); + thsub.subcategID_ = sub_category->categID_; + thsub.subCatStr_ = sub_category->categName_; - mmDBWrapper::getBudgetEntry(db_, budgetYearID_, thsub.categID_, thsub.subcategID_, thsub.period_, thsub.amt_); + mmDBWrapper::getBudgetEntry(db_, budgetYearID_, + thsub.categID_, thsub.subcategID_, thsub.period_, thsub.amt_); budgetDetails.setBudgetEstimate(thsub, monthlyBudget); if (thsub.estimated_ < 0) estExpenses += thsub.estimated_; @@ -433,10 +426,8 @@ /*************************************************************************** Update the TOTALS entry for the subcategory. ***************************************************************************/ - //catTotals.amt_ += thsub.amt_; catTotals.estimated_ += thsub.estimated_; catTotals.actual_ += thsub.actual_; - //mmex::formatDoubleToCurrencyEdit(catTotals.amt_, catTotals.amtString_); catTotals.amtString_ = wxEmptyString; mmex::formatDoubleToCurrencyEdit(catTotals.estimated_, catTotals.estimatedStr_); mmex::formatDoubleToCurrencyEdit(catTotals.actual_, catTotals.actualStr_); @@ -445,7 +436,6 @@ trans_.push_back(thsub); } } - st_sub.Reset(); if (mainFrame_->budgetSetupWithSummary() && displayEntryAllowed(catTotals)) { @@ -455,42 +445,26 @@ } } - st_sub.Finalize(); - st.Finalize(); - listCtrlBudget_->SetItemCount((int)trans_.size()); - wxString estIncomeStr, actIncomeStr, estExpensesStr, actExpensesStr; - mmex::formatDoubleToCurrency(estIncome, estIncomeStr); - mmex::formatDoubleToCurrency(actIncome, actIncomeStr); - if (estExpenses < 0.0) - estExpenses = -estExpenses; - if (actExpenses < 0.0) - actExpenses = -actExpenses; + wxString est_amount, act_amount, diff_amount; + mmex::formatDoubleToCurrency(estIncome, est_amount); + mmex::formatDoubleToCurrency(actIncome, act_amount); + mmex::formatDoubleToCurrency(estIncome - actIncome, diff_amount); - mmex::formatDoubleToCurrency(estExpenses, estExpensesStr); - mmex::formatDoubleToCurrency(actExpenses, actExpensesStr); + income_estimated_->SetLabel(est_amount); + income_actual_->SetLabel(act_amount); + income_diff_->SetLabel(diff_amount); - wxString differenceStr; - wxStaticText* header = (wxStaticText*)FindWindow(ID_DIALOG_BUDGETENTRY_SUMMARY_INCOME_EST); - header->SetLabel( _("Estimated: ") + estIncomeStr); - - header = (wxStaticText*)FindWindow(ID_DIALOG_BUDGETENTRY_SUMMARY_INCOME_ACT); - header->SetLabel( _("Actual: ") + actIncomeStr); + if (estExpenses < 0.0) estExpenses = -estExpenses; + if (actExpenses < 0.0) actExpenses = -actExpenses; + mmex::formatDoubleToCurrency(estExpenses, est_amount); + mmex::formatDoubleToCurrency(actExpenses, act_amount); + mmex::formatDoubleToCurrency(estExpenses -actExpenses, diff_amount); - mmex::formatDoubleToCurrency(estIncome - actIncome, differenceStr); - header = (wxStaticText*)FindWindow(ID_DIALOG_BUDGETENTRY_SUMMARY_INCOME_DIF); - header->SetLabel( _("Difference: ") + differenceStr); - - header = (wxStaticText*)FindWindow(ID_DIALOG_BUDGETENTRY_SUMMARY_EXPENSES_EST); - header->SetLabel( _("Estimated: ") + estExpensesStr); - - header = (wxStaticText*)FindWindow(ID_DIALOG_BUDGETENTRY_SUMMARY_EXPENSES_ACT); - header->SetLabel( _("Actual: ") + actExpensesStr); - - mmex::formatDoubleToCurrency(estExpenses -actExpenses, differenceStr); - header = (wxStaticText*)FindWindow(ID_DIALOG_BUDGETENTRY_SUMMARY_EXPENSES_DIF); - header->SetLabel( _("Difference: ") + differenceStr); + expences_estimated_->SetLabel(est_amount); + expences_actual_->SetLabel(act_amount); + expences_diff_->SetLabel(diff_amount); } /*******************************************************/ Modified: branches/0.9.9.0/mmex/src/budgetingpanel.h =================================================================== --- branches/0.9.9.0/mmex/src/budgetingpanel.h 2012-07-09 10:43:52 UTC (rev 2712) +++ branches/0.9.9.0/mmex/src/budgetingpanel.h 2012-07-10 06:49:46 UTC (rev 2713) @@ -25,6 +25,9 @@ #include "wx/wxprec.h" #include "util.h" +#include "dbwrapper.h" +#include "mmcoredb.h" + class wxListCtrl; class wxListEvent; class mmBudgetingPanel; @@ -44,8 +47,7 @@ attr1_(mmColors::listBorderColor, mmColors::listAlternativeColor0, wxNullFont), attr2_(mmColors::listBorderColor, mmColors::listAlternativeColor1, wxNullFont), attr3_(mmColors::listAlternativeColor1, mmColors::listFutureDateColor, wxNullFont), -// Forground,background,font -// attr3_(wxColour( 255, 0, 0 ), wxColour( 0, 255, 0 ), wxNullFont), + cp_(cp), selectedIndex_(-1) {} @@ -128,7 +130,6 @@ std::vector<mmBudgetEntryHolder> trans_; -public: wxImageList* m_imageList; budgetingListCtrl* listCtrlBudget_; wxString currentView_; @@ -136,6 +137,14 @@ mmGUIFrame* mainFrame_; bool displayEntryAllowed(mmBudgetEntryHolder& budgetEntry); + + wxStaticText* income_estimated_; + wxStaticText* income_actual_; + wxStaticText* income_diff_; + wxStaticText* expences_estimated_; + wxStaticText* expences_actual_; + wxStaticText* expences_diff_; + }; #endif Modified: branches/0.9.9.0/mmex/src/guiid.h =================================================================== --- branches/0.9.9.0/mmex/src/guiid.h 2012-07-09 10:43:52 UTC (rev 2712) +++ branches/0.9.9.0/mmex/src/guiid.h 2012-07-10 06:49:46 UTC (rev 2713) @@ -46,14 +46,8 @@ MENU_SAVE_AS, MENU_RECENT_FILES, MENU_RECENT_FILES_0, - MENU_RECENT_FILES_1, - MENU_RECENT_FILES_2, - MENU_RECENT_FILES_3, - MENU_RECENT_FILES_4, - MENU_RECENT_FILES_5, MENU_RECENT_FILES_CLEAR, MENU_EXPORT, - MENU_QUIT, MENU_ABOUT, MENU_NEWACCT, MENU_ACCTLIST, @@ -111,11 +105,7 @@ MENU_CUSTOM_SQL_REPORT_DELETE, MENU_TREEPOPUP_CUSTOM_SQL_REPORT_EDIT, MENU_TREEPOPUP_CUSTOM_SQL_REPORT_DELETE, - //DIALOG_CUSTOM_SQL_BTN_LOAD, - //DIALOG_CUSTOM_SQL_BTN_SAVE, DIALOG_CUSTOM_SQL_BTN_QUERY, - //DIALOG_CUSTOM_SQL_BTN_CLEAR, - //DIALOG_CUSTOM_SQL_BTN_CLOSE, DIALOG_CUSTOM_SQL_TXTCTRL_SOURCE, DIALOG_CUSTOM_SQL_TXTCTRL_REPORT_TITLE, DIALOG_CUSTOM_SQL_CHKBOX_HEADING_ONLY, @@ -179,16 +169,16 @@ ID_TOOL, ID_TOOL2, ID_PANEL20, - //ID_BUTTON_NEW_TRANS, - //ID_BUTTON_EDIT_TRANS, - //ID_BUTTON_DELETE_TRANS, - //ID_BUTTON_MOVE_TRANS, ID_DIALOG_ABOUT, ID_DIALOG_APPSTART, ID_PANEL_CHECKING_STATIC_HEADER, - ID_PANEL_CHECKING_STATIC_BALHEADER, + ID_PANEL_CHECKING_STATIC_BALHEADER1, + ID_PANEL_CHECKING_STATIC_BALHEADER2, + ID_PANEL_CHECKING_STATIC_BALHEADER3, + ID_PANEL_CHECKING_STATIC_BALHEADER4, + ID_PANEL_CHECKING_STATIC_BALHEADER5, ID_PANEL_CHECKING_LISTCTRL_ACCT, ID_PANEL_CHECKING_STATIC_DETAILS, ID_PANEL_CHECKING_STATIC_MINI, Modified: branches/0.9.9.0/mmex/src/mmcheckingpanel.cpp =================================================================== --- branches/0.9.9.0/mmex/src/mmcheckingpanel.cpp 2012-07-09 10:43:52 UTC (rev 2712) +++ branches/0.9.9.0/mmex/src/mmcheckingpanel.cpp 2012-07-10 06:49:46 UTC (rev 2713) @@ -535,9 +535,6 @@ menu.Append(MENU_VIEW_LAST90, _("View Transactions for last 90 days")); menu.Append(MENU_VIEW_LASTMONTH, _("View Transactions for last month")); menu.Append(MENU_VIEW_LAST3MONTHS, _("View Transactions for last 3 months")); - //menu.AppendSeparator(); - //menu.Append(MENU_VIEW_DELETE_TRANS, _("Delete all transactions in current view")); - //menu.Append(MENU_VIEW_DELETE_FLAGGED, _("Delete Viewed \"Follow Up\" Trans.")); PopupMenu(&menu, event.GetPosition()); @@ -559,7 +556,6 @@ { wxBoxSizer* itemBoxSizer9 = new wxBoxSizer(wxVERTICAL); this->SetSizer(itemBoxSizer9); - //this->SetBackgroundColour(mmColors::listBackColor); /* ---------------------- */ wxPanel* headerPanel = new wxPanel( this, wxID_ANY, wxDefaultPosition, @@ -568,7 +564,6 @@ wxBoxSizer* itemBoxSizerVHeader = new wxBoxSizer(wxVERTICAL); headerPanel->SetSizer(itemBoxSizerVHeader); - //headerPanel->SetBackgroundColour(mmColors::listBackColor); wxGridSizer* itemBoxSizerVHeader2 = new wxGridSizer(0,1,5,20); itemBoxSizerVHeader->Add(itemBoxSizerVHeader2); @@ -613,13 +608,35 @@ wxString::Format(wxT("CHECK_FILTER_ID_%ld"), m_AccountID), vTrans); initViewTransactionsHeader(); - wxBoxSizer* itemBoxSizerHHeader = new wxBoxSizer(wxHORIZONTAL); - itemBoxSizerVHeader->Add(itemBoxSizerHHeader, 0, wxALL, 1); - wxStaticText* itemStaticText10 = new wxStaticText( headerPanel, - ID_PANEL_CHECKING_STATIC_BALHEADER, wxT(""), wxDefaultPosition, wxSize(800,20), 0 ); - itemBoxSizerHHeader->Add(itemStaticText10, 0, wxRIGHT|wxEXPAND, 50); + wxStaticText* itemStaticText11 = new wxStaticText( headerPanel, + wxID_STATIC, _("Account Bal: ")); + wxStaticText* itemStaticText12 = new wxStaticText( headerPanel, + ID_PANEL_CHECKING_STATIC_BALHEADER1, wxT("$"), wxDefaultPosition, wxSize(120,-1)); + wxStaticText* itemStaticText13 = new wxStaticText( headerPanel, + wxID_STATIC, _("Reconciled Bal: ")); + wxStaticText* itemStaticText14 = new wxStaticText( headerPanel, + ID_PANEL_CHECKING_STATIC_BALHEADER2, wxT("$"), wxDefaultPosition, wxSize(120,-1)); + wxStaticText* itemStaticText15 = new wxStaticText( headerPanel, + wxID_STATIC, _("Diff: ")); + wxStaticText* itemStaticText16 = new wxStaticText( headerPanel, + ID_PANEL_CHECKING_STATIC_BALHEADER3, wxT("$"), wxDefaultPosition, wxSize(120,-1)); + wxStaticText* itemStaticText17 = new wxStaticText( headerPanel, + ID_PANEL_CHECKING_STATIC_BALHEADER4, _("Displayed Bal: ")); + wxStaticText* itemStaticText18 = new wxStaticText( headerPanel, + ID_PANEL_CHECKING_STATIC_BALHEADER5, wxT("$")); + wxFlexGridSizer* balances_header = new wxFlexGridSizer(0,8,5,10); + itemBoxSizerVHeader->Add(balances_header); + balances_header->Add(itemStaticText11); + balances_header->Add(itemStaticText12); + balances_header->Add(itemStaticText13); + balances_header->Add(itemStaticText14); + balances_header->Add(itemStaticText15); + balances_header->Add(itemStaticText16); + balances_header->Add(itemStaticText17); + balances_header->Add(itemStaticText18); + /* ---------------------- */ wxSplitterWindow* itemSplitterWindow10 = new wxSplitterWindow( this, @@ -637,7 +654,6 @@ m_imageList->Add(wxBitmap(duplicate_xpm)); m_imageList->Add(wxBitmap(trans_from_xpm)); m_imageList->Add(wxBitmap(trans_into_xpm)); - //m_imageList->Add(wxBitmap(trans_transfer_xpm)); m_listCtrlAccount = new TransactionListCtrl( this, itemSplitterWindow10, ID_PANEL_CHECKING_LISTCTRL_ACCT, wxDefaultPosition, wxDefaultSize, @@ -666,7 +682,6 @@ wxPanel *itemPanel12 = new wxPanel(itemSplitterWindow10, ID_PANEL1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL); - //itemPanel12->SetBackgroundColour(mmColors::listBackColor); itemSplitterWindow10->SplitHorizontally(m_listCtrlAccount, itemPanel12); itemSplitterWindow10->SetMinimumPaneSize(100); itemSplitterWindow10->SetSashGravity(1.0); @@ -679,16 +694,16 @@ wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxHORIZONTAL); itemBoxSizer4->Add(itemBoxSizer5, 0, wxALIGN_LEFT|wxALL, 5); - wxButton* itemButton6 = new wxButton(itemPanel12, wxID_NEW, _("&New")); + wxButton* itemButton6 = new wxButton(itemPanel12, wxID_NEW); itemButton6->SetToolTip(_("New Transaction")); itemBoxSizer5->Add(itemButton6, 0, wxRIGHT, 5); - wxButton* itemButton7 = new wxButton(itemPanel12, wxID_EDIT, _("&Edit")); + wxButton* itemButton7 = new wxButton(itemPanel12, wxID_EDIT); itemButton7->SetToolTip(_("Edit selected transaction")); itemBoxSizer5->Add(itemButton7, 0, wxRIGHT, 5); itemButton7->Enable(false); - wxButton* itemButton8 = new wxButton(itemPanel12, wxID_DELETE, _("&Delete")); + wxButton* itemButton8 = new wxButton(itemPanel12, wxID_DELETE); itemButton8->SetToolTip(_("Delete selected transaction")); itemBoxSizer5->Add(itemButton8, 0, wxRIGHT, 5); itemButton8->Enable(false); @@ -709,10 +724,10 @@ itemBoxSizer5->Add(itemStaticText44, 1, wxGROW|wxTOP|wxLEFT, 5); //Infobar - wxStaticText* itemStaticText11 = new wxStaticText( itemPanel12, + wxStaticText* itemStaticText111 = new wxStaticText( itemPanel12, ID_PANEL_CHECKING_STATIC_DETAILS, wxT(""), wxDefaultPosition, wxSize(200,-1), wxTE_MULTILINE|wxTE_WORDWRAP); - itemBoxSizer4->Add(itemStaticText11, 1, wxGROW|wxALL, 5); - //Show tips when no transaction selected + itemBoxSizer4->Add(itemStaticText111, 1, wxGROW|wxALL, 5); + //Show tips when no any transaction selected showTips(); } //---------------------------------------------------------------------------- @@ -911,16 +926,17 @@ mmex::formatDoubleToCurrency(checking_bal - reconciledBal, diffbal); mmex::formatDoubleToCurrency(filteredBalance_, filteredBalanceStr); - wxStaticText* header = (wxStaticText*)FindWindow(ID_PANEL_CHECKING_STATIC_BALHEADER); bool show_displayed_balance_ = (transFilterActive_ || (m_currentView != VIEW_TRANS_ALL_STR)); - - wxString lbl = wxString() << _("Account Bal: ") << balance << wxT(" ") - << _("Reconciled Bal: ") << recbalance << wxT(" ") - << _("Diff: ") << diffbal << wxT(" ") - << (show_displayed_balance_ ? _("Displayed Bal: ") : wxT("")) - << (show_displayed_balance_ ? filteredBalanceStr : wxT("")); - - header->SetLabel(lbl); + wxStaticText* header = (wxStaticText*)FindWindow(ID_PANEL_CHECKING_STATIC_BALHEADER1); + header->SetLabel(balance); + header = (wxStaticText*)FindWindow(ID_PANEL_CHECKING_STATIC_BALHEADER2); + header->SetLabel(recbalance); + header = (wxStaticText*)FindWindow(ID_PANEL_CHECKING_STATIC_BALHEADER3); + header->SetLabel(diffbal); + header = (wxStaticText*)FindWindow(ID_PANEL_CHECKING_STATIC_BALHEADER4); + header->SetLabel(show_displayed_balance_ ? _("Displayed Bal: ") : wxT(" ")); + header = (wxStaticText*)FindWindow(ID_PANEL_CHECKING_STATIC_BALHEADER5); + header->SetLabel(show_displayed_balance_ ? filteredBalanceStr : wxT(" ")); } //---------------------------------------------------------------------------- Modified: branches/0.9.9.0/mmex/src/mmex.cpp =================================================================== --- branches/0.9.9.0/mmex/src/mmex.cpp 2012-07-09 10:43:52 UTC (rev 2712) +++ branches/0.9.9.0/mmex/src/mmex.cpp 2012-07-10 06:49:46 UTC (rev 2713) @@ -406,11 +406,7 @@ EVT_TIMER(AUTO_REPEAT_TRANSACTIONS_TIMER_ID, mmGUIFrame::OnAutoRepeatTransactionsTimer) /* Recent Files */ - EVT_MENU(MENU_RECENT_FILES_1, mmGUIFrame::OnRecentFiles_1) - EVT_MENU(MENU_RECENT_FILES_2, mmGUIFrame::OnRecentFiles_2) - EVT_MENU(MENU_RECENT_FILES_3, mmGUIFrame::OnRecentFiles_3) - EVT_MENU(MENU_RECENT_FILES_4, mmGUIFrame::OnRecentFiles_4) - EVT_MENU(MENU_RECENT_FILES_5, mmGUIFrame::OnRecentFiles_5) + EVT_MENU_RANGE(wxID_FILE1, wxID_FILE5, mmGUIFrame::OnRecentFiles) EVT_MENU(MENU_RECENT_FILES_CLEAR, mmGUIFrame::OnClearRecentFiles) END_EVENT_TABLE() @@ -4779,3 +4775,14 @@ // End debugging code #endif } + +void mmGUIFrame::OnRecentFiles(wxCommandEvent& event) +{ + wxString file_name = recentFiles_->getRecentFile(event.GetId() - wxID_FILE1 +1); + SetDatabaseFile(file_name); +} + +void mmGUIFrame::OnClearRecentFiles(wxCommandEvent& /*event*/) +{ + recentFiles_->clearRecentList(); +} Modified: branches/0.9.9.0/mmex/src/mmex.h =================================================================== --- branches/0.9.9.0/mmex/src/mmex.h 2012-07-09 10:43:52 UTC (rev 2712) +++ branches/0.9.9.0/mmex/src/mmex.h 2012-07-10 06:49:46 UTC (rev 2713) @@ -280,12 +280,8 @@ RecentDatabaseFiles* recentFiles_; wxMenu *menuRecentFiles_; - void OnRecentFiles_1(wxCommandEvent& /*event*/) { SetDatabaseFile(recentFiles_->getRecentFile(1)); } - void OnRecentFiles_2(wxCommandEvent& /*event*/) { SetDatabaseFile(recentFiles_->getRecentFile(2)); } - void OnRecentFiles_3(wxCommandEvent& /*event*/) { SetDatabaseFile(recentFiles_->getRecentFile(3)); } - void OnRecentFiles_4(wxCommandEvent& /*event*/) { SetDatabaseFile(recentFiles_->getRecentFile(4)); } - void OnRecentFiles_5(wxCommandEvent& /*event*/) { SetDatabaseFile(recentFiles_->getRecentFile(5)); } - void OnClearRecentFiles(wxCommandEvent& /*event*/) { recentFiles_->clearRecentList(); } + void OnRecentFiles(wxCommandEvent& event); + void OnClearRecentFiles(wxCommandEvent& /*event*/); /** Sets the database to the new database selected by the user */ void SetDatabaseFile(wxString dbFileName, bool newDatabase = false); Modified: branches/0.9.9.0/mmex/src/recentfiles.cpp =================================================================== --- branches/0.9.9.0/mmex/src/recentfiles.cpp 2012-07-09 10:43:52 UTC (rev 2712) +++ branches/0.9.9.0/mmex/src/recentfiles.cpp 2012-07-10 06:49:46 UTC (rev 2713) @@ -75,40 +75,43 @@ if (menuRecentFiles_->FindItem(MENU_RECENT_FILES_0)) menuRecentFiles_->Delete(MENU_RECENT_FILES_0); - if (menuRecentFiles_->FindItem(MENU_RECENT_FILES_1)) - menuRecentFiles_->Delete(MENU_RECENT_FILES_1); + if (menuRecentFiles_->FindItem(wxID_FILE1)) + menuRecentFiles_->Delete(wxID_FILE1); - if (menuRecentFiles_->FindItem(MENU_RECENT_FILES_2)) - menuRecentFiles_->Delete(MENU_RECENT_FILES_2); + if (menuRecentFiles_->FindItem(wxID_FILE2)) + menuRecentFiles_->Delete(wxID_FILE2); - if (menuRecentFiles_->FindItem(MENU_RECENT_FILES_3)) - menuRecentFiles_->Delete(MENU_RECENT_FILES_3); + if (menuRecentFiles_->FindItem(wxID_FILE3)) + menuRecentFiles_->Delete(wxID_FILE3); - if (menuRecentFiles_->FindItem(MENU_RECENT_FILES_4)) - menuRecentFiles_->Delete(MENU_RECENT_FILES_4); + if (menuRecentFiles_->FindItem(wxID_FILE4)) + menuRecentFiles_->Delete(wxID_FILE4); - if (menuRecentFiles_->FindItem(MENU_RECENT_FILES_5)) - menuRecentFiles_->Delete(MENU_RECENT_FILES_5); + if (menuRecentFiles_->FindItem(wxID_FILE5)) + menuRecentFiles_->Delete(wxID_FILE5); if (recentFileList_[0].IsEmpty()) + { menuRecentFiles_->Append(MENU_RECENT_FILES_0, _("Empty")); + menuRecentFiles_->Enable(MENU_RECENT_FILES_0, false); + } else menuRecentFiles_->Append(MENU_RECENT_FILES_0, recentFileList_[0]); if (! recentFileList_[1].IsEmpty()) - menuRecentFiles_->Append(MENU_RECENT_FILES_1, recentFileList_[1]); + menuRecentFiles_->Append(wxID_FILE1, recentFileList_[1]); if (! recentFileList_[2].IsEmpty()) - menuRecentFiles_->Append(MENU_RECENT_FILES_2, recentFileList_[2]); + menuRecentFiles_->Append(wxID_FILE2, recentFileList_[2]); if (! recentFileList_[3].IsEmpty()) - menuRecentFiles_->Append(MENU_RECENT_FILES_3, recentFileList_[3]); + menuRecentFiles_->Append(wxID_FILE3, recentFileList_[3]); if (! recentFileList_[4].IsEmpty()) - menuRecentFiles_->Append(MENU_RECENT_FILES_4, recentFileList_[4]); + menuRecentFiles_->Append(wxID_FILE4, recentFileList_[4]); if (! recentFileList_[5].IsEmpty()) - menuRecentFiles_->Append(MENU_RECENT_FILES_5, recentFileList_[5]); + menuRecentFiles_->Append(wxID_FILE5, recentFileList_[5]); } void RecentDatabaseFiles::updateRecentList(wxString currentFileName) Modified: branches/0.9.9.0/mmex/src/stockspanel.cpp =================================================================== --- branches/0.9.9.0/mmex/src/stockspanel.cpp 2012-07-09 10:43:52 UTC (rev 2712) +++ branches/0.9.9.0/mmex/src/stockspanel.cpp 2012-07-10 06:49:46 UTC (rev 2713) @@ -32,8 +32,9 @@ { enum { - ID_PANEL_STOCKS_STATIC_DETAILS = 0, - ID_PANEL_STOCKS_STATIC_DETAILS_MINI + ID_PANEL_STOCKS_STATIC_DETAILS = wxID_HIGHEST + 1, + ID_PANEL_STOCKS_STATIC_DETAILS_MINI, + ID_PANEL_STOCKS_STATIC_BALHEADER }; enum EColumn { @@ -170,14 +171,13 @@ wxBoxSizer* itemBoxSizerVHeader = new wxBoxSizer(wxVERTICAL); headerPanel->SetSizer(itemBoxSizerVHeader); - //headerPanel->SetBackgroundColour(mmColors::listBackColor); wxStaticText* itemStaticText9 = new wxStaticText(headerPanel, ID_PANEL_BD_STATIC_HEADER, _("Stock Investments"), wxDefaultPosition, wxDefaultSize, 0); itemStaticText9->SetFont(wxFont(12, wxSWISS, wxNORMAL, wxBOLD, FALSE, wxT(""))); wxStaticText* itemStaticText10 = new wxStaticText(headerPanel, - ID_PANEL_CHECKING_STATIC_BALHEADER, + ID_PANEL_STOCKS_STATIC_BALHEADER, _("Total:"), wxDefaultPosition, wxSize(800, 20), 0); m_LED = new awxLed(headerPanel, ID_PANEL_STOCK_UPDATE_LED, wxDefaultPosition, wxDefaultSize, awxLED_GREEN, 1, 5); @@ -306,7 +306,7 @@ wxString diffStr; mmex::formatDoubleToCurrency((total > originalVal ? total - originalVal : originalVal - total), diffStr); - header = (wxStaticText*)FindWindow(ID_PANEL_CHECKING_STATIC_BALHEADER); + header = (wxStaticText*)FindWindow(ID_PANEL_STOCKS_STATIC_BALHEADER); wxString lbl; lbl << _("Total: ") << balance << wxT (" ") << _("Invested: ") << original; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2012-07-10 07:26:09
|
Revision: 2714 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=2714&view=rev Author: vomikan Date: 2012-07-10 07:26:03 +0000 (Tue, 10 Jul 2012) Log Message: ----------- qif export moved to qifimport file Modified Paths: -------------- branches/0.9.9.0/mmex/src/mmex.cpp branches/0.9.9.0/mmex/src/qifimport.cpp branches/0.9.9.0/mmex/src/util.cpp Modified: branches/0.9.9.0/mmex/src/mmex.cpp =================================================================== --- branches/0.9.9.0/mmex/src/mmex.cpp 2012-07-10 06:49:46 UTC (rev 2713) +++ branches/0.9.9.0/mmex/src/mmex.cpp 2012-07-10 07:26:03 UTC (rev 2714) @@ -15,54 +15,53 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ********************************************************/ - #include "mmex.h" -#include "mmcheckingpanel.h" -#include "budgetingpanel.h" +#include "aboutdialog.h" +#include "appstartdialog.h" +#include "assetspanel.h" +#include "billsdepositsdialog.h" #include "billsdepositspanel.h" +#include "budgetingpanel.h" +#include "budgetyeardialog.h" +#include "categdialog.h" +#include "constants.h" +#include "currencydialog.h" +#include "customreportdialog.h" +#include "customreportdisplay.h" +#include "customreportindex.h" +#include "dbwrapper.h" +#include "filtertransdialog.h" +#include "htmlbuilder.h" +#include "maincurrencydialog.h" +#include "mmcheckingpanel.h" +#include "mmgraphtopcategories.h" +#include "mmhelppanel.h" #include "mmhomepagepanel.h" #include "mmreportspanel.h" -#include "mmhelppanel.h" -#include "stockspanel.h" -#include "assetspanel.h" -#include "univcsvdialog.h" -#include "htmlbuilder.h" +#include "newacctdialog.h" +#include "optionsdialog.h" +#include "paths.h" +#include "payeedialog.h" +#include "platfdep.h" +#include "relocatecategorydialog.h" +#include "relocatepayeedialog.h" #include "reportbase.h" -#include "reportsummary.h" +#include "reportbudgetcategorysummary.h" +#include "reportbudgetingperf.h" +#include "reportcashflow.h" #include "reportcategexp.h" -#include "reportpayee.h" +#include "reportcategovertimeperf.h" #include "reportincexpenses.h" -#include "reportbudgetingperf.h" -#include "reportincexpesestime.h" #include "reportincexpensesfinancialperiod.h" -#include "reportsummarystocks.h" +#include "reportincexpesestime.h" +#include "reportpayee.h" +#include "reportsummary.h" #include "reportsummaryassets.h" +#include "reportsummarystocks.h" #include "reporttransactions.h" -#include "reportcashflow.h" #include "reporttransstats.h" -#include "reportcategovertimeperf.h" -#include "reportbudgetcategorysummary.h" -#include "mmgraphtopcategories.h" -#include "appstartdialog.h" -#include "aboutdialog.h" -#include "newacctdialog.h" -#include "categdialog.h" -#include "payeedialog.h" -#include "relocatecategorydialog.h" -#include "relocatepayeedialog.h" -#include "budgetyeardialog.h" -#include "optionsdialog.h" -#include "currencydialog.h" -#include "maincurrencydialog.h" -#include "filtertransdialog.h" -#include "billsdepositsdialog.h" -#include "dbwrapper.h" -#include "paths.h" -#include "constants.h" -#include "platfdep.h" -#include "customreportdisplay.h" -#include "customreportindex.h" -#include "customreportdialog.h" +#include "stockspanel.h" +#include "univcsvdialog.h" #include <boost/version.hpp> //---------------------------------------------------------------------------- Modified: branches/0.9.9.0/mmex/src/qifimport.cpp =================================================================== --- branches/0.9.9.0/mmex/src/qifimport.cpp 2012-07-10 06:49:46 UTC (rev 2713) +++ branches/0.9.9.0/mmex/src/qifimport.cpp 2012-07-10 07:26:03 UTC (rev 2714) @@ -761,3 +761,171 @@ return fromAccountID; } +void mmExportQIF(mmCoreDB* core, wxSQLite3Database* db_) +{ + if (core->getNumAccounts() == 0) + { + wxMessageBox(_("No Account available for export"), _("QIF Export"), wxICON_WARNING); + return; + } + + + wxString delimit = mmDBWrapper::getInfoSettingValue(db_, wxT("DELIMITER"), mmex::DEFDELIMTER); + wxString q = wxT("\""); + + wxArrayString as = core->getAccountsName(); + wxSingleChoiceDialog scd(0, _("Choose Account to Export from:"),_("QIF Export"), as); + + wxString acctName; + + if (scd.ShowModal() == wxID_OK) acctName = scd.GetStringSelection(); + if (acctName.IsEmpty()) return; + + wxString chooseExt; + chooseExt << _("QIF Files") << wxT(" (*.qif)|*.qif;*.QIF"); + wxString fileName = wxFileSelector(_("Choose QIF data file to Export"), + wxEmptyString, wxEmptyString, wxEmptyString, chooseExt, wxFD_SAVE | wxFD_OVERWRITE_PROMPT); + + if (fileName.IsEmpty()) return; + + correctEmptyFileExt(wxT("qif"), fileName); + + wxFileOutputStream output(fileName); + wxTextOutputStream text(output); + int fromAccountID = core->getAccountID(acctName); + wxString amtSeparator = core->accountList_.getAccountCurrencyDecimalChar(fromAccountID); + + static const char sql[] = + "SELECT transid, transdate as DATE, " + "transcode as TRANSACTIONTYPE, transamount as AMOUNT, totransamount as TOAMOUNT, " + " SUBCATEGID, " + "CATEGID, PAYEEID, " + "TRANSACTIONNUMBER, NOTES, TOACCOUNTID, ACCOUNTID " + "FROM checkingaccount_v1 " + "WHERE ACCOUNTID = ? OR TOACCOUNTID = ?" + "ORDER BY transdate"; + + wxSQLite3Statement st = db_->PrepareStatement(sql); + st.Bind(1, fromAccountID); + st.Bind(2, fromAccountID); + + wxSQLite3ResultSet q1 = st.ExecuteQuery(); + int numRecords = 0; + + text << wxT("!Account") << endl + << wxT("N") << acctName << endl + << wxT("TChecking") << endl + << wxT("^") << endl + << wxT("!Type:Cash") << endl; + + while (q1.NextRow()) + { + wxString transid = q1.GetString(wxT("TRANSID")); + wxString dateDBString = q1.GetString(wxT("DATE")); + wxDateTime dtdt = mmGetStorageStringAsDate(dateDBString); + wxString dateString = mmGetDateForDisplay(db_, dtdt); + + int sid, cid; + wxString payee = mmDBWrapper::getPayee(db_, q1.GetInt(wxT("PAYEEID")), sid, cid); + wxString type = q1.GetString(wxT("TRANSACTIONTYPE")); + + wxString amount = adjustedExportAmount(amtSeparator, q1.GetString(wxT("AMOUNT"))); + //Amount should be formated + double value = 0.0; + mmex::formatCurrencyToDouble(amount, value); + mmex::formatDoubleToCurrencyEdit(value, amount); + + wxString toamount = q1.GetString(wxT("TOAMOUNT")); + //Amount should be formated + value = 0.0; + mmex::formatCurrencyToDouble(toamount, value); + mmex::formatDoubleToCurrencyEdit(value, toamount); + + + wxString transNum = q1.GetString(wxT("TRANSACTIONNUMBER")); + wxString categ = core->getCategoryName(q1.GetInt(wxT("CATEGID"))); + wxString subcateg = mmDBWrapper::getSubCategoryName(db_, + q1.GetInt(wxT("CATEGID")), q1.GetInt(wxT("SUBCATEGID"))); + wxString notes = (q1.GetString(wxT("NOTES"))); + notes.Replace(wxT("''"), wxT("'")); + + // + notes.Replace(wxT("\n"), wxT(" ")); + wxString subcategStr = wxT ("") ; + + if (type == wxT("Transfer")) + { + subcategStr = type; + int tAccountID = q1.GetInt(wxT("TOACCOUNTID")); + int fAccountID = q1.GetInt(wxT("ACCOUNTID")); + + wxString fromAccount = core->getAccountName(fAccountID); + wxString toAccount = core->getAccountName(tAccountID); + + if (tAccountID == fromAccountID) { + payee = fromAccount; + amount = toamount; + } else if (fAccountID == fromAccountID) { + payee = toAccount; + amount = wxT ('-') + amount; + } + } + else + { + subcategStr << categ << (subcateg != wxT("") ? wxT(":") : wxT("")) << subcateg; + } + + text << wxT('D') << dateString << endl + << wxT('T') << (type == wxT("Withdrawal") ? wxT("-") : wxT("")) << amount << endl //FIXME: is T needed when Transfer? + << wxT('P') << payee << endl + << wxT('N') << transNum << endl + //Category or Transfer + << wxT('L') << subcategStr << endl + << wxT('M') << notes << endl; + if (type == wxT("Transfer")) + { + text << wxT('$') << amount << endl; + } + + //if categ id is empty the transaction has been splited + if (categ.IsEmpty() && subcateg.IsEmpty()) + { + static const char sql4splitedtrx[] = + "SELECT SUBCATEGID, CATEGID, SPLITTRANSAMOUNT " + "FROM splittransactions_v1 " + "WHERE TRANSID = ?"; + + wxSQLite3Statement st2 = db_->PrepareStatement(sql4splitedtrx); + st2.Bind(1, transid); + + wxSQLite3ResultSet q2 = st2.ExecuteQuery(); + + while (q2.NextRow()) + { + wxString splitamount = adjustedExportAmount(amtSeparator,q2.GetString(wxT("SPLITTRANSAMOUNT"))); + //Amount should be formated + value = 0.0; + mmex::formatCurrencyToDouble(splitamount, value); + mmex::formatDoubleToCurrencyEdit(value, splitamount); + wxString splitcateg = core->getCategoryName(q2.GetInt(wxT("CATEGID"))); + wxString splitsubcateg = mmDBWrapper::getSubCategoryName(db_, + q2.GetInt(wxT("CATEGID")), q2.GetInt(wxT("SUBCATEGID"))); + text << wxT('S') << splitcateg << (splitsubcateg != wxT("") ? wxT(":") : wxT("")) << splitsubcateg << endl + << wxT('$') << (type == wxT("Withdrawal") ? wxT("-") : wxT("")) << splitamount << endl + // E Split memo — any text to go with this split item. I saggest Category:Subcategory = Amount for earch line + << wxT('E') << splitcateg << (splitsubcateg != wxT("") ? wxT(":") : wxT("")) << splitsubcateg << (type == wxT("Withdrawal") ? wxT(" -") : wxT(" ")) << splitamount << endl; + } + + q2.Finalize(); + } + + text << wxT('^') << endl; + numRecords++; + } + + q1.Finalize(); + + wxString msg = wxString::Format(wxT("%d transactions exported"), numRecords); + mmShowErrorMessage(0, msg, _("Export to QIF")); +} + Modified: branches/0.9.9.0/mmex/src/util.cpp =================================================================== --- branches/0.9.9.0/mmex/src/util.cpp 2012-07-10 06:49:46 UTC (rev 2713) +++ branches/0.9.9.0/mmex/src/util.cpp 2012-07-10 07:26:03 UTC (rev 2714) @@ -404,14 +404,6 @@ return toReturn; } -//TODO this function used ones may be removed -wxString mmUnCleanString(const wxString& orig) -{ - wxString toReturn = orig; - toReturn.Replace(wxT("''"), wxT("'")); - return toReturn; -} - void fixFileExt(wxFileName &f, const wxString &ext) { if (f.GetExt().Lower() != ext) f.SetExt(ext); @@ -500,173 +492,6 @@ return label; } -void mmExportQIF(mmCoreDB* core, wxSQLite3Database* db_) -{ - if (core->getNumAccounts() == 0) - { - wxMessageBox(_("No Account available for export"), _("QIF Export"), wxICON_WARNING); - return; - } - - - wxString delimit = mmDBWrapper::getInfoSettingValue(db_, wxT("DELIMITER"), mmex::DEFDELIMTER); - wxString q = wxT("\""); - - wxArrayString as = core->getAccountsName(); - wxSingleChoiceDialog scd(0, _("Choose Account to Export from:"),_("QIF Export"), as); - - wxString acctName; - - if (scd.ShowModal() == wxID_OK) acctName = scd.GetStringSelection(); - if (acctName.IsEmpty()) return; - - wxString chooseExt; - chooseExt << _("QIF Files") << wxT(" (*.qif)|*.qif;*.QIF"); - wxString fileName = wxFileSelector(_("Choose QIF data file to Export"), - wxEmptyString, wxEmptyString, wxEmptyString, chooseExt, wxFD_SAVE | wxFD_OVERWRITE_PROMPT); - - if (fileName.IsEmpty()) return; - - correctEmptyFileExt(wxT("qif"), fileName); - - wxFileOutputStream output(fileName); - wxTextOutputStream text(output); - int fromAccountID = core->getAccountID(acctName); - wxString amtSeparator = core->accountList_.getAccountCurrencyDecimalChar(fromAccountID); - - static const char sql[] = - "SELECT transid, transdate as DATE, " - "transcode as TRANSACTIONTYPE, transamount as AMOUNT, totransamount as TOAMOUNT, " - " SUBCATEGID, " - "CATEGID, PAYEEID, " - "TRANSACTIONNUMBER, NOTES, TOACCOUNTID, ACCOUNTID " - "FROM checkingaccount_v1 " - "WHERE ACCOUNTID = ? OR TOACCOUNTID = ?" - "ORDER BY transdate"; - - wxSQLite3Statement st = db_->PrepareStatement(sql); - st.Bind(1, fromAccountID); - st.Bind(2, fromAccountID); - - wxSQLite3ResultSet q1 = st.ExecuteQuery(); - int numRecords = 0; - - text << wxT("!Account") << endl - << wxT("N") << acctName << endl - << wxT("TChecking") << endl - << wxT("^") << endl - << wxT("!Type:Cash") << endl; - - while (q1.NextRow()) - { - wxString transid = q1.GetString(wxT("TRANSID")); - wxString dateDBString = q1.GetString(wxT("DATE")); - wxDateTime dtdt = mmGetStorageStringAsDate(dateDBString); - wxString dateString = mmGetDateForDisplay(db_, dtdt); - - int sid, cid; - wxString payee = mmDBWrapper::getPayee(db_, q1.GetInt(wxT("PAYEEID")), sid, cid); - wxString type = q1.GetString(wxT("TRANSACTIONTYPE")); - - wxString amount = adjustedExportAmount(amtSeparator, q1.GetString(wxT("AMOUNT"))); - //Amount should be formated - double value = 0.0; - mmex::formatCurrencyToDouble(amount, value); - mmex::formatDoubleToCurrencyEdit(value, amount); - - wxString toamount = q1.GetString(wxT("TOAMOUNT")); - //Amount should be formated - value = 0.0; - mmex::formatCurrencyToDouble(toamount, value); - mmex::formatDoubleToCurrencyEdit(value, toamount); - - - wxString transNum = q1.GetString(wxT("TRANSACTIONNUMBER")); - wxString categ = core->getCategoryName(q1.GetInt(wxT("CATEGID"))); - wxString subcateg = mmDBWrapper::getSubCategoryName(db_, - q1.GetInt(wxT("CATEGID")), q1.GetInt(wxT("SUBCATEGID"))); - wxString notes = mmUnCleanString(q1.GetString(wxT("NOTES"))); - - // - notes.Replace(wxT("\n"), wxT(" ")); - wxString subcategStr = wxT ("") ; - - if (type == wxT("Transfer")) - { - subcategStr = type; - int tAccountID = q1.GetInt(wxT("TOACCOUNTID")); - int fAccountID = q1.GetInt(wxT("ACCOUNTID")); - - wxString fromAccount = core->getAccountName(fAccountID); - wxString toAccount = core->getAccountName(tAccountID); - - if (tAccountID == fromAccountID) { - payee = fromAccount; - amount = toamount; - } else if (fAccountID == fromAccountID) { - payee = toAccount; - amount = wxT ('-') + amount; - } - } - else - { - subcategStr << categ << (subcateg != wxT("") ? wxT(":") : wxT("")) << subcateg; - } - - text << wxT('D') << dateString << endl - << wxT('T') << (type == wxT("Withdrawal") ? wxT("-") : wxT("")) << amount << endl //FIXME: is T needed when Transfer? - << wxT('P') << payee << endl - << wxT('N') << transNum << endl - //Category or Transfer - << wxT('L') << subcategStr << endl - << wxT('M') << notes << endl; - if (type == wxT("Transfer")) - { - text << wxT('$') << amount << endl; - } - - //if categ id is empty the transaction has been splited - if (categ.IsEmpty() && subcateg.IsEmpty()) - { - static const char sql4splitedtrx[] = - "SELECT SUBCATEGID, CATEGID, SPLITTRANSAMOUNT " - "FROM splittransactions_v1 " - "WHERE TRANSID = ?"; - - wxSQLite3Statement st2 = db_->PrepareStatement(sql4splitedtrx); - st2.Bind(1, transid); - - wxSQLite3ResultSet q2 = st2.ExecuteQuery(); - - while (q2.NextRow()) - { - wxString splitamount = adjustedExportAmount(amtSeparator,q2.GetString(wxT("SPLITTRANSAMOUNT"))); - //Amount should be formated - value = 0.0; - mmex::formatCurrencyToDouble(splitamount, value); - mmex::formatDoubleToCurrencyEdit(value, splitamount); - wxString splitcateg = core->getCategoryName(q2.GetInt(wxT("CATEGID"))); - wxString splitsubcateg = mmDBWrapper::getSubCategoryName(db_, - q2.GetInt(wxT("CATEGID")), q2.GetInt(wxT("SUBCATEGID"))); - text << wxT('S') << splitcateg << (splitsubcateg != wxT("") ? wxT(":") : wxT("")) << splitsubcateg << endl - << wxT('$') << (type == wxT("Withdrawal") ? wxT("-") : wxT("")) << splitamount << endl - // E Split memo — any text to go with this split item. I saggest Category:Subcategory = Amount for earch line - << wxT('E') << splitcateg << (splitsubcateg != wxT("") ? wxT(":") : wxT("")) << splitsubcateg << (type == wxT("Withdrawal") ? wxT(" -") : wxT(" ")) << splitamount << endl; - } - - q2.Finalize(); - } - - text << wxT('^') << endl; - numRecords++; - } - - q1.Finalize(); - - wxString msg = wxString::Format(wxT("%d transactions exported"), numRecords); - mmShowErrorMessage(0, msg, _("Export to QIF")); -} - wxString mmGetDateForDisplay(wxSQLite3Database* /*db*/, const wxDateTime &dt) { return dt.Format(mmOptions::instance().dateFormat); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2012-07-10 11:50:10
|
Revision: 2716 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=2716&view=rev Author: vomikan Date: 2012-07-10 11:49:59 +0000 (Tue, 10 Jul 2012) Log Message: ----------- QIF export update Modified Paths: -------------- branches/0.9.9.0/mmex/src/mmaccount.cpp branches/0.9.9.0/mmex/src/mmaccount.h branches/0.9.9.0/mmex/src/mmcoredb.h branches/0.9.9.0/mmex/src/qifimport.cpp Modified: branches/0.9.9.0/mmex/src/mmaccount.cpp =================================================================== --- branches/0.9.9.0/mmex/src/mmaccount.cpp 2012-07-10 09:07:45 UTC (rev 2715) +++ branches/0.9.9.0/mmex/src/mmaccount.cpp 2012-07-10 11:49:59 UTC (rev 2716) @@ -246,6 +246,22 @@ return wxEmptyString; } +wxArrayInt mmAccountList::getAccountsID(const int except_id) const +{ + wxArrayInt accounts_id; + for (const_iterator it = accounts_.begin(); it != accounts_.end(); ++ it) + { + const mmAccount* account = it->get(); + if ((account->acctType_ == ACCOUNT_TYPE_TERM || account->acctType_ == ACCOUNT_TYPE_BANK) + && account->status_ != mmAccount::MMEX_Closed && account->id_ != except_id) + { + accounts_id.Add(account->id_); + } + } + + return accounts_id; +} +//TODO: Deprecated function. Use getAccountsID wxArrayString mmAccountList::getAccountsName(const int except_id) const { wxArrayString as; Modified: branches/0.9.9.0/mmex/src/mmaccount.h =================================================================== --- branches/0.9.9.0/mmex/src/mmaccount.h 2012-07-10 09:07:45 UTC (rev 2715) +++ branches/0.9.9.0/mmex/src/mmaccount.h 2012-07-10 11:49:59 UTC (rev 2716) @@ -84,6 +84,7 @@ boost::weak_ptr<mmCurrency> getCurrencyWeakPtr(int accountID) const; double getAccountBaseCurrencyConvRate(int accountID) const; wxString getName(int accountID) const; + wxArrayInt getAccountsID(const int except_id = -1) const; wxArrayString getAccountsName(const int except_id = -1) const; wxString getAccountCurrencyDecimalChar(int accountID) const; wxString getAccountCurrencyGroupChar(int accountID) const; Modified: branches/0.9.9.0/mmex/src/mmcoredb.h =================================================================== --- branches/0.9.9.0/mmex/src/mmcoredb.h 2012-07-10 09:07:45 UTC (rev 2715) +++ branches/0.9.9.0/mmex/src/mmcoredb.h 2012-07-10 11:49:59 UTC (rev 2716) @@ -56,6 +56,7 @@ std::pair<mmPayeeList::const_iterator, mmPayeeList::const_iterator> rangePayee() const { return payeeList_.range(); } wxString getAccountName(int accountID) const { return accountList_.getName(accountID); } + wxArrayInt getAccountsID(int except_id = -1) const { return accountList_.getAccountsID(except_id); } wxArrayString getAccountsName(int except_id = -1) const { return accountList_.getAccountsName(except_id); } boost::shared_ptr<mmAccount> getAccountSharedPtr(int accountID) const { return accountList_.getAccountSharedPtr(accountID); } int getNumAccounts() const { return accountList_.getNumAccounts(); } Modified: branches/0.9.9.0/mmex/src/qifimport.cpp =================================================================== --- branches/0.9.9.0/mmex/src/qifimport.cpp 2012-07-10 09:07:45 UTC (rev 2715) +++ branches/0.9.9.0/mmex/src/qifimport.cpp 2012-07-10 11:49:59 UTC (rev 2716) @@ -769,187 +769,194 @@ return; } + const wxArrayInt accounts_id = core->getAccountsID(); + wxArrayString accounts_name; + accounts_name.Add(wxString(wxT("-=")) << _("Categories") << wxT("=-")); + for (int i = 0; i < accounts_id.Count(); i++) + { + accounts_name.Add(core->getAccountName(accounts_id[i])); + } + wxMultiChoiceDialog scd(0, _("Choose Account to Export from:"),_("QIF Export"), accounts_name); - //wxString delimit = mmDBWrapper::getInfoSettingValue(db_, wxT("DELIMITER"), mmex::DEFDELIMTER); - const wxString q = wxT("\""); + wxArrayInt items_index; + if (scd.ShowModal() == wxID_OK) items_index = scd.GetSelections(); + if (items_index.IsEmpty()) return; - wxArrayString as = core->getAccountsName(); - wxSingleChoiceDialog scd(0, _("Choose Account to Export from:"),_("QIF Export"), as); - - wxString acctName; - - if (scd.ShowModal() == wxID_OK) acctName = scd.GetStringSelection(); - if (acctName.IsEmpty()) return; - - wxString chooseExt; - chooseExt << _("QIF Files") << wxT(" (*.qif)|*.qif;*.QIF"); + const wxString chooseExt = _("QIF Files"); wxString fileName = wxFileSelector(_("Choose QIF data file to Export"), - wxEmptyString, wxEmptyString, wxEmptyString, chooseExt, wxFD_SAVE | wxFD_OVERWRITE_PROMPT); + wxEmptyString, wxEmptyString, wxEmptyString, + chooseExt + wxT(" (*.qif)|*.qif;*.QIF"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT); if (fileName.IsEmpty()) return; - correctEmptyFileExt(wxT("qif"), fileName); + + const bool exp_categ = (items_index[0] == 0); + const bool exp_transactions = (items_index[0] != 0 || items_index.Count()>1); wxFileOutputStream output(fileName); wxTextOutputStream text(output); - int fromAccountID = core->getAccountID(acctName); - wxString amtSeparator = core->accountList_.getAccountCurrencyDecimalChar(fromAccountID); + const int fromAccountID = accounts_id[items_index[exp_categ ? 1 : 0] - 1]; + const wxString acctName = core->getAccountName(fromAccountID); + const wxString amtSeparator = core->accountList_.getAccountCurrencyDecimalChar(fromAccountID); //Export categories - //TODO: Should be user defind option - text << wxT("!Type:Cat") << endl; - std::pair<mmCategoryList::const_iterator, mmCategoryList::const_iterator> range = core->rangeCategory(); - for (mmCategoryList::const_iterator it = range.first; it != range.second; ++ it) + if (exp_categ) { - const boost::shared_ptr<mmCategory> category = *it; - const wxString categ_name = category->categName_; - text << wxT("N") << categ_name << endl - << wxT("E") << endl - << wxT("^") << endl; - - for (std::vector<boost::shared_ptr<mmCategory> >::const_iterator cit = category->children_.begin(); - cit != category->children_.end(); - ++ cit) + text << wxT("!Type:Cat") << endl; + std::pair<mmCategoryList::const_iterator, mmCategoryList::const_iterator> range = core->rangeCategory(); + for (mmCategoryList::const_iterator it = range.first; it != range.second; ++ it) { - const boost::shared_ptr<mmCategory> sub_category = *cit; - text << wxT("N") << categ_name << wxT(":") - << sub_category->categName_ << endl + const boost::shared_ptr<mmCategory> category = *it; + const wxString categ_name = category->categName_; + text << wxT("N") << categ_name << endl << wxT("E") << endl << wxT("^") << endl; + + for (std::vector<boost::shared_ptr<mmCategory> >::const_iterator cit = category->children_.begin(); + cit != category->children_.end(); + ++ cit) + { + const boost::shared_ptr<mmCategory> sub_category = *cit; + text << wxT("N") << categ_name << wxT(":") + << sub_category->categName_ << endl + << wxT("E") << endl + << wxT("^") << endl; + } } } - //Export transactions - static const char sql[] = - "SELECT transid, transdate as DATE, " - "transcode as TRANSACTIONTYPE, transamount as AMOUNT, totransamount as TOAMOUNT, " - " SUBCATEGID, " - "CATEGID, PAYEEID, " - "TRANSACTIONNUMBER, NOTES, TOACCOUNTID, ACCOUNTID " - "FROM checkingaccount_v1 " - "WHERE ACCOUNTID = ? OR TOACCOUNTID = ?" - "ORDER BY transdate"; - - wxSQLite3Statement st = db_->PrepareStatement(sql); - st.Bind(1, fromAccountID); - st.Bind(2, fromAccountID); - - wxSQLite3ResultSet q1 = st.ExecuteQuery(); long numRecords = 0; - - text << wxT("!Account") << endl - << wxT("N") << acctName << endl - << wxT("TChecking") << endl - << wxT("^") << endl - << wxT("!Type:Cash") << endl; - - while (q1.NextRow()) + if (exp_transactions) { - wxString transid = q1.GetString(wxT("TRANSID")); - wxString dateDBString = q1.GetString(wxT("DATE")); - wxDateTime dtdt = mmGetStorageStringAsDate(dateDBString); - wxString dateString = mmGetDateForDisplay(db_, dtdt); - - int sid, cid; - wxString payee = mmDBWrapper::getPayee(db_, q1.GetInt(wxT("PAYEEID")), sid, cid); - wxString type = q1.GetString(wxT("TRANSACTIONTYPE")); - - wxString amount = adjustedExportAmount(amtSeparator, q1.GetString(wxT("AMOUNT"))); - //Amount should be formated - double value = 0.0; - mmex::formatCurrencyToDouble(amount, value); - mmex::formatDoubleToCurrencyEdit(value, amount); - - wxString toamount = q1.GetString(wxT("TOAMOUNT")); - //Amount should be formated - value = 0.0; - mmex::formatCurrencyToDouble(toamount, value); - mmex::formatDoubleToCurrencyEdit(value, toamount); - - - wxString transNum = q1.GetString(wxT("TRANSACTIONNUMBER")); - wxString categ = core->getCategoryName(q1.GetInt(wxT("CATEGID"))); - wxString subcateg = mmDBWrapper::getSubCategoryName(db_, - q1.GetInt(wxT("CATEGID")), q1.GetInt(wxT("SUBCATEGID"))); - wxString notes = (q1.GetString(wxT("NOTES"))); - notes.Replace(wxT("''"), wxT("'")); - - // - notes.Replace(wxT("\n"), wxT(" ")); - wxString subcategStr = wxT ("") ; - - if (type == wxT("Transfer")) + static const char sql[] = + "SELECT transid, transdate as DATE, " + "transcode as TRANSACTIONTYPE, transamount as AMOUNT, totransamount as TOAMOUNT, " + " SUBCATEGID, " + "CATEGID, PAYEEID, " + "TRANSACTIONNUMBER, NOTES, TOACCOUNTID, ACCOUNTID " + "FROM checkingaccount_v1 " + "WHERE ACCOUNTID = ? OR TOACCOUNTID = ?" + "ORDER BY transdate"; + + wxSQLite3Statement st = db_->PrepareStatement(sql); + st.Bind(1, fromAccountID); + st.Bind(2, fromAccountID); + + wxSQLite3ResultSet q1 = st.ExecuteQuery(); + + text << wxT("!Account") << endl + << wxT("N") << acctName << endl + << wxT("TChecking") << endl + << wxT("^") << endl + << wxT("!Type:Cash") << endl; + + while (q1.NextRow()) { - subcategStr = type; - int tAccountID = q1.GetInt(wxT("TOACCOUNTID")); - int fAccountID = q1.GetInt(wxT("ACCOUNTID")); - - wxString fromAccount = core->getAccountName(fAccountID); - wxString toAccount = core->getAccountName(tAccountID); - - if (tAccountID == fromAccountID) { - payee = fromAccount; - amount = toamount; - } else if (fAccountID == fromAccountID) { - payee = toAccount; - amount = wxT ('-') + amount; + wxString transid = q1.GetString(wxT("TRANSID")); + wxString dateDBString = q1.GetString(wxT("DATE")); + wxDateTime dtdt = mmGetStorageStringAsDate(dateDBString); + wxString dateString = mmGetDateForDisplay(db_, dtdt); + + int sid, cid; + wxString payee = mmDBWrapper::getPayee(db_, q1.GetInt(wxT("PAYEEID")), sid, cid); + wxString type = q1.GetString(wxT("TRANSACTIONTYPE")); + + wxString amount = adjustedExportAmount(amtSeparator, q1.GetString(wxT("AMOUNT"))); + //Amount should be formated + double value = 0.0; + mmex::formatCurrencyToDouble(amount, value); + mmex::formatDoubleToCurrencyEdit(value, amount); + + wxString toamount = q1.GetString(wxT("TOAMOUNT")); + //Amount should be formated + value = 0.0; + mmex::formatCurrencyToDouble(toamount, value); + mmex::formatDoubleToCurrencyEdit(value, toamount); + + + wxString transNum = q1.GetString(wxT("TRANSACTIONNUMBER")); + wxString categ = core->getCategoryName(q1.GetInt(wxT("CATEGID"))); + wxString subcateg = mmDBWrapper::getSubCategoryName(db_, + q1.GetInt(wxT("CATEGID")), q1.GetInt(wxT("SUBCATEGID"))); + wxString notes = (q1.GetString(wxT("NOTES"))); + notes.Replace(wxT("''"), wxT("'")); + + // + notes.Replace(wxT("\n"), wxT(" ")); + wxString subcategStr = wxT ("") ; + + if (type == wxT("Transfer")) + { + subcategStr = type; + int tAccountID = q1.GetInt(wxT("TOACCOUNTID")); + int fAccountID = q1.GetInt(wxT("ACCOUNTID")); + + wxString fromAccount = core->getAccountName(fAccountID); + wxString toAccount = core->getAccountName(tAccountID); + + if (tAccountID == fromAccountID) { + payee = fromAccount; + amount = toamount; + } else if (fAccountID == fromAccountID) { + payee = toAccount; + amount = wxT ('-') + amount; + } } - } - else - { - subcategStr << categ << (subcateg != wxT("") ? wxT(":") : wxT("")) << subcateg; - } - - text << wxT('D') << dateString << endl - << wxT('T') << (type == wxT("Withdrawal") ? wxT("-") : wxT("")) << amount << endl //FIXME: is T needed when Transfer? - << wxT('P') << payee << endl - << wxT('N') << transNum << endl - //Category or Transfer - << wxT('L') << subcategStr << endl - << wxT('M') << notes << endl; - if (type == wxT("Transfer")) - { - text << wxT('$') << amount << endl; - } - - //if categ id is empty the transaction has been splited - if (categ.IsEmpty() && subcateg.IsEmpty()) - { - static const char sql4splitedtrx[] = - "SELECT SUBCATEGID, CATEGID, SPLITTRANSAMOUNT " - "FROM splittransactions_v1 " - "WHERE TRANSID = ?"; - - wxSQLite3Statement st2 = db_->PrepareStatement(sql4splitedtrx); - st2.Bind(1, transid); - - wxSQLite3ResultSet q2 = st2.ExecuteQuery(); - - while (q2.NextRow()) + else { - wxString splitamount = adjustedExportAmount(amtSeparator,q2.GetString(wxT("SPLITTRANSAMOUNT"))); - //Amount should be formated - value = 0.0; - mmex::formatCurrencyToDouble(splitamount, value); - mmex::formatDoubleToCurrencyEdit(value, splitamount); - wxString splitcateg = core->getCategoryName(q2.GetInt(wxT("CATEGID"))); - wxString splitsubcateg = mmDBWrapper::getSubCategoryName(db_, - q2.GetInt(wxT("CATEGID")), q2.GetInt(wxT("SUBCATEGID"))); - text << wxT('S') << splitcateg << (splitsubcateg != wxT("") ? wxT(":") : wxT("")) << splitsubcateg << endl - << wxT('$') << (type == wxT("Withdrawal") ? wxT("-") : wxT("")) << splitamount << endl - // E Split memo — any text to go with this split item. I saggest Category:Subcategory = Amount for earch line - << wxT('E') << splitcateg << (splitsubcateg != wxT("") ? wxT(":") : wxT("")) << splitsubcateg << (type == wxT("Withdrawal") ? wxT(" -") : wxT(" ")) << splitamount << endl; + subcategStr << categ << (subcateg != wxT("") ? wxT(":") : wxT("")) << subcateg; } - - q2.Finalize(); + + text << wxT('D') << dateString << endl + << wxT('T') << (type == wxT("Withdrawal") ? wxT("-") : wxT("")) << amount << endl //FIXME: is T needed when Transfer? + << wxT('P') << payee << endl + << wxT('N') << transNum << endl + //Category or Transfer + << wxT('L') << subcategStr << endl + << wxT('M') << notes << endl; + if (type == wxT("Transfer")) + { + text << wxT('$') << amount << endl; + } + + //if categ id is empty the transaction has been splited + if (categ.IsEmpty() && subcateg.IsEmpty()) + { + static const char sql4splitedtrx[] = + "SELECT SUBCATEGID, CATEGID, SPLITTRANSAMOUNT " + "FROM splittransactions_v1 " + "WHERE TRANSID = ?"; + + wxSQLite3Statement st2 = db_->PrepareStatement(sql4splitedtrx); + st2.Bind(1, transid); + + wxSQLite3ResultSet q2 = st2.ExecuteQuery(); + + while (q2.NextRow()) + { + wxString splitamount = adjustedExportAmount(amtSeparator,q2.GetString(wxT("SPLITTRANSAMOUNT"))); + //Amount should be formated + value = 0.0; + mmex::formatCurrencyToDouble(splitamount, value); + mmex::formatDoubleToCurrencyEdit(value, splitamount); + wxString splitcateg = core->getCategoryName(q2.GetInt(wxT("CATEGID"))); + wxString splitsubcateg = mmDBWrapper::getSubCategoryName(db_, + q2.GetInt(wxT("CATEGID")), q2.GetInt(wxT("SUBCATEGID"))); + text << wxT('S') << splitcateg << (splitsubcateg != wxT("") ? wxT(":") : wxT("")) << splitsubcateg << endl + << wxT('$') << (type == wxT("Withdrawal") ? wxT("-") : wxT("")) << splitamount << endl + // E Split memo — any text to go with this split item. I saggest Category:Subcategory = Amount for earch line + << wxT('E') << splitcateg << (splitsubcateg != wxT("") ? wxT(":") : wxT("")) << splitsubcateg << (type == wxT("Withdrawal") ? wxT(" -") : wxT(" ")) << splitamount << endl; + } + + q2.Finalize(); + } + + text << wxT('^') << endl; + numRecords++; } - - text << wxT('^') << endl; - numRecords++; + + q1.Finalize(); } - - q1.Finalize(); - wxString msg = wxString::Format(wxT("%d transactions exported"), numRecords); mmShowErrorMessage(0, msg, _("Export to QIF")); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2012-07-11 08:40:38
|
Revision: 2722 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=2722&view=rev Author: vomikan Date: 2012-07-11 08:40:31 +0000 (Wed, 11 Jul 2012) Log Message: ----------- fix for fileviewer Modified Paths: -------------- branches/0.9.9.0/mmex/src/mmex.cpp branches/0.9.9.0/mmex/src/qifimport.cpp branches/0.9.9.0/mmex/src/util.h Modified: branches/0.9.9.0/mmex/src/mmex.cpp =================================================================== --- branches/0.9.9.0/mmex/src/mmex.cpp 2012-07-10 19:51:46 UTC (rev 2721) +++ branches/0.9.9.0/mmex/src/mmex.cpp 2012-07-11 08:40:31 UTC (rev 2722) @@ -2285,16 +2285,16 @@ boost::shared_ptr<mmAccount> pAccount = m_core->getAccountSharedPtr(data); if (pAccount) { - wxString acctType = pAccount->acctType_; - if (acctType == ACCOUNT_TYPE_BANK || acctType == ACCOUNT_TYPE_TERM) - { - int accountID = mmImportQIF(m_core.get(), pAccount->name_); + wxString acctType = pAccount->acctType_; + if (acctType == ACCOUNT_TYPE_BANK || acctType == ACCOUNT_TYPE_TERM) + { + int accountID = mmImportQIF(this, m_core.get(), pAccount->name_); if (accountID != -1) { setAccountNavTreeSection(m_core.get()->getAccountName(accountID)); createCheckingAccountPage(accountID); } - } + } } } } @@ -3298,7 +3298,7 @@ void mmGUIFrame::OnImportQIF(wxCommandEvent& /*event*/) { - int accountID = mmImportQIF(m_core.get()); + int accountID = mmImportQIF(this, m_core.get()); if (accountID != -1) { setAccountNavTreeSection(m_core.get()->getAccountName(accountID)); Modified: branches/0.9.9.0/mmex/src/qifimport.cpp =================================================================== --- branches/0.9.9.0/mmex/src/qifimport.cpp 2012-07-10 19:51:46 UTC (rev 2721) +++ branches/0.9.9.0/mmex/src/qifimport.cpp 2012-07-11 08:40:31 UTC (rev 2722) @@ -373,7 +373,7 @@ return true; } -int mmImportQIF(mmCoreDB* core, wxString destinationAccountName ) +int mmImportQIF(wxWindow *parent_, mmCoreDB* core, wxString destinationAccountName ) { wxSQLite3Database* db_ = core->db_.get(); @@ -437,16 +437,14 @@ std::vector<int> QIF_transID; core->db_.get()->Begin(); - wxProgressDialog dlg(_("QIF Import"), _("Transactions imported from QIF: "), 100, + wxProgressDialog* dlg = new wxProgressDialog(_("QIF Import"), _("Transactions imported from QIF: "), 100, NULL, wxPD_AUTO_HIDE | wxPD_CAN_ABORT); while(!input.Eof()) { wxString progressMsg; progressMsg << _("Transactions imported from QIF") << wxT("\n") << _("to account ") << acctName << wxT(": ") << numImported; - dlg.Update(static_cast<int>((static_cast<double>(numImported)/100.0 - numImported/100) *99), progressMsg); - - if (!dlg.Update(-1)) // if cancel clicked + if (!dlg->Update(static_cast<int>((static_cast<double>(numImported)/100.0 - numImported/100) *99), progressMsg)) { canceledbyuser = true; break; // abort processing @@ -515,7 +513,7 @@ while( reading ) { readLine = getFileLine(text, numLines); - if (readLine == wxT("!Type:Bank")) + if (/*readLine.Contains(wxT("!Account")) ||*/ readLine.Contains(wxT("!Type:"))) reading = false; } continue; @@ -719,7 +717,7 @@ } } - dlg.Update(100); + dlg->Destroy(); log << _("Transactions imported from QIF: ") << numImported << endl; wxString confirmMsg; @@ -756,7 +754,7 @@ } if ( !fileName.IsEmpty() ) - fileviewer(logFile.GetFullPath(), 0).ShowModal(); + fileviewer(logFile.GetFullPath(), parent_).ShowModal(); return fromAccountID; } @@ -918,7 +916,7 @@ else if (type == wxT("Withdrawal")) amount.Prepend(wxT ('-')); - categ =+ (subcateg.IsEmpty() ? wxT("") : wxString(wxT(":"))<< subcateg); + categ += (subcateg.IsEmpty() ? wxT("") : wxString(wxT(":"))<< subcateg); text << wxT('D') << dateString << endl; text << wxT('T') << amount << endl; Modified: branches/0.9.9.0/mmex/src/util.h =================================================================== --- branches/0.9.9.0/mmex/src/util.h 2012-07-10 19:51:46 UTC (rev 2721) +++ branches/0.9.9.0/mmex/src/util.h 2012-07-11 08:40:31 UTC (rev 2722) @@ -134,7 +134,7 @@ wxString adjustedExportAmount(wxString amtSeparator, wxString strValue); void fixFileExt(wxFileName &f, const wxString &ext); -int mmImportQIF( mmCoreDB* core, wxString destinationAccountName = wxEmptyString ); +int mmImportQIF(wxWindow* parent_, mmCoreDB* core, wxString destinationAccountName = wxEmptyString ); void correctEmptyFileExt(wxString ext, wxString & fileName ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2012-07-11 19:50:25
|
Revision: 2730 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=2730&view=rev Author: vomikan Date: 2012-07-11 19:50:18 +0000 (Wed, 11 Jul 2012) Log Message: ----------- update Modified Paths: -------------- branches/0.9.9.0/mmex/src/htmlbuilder.cpp branches/0.9.9.0/mmex/src/mmex.cpp Modified: branches/0.9.9.0/mmex/src/htmlbuilder.cpp =================================================================== --- branches/0.9.9.0/mmex/src/htmlbuilder.cpp 2012-07-11 19:31:37 UTC (rev 2729) +++ branches/0.9.9.0/mmex/src/htmlbuilder.cpp 2012-07-11 19:50:18 UTC (rev 2730) @@ -151,8 +151,8 @@ void mmHTMLBuilder::addTotalRow(const wxString& caption, int cols, std::vector<wxString>& data) { html += wxT("<tr bgcolor=\"") + mmColors::listBackColor.GetAsString(wxC2S_HTML_SYNTAX) + wxT("\"><td"); - if(cols - data.size() > 1) - html += wxString::Format(wxT(" colspan=\"%d\""), cols - data.size()); + if((long)cols - data.size() > 1) + html += wxString::Format(wxT(" colspan=\"%ld\""), (long)cols - data.size()); html += wxT("><font size=") + fontSize + wxT("><b><i> "); html += caption; html += wxT("</i></b></font>"); Modified: branches/0.9.9.0/mmex/src/mmex.cpp =================================================================== --- branches/0.9.9.0/mmex/src/mmex.cpp 2012-07-11 19:31:37 UTC (rev 2729) +++ branches/0.9.9.0/mmex/src/mmex.cpp 2012-07-11 19:50:18 UTC (rev 2730) @@ -3912,7 +3912,12 @@ pinterData->SetMarginBottomRight(bottomRight); wxPrintData* printerData = printer_->GetPrintData(); + // fix warning for wxWidgets 2.9.3 +#if wxCHECK_VERSION(2,9,0) + printerData->SetOrientation((wxPrintOrientation)pageOrientation); +#else // use code for wxWidgets 2.8.x printerData->SetOrientation(pageOrientation); +#endif printerData->SetPaperId( (wxPaperSize)paperID ); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2012-07-11 20:01:35
|
Revision: 2731 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=2731&view=rev Author: vomikan Date: 2012-07-11 20:01:29 +0000 (Wed, 11 Jul 2012) Log Message: ----------- update for 2.9.x Modified Paths: -------------- branches/0.9.9.0/mmex/src/mmhomepagepanel.cpp branches/0.9.9.0/mmex/src/mmtransaction.cpp branches/0.9.9.0/mmex/src/mmyahoo.cpp Modified: branches/0.9.9.0/mmex/src/mmhomepagepanel.cpp =================================================================== --- branches/0.9.9.0/mmex/src/mmhomepagepanel.cpp 2012-07-11 19:50:18 UTC (rev 2730) +++ branches/0.9.9.0/mmex/src/mmhomepagepanel.cpp 2012-07-11 20:01:29 UTC (rev 2731) @@ -710,7 +710,7 @@ hb.startTableRow(); hb.addTableCell( _("Total Transactions: ")); - hb.addTableCell(wxString::Format(wxT("%d"), core_->bTransactionList_.transactions_.size()), true, true, true); + hb.addTableCell(wxString::Format(wxT("%ld"), core_->bTransactionList_.transactions_.size()), true, true, true); hb.endTableRow(); hb.addRowSeparator(2); hb.endTable(); Modified: branches/0.9.9.0/mmex/src/mmtransaction.cpp =================================================================== --- branches/0.9.9.0/mmex/src/mmtransaction.cpp 2012-07-11 19:50:18 UTC (rev 2730) +++ branches/0.9.9.0/mmex/src/mmtransaction.cpp 2012-07-11 20:01:29 UTC (rev 2731) @@ -517,7 +517,7 @@ pCopyTransaction->payeeID_= pBankTransaction->payeeID_; pCopyTransaction->transType_= pBankTransaction->transType_; pCopyTransaction->amt_ = pBankTransaction->amt_; - pCopyTransaction->status_ = (useOriginalDate ? wxChar('D') : pBankTransaction->status_); + pCopyTransaction->status_ = (useOriginalDate ? wxT("D") : pBankTransaction->status_); pCopyTransaction->transNum_= pBankTransaction->transNum_; pCopyTransaction->notes_= pBankTransaction->notes_; pCopyTransaction->categID_ = pBankTransaction->categID_; Modified: branches/0.9.9.0/mmex/src/mmyahoo.cpp =================================================================== --- branches/0.9.9.0/mmex/src/mmyahoo.cpp 2012-07-11 19:50:18 UTC (rev 2730) +++ branches/0.9.9.0/mmex/src/mmyahoo.cpp 2012-07-11 20:01:29 UTC (rev 2731) @@ -74,7 +74,7 @@ inidb_->Begin(); db_->Begin(); // Status - Save to mmexini.db3 - mmDBWrapper::setINISettingValue(inidb_, wxT("STOCKS_REFRESH_ENABLED"), wxString::Format(wxT("%d"),UpdatingEnabled_)); + mmDBWrapper::setINISettingValue(inidb_, wxT("STOCKS_REFRESH_ENABLED"), wxString::Format(wxT("%ld"),UpdatingEnabled_)); // Save to user database mmDBWrapper::setInfoSettingValue(db_, wxT("STOCKS_MARKET_OPEN_TIME"), OpenTimeStr_) ; @@ -85,7 +85,7 @@ mmDBWrapper::setInfoSettingValue(db_, wxT("STOCKS_LAST_REFRESH_DATETIME"), wxString::Format(wxT("%s %s"), LastRefreshDT_.FormatISODate().c_str(),LastRefreshDT_.FormatISOTime().c_str())); } - mmDBWrapper::setInfoSettingValue(db_, wxT("STOCKS_REFRESH_MINUTES"),wxString::Format(wxT("%d"),UpdateIntervalMinutes_)); + mmDBWrapper::setInfoSettingValue(db_, wxT("STOCKS_REFRESH_MINUTES"),wxString::Format(wxT("%ld"),UpdateIntervalMinutes_)); // Server mmDBWrapper::setInfoSettingValue(db_,wxT("HTTP_YAHOO_SERVER"),Server_); mmDBWrapper::setInfoSettingValue(db_,wxT("HTTP_YAHOO_SUFFIX"),Suffix_); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ste...@us...> - 2012-07-12 02:49:56
|
Revision: 2734 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=2734&view=rev Author: stef145g Date: 2012-07-12 02:49:49 +0000 (Thu, 12 Jul 2012) Log Message: ----------- Branch 0.9.9.0: Improve account switching from Navigation panel Modified Paths: -------------- branches/0.9.9.0/mmex/src/budgetingpanel.cpp branches/0.9.9.0/mmex/src/mmcheckingpanel.cpp branches/0.9.9.0/mmex/src/mmcheckingpanel.h branches/0.9.9.0/mmex/src/mmex.cpp branches/0.9.9.0/mmex/src/mmex.h Modified: branches/0.9.9.0/mmex/src/budgetingpanel.cpp =================================================================== --- branches/0.9.9.0/mmex/src/budgetingpanel.cpp 2012-07-11 20:37:03 UTC (rev 2733) +++ branches/0.9.9.0/mmex/src/budgetingpanel.cpp 2012-07-12 02:49:49 UTC (rev 2734) @@ -268,7 +268,7 @@ listCtrlBudget_->InsertColumn(5, _("Actual"), wxLIST_FORMAT_RIGHT); /* Get data from inidb */ - for (size_t i = 0; i < listCtrlBudget_->GetColumnCount(); ++i) + for (int i = 0; i < listCtrlBudget_->GetColumnCount(); ++i) { long col; if (!mmDBWrapper::getINISettingValue(inidb_, wxString::Format(wxT("BUDGET_COL%d_WIDTH"), i), wxT("80")).ToLong(&col)) Modified: branches/0.9.9.0/mmex/src/mmcheckingpanel.cpp =================================================================== --- branches/0.9.9.0/mmex/src/mmcheckingpanel.cpp 2012-07-11 20:37:03 UTC (rev 2733) +++ branches/0.9.9.0/mmex/src/mmcheckingpanel.cpp 2012-07-12 02:49:49 UTC (rev 2734) @@ -22,6 +22,7 @@ #include "util.h" #include "dbwrapper.h" #include "transactionfilterdialog.h" +#include "mmex.h" //---------------------------------------------------------------------------- #include <wx/event.h> #include <algorithm> @@ -451,12 +452,14 @@ ( mmCoreDB* core, wxSQLite3Database* inidb, + mmGUIFrame* mainFrame, int accountID, wxWindow *parent, wxWindowID winid, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : mmPanelBase(NULL, inidb, core), + mainFrame_(mainFrame), filteredBalance_(0.0), m_listCtrlAccount(), m_AccountID(accountID) @@ -474,6 +477,7 @@ */ mmCheckingPanel::~mmCheckingPanel() { + mainFrame_->SetCheckingAccountPageInactive(); } //---------------------------------------------------------------------------- @@ -490,7 +494,6 @@ { Freeze(); CreateControls(); - initViewTransactionsHeader(); GetSizer()->Fit(this); GetSizer()->SetSizeHints(this); @@ -591,22 +594,17 @@ itemFlexGridSizerHHeader2->AddSpacer(20); - itemStaticBitmap31_ = new wxStaticBitmap( headerPanel, ID_PANEL_CHECKING_STATIC_BITMAP_FILTER, + bitmapTransFilter_ = new wxStaticBitmap( headerPanel, ID_PANEL_CHECKING_STATIC_BITMAP_FILTER, itemStaticBitmap, wxDefaultPosition, wxSize(16, 16), 0 ); - itemFlexGridSizerHHeader2->Add(itemStaticBitmap31_, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 150); - itemStaticBitmap31_->Enable(false); - itemStaticBitmap31_->Connect(ID_PANEL_CHECKING_STATIC_BITMAP_FILTER, wxEVT_LEFT_DOWN, wxMouseEventHandler(mmCheckingPanel::OnFilterTransactions), NULL, this); - itemStaticBitmap31_->Connect(ID_PANEL_CHECKING_STATIC_BITMAP_FILTER, wxEVT_RIGHT_DOWN, wxMouseEventHandler(mmCheckingPanel::OnFilterTransactions), NULL, this); + itemFlexGridSizerHHeader2->Add(bitmapTransFilter_, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 150); + bitmapTransFilter_->Connect(ID_PANEL_CHECKING_STATIC_BITMAP_FILTER, wxEVT_LEFT_DOWN, wxMouseEventHandler(mmCheckingPanel::OnFilterTransactions), NULL, this); + bitmapTransFilter_->Connect(ID_PANEL_CHECKING_STATIC_BITMAP_FILTER, wxEVT_RIGHT_DOWN, wxMouseEventHandler(mmCheckingPanel::OnFilterTransactions), NULL, this); statTextTransFilter_ = new wxStaticText( headerPanel, ID_PANEL_CHECKING_STATIC_FILTER, _("Transaction Filter"), wxDefaultPosition, wxDefaultSize, 0 ); itemFlexGridSizerHHeader2->Add(statTextTransFilter_, 0, wxALIGN_CENTER_VERTICAL, 0); - statTextTransFilter_->Enable(false); + SetTransactionFilterState(false); - wxString vTrans = mmDBWrapper::getINISettingValue(inidb_, wxT("VIEWTRANSACTIONS"), VIEW_TRANS_ALL_STR); - m_currentView = mmDBWrapper::getInfoSettingValue(core_->db_.get(), - wxString::Format(wxT("CHECK_FILTER_ID_%ld"), m_AccountID), vTrans); - initViewTransactionsHeader(); wxStaticText* itemStaticText11 = new wxStaticText( headerPanel, @@ -1189,22 +1187,30 @@ void mmCheckingPanel::initViewTransactionsHeader() { - if (m_currentView == VIEW_TRANS_ALL_STR) { + wxString vTrans = mmDBWrapper::getINISettingValue(inidb_, wxT("VIEWTRANSACTIONS"), VIEW_TRANS_ALL_STR); + m_currentView = mmDBWrapper::getInfoSettingValue(core_->db_.get(), wxString::Format(wxT("CHECK_FILTER_ID_%ld"), m_AccountID), vTrans); + + if (m_currentView == VIEW_TRANS_ALL_STR) + { itemStaticTextMainFilter_->SetLabel(_("Viewing all transactions")); - itemStaticBitmap31_->Enable(true); - statTextTransFilter_->Enable(true); - } else { - if (m_currentView == VIEW_TRANS_RECONCILED_STR) itemStaticTextMainFilter_->SetLabel(_("Viewing Reconciled transactions")); + SetTransactionFilterState(true); + } + else + { + if (m_currentView == VIEW_TRANS_RECONCILED_STR) itemStaticTextMainFilter_->SetLabel(_("Viewing Reconciled transactions")); else if (m_currentView == VIEW_TRANS_NOT_RECONCILED_STR) itemStaticTextMainFilter_->SetLabel(_("Viewing All Except Reconciled Transactions")); - else if (m_currentView == VIEW_TRANS_UNRECONCILED_STR) itemStaticTextMainFilter_->SetLabel(_("Viewing Un-Reconciled transactions")); - else if (m_currentView == VIEW_TRANS_TODAY_STR) itemStaticTextMainFilter_->SetLabel(_("Viewing transactions for today")); - else if (m_currentView == VIEW_TRANS_CURRENT_MONTH_STR) itemStaticTextMainFilter_->SetLabel(_("Viewing transactions for current month")); - else if (m_currentView == VIEW_TRANS_LAST_30_DAYS_STR) itemStaticTextMainFilter_->SetLabel(_("Viewing transactions for last 30 days")); - else if (m_currentView == VIEW_TRANS_LAST_90_DAYS_STR) itemStaticTextMainFilter_->SetLabel(_("Viewing transactions for last 90 days")); - else if (m_currentView == VIEW_TRANS_LAST_MONTH_STR) itemStaticTextMainFilter_->SetLabel(_("Viewing transactions for last month")); - else if (m_currentView == VIEW_TRANS_LAST_3MONTHS_STR) itemStaticTextMainFilter_->SetLabel(_("Viewing transactions for last 3 months")); - itemStaticBitmap31_->Enable(false); - statTextTransFilter_->Enable(false); + else if (m_currentView == VIEW_TRANS_UNRECONCILED_STR) itemStaticTextMainFilter_->SetLabel(_("Viewing Un-Reconciled transactions")); + else if (m_currentView == VIEW_TRANS_TODAY_STR) itemStaticTextMainFilter_->SetLabel(_("Viewing transactions for today")); + else if (m_currentView == VIEW_TRANS_CURRENT_MONTH_STR) itemStaticTextMainFilter_->SetLabel(_("Viewing transactions for current month")); + else if (m_currentView == VIEW_TRANS_LAST_30_DAYS_STR) itemStaticTextMainFilter_->SetLabel(_("Viewing transactions for last 30 days")); + else if (m_currentView == VIEW_TRANS_LAST_90_DAYS_STR) itemStaticTextMainFilter_->SetLabel(_("Viewing transactions for last 90 days")); + else if (m_currentView == VIEW_TRANS_LAST_MONTH_STR) itemStaticTextMainFilter_->SetLabel(_("Viewing transactions for last month")); + else if (m_currentView == VIEW_TRANS_LAST_3MONTHS_STR) itemStaticTextMainFilter_->SetLabel(_("Viewing transactions for last 3 months")); + else if (m_currentView == VIEW_TRANS_VOID) itemStaticTextMainFilter_->SetLabel(_("Viewing Void transactions")); + else if (m_currentView == VIEW_TRANS_FLAGGED) itemStaticTextMainFilter_->SetLabel(_("Viewing Follow-Up transactions")); + else if (m_currentView == VIEW_TRANS_DUPLICATES) itemStaticTextMainFilter_->SetLabel(_("Viewing duplicate transactions")); + + SetTransactionFilterState(false); } } //---------------------------------------------------------------------------- @@ -1218,8 +1224,7 @@ itemStaticTextMainFilter_->SetLabel(_("Viewing all transactions")); m_currentView = VIEW_TRANS_ALL_STR; - itemStaticBitmap31_->Enable(true); - statTextTransFilter_->Enable(true); + SetTransactionFilterState(true); m_listCtrlAccount->DeleteAllItems(); initVirtualListControl(); @@ -1315,8 +1320,7 @@ wxASSERT(false); } - itemStaticBitmap31_->Enable(show_filter_); - statTextTransFilter_->Enable(show_filter_); + SetTransactionFilterState(show_filter_); m_listCtrlAccount->DeleteAllItems(); @@ -1392,9 +1396,8 @@ } wxImage pic = bitmapFilterIcon.ConvertToImage(); - itemStaticBitmap31_->SetBitmap(pic); - itemStaticBitmap31_->Enable(true); - statTextTransFilter_->Enable(true); + bitmapTransFilter_->SetBitmap(pic); + SetTransactionFilterState(true); m_listCtrlAccount->DeleteAllItems(); initVirtualListControl(); @@ -2132,3 +2135,22 @@ splitTransDialog.SetDisplaySplitCategories(); splitTransDialog.ShowModal(); } + +// Refresh account screen with new details +void mmCheckingPanel::DisplayAccountDetails(int accountID) +{ + m_AccountID = accountID; + Freeze(); // prevent screen updates while controls being repopulated + + initViewTransactionsHeader(); + initVirtualListControl(); + + showTips(); + Thaw(); // Enable screen refresh with new data. +} + +void mmCheckingPanel::SetTransactionFilterState(bool active) +{ + bitmapTransFilter_->Enable(active); + statTextTransFilter_->Enable(active); +} Modified: branches/0.9.9.0/mmex/src/mmcheckingpanel.h =================================================================== --- branches/0.9.9.0/mmex/src/mmcheckingpanel.h 2012-07-11 20:37:03 UTC (rev 2733) +++ branches/0.9.9.0/mmex/src/mmcheckingpanel.h 2012-07-12 02:49:49 UTC (rev 2734) @@ -27,11 +27,15 @@ #include <boost/shared_ptr.hpp> #include <vector> //---------------------------------------------------------------------------- +class mmGUIFrame; class mmBankTransaction; class TransactionListCtrl; class TransFilterDialog; //---------------------------------------------------------------------------- +// This structure is currently not being used. +// temporarily removed for now +#if 0 /* Holds a single transaction */ @@ -70,6 +74,7 @@ double balance_; wxString balanceStr_; }; +#endif //---------------------------------------------------------------------------- class mmCheckingPanel : public mmPanelBase @@ -78,7 +83,8 @@ mmCheckingPanel( mmCoreDB* core, - wxSQLite3Database* inidb, + wxSQLite3Database* inidb, + mmGUIFrame* mainFrame, int accountID, wxWindow *parent, wxWindowID winid = wxID_ANY, @@ -91,22 +97,25 @@ ~mmCheckingPanel(); /// Display the split categories for the selected transaction. - void DisplaySplitCategories(int transID); + void DisplaySplitCategories(int transID); + /// Refresh account screen with new details + void DisplayAccountDetails(int accountID); private: DECLARE_EVENT_TABLE() friend class TransactionListCtrl; // needs access to m_core, initdb_, ... wxString m_currentView; + mmGUIFrame* mainFrame_; + wxStaticText* itemStaticTextMainFilter_; wxStaticText* statTextTransFilter_; - wxStaticText* itemStaticTextMainFilter_; - wxStaticBitmap* itemStaticBitmap31_; + wxStaticBitmap* bitmapTransFilter_; TransFilterDialog* transFilterDlg_; bool transFilterActive_; double filteredBalance_; TransactionListCtrl *m_listCtrlAccount; - const int m_AccountID; + int m_AccountID; boost::scoped_ptr<wxImageList> m_imageList; std::vector<mmBankTransaction*> m_trans; @@ -139,6 +148,7 @@ void DeleteViewedTransactions(); void DeleteFlaggedTransactions(); + void SetTransactionFilterState(bool active); /* updates the checking panel data */ void initVirtualListControl(); Modified: branches/0.9.9.0/mmex/src/mmex.cpp =================================================================== --- branches/0.9.9.0/mmex/src/mmex.cpp 2012-07-11 20:37:03 UTC (rev 2733) +++ branches/0.9.9.0/mmex/src/mmex.cpp 2012-07-12 02:49:49 UTC (rev 2734) @@ -542,11 +542,13 @@ wxFrame(0, -1, title, pos, size), gotoAccountID_(-1), homePageAccountSelect_(false), + activeCheckingAccountPage_(false), + checkingAccountPage_(), refreshRequested_(), autoRepeatTransactionsTimer_(this, AUTO_REPEAT_TRANSACTIONS_TIMER_ID), activeHomePage_(false), panelCurrent_(), - homePanel(), + homePanel_(), navTreeCtrl_(), menuBar_(), toolBar_(), @@ -1021,7 +1023,7 @@ navTreeCtrl_->AssignImageList(imageList_); - homePanel = new wxPanel( this, ID_PANEL, + homePanel_ = new wxPanel( this, ID_PANEL, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL | wxTR_SINGLE | wxNO_BORDER); m_mgr.AddPane(navTreeCtrl_, wxAuiPaneInfo(). @@ -1029,7 +1031,7 @@ BestSize(wxSize(200,100)).MinSize(wxSize(100,100)). Left()); - m_mgr.AddPane(homePanel, wxAuiPaneInfo(). + m_mgr.AddPane(homePanel_, wxAuiPaneInfo(). Name(wxT("Home")).Caption(wxT("Home")). CenterPane().PaneBorder(false)); } @@ -1608,10 +1610,10 @@ Freeze(); wxSizer *sizer = cleanupHomePanel(); - panelCurrent_ = new mmStocksPanel(m_db.get(), m_inidb.get(), m_core.get(), data, homePanel, ID_PANEL3, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL); + panelCurrent_ = new mmStocksPanel(m_db.get(), m_inidb.get(), m_core.get(), data, homePanel_, ID_PANEL3, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL); sizer->Add(panelCurrent_, 1, wxGROW|wxALL, 1); - homePanel->Layout(); + homePanel_->Layout(); Thaw(); } } @@ -2535,11 +2537,11 @@ wxSizer *sizer = cleanupHomePanel(); panelCurrent_ = new mmBudgetingPanel(m_db.get(), m_inidb.get(), m_core.get(), this, budgetYearID, - homePanel, ID_PANEL3, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL); + homePanel_, ID_PANEL3, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL); sizer->Add(panelCurrent_, 1, wxGROW|wxALL, 1); - homePanel->Layout(); + homePanel_->Layout(); } //---------------------------------------------------------------------------- @@ -2558,7 +2560,7 @@ m_inidb.get(), m_core.get(), m_topCategories, - homePanel, + homePanel_, ID_PANEL3, wxDefaultPosition, wxDefaultSize, @@ -2566,7 +2568,7 @@ sizer->Add(panelCurrent_, 1, wxGROW|wxALL, 1); - homePanel->Layout(); + homePanel_->Layout(); refreshRequested_ = false; } //---------------------------------------------------------------------------- @@ -2575,12 +2577,12 @@ { wxSizer *sizer = cleanupHomePanel(); - panelCurrent_ = new mmReportsPanel(this, m_db.get(), rs, homePanel, ID_PANEL3, + panelCurrent_ = new mmReportsPanel(this, m_db.get(), rs, homePanel_, ID_PANEL3, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL); sizer->Add(panelCurrent_, 1, wxGROW|wxALL, 1); - homePanel->Layout(); + homePanel_->Layout(); } //---------------------------------------------------------------------------- @@ -2588,12 +2590,12 @@ { wxSizer *sizer = cleanupHomePanel(); - panelCurrent_ = new mmHelpPanel(this, m_db.get(), homePanel, ID_PANEL3, + panelCurrent_ = new mmHelpPanel(this, m_db.get(), homePanel_, ID_PANEL3, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL); sizer->Add(panelCurrent_, 1, wxGROW|wxALL, 1); - homePanel->Layout(); + homePanel_->Layout(); } //---------------------------------------------------------------------------- @@ -4056,12 +4058,12 @@ { wxSizer *sizer = cleanupHomePanel(); - panelCurrent_ = new mmBillsDepositsPanel(m_db.get(), m_inidb.get(), m_core.get(), homePanel, ID_PANEL3, + panelCurrent_ = new mmBillsDepositsPanel(m_db.get(), m_inidb.get(), m_core.get(), homePanel_, ID_PANEL3, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL); sizer->Add(panelCurrent_, 1, wxGROW|wxALL, 1); - homePanel->Layout(); + homePanel_->Layout(); } //---------------------------------------------------------------------------- @@ -4070,12 +4072,12 @@ wxSizer *sizer = cleanupHomePanel(); panelCurrent_ = new mmStocksPanel(m_db.get(), m_inidb.get(), m_core.get(), - accountID, homePanel, ID_PANEL3, + accountID, homePanel_, ID_PANEL3, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); sizer->Add(panelCurrent_, 1, wxGROW|wxALL, 1); - homePanel->Layout(); + homePanel_->Layout(); } //---------------------------------------------------------------------------- @@ -4085,18 +4087,29 @@ createStocksAccountPage(gotoAccountID_); } +void mmGUIFrame::SetCheckingAccountPageInactive() +{ + activeCheckingAccountPage_ = false; +} //---------------------------------------------------------------------------- void mmGUIFrame::createCheckingAccountPage(int accountID) { - wxSizer *sizer = cleanupHomePanel(); + if (activeCheckingAccountPage_) + { + checkingAccountPage_->DisplayAccountDetails(accountID); + } + else + { + wxSizer *sizer = cleanupHomePanel(); - panelCurrent_ = new mmCheckingPanel(m_core.get(), m_inidb.get(), - accountID, homePanel, ID_PANEL3, - wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL - ); - - sizer->Add(panelCurrent_, 1, wxGROW|wxALL, 1); - homePanel->Layout(); + checkingAccountPage_ = new mmCheckingPanel(m_core.get(), m_inidb.get(), this, + accountID, homePanel_, ID_PANEL3, + wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL); + panelCurrent_ = checkingAccountPage_; + activeCheckingAccountPage_ = true; + sizer->Add(panelCurrent_, 1, wxGROW|wxALL, 1); + homePanel_->Layout(); + } } //---------------------------------------------------------------------------- @@ -4110,9 +4123,9 @@ void mmGUIFrame::OnAssets(wxCommandEvent& /*event*/) { wxSizer *sizer = cleanupHomePanel(); - panelCurrent_ = new mmAssetsPanel(homePanel, m_db.get(), m_inidb.get(), m_core.get()); + panelCurrent_ = new mmAssetsPanel(homePanel_, m_db.get(), m_inidb.get(), m_core.get()); sizer->Add(panelCurrent_, 1, wxGROW|wxALL, 1); - homePanel->Layout(); + homePanel_->Layout(); } //---------------------------------------------------------------------------- @@ -4607,12 +4620,12 @@ wxSizer* mmGUIFrame::cleanupHomePanel(bool new_sizer) { - wxASSERT(homePanel); + wxASSERT(homePanel_); - homePanel->DestroyChildren(); - homePanel->SetSizer(new_sizer ? new wxBoxSizer(wxHORIZONTAL) : 0); + homePanel_->DestroyChildren(); + homePanel_->SetSizer(new_sizer ? new wxBoxSizer(wxHORIZONTAL) : 0); - return homePanel->GetSizer(); + return homePanel_->GetSizer(); } //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- @@ -4759,39 +4772,6 @@ wxFileName fnLastFile(backupFileArray.Last()); if (fnLastFile.IsFileWritable()) wxRemoveFile(backupFileArray.Last()); } - -#if 0 -// Start debugging code - wxLogMessage(wxString() << wxT("Before - File List size:") << backupFileArray.Count()); - if (backupFileArray.Count() > 0) - { - backupFileArray.Sort(true); - for (size_t debugIndex = 0; debugIndex < backupFileArray.Count(); debugIndex++) - { - wxLogMessage(wxString() << wxT("File ") <<debugIndex << wxT(": ") << backupFileArray[debugIndex]); - } - } - - wxLogMessage(wxT(" ")); - wxLogMessage(wxString() << wxT("After - File List size:") << backupFileArray.Count()); - backupFileArray.Clear(); - backupFile = wxFindFirstFile(fileSearch); - while (!backupFile.empty()) - { - backupFileArray.Add(backupFile); - backupFile = wxFindNextFile(); - } - - if (backupFileArray.Count() > 0) - { - backupFileArray.Sort(true); - for (size_t debugIndex = 0; debugIndex < backupFileArray.Count(); debugIndex++) - { - wxLogMessage(wxString() << wxT("File ") <<debugIndex << wxT(": ") << backupFileArray[debugIndex]); - } - } -// End debugging code -#endif } void mmGUIFrame::OnRecentFiles(wxCommandEvent& event) Modified: branches/0.9.9.0/mmex/src/mmex.h =================================================================== --- branches/0.9.9.0/mmex/src/mmex.h 2012-07-11 20:37:03 UTC (rev 2733) +++ branches/0.9.9.0/mmex/src/mmex.h 2012-07-12 02:49:49 UTC (rev 2734) @@ -43,6 +43,7 @@ class mmPanelBase; class mmTreeItemData; class customSQLReportIndex; +class mmCheckingPanel; //---------------------------------------------------------------------------- struct CategInfo @@ -92,22 +93,54 @@ void setGotoAccountID(int account_id) { gotoAccountID_ = account_id; } void setHomePageActive(bool active = true); - bool expandedBankAccounts() { return menuBar_->IsChecked(MENU_VIEW_BANKACCOUNTS); } - bool expandedTermAccounts() { return menuBar_->IsChecked(MENU_VIEW_TERMACCOUNTS); } - bool expandedStockAccounts() { return menuBar_->IsChecked(MENU_VIEW_STOCKACCOUNTS); } - bool hasActiveTermAccounts() const { return activeTermAccounts_; } - bool financialYearIsDifferent() { return (mmOptions::instance().financialYearStartDayString_ != wxT("1") || mmOptions::instance().financialYearStartMonthString_ != wxT("1")); } - bool budgetFinancialYears() { return menuBar_->IsChecked(MENU_VIEW_BUDGET_FINANCIAL_YEARS); } - bool budgetSetupWithSummary() { return !menuBar_->IsChecked(MENU_VIEW_BUDGET_SETUP_SUMMARY); } - bool budgetCategoryTotal() { return menuBar_->IsChecked(MENU_VIEW_BUDGET_CATEGORY_SUMMARY); } - bool budgetTransferTotal() { return menuBar_->IsChecked(MENU_VIEW_BUDGET_TRANSFER_TOTAL); } + bool expandedBankAccounts() + { + return menuBar_->IsChecked(MENU_VIEW_BANKACCOUNTS); + } + bool expandedTermAccounts() + { + return menuBar_->IsChecked(MENU_VIEW_TERMACCOUNTS); + } + bool expandedStockAccounts() + { + return menuBar_->IsChecked(MENU_VIEW_STOCKACCOUNTS); + } + bool hasActiveTermAccounts() const + { + return activeTermAccounts_; + } + bool financialYearIsDifferent() + { + return (mmOptions::instance().financialYearStartDayString_ != wxT("1") || + mmOptions::instance().financialYearStartMonthString_ != wxT("1")); + } + bool budgetFinancialYears() + { + return menuBar_->IsChecked(MENU_VIEW_BUDGET_FINANCIAL_YEARS); + } + bool budgetSetupWithSummary() + { + return !menuBar_->IsChecked(MENU_VIEW_BUDGET_SETUP_SUMMARY); + } + bool budgetCategoryTotal() + { + return menuBar_->IsChecked(MENU_VIEW_BUDGET_CATEGORY_SUMMARY); + } + bool budgetTransferTotal() + { + return menuBar_->IsChecked(MENU_VIEW_BUDGET_TRANSFER_TOTAL); + } /// return the index (mmex::EDocFile) to return the correct file. - int getHelpFileIndex() const { return helpFileIndex_; } + int getHelpFileIndex() const + { + return helpFileIndex_; + } wxDateTime getUserDefinedFinancialYear(bool prevDayRequired = false) const; void setAccountNavTreeSection(wxString accountName); bool setNavTreeSection( wxString sectionName); + void SetCheckingAccountPageInactive(); private: /* handles to the DB Abstraction */ @@ -134,7 +167,7 @@ /* controls */ mmPanelBase* panelCurrent_; - wxPanel* homePanel; + wxPanel* homePanel_; wxTreeCtrl* navTreeCtrl_; wxMenuBar *menuBar_; wxToolBar* toolBar_; @@ -175,6 +208,9 @@ void createHelpPage(); wxPanel* createMainFrame(wxPanel* mainpanel); + mmCheckingPanel* checkingAccountPage_; + bool activeCheckingAccountPage_; + void createCheckingAccountPage(int accountID); void createStocksAccountPage(int accountID); void createBudgetingPage(int budgetYearID); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2012-07-12 06:50:10
|
Revision: 2735 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=2735&view=rev Author: vomikan Date: 2012-07-12 06:49:59 +0000 (Thu, 12 Jul 2012) Log Message: ----------- load currencies settings replacement and raw sql reorganization Modified Paths: -------------- branches/0.9.9.0/mmex/src/dbwrapper.cpp branches/0.9.9.0/mmex/src/paths.cpp Modified: branches/0.9.9.0/mmex/src/dbwrapper.cpp =================================================================== --- branches/0.9.9.0/mmex/src/dbwrapper.cpp 2012-07-12 02:49:49 UTC (rev 2734) +++ branches/0.9.9.0/mmex/src/dbwrapper.cpp 2012-07-12 06:49:59 UTC (rev 2735) @@ -35,11 +35,7 @@ const double g_defBASECONVRATE = 1.0; const char g_BaseCurrencyIdName[] = "BASECURRENCYID"; -//---------------------------------------------------------------------------- -void loadCurrencies(wxSQLite3Database* db) -{ - try{ - static const char sql[] = +static const char SELECT_ALL_FROM_CURRENCYFORMATS_V1[] = "select CURRENCYNAME, " "PFX_SYMBOL, " "SFX_SYMBOL, " @@ -48,63 +44,118 @@ "UNIT_NAME, " "CENT_NAME, " "SCALE, " - "BASECONVRATE " // CURRENCY_SYMBOL not exists in this table - "from CURRENCYFORMATS_V1"; + "BASECONVRATE " + "FROM CURRENCYFORMATS_V1 " + "WHERE CURRENCYID = ?"; - static const char sql2[] = +static const char INSERT_INTO_CURRENCYFORMATS_V1[] = "insert into CURRENCYFORMATS_V1 (" "CURRENCYNAME, PFX_SYMBOL, SFX_SYMBOL, DECIMAL_POINT, GROUP_SEPARATOR, " "UNIT_NAME, CENT_NAME, SCALE, BASECONVRATE, CURRENCY_SYMBOL " - " ) values ( ?, ?, ?, ?, ?, ?, ?, ?, ?, '' )"; + " ) values ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )"; - wxString fName = mmex::getPathResource(mmex::CURRENCY_DB_SEED); - wxASSERT(wxFileName::FileExists(fName)); +static const char CREATE_TABLE_CURRENCYFORMATS_V1[] = + "CREATE TABLE CURRENCYFORMATS_V1(CURRENCYID integer primary key, " + "CURRENCYNAME TEXT NOT NULL UNIQUE, PFX_SYMBOL TEXT, SFX_SYMBOL TEXT, " + "DECIMAL_POINT TEXT, GROUP_SEPARATOR TEXT, " + "UNIT_NAME TEXT, CENT_NAME TEXT, SCALE numeric, BASECONVRATE numeric, CURRENCY_SYMBOL TEXT)"; - wxSQLite3Database currencies; - currencies.Open(fName, wxGetEmptyString(), WXSQLITE_OPEN_READONLY); +static const char CREATE_TABLE_INFOTABLE_V1[] = + "CREATE TABLE INFOTABLE_V1 " + "( INFOID integer not null primary key, " + "INFONAME TEXT NOT NULL UNIQUE, " + "INFOVALUE TEXT NOT NULL )"; - { - bool ok = currencies.TableExists(wxT("CURRENCYFORMATS_V1")); - wxASSERT(ok); - ok = ok; // removes compiler's warning - } +static const char CREATE_TABLE_BUDGETTABLE_V1[] = + "CREATE TABLE BUDGETTABLE_V1(BUDGETENTRYID integer primary key, " + "BUDGETYEARID integer, CATEGID integer, SUBCATEGID integer, " + "PERIOD TEXT NOT NULL, AMOUNT numeric NOT NULL)"; - wxSQLite3ResultSet rs = currencies.ExecuteQuery(sql); - wxSQLite3Statement st = db->PrepareStatement(sql2); +static const char CREATE_TABLE_STOCK_V1[] = + "CREATE TABLE STOCK_V1(STOCKID integer primary key, " + "HELDAT numeric, PURCHASEDATE TEXT NOT NULL, STOCKNAME TEXT, SYMBOL TEXT, " + "NUMSHARES numeric, PURCHASEPRICE numeric NOT NULL, NOTES TEXT, CURRENTPRICE numeric NOT NULL, " + "VALUE numeric, COMMISSION numeric)"; - while(rs.NextRow()) - { - int i = 0; - st.Bind(++i, rs.GetString(wxT("CURRENCYNAME"))); - st.Bind(++i, rs.GetString(wxT("PFX_SYMBOL"))); - st.Bind(++i, rs.GetString(wxT("SFX_SYMBOL"))); - st.Bind(++i, rs.GetString(wxT("DECIMAL_POINT"))); - st.Bind(++i, rs.GetString(wxT("GROUP_SEPARATOR"))); - st.Bind(++i, rs.GetString(wxT("UNIT_NAME"))); - st.Bind(++i, rs.GetString(wxT("CENT_NAME"))); - st.Bind(++i, rs.GetDouble(wxT("SCALE"))); - st.Bind(++i, rs.GetDouble(wxT("BASECONVRATE"), g_defBASECONVRATE)); +static const char CREATE_TABLE_BUDGETYEAR_V1[] = + "CREATE TABLE BUDGETYEAR_V1(BUDGETYEARID integer primary key, " + "BUDGETYEARNAME TEXT NOT NULL UNIQUE)"; - wxASSERT(st.GetParamCount() == i); +static const char CREATE_TABLE_ASSETS_V1[] = + "CREATE TABLE ASSETS_V1(ASSETID integer primary key, " + "STARTDATE TEXT NOT NULL, ASSETNAME TEXT, " + "VALUE numeric, VALUECHANGE TEXT, NOTES TEXT, VALUECHANGERATE numeric, " + "ASSETTYPE TEXT)"; + +static const char CREATE_TABLE_BILLSDEPOSITS_V1[] = + "CREATE TABLE BILLSDEPOSITS_V1(BDID INTEGER PRIMARY KEY, " + "ACCOUNTID INTEGER NOT NULL, TOACCOUNTID INTEGER, PAYEEID integer NOT NULL, TRANSCODE TEXT NOT NULL, " + "TRANSAMOUNT numeric NOT NULL, STATUS TEXT, TRANSACTIONNUMBER TEXT, NOTES TEXT, " + "CATEGID integer, SUBCATEGID integer, TRANSDATE TEXT, FOLLOWUPID integer, TOTRANSAMOUNT numeric, " + "REPEATS numeric, NEXTOCCURRENCEDATE TEXT, NUMOCCURRENCES numeric)"; - st.ExecuteUpdate(); - st.Reset(); - } +static const char CREATE_TABLE_ACCOUNTLIST_V1[] = + "CREATE TABLE ACCOUNTLIST_V1(ACCOUNTID integer primary key, " + "ACCOUNTNAME TEXT NOT NULL UNIQUE, ACCOUNTTYPE TEXT NOT NULL, ACCOUNTNUM TEXT, " + "STATUS TEXT NOT NULL, " + "NOTES TEXT, HELDAT TEXT, WEBSITE TEXT, CONTACTINFO TEXT, " + "ACCESSINFO TEXT, INITIALBAL numeric, FAVORITEACCT TEXT NOT NULL, " + "CURRENCYID integer NOT NULL)"; - st.Finalize(); - rs.Finalize(); +static const char CREATE_TABLE_CHECKINGACCOUNT_V1[]= + "CREATE TABLE CHECKINGACCOUNT_V1(TRANSID integer primary key, " + "ACCOUNTID integer NOT NULL, TOACCOUNTID integer, PAYEEID integer NOT NULL, TRANSCODE TEXT NOT NULL, " + "TRANSAMOUNT numeric NOT NULL, STATUS TEXT, TRANSACTIONNUMBER TEXT, NOTES TEXT, " + "CATEGID integer, SUBCATEGID integer, TRANSDATE TEXT, FOLLOWUPID integer, TOTRANSAMOUNT numeric)"; - currencies.Close(); - } catch(const wxSQLite3Exception& e) - { - wxLogDebug(wxT("Database::loadCurrencies: Exception"), e.GetMessage().c_str()); - wxLogError(wxT("insert into CURRENCYFORMATS_V1. ") + wxString::Format(_("Error: %s"), e.GetMessage().c_str())); - } -} +static const char CREATE_TABLE_SPLITTRANSACTIONS_V1[]= + "CREATE TABLE SPLITTRANSACTIONS_V1(SPLITTRANSID integer primary key, " + "TRANSID numeric NOT NULL, CATEGID integer, SUBCATEGID integer, SPLITTRANSAMOUNT numeric)"; + +static const char CREATE_TABLE_BUDGETSPLITTRANSACTIONS_V1[]= + "CREATE TABLE BUDGETSPLITTRANSACTIONS_V1(SPLITTRANSID integer primary key, " + "TRANSID integer NOT NULL, CATEGID integer, SUBCATEGID integer, SPLITTRANSAMOUNT numeric)"; + +static const char CREATE_TABLE_PAYEE_V1[]= + "CREATE TABLE PAYEE_V1(PAYEEID integer primary key, " + "PAYEENAME TEXT NOT NULL UNIQUE, CATEGID integer, SUBCATEGID integer)"; + +static const char CREATE_TABLE_CATEGORY_V1[]= + "CREATE TABLE CATEGORY_V1(CATEGID integer primary key, " + "CATEGNAME TEXT NOT NULL)"; + +static const char CREATE_TABLE_SUBCATEGORY_V1[]= + "CREATE TABLE SUBCATEGORY_V1(SUBCATEGID integer primary key, " + "SUBCATEGNAME TEXT NOT NULL, CATEGID integer NOT NULL)"; + +static const char SELECT_INFOVALUE_FROM_INFOTABLE_V1[] = + "SELECT INFOVALUE FROM INFOTABLE_V1 " + "where INFONAME = ?"; + +static const char DELETE_FROM_SPLITTRANSACTIONS_V1[] = + "DELETE FROM SPLITTRANSACTIONS_V1 " + "where TRANSID in( SELECT TRANSID " + "from CHECKINGACCOUNT_V1 " + "where ACCOUNTID = ? OR TOACCOUNTID = ? " + ")"; + +static const char DELETE_FROM_BUDGETSPLITTRANSACTIONS_V1[] = + "DELETE FROM BUDGETSPLITTRANSACTIONS_V1 " + "where TRANSID in( SELECT BDID " + "from BILLSDEPOSITS_V1 " + "where ACCOUNTID = ? OR TOACCOUNTID = ? " + ")"; + +static const char UPDATE_PAYEE_V1[] = + "UPDATE PAYEE_V1 " + "SET PAYEENAME = ?, " + "CATEGID = ?, " + "SUBCATEGID = ? " + "WHERE PAYEEID = ?"; + //---------------------------------------------------------------------------- -void -insertCategoryTree(wxSQLite3Database* db, +void insertCategoryTree(wxSQLite3Database* db, wxSQLite3Statement &cat, wxSQLite3Statement &subcat, const wxString &categoryName, @@ -232,15 +283,8 @@ /* We always create new INFOTABLE_V1 */ if (!db->TableExists(wxT("INFOTABLE_V1"))) { - static const char sql[] = - "create table INFOTABLE_V1 " - "( " - "INFOID integer not null primary key, " - "INFONAME TEXT NOT NULL UNIQUE, " - "INFOVALUE TEXT NOT NULL " - ")"; - db->ExecuteUpdate(sql); + db->ExecuteUpdate(CREATE_TABLE_INFOTABLE_V1); { bool ok = db->TableExists(wxT("INFOTABLE_V1")); @@ -289,43 +333,58 @@ void mmDBWrapper::createCurrencyV1Table(wxSQLite3Database* db) { - try{ - bool exists = db->TableExists(wxT("CURRENCYFORMATS_V1")); + if (db->TableExists(wxT("CURRENCYFORMATS_V1"))) return; - if (exists) { - - /* Check whether the column "CURRENCY_SYMBOL" exists or not */ - wxSQLite3ResultSet q1 = db->ExecuteQuery(wxT("select * from CURRENCYFORMATS_V1 limit 1")); - - if(q1.GetColumnCount() < 11) { - /* not exist, create the column */ - db->ExecuteUpdate(wxT("alter table CURRENCYFORMATS_V1 add CURRENCY_SYMBOL TEXT")); + try + { + db->ExecuteUpdate(CREATE_TABLE_CURRENCYFORMATS_V1); + /* Load Default Currencies */ + wxSortedArrayString currencies; + currencies.Add(wxT("US Dollar ;$;;.;,;dollar;cents;100;1;USD")); + currencies.Add(wxT("EURO;€;;.;,;euro;cent;100;1;EUR")); + // currencies.Add(wxT("EURO;\u20ac;;.;,;euro;cent;100;1;EUR")); + wxString fileName = mmex::getPathResource(mmex::CURRENCY_DB_SEED); + wxASSERT(wxFileName::FileExists(fileName)); + + if (!fileName.empty()) + { + wxTextFile tFile(fileName); + if (tFile.Open()) + { + wxString str; + for (str = tFile.GetFirstLine(); !tFile.Eof(); str = tFile.GetNextLine()) + { + currencies.Add(str); + } } + else + wxMessageBox(_("Unable to open file."), _("Currencies"), wxOK|wxICON_WARNING); + } - } else { + wxSQLite3Statement st; + for (size_t i = 0; i < currencies.Count(); ++i) + { + wxStringTokenizer tk(currencies[i], wxT(";")); - db->ExecuteUpdate(wxT("create table CURRENCYFORMATS_V1(CURRENCYID integer primary key, \ - CURRENCYNAME TEXT NOT NULL UNIQUE, PFX_SYMBOL TEXT, SFX_SYMBOL TEXT, \ - DECIMAL_POINT TEXT, GROUP_SEPARATOR TEXT, \ - UNIT_NAME TEXT, CENT_NAME TEXT, SCALE numeric, BASECONVRATE numeric, CURRENCY_SYMBOL TEXT);")); + st = db->PrepareStatement(INSERT_INTO_CURRENCYFORMATS_V1); + int i = 0; + st.Bind(++i, tk.GetNextToken().Trim()); + st.Bind(++i, tk.GetNextToken()); + st.Bind(++i, tk.GetNextToken()); + st.Bind(++i, tk.GetNextToken()); + st.Bind(++i, tk.GetNextToken()); + st.Bind(++i, tk.GetNextToken()); + st.Bind(++i, tk.GetNextToken()); + st.Bind(++i, wxAtoi(tk.GetNextToken())); + st.Bind(++i, wxAtoi(tk.GetNextToken())); + st.Bind(++i, tk.GetNextToken()); - exists = db->TableExists(wxT("CURRENCYFORMATS_V1")); - wxASSERT(exists); - - /* Load Default US Currency */ - - static const char sql[] = - "insert into CURRENCYFORMATS_V1 (" - "CURRENCYNAME, PFX_SYMBOL, SFX_SYMBOL, DECIMAL_POINT,GROUP_SEPARATOR, UNIT_NAME, " - "CENT_NAME, SCALE, BASECONVRATE, CURRENCY_SYMBOL " - ") values (" - "'US DOLLAR', '$', '', '.', ',', 'dollar', 'cents', 100, 1.0, 'USD' " - ")"; - - db->ExecuteUpdate(sql); - loadCurrencies(db); + st.ExecuteUpdate(); + st.Reset(); } - } catch(const wxSQLite3Exception& e) + st.Finalize(); + } + catch(const wxSQLite3Exception& e) { wxLogDebug(wxT("Database::createCurrencyV1Table: Exception"), e.GetMessage().c_str()); wxLogError(wxT("create CURRENCYFORMATS_V1. ") + wxString::Format(_("Error: %s"), e.GetMessage().c_str())); @@ -339,8 +398,7 @@ bool valid = db->TableExists(wxT("BUDGETYEAR_V1")); if (!valid) { - db->ExecuteUpdate(wxT("CREATE TABLE BUDGETYEAR_V1(BUDGETYEARID integer primary key, \ - BUDGETYEARNAME TEXT NOT NULL UNIQUE);")); + db->ExecuteUpdate(CREATE_TABLE_BUDGETYEAR_V1); valid = db->TableExists(wxT("BUDGETYEAR_V1")); wxASSERT(valid); } @@ -348,9 +406,7 @@ valid = db->TableExists(wxT("BUDGETTABLE_V1")); if (!valid) { - db->ExecuteUpdate(wxT("create table BUDGETTABLE_V1(BUDGETENTRYID integer primary key, \ - BUDGETYEARID integer, CATEGID integer, SUBCATEGID integer, \ - PERIOD TEXT NOT NULL, AMOUNT numeric NOT NULL);")); + db->ExecuteUpdate(CREATE_TABLE_BUDGETTABLE_V1); valid = db->TableExists(wxT("BUDGETTABLE_V1")); wxASSERT(valid); } @@ -367,10 +423,7 @@ bool valid = db->TableExists(wxT("STOCK_V1")); if (!valid) { - db->ExecuteUpdate(wxT("create table STOCK_V1(STOCKID integer primary key, \ - HELDAT numeric, PURCHASEDATE TEXT NOT NULL, STOCKNAME TEXT, SYMBOL TEXT, \ - NUMSHARES numeric, PURCHASEPRICE numeric NOT NULL, NOTES TEXT, CURRENTPRICE numeric NOT NULL,\ - VALUE numeric, COMMISSION numeric);")); + db->ExecuteUpdate(CREATE_TABLE_STOCK_V1); valid = db->TableExists(wxT("STOCK_V1")); wxASSERT(valid); } @@ -388,10 +441,7 @@ bool valid = db->TableExists(wxT("ASSETS_V1")); if (!valid) { - db->ExecuteUpdate(wxT("create table ASSETS_V1(ASSETID integer primary key, \ - STARTDATE TEXT NOT NULL, ASSETNAME TEXT, \ - VALUE numeric, VALUECHANGE TEXT, NOTES TEXT, VALUECHANGERATE numeric,\ - ASSETTYPE TEXT);")); + db->ExecuteUpdate(CREATE_TABLE_ASSETS_V1); valid = db->TableExists(wxT("ASSETS_V1")); wxASSERT(valid); } @@ -408,11 +458,7 @@ bool valid = db->TableExists(wxT("BILLSDEPOSITS_V1")); if (!valid) { - db->ExecuteUpdate(wxT("create table BILLSDEPOSITS_V1(BDID integer primary key, \ - ACCOUNTID integer NOT NULL, TOACCOUNTID integer, PAYEEID integer NOT NULL, TRANSCODE TEXT NOT NULL, \ - TRANSAMOUNT numeric NOT NULL, STATUS TEXT, TRANSACTIONNUMBER TEXT, NOTES TEXT, \ - CATEGID integer, SUBCATEGID integer, TRANSDATE TEXT, FOLLOWUPID integer, TOTRANSAMOUNT numeric, \ - REPEATS numeric, NEXTOCCURRENCEDATE TEXT, NUMOCCURRENCES numeric);")); + db->ExecuteUpdate(CREATE_TABLE_BILLSDEPOSITS_V1); valid = db->TableExists(wxT("BILLSDEPOSITS_V1")); wxASSERT(valid); } @@ -431,16 +477,15 @@ if (!valid) return false; - wxSQLite3ResultSet q1 = db->ExecuteQuery("select INFOVALUE " - "from INFOTABLE_V1 " - "where INFONAME = 'DATAVERSION'"); - + wxSQLite3Statement st = db->PrepareStatement(SELECT_INFOVALUE_FROM_INFOTABLE_V1); + st.Bind(1, wxT("DATAVERSION")); + wxSQLite3ResultSet q1 = st.ExecuteQuery(); if (q1.NextRow()) { int dataVersion = q1.GetInt(wxT("INFOVALUE")); ok = dataVersion >= mmex::MIN_DATAVERSION; } - q1.Finalize(); + st.Finalize(); return ok; } @@ -451,12 +496,7 @@ bool exists = db->TableExists(wxT("ACCOUNTLIST_V1")); if (!exists) { - db->ExecuteUpdate(wxT("create table ACCOUNTLIST_V1(ACCOUNTID integer primary key, \ - ACCOUNTNAME TEXT NOT NULL UNIQUE, ACCOUNTTYPE TEXT NOT NULL, ACCOUNTNUM TEXT, \ - STATUS TEXT NOT NULL, \ - NOTES TEXT, HELDAT TEXT, WEBSITE TEXT, CONTACTINFO TEXT, \ - ACCESSINFO TEXT, INITIALBAL numeric, FAVORITEACCT TEXT NOT NULL, \ - CURRENCYID integer NOT NULL);")); + db->ExecuteUpdate(CREATE_TABLE_ACCOUNTLIST_V1); exists = db->TableExists(wxT("ACCOUNTLIST_V1")); wxASSERT(exists); } @@ -476,18 +516,14 @@ void mmDBWrapper::createCheckingAccountV1Table(wxSQLite3Database* db) { - try{ - bool exists = db->TableExists(wxT("CHECKINGACCOUNT_V1")); - if (!exists) - { - db->ExecuteUpdate(wxT("create table CHECKINGACCOUNT_V1(TRANSID integer primary key, \ - ACCOUNTID integer NOT NULL, TOACCOUNTID integer, PAYEEID integer NOT NULL, TRANSCODE TEXT NOT NULL, \ - TRANSAMOUNT numeric NOT NULL, STATUS TEXT, TRANSACTIONNUMBER TEXT, NOTES TEXT, \ - CATEGID integer, SUBCATEGID integer, TRANSDATE TEXT, FOLLOWUPID integer, TOTRANSAMOUNT numeric);")); - exists = db->TableExists(wxT("CHECKINGACCOUNT_V1")); + if (db->TableExists(wxT("CHECKINGACCOUNT_V1"))) return; + try + { + db->ExecuteUpdate(CREATE_TABLE_CHECKINGACCOUNT_V1); + bool exists = db->TableExists(wxT("CHECKINGACCOUNT_V1")); wxASSERT(exists); - } - } catch(const wxSQLite3Exception& e) + } + catch(const wxSQLite3Exception& e) { wxLogDebug(wxT("Database::createCheckingAccountV1Table: Exception"), e.GetMessage().c_str()); wxLogError(wxT("create table CHECKINGACCOUNT_V1. ") + wxString::Format(_("Error: %s"), e.GetMessage().c_str())); @@ -500,8 +536,7 @@ bool exists = db->TableExists(wxT("SPLITTRANSACTIONS_V1")); if (!exists) { - db->ExecuteUpdate(wxT("create table SPLITTRANSACTIONS_V1(SPLITTRANSID integer primary key, \ - TRANSID numeric NOT NULL, CATEGID integer, SUBCATEGID integer, SPLITTRANSAMOUNT numeric);")); + db->ExecuteUpdate(CREATE_TABLE_SPLITTRANSACTIONS_V1); exists = db->TableExists(wxT("SPLITTRANSACTIONS_V1")); wxASSERT(exists); } @@ -509,8 +544,7 @@ exists = db->TableExists(wxT("BUDGETSPLITTRANSACTIONS_V1")); if (!exists) { - db->ExecuteUpdate(wxT("create table BUDGETSPLITTRANSACTIONS_V1(SPLITTRANSID integer primary key, \ - TRANSID integer NOT NULL, CATEGID integer, SUBCATEGID integer, SPLITTRANSAMOUNT numeric);")); + db->ExecuteUpdate(CREATE_TABLE_BUDGETSPLITTRANSACTIONS_V1); exists = db->TableExists(wxT("BUDGETSPLITTRANSACTIONS_V1")); wxASSERT(exists); } @@ -527,8 +561,7 @@ bool exists = db->TableExists(wxT("PAYEE_V1")); if (!exists) { - db->ExecuteUpdate(wxT("create table PAYEE_V1(PAYEEID integer primary key, \ - PAYEENAME TEXT NOT NULL UNIQUE, CATEGID integer, SUBCATEGID integer);")); + db->ExecuteUpdate(CREATE_TABLE_PAYEE_V1); exists = db->TableExists(wxT("PAYEE_V1")); wxASSERT(exists); } @@ -546,9 +579,7 @@ if (!existsCat) { /* Create CATEGORY_V1 Tables */ - db->ExecuteUpdate(wxT("create table CATEGORY_V1(CATEGID integer primary key, \ - CATEGNAME TEXT NOT NULL);")); - + db->ExecuteUpdate(CREATE_TABLE_CATEGORY_V1); { bool ok = db->TableExists(wxT("CATEGORY_V1")); wxASSERT(ok); @@ -560,8 +591,7 @@ if (!existsSubCat) { /* Create SUBCATEGORY_V1 Tables */ - db->ExecuteUpdate(wxT("create table SUBCATEGORY_V1(SUBCATEGID integer primary key, \ - SUBCATEGNAME TEXT NOT NULL, CATEGID integer NOT NULL);")); + db->ExecuteUpdate(CREATE_TABLE_SUBCATEGORY_V1); existsSubCat = db->TableExists(wxT("SUBCATEGORY_V1")); wxASSERT(existsSubCat); } @@ -794,15 +824,11 @@ int mmDBWrapper::getBaseCurrencySettings(wxSQLite3Database* db) { - static const char sql[] = - "select INFOVALUE " - "from INFOTABLE_V1 " - "where INFONAME = ?"; const int defID = -1; int currencyID = defID; - wxSQLite3Statement st = db->PrepareStatement(sql); + wxSQLite3Statement st = db->PrepareStatement(SELECT_INFOVALUE_FROM_INFOTABLE_V1); st.Bind(1, g_BaseCurrencyIdName); wxSQLite3ResultSet q1 = st.ExecuteQuery(); @@ -858,19 +884,7 @@ void mmDBWrapper::loadSettings(wxSQLite3Database* db, int currencyID) { - static const char sql[] = - "select PFX_SYMBOL, " - "SFX_SYMBOL, " - "DECIMAL_POINT, " - "GROUP_SEPARATOR, " - "UNIT_NAME, " - "CENT_NAME, " - "SCALE, " - "CURRENCY_SYMBOL " - "from CURRENCYFORMATS_V1 " - "where CURRENCYID = ?"; - - wxSQLite3Statement st = db->PrepareStatement(sql); + wxSQLite3Statement st = db->PrepareStatement(SELECT_ALL_FROM_CURRENCYFORMATS_V1); st.Bind(1, currencyID); wxSQLite3ResultSet q1 = st.ExecuteQuery(); @@ -1188,14 +1202,8 @@ int payeeID, int categID, int subcategID) { try { - static const char sql[] = - "update PAYEE_V1 " - "SET PAYEENAME = ?, " - "CATEGID = ?, " - "SUBCATEGID = ? " - "WHERE PAYEEID = ?"; - wxSQLite3Statement st = db->PrepareStatement(sql); + wxSQLite3Statement st = db->PrepareStatement(UPDATE_PAYEE_V1); st.Bind(1, payeeName); st.Bind(2, categID); st.Bind(3, subcategID); @@ -1281,11 +1289,7 @@ { wxString symbol; - wxSQLite3Statement st = db->PrepareStatement("select CURRENCY_SYMBOL " - "from CURRENCYFORMATS_V1 " - "where CURRENCYID = ?" - ); - + wxSQLite3Statement st = db->PrepareStatement(SELECT_ALL_FROM_CURRENCYFORMATS_V1); st.Bind(1, currencyID); wxSQLite3ResultSet q1 = st.ExecuteQuery(); @@ -1303,10 +1307,7 @@ { double rate = g_defBASECONVRATE; - wxSQLite3Statement st = db->PrepareStatement("select BASECONVRATE " - "from CURRENCYFORMATS_V1 " - "where CURRENCYID = ?" - ); + wxSQLite3Statement st = db->PrepareStatement(SELECT_ALL_FROM_CURRENCYFORMATS_V1); st.Bind(1, currencyID); wxSQLite3ResultSet q1 = st.ExecuteQuery(); @@ -1325,10 +1326,8 @@ static const char sql[] = "select f.BASECONVRATE " "from ACCOUNTLIST_V1 acl " - "join CURRENCYFORMATS_V1 f " "on f.CURRENCYID = acl.CURRENCYID " - "where acl.ACCOUNTID = ?"; double rate = g_defBASECONVRATE; @@ -1647,27 +1646,27 @@ bool mmDBWrapper::copyBudgetYear(wxSQLite3Database* db, int newYear, int baseYear) { - try { - static const char sql[] = - "insert into BUDGETTABLE_V1 ( " - "BUDGETYEARID, " - "CATEGID, " - "SUBCATEGID, " - "PERIOD, " - "AMOUNT " - ") " - "select ?, " - "CATEGID, " - "SUBCATEGID, " - "PERIOD, " - "AMOUNT " - "from BUDGETTABLE_V1 " - "WHERE BUDGETYEARID = ?"; + static const char INSERT_INTO_BUDGETTABLE_V1[] = + "INSERT INTO BUDGETTABLE_V1 ( " + "BUDGETYEARID, " + "CATEGID, " + "SUBCATEGID, " + "PERIOD, " + "AMOUNT " + ") " + "select ?, " + "CATEGID, " + "SUBCATEGID, " + "PERIOD, " + "AMOUNT " + "from BUDGETTABLE_V1 " + "WHERE BUDGETYEARID = ?"; + try { if (newYear == baseYear) return false; - wxSQLite3Statement st = db->PrepareStatement(sql); + wxSQLite3Statement st = db->PrepareStatement(INSERT_INTO_BUDGETTABLE_V1); st.Bind(1, newYear); st.Bind(2, baseYear); @@ -1717,8 +1716,8 @@ void mmDBWrapper::addBudgetEntry(wxSQLite3Database* db, int budgetYearID, int categID, int subCategID, const wxString& period, double amount) { - static const char sql[] = - "insert into BUDGETTABLE_V1 ( " + static const char INSERT_INTO_BUDGETTABLE_V1[] = + "INSERT INTO BUDGETTABLE_V1 ( " "BUDGETYEARID, " "CATEGID, " "SUBCATEGID, " @@ -1729,7 +1728,7 @@ ")"; try { - wxSQLite3Statement st = db->PrepareStatement(sql); + wxSQLite3Statement st = db->PrepareStatement(INSERT_INTO_BUDGETTABLE_V1); int i = 0; st.Bind(++i, budgetYearID); @@ -1754,7 +1753,7 @@ void mmDBWrapper::deleteBudgetEntry(wxSQLite3Database* db, int budgetEntryID) { try { - wxSQLite3Statement st = db->PrepareStatement("delete from BUDGETTABLE_V1 where BUDGETENTRYID = ?"); + wxSQLite3Statement st = db->PrepareStatement("DELETE FROM BUDGETTABLE_V1 where BUDGETENTRYID = ?"); st.Bind(1, budgetEntryID); st.ExecuteUpdate(); @@ -1773,8 +1772,8 @@ const wxString& period, double amount) { try { - static const char sql[] = - "delete from BUDGETTABLE_V1 " + static const char DELETE_FROM_BUDGETTABLE_V1[] = + "DELETE FROM BUDGETTABLE_V1 " "where BUDGETENTRYID in( select BUDGETENTRYID " "from BUDGETTABLE_V1 " "WHERE BUDGETYEARID = ? AND " @@ -1782,7 +1781,7 @@ "SUBCATEGID = ? " ")"; - wxSQLite3Statement st = db->PrepareStatement(sql); + wxSQLite3Statement st = db->PrepareStatement(DELETE_FROM_BUDGETTABLE_V1); st.Bind(1, budgetYearID); st.Bind(2, categID); st.Bind(3, subCategID); @@ -1801,17 +1800,17 @@ bool mmDBWrapper::getBudgetEntry(wxSQLite3Database* db, int budgetYearID, int categID, int subCategID, wxString& period, double& amount) { - static const char sql[] = - "select PERIOD, " + static const char SELECT_FROM_BUDGETTABLE_V1[] = + "SELECT PERIOD, " "AMOUNT " - "from BUDGETTABLE_V1 " + "FROM BUDGETTABLE_V1 " "WHERE BUDGETYEARID = ? AND " "CATEGID = ? AND " "SUBCATEGID = ?"; bool found = false; - wxSQLite3Statement st = db->PrepareStatement(sql); + wxSQLite3Statement st = db->PrepareStatement(SELECT_FROM_BUDGETTABLE_V1); st.Bind(1, budgetYearID); st.Bind(2, categID); st.Bind(3, subCategID); @@ -1835,8 +1834,8 @@ try { static const char* sql[] = { - "delete from BILLSDEPOSITS_V1 where BDID = ?", - "delete from BUDGETSPLITTRANSACTIONS_V1 where TRANSID = ?", + "DELETE FROM BILLSDEPOSITS_V1 where BDID = ?", + "DELETE FROM BUDGETSPLITTRANSACTIONS_V1 where TRANSID = ?", 0 }; @@ -1860,10 +1859,10 @@ { try { static const char sql[] = - "select NUMOCCURRENCES, " + "SELECT NUMOCCURRENCES, " "NEXTOCCURRENCEDATE, " "REPEATS " - "from BILLSDEPOSITS_V1 " + "FROM BILLSDEPOSITS_V1 " "WHERE BDID = ?"; // Removed "date(NEXTOCCURRENCEDATE, 'localtime') as NEXTOCCURRENCEDATE, " // because causing problems with some systems and in different time zones @@ -1957,13 +1956,13 @@ st.Finalize(); { - static const char sql[] = - "update BILLSDEPOSITS_V1 " + static const char UPDATE_BILLSDEPOSITS_V1[] = + "UPDATE BILLSDEPOSITS_V1 " "set NEXTOCCURRENCEDATE = ?, " "NUMOCCURRENCES = ? " "where BDID = ?"; - wxSQLite3Statement st = db->PrepareStatement(sql); + wxSQLite3Statement st = db->PrepareStatement(UPDATE_BILLSDEPOSITS_V1); st.Bind(1, updateOccur.FormatISODate()); st.Bind(2, numRepeats); @@ -1973,7 +1972,7 @@ st.Finalize(); } - db->ExecuteUpdate("delete from BILLSDEPOSITS_V1 where NUMOCCURRENCES = 0"); + db->ExecuteUpdate("DELETE FROM BILLSDEPOSITS_V1 where NUMOCCURRENCES = 0"); mmOptions::instance().databaseUpdated_ = true; } catch(const wxSQLite3Exception& e) @@ -1986,7 +1985,7 @@ void mmDBWrapper::deleteStockInvestment(wxSQLite3Database* db, int stockID) { try { - wxSQLite3Statement st = db->PrepareStatement("delete from STOCK_V1 where STOCKID = ?"); + wxSQLite3Statement st = db->PrepareStatement("DELETE FROM STOCK_V1 where STOCKID = ?"); st.Bind(1, stockID); st.ExecuteUpdate(); st.Finalize(); @@ -2002,8 +2001,8 @@ double mmDBWrapper::getStockInvestmentBalance(wxSQLite3Database* db, double& invested) { static const char sql[] = - "select ACCOUNTID " - "from ACCOUNTLIST_V1 " + "SELECT ACCOUNTID " + "FROM ACCOUNTLIST_V1 " "where ACCOUNTTYPE = 'Investment'"; double balance = 0.0; @@ -2085,7 +2084,7 @@ { double balance = 0.0; - wxSQLite3ResultSet q1 = db->ExecuteQuery("select ASSETID from ASSETS_V1"); + wxSQLite3ResultSet q1 = db->ExecuteQuery("SELECT ASSETID FROM ASSETS_V1"); while (q1.NextRow()) { @@ -2199,7 +2198,7 @@ double amount; wxString amountStr; - char sql[]= + static const char sql[]= "select c.categname || case when sc.subcategname not null then ' : '||sc.subcategname else ''end as CATEG " ", -st.splittransamount as SPLITTRANSAMOUNT " "from splittransactions_v1 st " @@ -2227,21 +2226,7 @@ void mmDBWrapper::removeSplitsForAccount(wxSQLite3Database* db, int accountID) { try { - static const char sql[] = - "delete from SPLITTRANSACTIONS_V1 " - "where TRANSID in( SELECT TRANSID " - "from CHECKINGACCOUNT_V1 " - "where ACCOUNTID = ? OR TOACCOUNTID = ? " - ")"; - - static const char sql2[] = - "delete from BUDGETSPLITTRANSACTIONS_V1 " - "where TRANSID in( SELECT BDID " - "from BILLSDEPOSITS_V1 " - "where ACCOUNTID = ? OR TOACCOUNTID = ? " - ")"; - - wxSQLite3Statement st = db->PrepareStatement(sql); + wxSQLite3Statement st = db->PrepareStatement(DELETE_FROM_SPLITTRANSACTIONS_V1); st.Bind(1, accountID); st.Bind(2, accountID); @@ -2249,7 +2234,7 @@ st.ExecuteUpdate(); st.Finalize(); - st = db->PrepareStatement(sql2); + st = db->PrepareStatement(DELETE_FROM_BUDGETSPLITTRANSACTIONS_V1); st.Bind(1, accountID); st.Bind(2, accountID); Modified: branches/0.9.9.0/mmex/src/paths.cpp =================================================================== --- branches/0.9.9.0/mmex/src/paths.cpp 2012-07-12 02:49:49 UTC (rev 2734) +++ branches/0.9.9.0/mmex/src/paths.cpp 2012-07-12 06:49:59 UTC (rev 2735) @@ -149,7 +149,7 @@ static const wxChar* files[RES_FILES_MAX] = { wxT("mmex.ico"), wxT("kaching.wav"), - wxT("currency_seed.db3") + wxT("currency_seed.csv") }; wxASSERT(f >= 0 && f < RES_FILES_MAX); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2012-07-12 07:53:17
|
Revision: 2738 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=2738&view=rev Author: vomikan Date: 2012-07-12 07:53:08 +0000 (Thu, 12 Jul 2012) Log Message: ----------- for 2.9.x Modified Paths: -------------- branches/0.9.9.0/mmex/src/mmcheckingpanel.cpp branches/0.9.9.0/mmex/src/mmex.cpp branches/0.9.9.0/mmex/src/util.h Modified: branches/0.9.9.0/mmex/src/mmcheckingpanel.cpp =================================================================== --- branches/0.9.9.0/mmex/src/mmcheckingpanel.cpp 2012-07-12 07:02:38 UTC (rev 2737) +++ branches/0.9.9.0/mmex/src/mmcheckingpanel.cpp 2012-07-12 07:53:08 UTC (rev 2738) @@ -26,7 +26,6 @@ //---------------------------------------------------------------------------- #include <wx/event.h> #include <algorithm> -#include <vector> #include <boost/unordered_map.hpp> #include <wx/srchctrl.h> @@ -638,7 +637,7 @@ /* ---------------------- */ wxSplitterWindow* itemSplitterWindow10 = new wxSplitterWindow( this, - ID_SPLITTERWINDOW, wxDefaultPosition, wxSize(100, 100), + ID_SPLITTERWINDOW, wxDefaultPosition, wxSize(200, 200), wxSP_3DBORDER|wxSP_3DSASH|wxNO_BORDER ); wxSize imageSize(16, 16); Modified: branches/0.9.9.0/mmex/src/mmex.cpp =================================================================== --- branches/0.9.9.0/mmex/src/mmex.cpp 2012-07-12 07:02:38 UTC (rev 2737) +++ branches/0.9.9.0/mmex/src/mmex.cpp 2012-07-12 07:53:08 UTC (rev 2738) @@ -1004,22 +1004,21 @@ //navTreeCtrl_->SetBackgroundColour(mmColors::navTreeBkColor); - wxSize imageSize(16, 16); - wxImageList* imageList_ = new wxImageList( imageSize.GetWidth(), imageSize.GetHeight() ); - imageList_->Add(wxBitmap(house_xpm)); - imageList_->Add(wxBitmap(moneyaccount_xpm)); // used for: savings_account - imageList_->Add(wxBitmap(clock_xpm)); - imageList_->Add(wxBitmap(calendar_xpm)); - imageList_->Add(wxBitmap(chartpiereport_xpm)); - imageList_->Add(wxBitmap(help_xpm)); - imageList_->Add(wxBitmap(stock_curve_xpm)); - imageList_->Add(wxBitmap(car_xpm)); - imageList_->Add(wxBitmap(customsql_xpm)); - imageList_->Add(wxBitmap(termaccount_xpm)); // used for: term_account - imageList_->Add(wxBitmap(savings_acc_favorite_xpm)); - imageList_->Add(wxBitmap(savings_acc_closed_xpm)); - imageList_->Add(wxBitmap(term_acc_favorite_xpm)); - imageList_->Add(wxBitmap(term_acc_closed_xpm)); + wxImageList* imageList_ = new wxImageList(16, 16); + imageList_->Add(wxBitmap(wxImage(house_xpm).Scale(16, 16))); + imageList_->Add(wxBitmap(wxImage(moneyaccount_xpm).Scale(16, 16))); // used for: savings_account + imageList_->Add(wxBitmap(wxImage(clock_xpm).Scale(16, 16))); + imageList_->Add(wxBitmap(wxImage(calendar_xpm).Scale(16, 16))); + imageList_->Add(wxBitmap(wxImage(chartpiereport_xpm).Scale(16, 16))); + imageList_->Add(wxBitmap(wxImage(help_xpm).Scale(16, 16))); + imageList_->Add(wxBitmap(wxImage(stock_curve_xpm).Scale(16, 16))); + imageList_->Add(wxBitmap(wxImage(car_xpm).Scale(16, 16))); + imageList_->Add(wxBitmap(wxImage(customsql_xpm).Scale(16, 16))); + imageList_->Add(wxBitmap(wxImage(termaccount_xpm).Scale(16, 16))); // used for: term_account + imageList_->Add(wxBitmap(wxImage(savings_acc_favorite_xpm).Scale(16, 16))); + imageList_->Add(wxBitmap(wxImage(savings_acc_closed_xpm).Scale(16, 16))); + imageList_->Add(wxBitmap(wxImage(term_acc_favorite_xpm).Scale(16, 16))); + imageList_->Add(wxBitmap(wxImage(term_acc_closed_xpm).Scale(16, 16))); navTreeCtrl_->AssignImageList(imageList_); Modified: branches/0.9.9.0/mmex/src/util.h =================================================================== --- branches/0.9.9.0/mmex/src/util.h 2012-07-12 07:02:38 UTC (rev 2737) +++ branches/0.9.9.0/mmex/src/util.h 2012-07-12 07:53:08 UTC (rev 2738) @@ -299,12 +299,15 @@ return int_key; } - /* problems using wxWidgets 2.9.2 + /* problems using wxWidgets 2.9.x */ inline std::size_t hash_value(const wxString& value) { - return boost::hash_value(value.c_str()); + size_t key = 0; + for(wxString::const_iterator it = value.begin(); it != value.end(); ++ it) + key += static_cast<wxUChar>(*it); + + return key; } - */ } // namespace boost This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2012-07-12 12:46:57
|
Revision: 2747 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=2747&view=rev Author: vomikan Date: 2012-07-12 12:46:47 +0000 (Thu, 12 Jul 2012) Log Message: ----------- wxFlexGridSizer(0 Modified Paths: -------------- branches/0.9.9.0/mmex/src/assetdialog.cpp branches/0.9.9.0/mmex/src/billsdepositsdialog.cpp branches/0.9.9.0/mmex/src/budgetentrydialog.cpp branches/0.9.9.0/mmex/src/budgetyearentrydialog.cpp branches/0.9.9.0/mmex/src/filtertransdialog.cpp branches/0.9.9.0/mmex/src/newacctdialog.cpp branches/0.9.9.0/mmex/src/optionsdialog.cpp branches/0.9.9.0/mmex/src/splitdetailsdialog.cpp branches/0.9.9.0/mmex/src/stockdialog.cpp branches/0.9.9.0/mmex/src/transactionfilterdialog.cpp branches/0.9.9.0/mmex/src/yahoosettingsdialog.cpp Modified: branches/0.9.9.0/mmex/src/assetdialog.cpp =================================================================== --- branches/0.9.9.0/mmex/src/assetdialog.cpp 2012-07-12 12:28:59 UTC (rev 2746) +++ branches/0.9.9.0/mmex/src/assetdialog.cpp 2012-07-12 12:46:47 UTC (rev 2747) @@ -181,7 +181,7 @@ wxDefaultSize, wxTAB_TRAVERSAL ); itemStaticBoxSizer4->Add(itemPanel5, 1, wxGROW|wxALL, 5); - wxFlexGridSizer* itemFlexGridSizer6 = new wxFlexGridSizer(8, 2, 0, 0); + wxFlexGridSizer* itemFlexGridSizer6 = new wxFlexGridSizer(0, 2, 0, 0); itemPanel5->SetSizer(itemFlexGridSizer6); wxStaticText* itemStaticText7 = new wxStaticText( itemPanel5, wxID_STATIC, Modified: branches/0.9.9.0/mmex/src/billsdepositsdialog.cpp =================================================================== --- branches/0.9.9.0/mmex/src/billsdepositsdialog.cpp 2012-07-12 12:28:59 UTC (rev 2746) +++ branches/0.9.9.0/mmex/src/billsdepositsdialog.cpp 2012-07-12 12:46:47 UTC (rev 2747) @@ -297,7 +297,7 @@ wxStaticBoxSizer* repeatDetailsStaticBoxSizer = new wxStaticBoxSizer(repeatDetailsStaticBox, wxHORIZONTAL); repeatTransBoxSizer->Add(repeatDetailsStaticBoxSizer, 0, wxALIGN_CENTER|wxALL, 5); - wxFlexGridSizer* itemFlexGridSizer5 = new wxFlexGridSizer(4, 2, 10, 10); + wxFlexGridSizer* itemFlexGridSizer5 = new wxFlexGridSizer(0, 2, 10, 10); repeatDetailsStaticBoxSizer->Add(itemFlexGridSizer5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); wxStaticText* staticTextAccName = new wxStaticText( this, wxID_STATIC, _("Account Name") ); @@ -405,7 +405,7 @@ wxPanel* transactionPanel = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); transDetailsStaticBoxSizer->Add(transactionPanel, 0, wxGROW|wxALL, 10); - wxFlexGridSizer* transPanelSizer = new wxFlexGridSizer(5, 2, 10, 10); + wxFlexGridSizer* transPanelSizer = new wxFlexGridSizer(0, 2, 10, 10); transactionPanel->SetSizer(transPanelSizer); // Trans Date -------------------------------------------- Modified: branches/0.9.9.0/mmex/src/budgetentrydialog.cpp =================================================================== --- branches/0.9.9.0/mmex/src/budgetentrydialog.cpp 2012-07-12 12:28:59 UTC (rev 2746) +++ branches/0.9.9.0/mmex/src/budgetentrydialog.cpp 2012-07-12 12:46:47 UTC (rev 2747) @@ -133,7 +133,7 @@ wxPanel* itemPanel7 = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); itemStaticBoxSizer4->Add(itemPanel7, 0, wxGROW|wxALL, 10); - wxFlexGridSizer* itemGridSizer2 = new wxFlexGridSizer(4, 2, 10, 10); + wxFlexGridSizer* itemGridSizer2 = new wxFlexGridSizer(0, 2, 10, 10); itemPanel7->SetSizer(itemGridSizer2); wxStaticText* itemTextCatTag = new wxStaticText( itemPanel7, wxID_STATIC, _("Category: ")); Modified: branches/0.9.9.0/mmex/src/budgetyearentrydialog.cpp =================================================================== --- branches/0.9.9.0/mmex/src/budgetyearentrydialog.cpp 2012-07-12 12:28:59 UTC (rev 2746) +++ branches/0.9.9.0/mmex/src/budgetyearentrydialog.cpp 2012-07-12 12:46:47 UTC (rev 2747) @@ -66,7 +66,7 @@ wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL); this->SetSizer(itemBoxSizer2); - wxFlexGridSizer* itemGridSizer2 = new wxFlexGridSizer(2, 2, 0, 0); + wxFlexGridSizer* itemGridSizer2 = new wxFlexGridSizer(0, 2, 0, 0); itemBoxSizer2->Add(itemGridSizer2, 0, wxALL, 5); wxStaticText* itemStaticText3 = new wxStaticText( this, wxID_STATIC, _("Budget Year:")); Modified: branches/0.9.9.0/mmex/src/filtertransdialog.cpp =================================================================== --- branches/0.9.9.0/mmex/src/filtertransdialog.cpp 2012-07-12 12:28:59 UTC (rev 2746) +++ branches/0.9.9.0/mmex/src/filtertransdialog.cpp 2012-07-12 12:46:47 UTC (rev 2747) @@ -138,7 +138,7 @@ wxPanel* itemPanel = new wxPanel( this, ID_PANEL11, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); itemStaticBoxSizer4->Add(itemPanel, 1, wxGROW|wxALL, 5); - wxFlexGridSizer* itemPanelSizer = new wxFlexGridSizer(2, 2, 0, 0); + wxFlexGridSizer* itemPanelSizer = new wxFlexGridSizer(0, 2, 0, 0); itemPanel->SetSizer(itemPanelSizer); //--Start of Row -------------------------------------------------------- Modified: branches/0.9.9.0/mmex/src/newacctdialog.cpp =================================================================== --- branches/0.9.9.0/mmex/src/newacctdialog.cpp 2012-07-12 12:28:59 UTC (rev 2746) +++ branches/0.9.9.0/mmex/src/newacctdialog.cpp 2012-07-12 12:46:47 UTC (rev 2747) @@ -138,7 +138,7 @@ wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL); this->SetSizer(itemBoxSizer2); - wxFlexGridSizer* itemGridSizer2 = new wxFlexGridSizer(2, 2, 0, 0); + wxFlexGridSizer* itemGridSizer2 = new wxFlexGridSizer(0, 2, 0, 0); itemBoxSizer2->Add(itemGridSizer2, 0, wxALL); wxStaticText* itemStaticText3 = new wxStaticText( this, Modified: branches/0.9.9.0/mmex/src/optionsdialog.cpp =================================================================== --- branches/0.9.9.0/mmex/src/optionsdialog.cpp 2012-07-12 12:28:59 UTC (rev 2746) +++ branches/0.9.9.0/mmex/src/optionsdialog.cpp 2012-07-12 12:46:47 UTC (rev 2747) @@ -226,7 +226,7 @@ wxStaticBox* dateFormatStaticBox = new wxStaticBox(generalPanel, wxID_ANY, _("Date Format")); dateFormatStaticBox->SetFont(staticBoxFontSetting); wxStaticBoxSizer* dateFormatStaticBoxSizer = new wxStaticBoxSizer(dateFormatStaticBox, wxVERTICAL); - wxFlexGridSizer* dateFormatSettingStaticBoxSizerGrid = new wxFlexGridSizer(2,2,0,5); + wxFlexGridSizer* dateFormatSettingStaticBoxSizerGrid = new wxFlexGridSizer(0,2,0,5); generalPanelSizer->Add(dateFormatStaticBoxSizer, 0, wxALIGN_LEFT|wxGROW|wxALL, 5); dateFormatStaticBoxSizer->Add(dateFormatSettingStaticBoxSizerGrid); @@ -252,7 +252,7 @@ wxStaticBox* financialYearStaticBox = new wxStaticBox(generalPanel, wxID_ANY, _("Financial Year")); financialYearStaticBox->SetFont(staticBoxFontSetting); wxStaticBoxSizer* financialYearStaticBoxSizer = new wxStaticBoxSizer(financialYearStaticBox, wxVERTICAL); - wxFlexGridSizer* financialYearStaticBoxSizerGrid = new wxFlexGridSizer(3,2,0,0); + wxFlexGridSizer* financialYearStaticBoxSizerGrid = new wxFlexGridSizer(0,2,0,0); generalPanelSizer->Add(financialYearStaticBoxSizer, 0, wxGROW|wxALL, 5); financialYearStaticBoxSizer->Add(financialYearStaticBoxSizerGrid); @@ -343,7 +343,7 @@ wxBoxSizer* transOptionStaticBoxSizer = new wxStaticBoxSizer(transOptionStaticBox, wxHORIZONTAL); viewsPanelSizer->Add(transOptionStaticBoxSizer, 0, wxGROW|wxALL, 5); - wxFlexGridSizer* dateFormatSettingStaticBoxSizerGrid2 = new wxFlexGridSizer(1,2,0,5); + wxFlexGridSizer* dateFormatSettingStaticBoxSizerGrid2 = new wxFlexGridSizer(0,2,0,5); transOptionStaticBoxSizer->Add(dateFormatSettingStaticBoxSizerGrid2); wxStaticText* transVisibleStaticText = new wxStaticText(viewsPanel, wxID_STATIC, @@ -478,7 +478,7 @@ wxStaticBoxSizer* colourSettingStaticBoxSizer = new wxStaticBoxSizer(colourSettingStaticBox, wxVERTICAL); colourPanelSizer->Add(colourSettingStaticBoxSizer, 0, wxGROW|wxALL, 5); - wxFlexGridSizer* colourPanelSizerGrid = new wxFlexGridSizer(2, 2, 10, 10); + wxFlexGridSizer* colourPanelSizerGrid = new wxFlexGridSizer(0, 2, 10, 10); colourSettingStaticBoxSizer->Add(colourPanelSizerGrid, 0, wxALL, 5); wxStaticText* navTreeStaticText = new wxStaticText(colourPanel, wxID_STATIC, _("Nav Tree")); @@ -602,7 +602,7 @@ wxDefaultPosition, defaultPayeeChoice->GetSize(), choiceStatusStrings); defaultStatusChoice->SetSelection(mmIniOptions::instance().transStatusReconciled_); - wxFlexGridSizer* newTransflexGridSizer = new wxFlexGridSizer(3,2,0,0); + wxFlexGridSizer* newTransflexGridSizer = new wxFlexGridSizer(0,2,0,0); transSettingsStaticBoxSizer->Add(newTransflexGridSizer); newTransflexGridSizer->Add(dateStaticText, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); newTransflexGridSizer->Add(defaultDateChoice, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); Modified: branches/0.9.9.0/mmex/src/splitdetailsdialog.cpp =================================================================== --- branches/0.9.9.0/mmex/src/splitdetailsdialog.cpp 2012-07-12 12:28:59 UTC (rev 2746) +++ branches/0.9.9.0/mmex/src/splitdetailsdialog.cpp 2012-07-12 12:46:47 UTC (rev 2747) @@ -95,7 +95,7 @@ wxPanel* itemPanel7 = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); itemStaticBoxSizer4->Add(itemPanel7, 0, wxGROW|wxALL, 10); - wxFlexGridSizer* controlSizer = new wxFlexGridSizer(5, 2, 10, 10); + wxFlexGridSizer* controlSizer = new wxFlexGridSizer(0, 2, 10, 10); itemPanel7->SetSizer(controlSizer); wxStaticText* staticTextType = new wxStaticText( itemPanel7, wxID_STATIC, _("Type")); Modified: branches/0.9.9.0/mmex/src/stockdialog.cpp =================================================================== --- branches/0.9.9.0/mmex/src/stockdialog.cpp 2012-07-12 12:28:59 UTC (rev 2746) +++ branches/0.9.9.0/mmex/src/stockdialog.cpp 2012-07-12 12:46:47 UTC (rev 2747) @@ -144,7 +144,7 @@ wxPanel* itemPanel5 = new wxPanel( this, ID_PANEL3, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); itemStaticBoxSizer4->Add(itemPanel5, 1, wxGROW|wxALL, 5); - wxFlexGridSizer* itemFlexGridSizer6 = new wxFlexGridSizer(8, 2, 0, 0); + wxFlexGridSizer* itemFlexGridSizer6 = new wxFlexGridSizer(0, 2, 0, 0); itemPanel5->SetSizer(itemFlexGridSizer6); wxStaticText* itemStaticText11 = new wxStaticText( itemPanel5, wxID_STATIC, _("Stock Name"), wxDefaultPosition, wxDefaultSize, 0 ); Modified: branches/0.9.9.0/mmex/src/transactionfilterdialog.cpp =================================================================== --- branches/0.9.9.0/mmex/src/transactionfilterdialog.cpp 2012-07-12 12:28:59 UTC (rev 2746) +++ branches/0.9.9.0/mmex/src/transactionfilterdialog.cpp 2012-07-12 12:46:47 UTC (rev 2747) @@ -101,7 +101,7 @@ wxPanel* itemPanel = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); itemStaticBoxSizer->Add(itemPanel, 1, wxGROW|wxALL, 5); - wxFlexGridSizer* itemPanelSizer = new wxFlexGridSizer(2, 2, 0, 0); + wxFlexGridSizer* itemPanelSizer = new wxFlexGridSizer(0, 2, 0, 0); itemPanel->SetSizer(itemPanelSizer); //--Start of Row -------------------------------------------------------- Modified: branches/0.9.9.0/mmex/src/yahoosettingsdialog.cpp =================================================================== --- branches/0.9.9.0/mmex/src/yahoosettingsdialog.cpp 2012-07-12 12:28:59 UTC (rev 2746) +++ branches/0.9.9.0/mmex/src/yahoosettingsdialog.cpp 2012-07-12 12:46:47 UTC (rev 2747) @@ -79,7 +79,7 @@ m_staticText3 = new wxStaticText( this, wxID_ANY, _("Market open from")); fgSizer_flex->Add( m_staticText3, 0, wxALIGN_RIGHT|wxALL, 5 ); - wxFlexGridSizer* fgSizer5 = new wxFlexGridSizer( 1, 3, 0, 0 ); + wxFlexGridSizer* fgSizer5 = new wxFlexGridSizer(0, 3, 0, 0); fgSizer5->SetFlexibleDirection( wxBOTH ); fgSizer5->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); @@ -109,7 +109,7 @@ fgSizer_flex->Add( m_staticText4, 0, wxALIGN_RIGHT|wxALL, 5 ); wxFlexGridSizer* fgSizer6; - fgSizer6 = new wxFlexGridSizer( 1, 3, 0, 0 ); + fgSizer6 = new wxFlexGridSizer( 0, 3, 0, 0 ); fgSizer6->SetFlexibleDirection( wxBOTH ); fgSizer6->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2012-07-12 13:54:03
|
Revision: 2751 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=2751&view=rev Author: vomikan Date: 2012-07-12 13:53:52 +0000 (Thu, 12 Jul 2012) Log Message: ----------- fix for wx2.9.x Modified Paths: -------------- branches/0.9.9.0/mmex/src/assetspanel.cpp branches/0.9.9.0/mmex/src/stockspanel.cpp Modified: branches/0.9.9.0/mmex/src/assetspanel.cpp =================================================================== --- branches/0.9.9.0/mmex/src/assetspanel.cpp 2012-07-12 13:20:29 UTC (rev 2750) +++ branches/0.9.9.0/mmex/src/assetspanel.cpp 2012-07-12 13:53:52 UTC (rev 2751) @@ -83,7 +83,9 @@ if (!wxPanel::Create(parent, winid, pos, size, style, name)) return false; - Freeze(); +#ifdef __WXMSW__ + this->Freeze(); +#endif CreateControls(); GetSizer()->Fit(this); GetSizer()->SetSizeHints(this); @@ -92,7 +94,9 @@ if (!m_trans.empty()) m_listCtrlAssets->EnsureVisible(static_cast<long>(m_trans.size()) - 1); +#ifdef __WXMSW__ Thaw(); +#endif return true; } @@ -137,7 +141,7 @@ /* ---------------------- */ wxSplitterWindow* itemSplitterWindow10 = new wxSplitterWindow( this, IDC_PANEL_CHECKING_STATIC_BAL, - wxDefaultPosition, wxSize(100, 100), wxSP_3DBORDER|wxSP_3DSASH|wxNO_BORDER ); + wxDefaultPosition, wxSize(200, 200), wxSP_3DBORDER|wxSP_3DSASH|wxNO_BORDER ); wxSize imageSize(16, 16); m_imageList.reset(new wxImageList(imageSize.GetWidth(), imageSize.GetHeight())); Modified: branches/0.9.9.0/mmex/src/stockspanel.cpp =================================================================== --- branches/0.9.9.0/mmex/src/stockspanel.cpp 2012-07-12 13:20:29 UTC (rev 2750) +++ branches/0.9.9.0/mmex/src/stockspanel.cpp 2012-07-12 13:53:52 UTC (rev 2751) @@ -90,7 +90,9 @@ SetExtraStyle(GetExtraStyle()|wxWS_EX_BLOCK_EVENTS); wxPanel::Create(parent, winid, pos, size, style, name); +#ifdef __WXMSW__ this->Freeze(); +#endif CreateControls(); GetSizer()->Fit(this); GetSizer()->SetSizeHints(this); @@ -114,7 +116,9 @@ DownloadScheduleTimer_ = new wxTimer(this, ID_TIMER_SCHEDULE_STOCK); DownloadScheduleTimer_->Start(yahoo_->UpdateIntervalMinutes_ * 60000, wxTIMER_CONTINUOUS); +#ifdef __WXMSW__ this->Thaw(); +#endif return TRUE; } @@ -196,7 +200,7 @@ /* ---------------------- */ wxSplitterWindow* itemSplitterWindow10 = new wxSplitterWindow(this, - ID_SPLITTERWINDOW, wxDefaultPosition, wxSize(100, 100), + ID_SPLITTERWINDOW, wxDefaultPosition, wxSize(200, 200), wxSP_3DBORDER|wxSP_3DSASH|wxNO_BORDER); wxSize imageSize(16, 16); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |