void mmCustomFieldListDialog::CreateControls() { wxBoxSizer* mainBoxSizer = new wxBoxSizer(wxVERTICAL); fieldListBox_ = new wxDataViewListCtrl( this , wxID_ANY, wxDefaultPosition, wxSize(460, 500)/*, wxDV_HORIZ_RULES*/); if (debug_) fieldListBox_->AppendTextColumn(ColName_[FIELD_ID], wxDATAVIEW_CELL_INERT, wxLIST_AUTOSIZE_USEHEADER); fieldListBox_->AppendTextColumn(ColName_[FIELD_DESCRIPTION], wxDATAVIEW_CELL_INERT, wxLIST_AUTOSIZE_USEHEADER); fieldListBox_->AppendTextColumn(ColName_[FIELD_TYPE], wxDATAVIEW_CELL_INERT, wxLIST_AUTOSIZE_USEHEADER); if (debug_) fieldListBox_->AppendTextColumn(ColName_[FIELD_PROPERTIES], wxDATAVIEW_CELL_INERT, wxLIST_AUTOSIZE_USEHEADER); mainBoxSizer->Add(fieldListBox_, wxSizerFlags(g_flagsExpand).Border(wxALL, 10)); wxPanel* buttons_panel = new wxPanel(this, wxID_ANY); mainBoxSizer->Add(buttons_panel, wxSizerFlags(g_flagsV).Center()); wxStdDialogButtonSizer* buttons_sizer = new wxStdDialogButtonSizer; buttons_panel->SetSizer(buttons_sizer); wxButton* btnClose = new wxButton(buttons_panel, wxID_OK, wxGetTranslation(g_CloseLabel)); buttons_sizer->Add(btnClose, g_flagsH); wxBitmapButton* magicButton = new wxBitmapButton(buttons_panel, wxID_APPLY, mmBitmap(png::RUN)); magicButton->SetToolTip(_("Other tools")); buttons_sizer->Add(magicButton, g_flagsH); Center(); this->SetSizer(mainBoxSizer); }
void mmAttachmentDialog::CreateControls() { wxBoxSizer* mainBoxSizer = new wxBoxSizer(wxVERTICAL); attachmentListBox_ = new wxDataViewListCtrl( this , wxID_ANY, wxDefaultPosition, wxSize(460, 500)/*, wxDV_HORIZ_RULES*/); if (debug_) attachmentListBox_->AppendTextColumn(ColName_[ATTACHMENT_ID], wxDATAVIEW_CELL_INERT, 30); attachmentListBox_->AppendTextColumn(ColName_[ATTACHMENT_DESCRIPTION], wxDATAVIEW_CELL_INERT, 150); attachmentListBox_->AppendTextColumn(ColName_[ATTACHMENT_FILENAME], wxDATAVIEW_CELL_INERT, 300); mainBoxSizer->Add(attachmentListBox_, wxSizerFlags(g_flagsExpand).Border(wxALL, 10)); wxPanel* buttons_panel = new wxPanel(this, wxID_ANY); mainBoxSizer->Add(buttons_panel, wxSizerFlags(g_flagsV).Center()); wxStdDialogButtonSizer* buttons_sizer = new wxStdDialogButtonSizer; buttons_panel->SetSizer(buttons_sizer); wxButton* buttonOK = new wxButton(buttons_panel, wxID_OK, _("&OK ")); wxButton* btnCancel = new wxButton(buttons_panel, wxID_CANCEL, wxGetTranslation(g_CancelLabel)); buttons_sizer->Add(buttonOK, g_flagsH); buttons_sizer->Add(btnCancel, g_flagsH); wxBitmapButton* magicButton = new wxBitmapButton(buttons_panel , wxID_APPLY, mmBitmap(png::RUN)); magicButton->SetToolTip(_("Other tools")); buttons_sizer->Add(magicButton, g_flagsH); Center(); this->SetSizer(mainBoxSizer); }
void mmPayeeDialog::CreateControls() { wxBoxSizer* mainBoxSizer = new wxBoxSizer(wxVERTICAL); //TODO:provide proper style payeeListBox_ = new wxDataViewListCtrl( this , wxID_ANY, wxDefaultPosition, wxSize(450, 500)/*, wxDV_HORIZ_RULES*/); if (debug_) payeeListBox_->AppendTextColumn(ColName_[PAYEE_ID], wxDATAVIEW_CELL_INERT, 30); payeeListBox_->AppendTextColumn(ColName_[PAYEE_NAME], wxDATAVIEW_CELL_EDITABLE, 150); payeeListBox_->AppendTextColumn(ColName_[PAYEE_CATEGORY], wxDATAVIEW_CELL_INERT, 250); mainBoxSizer->Add(payeeListBox_, wxSizerFlags(g_flagsExpand).Border(wxALL, 10)); wxPanel* buttons_panel = new wxPanel(this, wxID_ANY); mainBoxSizer->Add(buttons_panel, wxSizerFlags(g_flagsExpand).Proportion(0)); wxBoxSizer* tools_sizer = new wxBoxSizer(wxVERTICAL); buttons_panel->SetSizer(tools_sizer); wxBoxSizer* tools_sizer2 = new wxBoxSizer(wxHORIZONTAL); tools_sizer->Add(tools_sizer2, wxSizerFlags(g_flagsExpand).Border(0)); wxBitmapButton* magicButton = new wxBitmapButton(buttons_panel , wxID_APPLY, mmBitmap(png::RUN)); magicButton->SetToolTip(_("Other tools")); tools_sizer2->Add(magicButton, g_flagsH); m_maskTextCtrl = new wxSearchCtrl(buttons_panel, wxID_FIND); m_maskTextCtrl->SetFocus(); tools_sizer2->Prepend(m_maskTextCtrl, g_flagsExpand); tools_sizer2->Prepend(new wxStaticText(buttons_panel, wxID_STATIC, _("Search:")), g_flagsH); wxStdDialogButtonSizer* buttons_sizer = new wxStdDialogButtonSizer; tools_sizer->Add(buttons_sizer, wxSizerFlags(g_flagsV).Center()); wxButton* buttonOK = new wxButton(buttons_panel, wxID_OK, _("&OK ")); wxButton* btnCancel = new wxButton(buttons_panel, wxID_CANCEL, wxGetTranslation(g_CancelLabel)); buttons_sizer->Add(buttonOK, g_flagsH); buttons_sizer->Add(btnCancel, g_flagsH); this->SetSizer(mainBoxSizer); }
void mmAssetDialog::CreateControls() { wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxHORIZONTAL); this->SetSizer(itemBoxSizer2); wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxVERTICAL); itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); wxStaticBox* itemStaticBoxSizer4Static = new wxStaticBox(this, wxID_ANY, _("Asset Details")); wxStaticBoxSizer* itemStaticBoxSizer4 = new wxStaticBoxSizer(itemStaticBoxSizer4Static , wxVERTICAL); itemBoxSizer3->Add(itemStaticBoxSizer4, g_flags); wxPanel* itemPanel5 = new wxPanel( this, wxID_STATIC, wxDefaultPosition , wxDefaultSize, wxTAB_TRAVERSAL ); itemStaticBoxSizer4->Add(itemPanel5, g_flags); wxFlexGridSizer* itemFlexGridSizer6 = new wxFlexGridSizer(0, 2, 0, 0); itemPanel5->SetSizer(itemFlexGridSizer6); wxStaticText* n = new wxStaticText(itemPanel5, wxID_STATIC, _("Name")); itemFlexGridSizer6->Add(n, g_flags); n->SetFont(this->GetFont().Bold()); m_assetName = new mmTextCtrl(itemPanel5, wxID_ANY, wxGetEmptyString()); m_assetName->SetToolTip(_("Enter the name of the asset")); itemFlexGridSizer6->Add(m_assetName, g_flagsExpand); itemFlexGridSizer6->Add(new wxStaticText(itemPanel5, wxID_STATIC, _("Date")), g_flags); m_dpc = new wxDatePickerCtrl( itemPanel5, wxID_ANY, wxDefaultDateTime, wxDefaultPosition, wxSize(150, -1), wxDP_DROPDOWN|wxDP_SHOWCENTURY); itemFlexGridSizer6->Add(m_dpc, g_flags); m_dpc->SetToolTip(_("Specify the date of purchase of asset")); itemFlexGridSizer6->Add(new wxStaticText(itemPanel5, wxID_STATIC, _("Asset Type")), g_flags); m_assetType = new wxChoice(itemPanel5, wxID_STATIC, wxDefaultPosition, wxSize(150, -1)); for (const auto& a : Model_Asset::all_type()) m_assetType->Append(wxGetTranslation(a), new wxStringClientData(a)); m_assetType->SetToolTip(_("Select type of asset")); m_assetType->SetSelection(Model_Asset::TYPE_PROPERTY); itemFlexGridSizer6->Add(m_assetType, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5); wxStaticText* v = new wxStaticText(itemPanel5, wxID_STATIC, _("Value")); itemFlexGridSizer6->Add(v, g_flags); v->SetFont(this->GetFont().Bold()); m_value = new mmTextCtrl(itemPanel5, IDC_VALUE, wxGetEmptyString() , wxDefaultPosition, wxSize(150,-1), wxALIGN_RIGHT|wxTE_PROCESS_ENTER , mmCalcValidator() ); m_value->SetToolTip(_("Enter the current value of the asset")); itemFlexGridSizer6->Add(m_value, g_flags); m_value->Connect(IDC_VALUE, wxEVT_COMMAND_TEXT_ENTER , wxCommandEventHandler(mmAssetDialog::onTextEntered), nullptr, this); itemFlexGridSizer6->Add(new wxStaticText(itemPanel5, wxID_STATIC, _("Change in Value")), g_flags); m_valueChange = new wxChoice(itemPanel5, IDC_COMBO_TYPE, wxDefaultPosition, wxSize(150, -1)); for(const auto& a : Model_Asset::all_rate()) m_valueChange->Append(wxGetTranslation(a)); m_valueChange->SetToolTip(_("Specify if the value of the asset changes over time")); m_valueChange->SetSelection(Model_Asset::RATE_NONE); itemFlexGridSizer6->Add(m_valueChange, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); m_valueChangeRateLabel = new wxStaticText(itemPanel5, wxID_STATIC, _("% Rate")); itemFlexGridSizer6->Add(m_valueChangeRateLabel, g_flags); m_valueChangeRate = new mmTextCtrl(itemPanel5, IDC_RATE, wxGetEmptyString() , wxDefaultPosition, wxSize(150,-1), wxALIGN_RIGHT|wxTE_PROCESS_ENTER , mmCalcValidator()); m_valueChangeRate->SetToolTip(_("Enter the rate at which the asset changes its value in % per year")); itemFlexGridSizer6->Add(m_valueChangeRate, g_flags); m_valueChangeRate->Connect(IDC_RATE, wxEVT_COMMAND_TEXT_ENTER , wxCommandEventHandler(mmAssetDialog::onTextEntered), nullptr, this); enableDisableRate(false); itemFlexGridSizer6->Add(new wxStaticText( itemPanel5, wxID_STATIC, _("Notes")), g_flags); bAttachments_ = new wxBitmapButton(itemPanel5, wxID_FILE , mmBitmap(png::CLIP), wxDefaultPosition , wxSize(m_valueChange->GetSize().GetY(), m_valueChange->GetSize().GetY())); itemFlexGridSizer6->Add(bAttachments_, wxSizerFlags(g_flags).Align(wxALIGN_RIGHT)); bAttachments_->SetToolTip(_("Organize attachments of this asset")); m_notes = new mmTextCtrl(this, IDC_NOTES, wxGetEmptyString(), wxDefaultPosition, wxSize(220, 170), wxTE_MULTILINE); m_notes->SetToolTip(_("Enter notes associated with this asset")); itemStaticBoxSizer4->Add(m_notes, 0, wxGROW | wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT | wxBOTTOM, 10); wxPanel* itemPanel27 = new wxPanel(this, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL); itemBoxSizer3->Add(itemPanel27, wxSizerFlags(g_flags).Center()); wxBoxSizer* itemBoxSizer28 = new wxBoxSizer(wxHORIZONTAL); itemPanel27->SetSizer(itemBoxSizer28); wxButton* itemButton29 = new wxButton(itemPanel27, wxID_OK, _("&OK ")); itemBoxSizer28->Add(itemButton29, g_flags); wxButton* itemButton30 = new wxButton(itemPanel27, wxID_CANCEL, wxGetTranslation(g_CancelLabel)); itemBoxSizer28->Add(itemButton30, g_flags); itemButton30->SetFocus(); }
void mmAssetsPanel::CreateControls() { wxBoxSizer* itemBoxSizer9 = new wxBoxSizer(wxVERTICAL); this->SetSizer(itemBoxSizer9); wxPanel* headerPanel = new wxPanel(this, wxID_ANY, wxDefaultPosition , wxDefaultSize, wxNO_BORDER | wxTAB_TRAVERSAL); itemBoxSizer9->Add(headerPanel, g_flagsBorder1V); wxBoxSizer* itemBoxSizerVHeader = new wxBoxSizer(wxVERTICAL); headerPanel->SetSizer(itemBoxSizerVHeader); wxStaticText* itemStaticText9 = new wxStaticText( headerPanel, wxID_STATIC, _("Assets")); itemStaticText9->SetFont(this->GetFont().Larger().Bold()); itemBoxSizerVHeader->Add(itemStaticText9, g_flagsBorder1V); wxBoxSizer* itemBoxSizerHHeader2 = new wxBoxSizer(wxHORIZONTAL); itemBoxSizerVHeader->Add(itemBoxSizerHHeader2); wxStaticBitmap* itemStaticBitmap3 = new wxStaticBitmap(headerPanel, wxID_STATIC, mmBitmap(png::RIGHTARROW)); itemBoxSizerHHeader2->Add(itemStaticBitmap3, g_flagsBorder1H); //itemStaticBitmap3->Connect(ID_PANEL_CHECKING_STATIC_BITMAP_VIEW, wxEVT_RIGHT_DOWN, wxMouseEventHandler(mmAssetsPanel::OnFilterResetToViewAll), nullptr, this); itemStaticBitmap3->Connect(wxID_STATIC, wxEVT_LEFT_DOWN, wxMouseEventHandler(mmAssetsPanel::OnMouseLeftDown), nullptr, this); itemStaticTextMainFilter_ = new wxStaticText(headerPanel, wxID_STATIC, _("All")); itemBoxSizerHHeader2->Add(itemStaticTextMainFilter_, 0, wxALIGN_CENTER_VERTICAL | wxALL, 1); header_text_ = new wxStaticText(headerPanel, wxID_STATIC, ""); itemBoxSizerVHeader->Add(header_text_, g_flagsBorder1V); /* ---------------------- */ wxSplitterWindow* itemSplitterWindow10 = new wxSplitterWindow( this, wxID_STATIC, wxDefaultPosition, wxSize(200, 200), wxSP_3DBORDER|wxSP_3DSASH|wxNO_BORDER); m_listCtrlAssets = new mmAssetsListCtrl(this, itemSplitterWindow10, wxID_ANY); int x = Option::instance().IconSize(); m_imageList.reset(new wxImageList(x, x)); m_imageList->Add(mmBitmap(png::PROPERTY)); m_imageList->Add(mmBitmap(png::CAR)); m_imageList->Add(mmBitmap(png::HOUSEHOLD_OBJ)); m_imageList->Add(mmBitmap(png::ART)); m_imageList->Add(mmBitmap(png::JEWELLERY)); m_imageList->Add(mmBitmap(png::CASH)); m_imageList->Add(mmBitmap(png::OTHER)); m_imageList->Add(mmBitmap(png::UPARROW)); m_imageList->Add(mmBitmap(png::DOWNARROW)); m_listCtrlAssets->SetImageList(m_imageList.get(), wxIMAGE_LIST_SMALL); wxPanel* assets_panel = new wxPanel(itemSplitterWindow10, wxID_ANY , wxDefaultPosition, wxDefaultSize, wxNO_BORDER | wxTAB_TRAVERSAL); itemSplitterWindow10->SplitHorizontally(m_listCtrlAssets, assets_panel); itemSplitterWindow10->SetMinimumPaneSize(100); itemSplitterWindow10->SetSashGravity(1.0); itemBoxSizer9->Add(itemSplitterWindow10, g_flagsExpandBorder1); wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxVERTICAL); assets_panel->SetSizer(itemBoxSizer4); wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxHORIZONTAL); itemBoxSizer4->Add(itemBoxSizer5, g_flagsBorder1V); wxButton* itemButton6 = new wxButton( assets_panel, wxID_NEW, _("&New ")); itemButton6->SetToolTip(_("New Asset")); itemBoxSizer5->Add(itemButton6, 0, wxRIGHT, 5); wxButton* itemButton81 = new wxButton( assets_panel, wxID_EDIT, _("&Edit ")); itemButton81->SetToolTip(_("Edit Asset")); itemBoxSizer5->Add(itemButton81, 0, wxRIGHT, 5); itemButton81->Enable(false); wxButton* itemButton7 = new wxButton( assets_panel, wxID_DELETE, _("&Delete ")); itemButton7->SetToolTip(_("Delete Asset")); itemBoxSizer5->Add(itemButton7, 0, wxRIGHT, 5); itemButton7->Enable(false); wxBitmapButton* attachment_button_ = new wxBitmapButton(assets_panel , wxID_FILE, mmBitmap(png::CLIP), wxDefaultPosition, wxSize(30, itemButton7->GetSize().GetY())); attachment_button_->SetToolTip(_("Open attachments")); itemBoxSizer5->Add(attachment_button_, 0, wxRIGHT, 5); attachment_button_->Enable(false); wxSearchCtrl* searchCtrl = new wxSearchCtrl(assets_panel , wxID_FIND, wxEmptyString, wxDefaultPosition , wxSize(100, itemButton7->GetSize().GetHeight()) , wxTE_PROCESS_ENTER, wxDefaultValidator, _("Search")); searchCtrl->SetHint(_("Search")); itemBoxSizer5->Add(searchCtrl, 0, wxCENTER, 1); searchCtrl->SetToolTip(_("Enter any string to find related assets")); //Infobar-mini wxStaticText* itemStaticText44 = new wxStaticText(assets_panel, IDC_PANEL_ASSET_STATIC_DETAILS_MINI, ""); itemBoxSizer5->Add(itemStaticText44, 1, wxGROW | wxTOP | wxLEFT, 5); //Infobar wxStaticText* itemStaticText33 = new wxStaticText(assets_panel , IDC_PANEL_ASSET_STATIC_DETAILS, "", wxDefaultPosition, wxSize(200, -1), wxTE_MULTILINE | wxTE_WORDWRAP); itemBoxSizer4->Add(itemStaticText33, g_flagsExpandBorder1); updateExtraAssetData(-1); }
void ShareTransactionDialog::CreateControls() { wxBoxSizer* main_sizer = new wxBoxSizer(wxVERTICAL); SetSizer(main_sizer); wxBoxSizer* panel_sizer = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer* left_sizer = new wxBoxSizer(wxVERTICAL); wxBoxSizer* right_sizer = new wxBoxSizer(wxVERTICAL); main_sizer->Add(panel_sizer, wxSizerFlags(g_flagsV)); panel_sizer->Add(left_sizer, 0); panel_sizer->Add(right_sizer, 0); /******************************************************************** Stock Details Panel *********************************************************************/ wxStaticBox* details_frame = new wxStaticBox(this, wxID_ANY, _("Stock Investment Details")); wxStaticBoxSizer* details_frame_sizer = new wxStaticBoxSizer(details_frame, wxVERTICAL); left_sizer->Add(details_frame_sizer, g_flagsExpand); wxPanel* stock_details_panel = new wxPanel(this, wxID_STATIC); details_frame_sizer->Add(stock_details_panel, g_flagsV); wxFlexGridSizer* itemFlexGridSizer6 = new wxFlexGridSizer(0, 2, 0, 0); stock_details_panel->SetSizer(itemFlexGridSizer6); itemFlexGridSizer6->Add(new wxStaticText(stock_details_panel, wxID_STATIC, _("Company Name")), g_flagsH); m_stock_name_ctrl = new mmTextCtrl(stock_details_panel, ID_STOCKTRANS_SHARE_NAME, ""); itemFlexGridSizer6->Add(m_stock_name_ctrl, g_flagsExpand); m_stock_name_ctrl->SetToolTip(_("Enter the stock company name")); //Symbol wxStaticText* symbol = new wxStaticText(stock_details_panel, wxID_STATIC, _("Stock Symbol")); itemFlexGridSizer6->Add(symbol, g_flagsH); symbol->SetFont(this->GetFont().Bold()); m_stock_symbol_ctrl = new mmTextCtrl(stock_details_panel, ID_STOCKTRANS_SHARE_SYMBOL , "", wxDefaultPosition, wxSize(150, -1), 0); itemFlexGridSizer6->Add(m_stock_symbol_ctrl, g_flagsH); m_stock_symbol_ctrl->SetToolTip(_("Enter the stock symbol. (Optional) Include exchange. eg: IBM.BE")); //Share Unit Number wxStaticText* number = new wxStaticText(stock_details_panel, wxID_STATIC, _("Share Number")); itemFlexGridSizer6->Add(number, g_flagsH); number->SetFont(this->GetFont().Bold()); m_share_num_ctrl = new mmTextCtrl(stock_details_panel, ID_STOCKTRANS_SHARE_NUMBER, "" , wxDefaultPosition, wxSize(150, -1), wxALIGN_RIGHT | wxTE_PROCESS_ENTER, mmCalcValidator()); itemFlexGridSizer6->Add(m_share_num_ctrl, g_flagsH); m_share_num_ctrl->SetToolTip(_("Enter number of shares held")); m_share_num_ctrl->Connect(ID_STOCKTRANS_SHARE_NUMBER, wxEVT_COMMAND_TEXT_ENTER , wxCommandEventHandler(ShareTransactionDialog::OnTextEntered), nullptr, this); //Share Price wxStaticText* pprice = new wxStaticText(stock_details_panel, wxID_STATIC, _("Share Price")); pprice->SetFont(this->GetFont().Bold()); m_share_price_ctrl = new mmTextCtrl(stock_details_panel, ID_STOCKTRANS_SHARE_PRICE, "" , wxDefaultPosition, wxSize(150, -1), wxALIGN_RIGHT | wxTE_PROCESS_ENTER, mmCalcValidator()); itemFlexGridSizer6->Add(pprice, g_flagsH); itemFlexGridSizer6->Add(m_share_price_ctrl, g_flagsH); m_share_price_ctrl->SetToolTip(_("Enter the current value for a single share unit")); m_share_price_ctrl->Connect(ID_STOCKTRANS_SHARE_PRICE, wxEVT_COMMAND_TEXT_ENTER , wxCommandEventHandler(ShareTransactionDialog::OnTextEntered), nullptr, this); // Commission m_commission_ctrl = new mmTextCtrl(stock_details_panel, ID_STOCKTRANS_SHARE_COMMISSION, "0" , wxDefaultPosition, wxSize(150, -1), wxALIGN_RIGHT | wxTE_PROCESS_ENTER, mmCalcValidator()); itemFlexGridSizer6->Add(new wxStaticText(stock_details_panel, wxID_STATIC, _("Commission")), g_flagsH); itemFlexGridSizer6->Add(m_commission_ctrl, g_flagsH); m_commission_ctrl->SetToolTip(_("Enter any commission paid")); m_commission_ctrl->Connect(ID_STOCKTRANS_SHARE_COMMISSION, wxEVT_COMMAND_TEXT_ENTER , wxCommandEventHandler(ShareTransactionDialog::OnTextEntered), nullptr, this); //Share Lot wxStaticText* lot_text = new wxStaticText(stock_details_panel, wxID_STATIC, _("Share Lot")); itemFlexGridSizer6->Add(lot_text, g_flagsH); lot_text->SetFont(this->GetFont().Bold()); m_share_lot_ctrl = new mmTextCtrl(stock_details_panel, ID_STOCKTRANS_SHARE_LOT , "", wxDefaultPosition, wxSize(150, -1), 0); itemFlexGridSizer6->Add(m_share_lot_ctrl, g_flagsH); m_share_lot_ctrl->SetToolTip(_("Enter the LOT that this parcel os shares belong to")); //Notes itemFlexGridSizer6->Add(new wxStaticText(stock_details_panel, wxID_STATIC, _("Notes")), g_flagsH); //Attachments m_attachments_btn = new wxBitmapButton(stock_details_panel, wxID_FILE, mmBitmap(png::CLIP)); m_attachments_btn->SetToolTip(_("Organize attachments of this stock")); //TODO m_attachments not used here m_attachments_btn->Hide(); wxBitmapButton* web_button = new wxBitmapButton(stock_details_panel, wxID_INDEX, mmBitmap(png::WEB)); web_button->SetToolTip(_("Display the web page for the specified Stock symbol")); wxBoxSizer* icon_sizer = new wxBoxSizer(wxHORIZONTAL); icon_sizer->Add(m_attachments_btn, g_flagsH); icon_sizer->Add(web_button, g_flagsH); itemFlexGridSizer6->Add(icon_sizer, wxSizerFlags(g_flagsH).Align(wxALIGN_RIGHT)); m_notes_ctrl = new mmTextCtrl(this, wxID_STATIC, "", wxDefaultPosition, wxSize(200, 162), wxTE_MULTILINE); details_frame_sizer->Add(m_notes_ctrl, g_flagsExpand); details_frame_sizer->AddSpacer(1); m_notes_ctrl->SetToolTip(_("Enter notes associated with this investment")); /******************************************************************** Transaction Panel *********************************************************************/ wxString trans_frame_heading = _("Add Transaction Details"); if (m_checking_entry) { trans_frame_heading = _("Edit Transaction Details"); } wxStaticBox* transaction_frame = new wxStaticBox(this, wxID_ANY, trans_frame_heading); wxStaticBoxSizer* transaction_frame_sizer = new wxStaticBoxSizer(transaction_frame, wxVERTICAL); right_sizer->Add(transaction_frame_sizer, g_flagsV); m_transaction_panel = new UserTransactionPanel(this, m_checking_entry, wxID_STATIC); transaction_frame_sizer->Add(m_transaction_panel, g_flagsV); if (m_translink_entry && m_checking_entry) { m_transaction_panel->CheckingType(Model_Translink::type_checking(m_checking_entry->TOACCOUNTID)); } else { wxString acc_held = Model_Account::get_account_name(m_stock->HELDAT); m_transaction_panel->SetTransactionNumber(acc_held); } /******************************************************************** Separation Line *********************************************************************/ wxStaticLine* separation_line = new wxStaticLine(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL); main_sizer->Add(separation_line, 0, wxEXPAND | wxALL, 1); /******************************************************************** Button Panel *********************************************************************/ wxPanel* button_panel = new wxPanel(this, wxID_STATIC); wxBoxSizer* button_panel_sizer = new wxBoxSizer(wxHORIZONTAL); wxButton* ok_button = new wxButton(button_panel, wxID_OK, _("&OK ")); wxButton* close_button = new wxButton(button_panel, wxID_CANCEL, _("&Cancel ")); main_sizer->Add(button_panel, wxSizerFlags(g_flagsH).Center()); button_panel->SetSizer(button_panel_sizer); button_panel_sizer->Add(ok_button, g_flagsH); button_panel_sizer->Add(close_button, g_flagsH); //cancel_button->SetFocus(); }
void mmCategDialog::CreateControls() { wxBoxSizer* mainSizerVertical = new wxBoxSizer(wxVERTICAL); this->SetSizer(mainSizerVertical); wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxVERTICAL); mainSizerVertical->Add(itemBoxSizer3, g_flagsExpand); wxBoxSizer* itemBoxSizer33 = new wxBoxSizer(wxHORIZONTAL); itemBoxSizer3->Add(itemBoxSizer33); m_buttonRelocate = new wxBitmapButton(this , wxID_REPLACE_ALL, mmBitmap(png::CATEGORY_RELOCATION)); m_buttonRelocate->Connect(wxID_REPLACE_ALL, wxEVT_COMMAND_BUTTON_CLICKED , wxCommandEventHandler(mmCategDialog::OnCategoryRelocation), nullptr, this); m_buttonRelocate->SetToolTip(_("Reassign all categories to another category")); m_cbExpand = new wxCheckBox(this, wxID_ANY, _("Expand"), wxDefaultPosition , wxDefaultSize, wxCHK_2STATE); m_cbExpand->Connect(wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(mmCategDialog::OnExpandChbClick), nullptr, this); m_cbShowAll = new wxCheckBox(this, wxID_SELECTALL, _("Show All"), wxDefaultPosition , wxDefaultSize, wxCHK_2STATE); m_cbShowAll->SetToolTip(_("Show all hidden categories")); m_cbShowAll->Connect(wxID_SELECTALL, wxEVT_COMMAND_CHECKBOX_CLICKED , wxCommandEventHandler(mmCategDialog::OnShowHiddenChbClick), nullptr, this); itemBoxSizer33->Add(m_buttonRelocate, g_flagsH); itemBoxSizer33->AddSpacer(10); itemBoxSizer33->Add(m_cbExpand, g_flagsH); itemBoxSizer33->AddSpacer(10); itemBoxSizer33->Add(m_cbShowAll, g_flagsH); #if defined (__WXGTK__) || defined (__WXMAC__) m_treeCtrl = new wxTreeCtrl( this, wxID_ANY, wxDefaultPosition, wxSize(200, 380)); #else m_treeCtrl = new wxTreeCtrl(this, wxID_ANY , wxDefaultPosition, wxSize(200, 380) , wxTR_SINGLE | wxTR_HAS_BUTTONS | wxTR_ROW_LINES); #endif itemBoxSizer3->Add(m_treeCtrl, g_flagsExpand); wxPanel* buttonsPanel = new wxPanel(this, wxID_ANY); mainSizerVertical->Add(buttonsPanel, wxSizerFlags(g_flagsV).Center()); wxBoxSizer* buttonsSizer = new wxBoxSizer(wxVERTICAL); buttonsPanel->SetSizer(buttonsSizer); wxStdDialogButtonSizer* itemBoxSizer66 = new wxStdDialogButtonSizer; buttonsSizer->Add(itemBoxSizer66); m_buttonAdd = new wxButton(buttonsPanel, wxID_ADD, _("&Add ")); itemBoxSizer66->Add(m_buttonAdd, g_flagsH); m_buttonAdd->SetToolTip(_("Add a new category")); m_buttonEdit = new wxButton(buttonsPanel, wxID_EDIT, _("&Edit ")); itemBoxSizer66->Add(m_buttonEdit, g_flagsH); m_buttonEdit->SetToolTip(_("Edit the name of an existing category")); m_buttonDelete = new wxButton(buttonsPanel, wxID_REMOVE, _("&Delete ")); itemBoxSizer66->Add(m_buttonDelete, g_flagsH); m_buttonDelete->SetToolTip(_("Delete an existing category. The category cannot be used by existing transactions.")); wxStdDialogButtonSizer* itemBoxSizer9 = new wxStdDialogButtonSizer; buttonsSizer->Add(itemBoxSizer9, wxSizerFlags(g_flagsExpand).Border(wxALL, 0)); m_buttonSelect = new wxButton(buttonsPanel, wxID_OK, _("&Select")); itemBoxSizer9->Add(m_buttonSelect, wxSizerFlags(g_flagsExpand).Proportion(4)); m_buttonSelect->SetToolTip(_("Select the currently selected category as the selected category for the transaction")); //Some interfaces has no any close buttons, it may confuse user. Cancel button added wxButton* itemCancelButton = new wxButton(buttonsPanel, wxID_CANCEL, wxGetTranslation(g_CancelLabel)); itemBoxSizer9->Add(itemCancelButton, g_flagsH); }
void mmNewAcctDialog::CreateControls() { wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL); this->SetSizer(itemBoxSizer2); wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxVERTICAL); itemBoxSizer2->Add(itemBoxSizer3, g_flagsExpand); wxFlexGridSizer* grid_sizer = new wxFlexGridSizer(0, 2, 0, 0); grid_sizer->AddGrowableCol(1, 1); itemBoxSizer3->Add(grid_sizer, g_flagsExpand); grid_sizer->Add(new wxStaticText(this, wxID_STATIC, _("Account Name:")), g_flagsH); m_textAccountName = new wxTextCtrl(this, wxID_ANY, ""); grid_sizer->Add(m_textAccountName, g_flagsExpand); grid_sizer->Add(new wxStaticText(this, wxID_STATIC, _("Account Type:")), g_flagsH); wxChoice* itemChoice61 = new wxChoice(this, ID_DIALOG_NEWACCT_COMBO_ACCTTYPE); for (const auto& type : Model_Account::all_type()) itemChoice61->Append(wxGetTranslation(type), new wxStringClientData(type)); if (Model_Account::all_type().Index(m_account->ACCOUNTTYPE) == wxNOT_FOUND) itemChoice61->Append(m_account->ACCOUNTTYPE); grid_sizer->Add(itemChoice61, g_flagsExpand); itemChoice61->SetSelection(0); grid_sizer->Add(new wxStaticText(this, wxID_STATIC, _("Account Status:")), g_flagsH); wxChoice* itemChoice6 = new wxChoice(this, ID_DIALOG_NEWACCT_COMBO_ACCTSTATUS); for (const auto& status : Model_Account::all_status()) itemChoice6->Append(wxGetTranslation(status), new wxStringClientData(status)); grid_sizer->Add(itemChoice6, g_flagsExpand); itemChoice6->SetSelection(0); grid_sizer->Add(new wxStaticText(this, wxID_STATIC , wxString::Format(_("Initial Balance: %s"), "")), g_flagsH); m_itemInitValue = new mmTextCtrl(this , ID_DIALOG_NEWACCT_TEXTCTRL_INITBALANCE , "", wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER, mmCalcValidator()); grid_sizer->Add(m_itemInitValue, g_flagsExpand); grid_sizer->Add(new wxStaticText(this, wxID_STATIC, _("Currency:")), g_flagsH); wxString currName = _("Select Currency"); Model_Currency::Data* base_currency = Model_Currency::GetBaseCurrency(); if (base_currency) currName = base_currency->CURRENCYNAME; wxButton* itemButton71 = new wxButton(this, ID_DIALOG_NEWACCT_BUTTON_CURRENCY, currName); grid_sizer->Add(itemButton71, g_flagsExpand); wxCheckBox* itemCheckBox10 = new wxCheckBox(this , ID_DIALOG_NEWACCT_CHKBOX_FAVACCOUNT , _("Favorite Account"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE); itemCheckBox10->SetValue(TRUE); grid_sizer->AddSpacer(1); grid_sizer->Add(itemCheckBox10, g_flagsH); // Notes --------------------------------------------- wxNotebook* acc_notebook = new wxNotebook(this , wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNB_MULTILINE); wxPanel* notes_tab = new wxPanel(acc_notebook, wxID_ANY); acc_notebook->AddPage(notes_tab, _("Notes")); wxBoxSizer *notes_sizer = new wxBoxSizer(wxVERTICAL); notes_tab->SetSizer(notes_sizer); m_notesCtrl = new wxTextCtrl(notes_tab, ID_DIALOG_NEWACCT_TEXTCTRL_NOTES, "" , wxDefaultPosition, wxSize(270, 180), wxTE_MULTILINE); notes_sizer->Add(m_notesCtrl, g_flagsExpand); // wxPanel* others_tab = new wxPanel(acc_notebook, wxID_ANY); acc_notebook->AddPage(others_tab, _("Others")); wxBoxSizer *others_sizer = new wxBoxSizer(wxVERTICAL); others_tab->SetSizer(others_sizer); wxFlexGridSizer* grid_sizer2 = new wxFlexGridSizer(0, 2, 0, 0); grid_sizer2->AddGrowableCol(1, 1); others_sizer->Add(grid_sizer2, g_flagsExpand); grid_sizer2->Add(new wxStaticText(others_tab, wxID_STATIC , (Model_Account::type(m_account) == Model_Account::CREDIT_CARD ? _("Card Number:") : _("Account Number:"))), g_flagsH); wxTextCtrl* itemTextCtrl6 = new wxTextCtrl(others_tab , ID_ACCTNUMBER, "", wxDefaultPosition, wxDefaultSize); grid_sizer2->Add(itemTextCtrl6, g_flagsExpand); grid_sizer2->Add(new wxStaticText(others_tab, wxID_STATIC, _("Held At:")), g_flagsH); wxTextCtrl* itemTextCtrl8 = new wxTextCtrl(others_tab , ID_DIALOG_NEWACCT_TEXTCTRL_HELDAT, ""); grid_sizer2->Add(itemTextCtrl8, g_flagsExpand); grid_sizer2->Add(new wxStaticText(others_tab, wxID_STATIC, _("Website:")), g_flagsH); wxTextCtrl* itemTextCtrl10 = new wxTextCtrl(others_tab , ID_DIALOG_NEWACCT_TEXTCTRL_WEBSITE, ""); grid_sizer2->Add(itemTextCtrl10, g_flagsExpand); grid_sizer2->Add(new wxStaticText(others_tab , wxID_STATIC, _("Contact:")), g_flagsH); wxTextCtrl* itemTextCtrl12 = new wxTextCtrl(others_tab , ID_DIALOG_NEWACCT_TEXTCTRL_CONTACT, ""); grid_sizer2->Add(itemTextCtrl12, g_flagsExpand); grid_sizer2->Add(new wxStaticText(others_tab , wxID_STATIC, _("Access Info:")), g_flagsH); wxTextCtrl* itemTextCtrl14 = new wxTextCtrl(others_tab , ID_DIALOG_NEWACCT_TEXTCTRL_ACCESSINFO, m_accessInfo); grid_sizer2->Add(itemTextCtrl14, g_flagsExpand); itemBoxSizer3->Add(acc_notebook); //Buttons wxPanel* itemPanel27 = new wxPanel(this, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL); itemBoxSizer3->Add(itemPanel27, g_flagsV); wxBoxSizer* itemBoxSizer28 = new wxBoxSizer(wxHORIZONTAL); itemPanel27->SetSizer(itemBoxSizer28); m_bitmapButtons = new wxBitmapButton(itemPanel27 , wxID_STATIC, wxNullBitmap); m_bitmapButtons->Connect(wxID_STATIC, wxEVT_COMMAND_BUTTON_CLICKED , wxCommandEventHandler(mmNewAcctDialog::OnImageButton), nullptr, this); itemBoxSizer28->Add(m_bitmapButtons, g_flagsH); bAttachments_ = new wxBitmapButton(itemPanel27, wxID_FILE , mmBitmap(png::CLIP)); bAttachments_->SetToolTip(_("Organize attachments of this account")); itemBoxSizer28->Add(bAttachments_, g_flagsH); itemBoxSizer28->AddSpacer(20); wxButton* itemButton29 = new wxButton(itemPanel27, wxID_OK, _("&OK ")); itemBoxSizer28->Add(itemButton29, g_flagsH); wxButton* itemButton30 = new wxButton(itemPanel27, wxID_CANCEL, wxGetTranslation(g_CancelLabel)); itemBoxSizer28->Add(itemButton30, g_flagsH); if (true) { m_textAccountName->SetToolTip(_("Enter the Name of the Account. This name can be renamed at any time.")); itemChoice61->SetToolTip(_("Specify the type of account to be created.")); itemChoice6->SetToolTip(_("Specify if this account has been closed. Closed accounts are inactive in most calculations, reporting etc.")); m_itemInitValue->SetToolTip(_("Enter the initial balance in this account.")); itemButton71->SetToolTip(_("Specify the currency to be used by this account.")); itemCheckBox10->SetToolTip(_("Select whether this is an account that is used often. This is used to filter accounts display view.")); m_notesCtrl->SetToolTip(_("Enter user notes and details about this account.")); itemTextCtrl6->SetToolTip(_("Enter the Account Number associated with this account.")); itemTextCtrl8->SetToolTip(_("Enter the name of the financial institution in which the account is held.")); itemTextCtrl10->SetToolTip(_("Enter the URL of the website for the financial institution.")); itemTextCtrl12->SetToolTip(_("Enter any contact information for the financial institution.")); itemTextCtrl14->SetToolTip(_("Enter any login/access information for the financial institution. This is not secure as anyone with access to the mmb file can access it.")); } }
void mmBudgetingPanel::CreateControls() { wxSizerFlags flags; flags.Align(wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL).Border(wxLEFT|wxTOP, 4); wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL); this->SetSizer(itemBoxSizer2); wxPanel* itemPanel3 = new wxPanel(this, ID_PANEL_REPORTS_HEADER_PANEL , wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); itemBoxSizer2->Add(itemPanel3, flags); wxBoxSizer* itemBoxSizerVHeader = new wxBoxSizer(wxVERTICAL); itemPanel3->SetSizer(itemBoxSizerVHeader); budgetReportHeading_ = new wxStaticText(itemPanel3, wxID_ANY, ""); budgetReportHeading_->SetFont(this->GetFont().Larger().Bold()); wxBoxSizer* budgetReportHeadingSizer = new wxBoxSizer(wxHORIZONTAL); budgetReportHeadingSizer->Add(budgetReportHeading_, 1); itemBoxSizerVHeader->Add(budgetReportHeadingSizer, 0, wxALL, 1); wxBoxSizer* itemBoxSizerHHeader2 = new wxBoxSizer(wxHORIZONTAL); itemBoxSizerVHeader->Add(itemBoxSizerHHeader2, 0, wxALL, 1); wxStaticBitmap* itemStaticBitmap3 = new wxStaticBitmap(itemPanel3 , ID_PANEL_BUDGETENTRY_STATIC_BITMAP_VIEW , mmBitmap(png::RIGHTARROW)); itemStaticBitmap3->Connect(ID_PANEL_BUDGETENTRY_STATIC_BITMAP_VIEW, wxEVT_LEFT_DOWN , wxMouseEventHandler(mmBudgetingPanel::OnMouseLeftDown), nullptr, this); itemBoxSizerHHeader2->Add(itemStaticBitmap3, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1); wxStaticText* itemStaticText18 = new wxStaticText(itemPanel3 , ID_PANEL_CHECKING_STATIC_PANELVIEW, ""); itemBoxSizerHHeader2->Add(itemStaticText18, 0, wxALL, 1); wxFlexGridSizer* itemIncomeSizer = new wxFlexGridSizer(0, 7, 5, 10); itemBoxSizerVHeader->Add(itemIncomeSizer); income_estimated_ = new wxStaticText(itemPanel3 , ID_DIALOG_BUDGETENTRY_SUMMARY_INCOME_EST, "$", wxDefaultPosition, wxSize(120, -1)); income_actual_ = new wxStaticText(itemPanel3 , ID_DIALOG_BUDGETENTRY_SUMMARY_INCOME_ACT, "$", wxDefaultPosition, wxSize(120, -1)); income_diff_ = new wxStaticText(itemPanel3 , ID_DIALOG_BUDGETENTRY_SUMMARY_INCOME_DIF, "$"); expenses_estimated_ = new wxStaticText(itemPanel3 , ID_DIALOG_BUDGETENTRY_SUMMARY_EXPENSES_EST, "$", wxDefaultPosition, wxSize(120, -1)); expenses_actual_ = new wxStaticText(itemPanel3 , ID_DIALOG_BUDGETENTRY_SUMMARY_EXPENSES_ACT, "$", wxDefaultPosition, wxSize(120, -1)); expenses_diff_ = new wxStaticText(itemPanel3 , ID_DIALOG_BUDGETENTRY_SUMMARY_EXPENSES_DIF, "$"); itemIncomeSizer->Add(new wxStaticText(itemPanel3, wxID_STATIC, _("Income: "))); itemIncomeSizer->Add(new wxStaticText(itemPanel3, wxID_STATIC, _("Estimated: "))); itemIncomeSizer->Add(income_estimated_); itemIncomeSizer->Add(new wxStaticText(itemPanel3, wxID_STATIC, _("Actual: "))); itemIncomeSizer->Add(income_actual_); itemIncomeSizer->Add(new wxStaticText(itemPanel3, wxID_STATIC, _("Difference: "))); itemIncomeSizer->Add(income_diff_); itemIncomeSizer->Add(new wxStaticText(itemPanel3, wxID_STATIC, _("Expenses: "))); itemIncomeSizer->Add(new wxStaticText(itemPanel3, wxID_STATIC, _("Estimated: "))); itemIncomeSizer->Add(expenses_estimated_); itemIncomeSizer->Add(new wxStaticText(itemPanel3, wxID_STATIC, _("Actual: "))); itemIncomeSizer->Add(expenses_actual_); itemIncomeSizer->Add(new wxStaticText(itemPanel3, wxID_STATIC, _("Difference: "))); itemIncomeSizer->Add(expenses_diff_); /* ---------------------- */ int x = mmIniOptions::instance().ico_size_; m_imageList = new wxImageList(x, x); m_imageList->Add(mmBitmap(png::RECONCILED)); m_imageList->Add(mmBitmap(png::VOID_STAT)); m_imageList->Add(mmBitmap(png::FOLLOW_UP)); m_imageList->Add(mmBitmap(png::EMPTY)); listCtrlBudget_ = new budgetingListCtrl(this, this, wxID_ANY); listCtrlBudget_->SetImageList(m_imageList, wxIMAGE_LIST_SMALL); listCtrlBudget_->InsertColumn(COL_ICON, (" ")); listCtrlBudget_->InsertColumn(COL_CATEGORY, std::get<0>(listCtrlBudget_->m_columns[COL_CATEGORY])); listCtrlBudget_->InsertColumn(COL_SUBCATEGORY, std::get<0>(listCtrlBudget_->m_columns[COL_SUBCATEGORY])); listCtrlBudget_->InsertColumn(COL_FREQUENCY, std::get<0>(listCtrlBudget_->m_columns[COL_FREQUENCY])); listCtrlBudget_->InsertColumn(COL_AMOUNT, std::get<0>(listCtrlBudget_->m_columns[COL_AMOUNT]), wxLIST_FORMAT_RIGHT); listCtrlBudget_->InsertColumn(COL_ESTIMATED, std::get<0>(listCtrlBudget_->m_columns[COL_ESTIMATED]), wxLIST_FORMAT_RIGHT); listCtrlBudget_->InsertColumn(COL_ACTUAL, std::get<0>(listCtrlBudget_->m_columns[COL_ACTUAL]), wxLIST_FORMAT_RIGHT); /* Get data from inidb */ for (int i = 0; i < listCtrlBudget_->GetColumnCount(); ++i) { int col = Model_Setting::instance().GetIntSetting(wxString::Format(listCtrlBudget_->m_col_width, i), std::get<1>(listCtrlBudget_->m_columns[i])); listCtrlBudget_->SetColumnWidth(i, col); } itemBoxSizer2->Add(listCtrlBudget_, 1, wxGROW | wxALL, 1); }
void mmTransDialog::CreateControls() { wxBoxSizer* box_sizer1 = new wxBoxSizer(wxVERTICAL); wxBoxSizer* box_sizer2 = new wxBoxSizer(wxVERTICAL); box_sizer1->Add(box_sizer2, g_flagsExpand); wxStaticBox* static_box = new wxStaticBox(this, wxID_ANY, _("Transaction Details")); wxStaticBoxSizer* box_sizer = new wxStaticBoxSizer(static_box, wxVERTICAL); box_sizer2->Add(box_sizer, g_flagsExpand); wxFlexGridSizer* flex_sizer = new wxFlexGridSizer(0, 2, 0, 0); box_sizer->Add(flex_sizer, g_flagsV); // Date -------------------------------------------- long date_style = wxDP_DROPDOWN | wxDP_SHOWCENTURY; dpc_ = new wxDatePickerCtrl(this, ID_DIALOG_TRANS_BUTTONDATE, wxDateTime::Today() , wxDefaultPosition, wxSize(110, -1), date_style); //Text field for day of the week itemStaticTextWeek_ = new wxStaticText(this, wxID_STATIC, ""); // Display the day of the week spinCtrl_ = new wxSpinButton(this, wxID_STATIC , wxDefaultPosition, wxSize(18, wxSize(dpc_->GetSize()).GetHeight()) , wxSP_VERTICAL | wxSP_ARROW_KEYS | wxSP_WRAP); spinCtrl_->SetRange (-32768, 32768); flex_sizer->Add(new wxStaticText(this, wxID_STATIC, _("Date")), g_flagsH); wxBoxSizer* date_sizer = new wxBoxSizer(wxHORIZONTAL); flex_sizer->Add(date_sizer); date_sizer->Add(dpc_, g_flagsH); date_sizer->Add(spinCtrl_, g_flagsH); date_sizer->Add(itemStaticTextWeek_, g_flagsH); // Status -------------------------------------------- choiceStatus_ = new wxChoice(this, ID_DIALOG_TRANS_STATUS , wxDefaultPosition, wxSize(110, -1)); for(const auto& i : Model_Checking::all_status()) choiceStatus_->Append(wxGetTranslation(i), new wxStringClientData(i)); flex_sizer->Add(new wxStaticText(this, wxID_STATIC, _("Status")), g_flagsH); flex_sizer->Add(choiceStatus_, g_flagsH); // Type -------------------------------------------- transaction_type_ = new wxChoice(this, ID_DIALOG_TRANS_TYPE , wxDefaultPosition, wxSize(110, -1)); for (const auto& i : Model_Checking::all_type()) { if (i != Model_Checking::all_type()[Model_Checking::TRANSFER] || Model_Account::instance().all().size() > 1) transaction_type_->Append(wxGetTranslation(i), new wxStringClientData(i)); } cAdvanced_ = new wxCheckBox(this , ID_DIALOG_TRANS_ADVANCED_CHECKBOX, _("&Advanced") , wxDefaultPosition, wxDefaultSize, wxCHK_2STATE ); wxBoxSizer* typeSizer = new wxBoxSizer(wxHORIZONTAL); flex_sizer->Add(new wxStaticText(this, wxID_STATIC, _("Type")), g_flagsH); flex_sizer->Add(typeSizer); typeSizer->Add(transaction_type_, g_flagsH); typeSizer->Add(cAdvanced_, g_flagsH); // Amount Fields -------------------------------------------- textAmount_ = new mmTextCtrl(this, ID_DIALOG_TRANS_TEXTAMOUNT, "" , wxDefaultPosition, wxSize(110, -1) , wxALIGN_RIGHT | wxTE_PROCESS_ENTER, mmCalcValidator()); toTextAmount_ = new mmTextCtrl( this, ID_DIALOG_TRANS_TOTEXTAMOUNT, "" , wxDefaultPosition, wxSize(110, -1) , wxALIGN_RIGHT | wxTE_PROCESS_ENTER, mmCalcValidator()); wxBoxSizer* amountSizer = new wxBoxSizer(wxHORIZONTAL); amountSizer->Add(textAmount_, g_flagsH); amountSizer->Add(toTextAmount_, g_flagsH); flex_sizer->Add(new wxStaticText( this, wxID_STATIC, _("Amount")), g_flagsH); flex_sizer->Add(amountSizer); // Account --------------------------------------------- cbAccount_ = new wxComboBox(this, wxID_ANY, "" , wxDefaultPosition, wxSize(230, -1)); account_label_ = new wxStaticText(this, wxID_STATIC, _("Account")); flex_sizer->Add(account_label_, g_flagsH); flex_sizer->Add(cbAccount_, g_flagsH); // Payee --------------------------------------------- payee_label_ = new wxStaticText(this, wxID_STATIC, _("Payee")); /*Note: If you want to use EVT_TEXT_ENTER(id,func) to receive wxEVT_COMMAND_TEXT_ENTER events, you have to add the wxTE_PROCESS_ENTER window style flag. If you create a wxComboBox with the flag wxTE_PROCESS_ENTER, the tab key won't jump to the next control anymore.*/ cbPayee_ = new wxComboBox(this, ID_DIALOG_TRANS_PAYEECOMBO, "" , wxDefaultPosition, wxSize(230, -1)); flex_sizer->Add(payee_label_, g_flagsH); flex_sizer->Add(cbPayee_, g_flagsH); // Split Category ------------------------------------------- cSplit_ = new wxCheckBox(this, wxID_FORWARD , _("Split"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE ); cSplit_->SetValue(FALSE); flex_sizer->AddSpacer(20); // Fill empty space. flex_sizer->Add(cSplit_, g_flagsH); // Category ------------------------------------------------- bCategory_ = new wxButton(this, wxID_VIEW_DETAILS, "" , wxDefaultPosition, wxSize(230, -1)); flex_sizer->Add(new wxStaticText(this, wxID_STATIC, _("Category")), g_flagsH); flex_sizer->Add(bCategory_, g_flagsH); // Number --------------------------------------------- textNumber_ = new mmTextCtrl(this , ID_DIALOG_TRANS_TEXTNUMBER, "", wxDefaultPosition , wxDefaultSize, wxTE_PROCESS_ENTER); wxButton* bAuto = new wxButton(this , ID_DIALOG_TRANS_BUTTONTRANSNUM, "...", wxDefaultPosition , wxSize(cbPayee_->GetSize().GetY(), cbPayee_->GetSize().GetY())); bAuto->Connect(ID_DIALOG_TRANS_BUTTONTRANSNUM, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(mmTransDialog::OnAutoTransNum), nullptr, this); bAuto->SetToolTip(_("Populate Transaction #")); flex_sizer->Add(new wxStaticText(this, wxID_STATIC, _("Number")), g_flagsH); wxBoxSizer* number_sizer = new wxBoxSizer(wxHORIZONTAL); flex_sizer->Add(number_sizer, wxSizerFlags(g_flagsExpand).Border(wxALL, 0)); number_sizer->Add(textNumber_, g_flagsExpand); number_sizer->Add(bAuto, g_flagsH); // Notes --------------------------------------------- flex_sizer->Add(new wxStaticText(this, wxID_STATIC, _("Notes")), g_flagsH); wxButton* bFrequentUsedNotes = new wxButton(this, ID_DIALOG_TRANS_BUTTON_FREQENTNOTES , "...", wxDefaultPosition , wxSize(cbPayee_->GetSize().GetY(), cbPayee_->GetSize().GetY()), 0); bFrequentUsedNotes->SetToolTip(_("Select one of the frequently used notes")); bFrequentUsedNotes->Connect(ID_DIALOG_TRANS_BUTTON_FREQENTNOTES , wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(mmTransDialog::OnFrequentUsedNotes), nullptr, this); // Attachments --------------------------------------------- bAttachments_ = new wxBitmapButton(this, wxID_FILE , mmBitmap(png::CLIP), wxDefaultPosition , wxSize(bFrequentUsedNotes->GetSize().GetY(), bFrequentUsedNotes->GetSize().GetY())); bAttachments_->SetToolTip(_("Organize attachments of this transaction")); wxBoxSizer* RightAlign_sizer = new wxBoxSizer(wxHORIZONTAL); flex_sizer->Add(RightAlign_sizer, wxSizerFlags(g_flagsH).Align(wxALIGN_RIGHT)); RightAlign_sizer->Add(bAttachments_, wxSizerFlags().Border(wxRIGHT, 5)); RightAlign_sizer->Add(bFrequentUsedNotes, wxSizerFlags().Border(wxLEFT, 5)); textNotes_ = new wxTextCtrl(this, ID_DIALOG_TRANS_TEXTNOTES, "", wxDefaultPosition, wxSize(-1, 120), wxTE_MULTILINE); box_sizer->Add(textNotes_, wxSizerFlags(g_flagsExpand).Border(wxLEFT | wxRIGHT | wxBOTTOM, 10)); /********************************************************************************************** Button Panel with OK and Cancel Buttons ***********************************************************************************************/ wxPanel* buttons_panel = new wxPanel(this, wxID_ANY); box_sizer1->Add(buttons_panel, wxSizerFlags(g_flagsV).Center().Border(wxALL, 0)); wxStdDialogButtonSizer* buttons_sizer = new wxStdDialogButtonSizer; buttons_panel->SetSizer(buttons_sizer); wxButton* itemButtonOK = new wxButton(buttons_panel, wxID_OK, _("&OK ")); itemButtonCancel_ = new wxButton(buttons_panel, wxID_CANCEL, wxGetTranslation(g_CancelLabel)); // Custom Fields --------------------------------------------- bCustomFields_ = new wxBitmapButton(buttons_panel, ID_DIALOG_TRANS_CUSTOMFIELDS , mmBitmap(png::EDIT_ACC)); bCustomFields_->SetToolTip(_("Open custom fields window")); buttons_sizer->Add(itemButtonOK, wxSizerFlags(g_flagsH).Border(wxBOTTOM | wxRIGHT, 10)); buttons_sizer->Add(itemButtonCancel_, wxSizerFlags(g_flagsH).Border(wxBOTTOM | wxRIGHT, 10)); buttons_sizer->Add(bCustomFields_, wxSizerFlags(g_flagsH).Border(wxBOTTOM | wxRIGHT, 10)); if (!m_new_trx && !m_duplicate) itemButtonCancel_->SetFocus(); buttons_sizer->Realize(); Center(); this->SetSizer(box_sizer1); cbPayee_->Connect(ID_DIALOG_TRANS_PAYEECOMBO, wxEVT_COMMAND_TEXT_UPDATED , wxCommandEventHandler(mmTransDialog::OnAccountOrPayeeUpdated), nullptr, this); textAmount_->Connect(ID_DIALOG_TRANS_TEXTAMOUNT, wxEVT_COMMAND_TEXT_ENTER , wxCommandEventHandler(mmTransDialog::onTextEntered), nullptr, this); toTextAmount_->Connect(ID_DIALOG_TRANS_TOTEXTAMOUNT, wxEVT_COMMAND_TEXT_ENTER , wxCommandEventHandler(mmTransDialog::onTextEntered), nullptr, this); textNumber_->Connect(ID_DIALOG_TRANS_TEXTNUMBER, wxEVT_COMMAND_TEXT_ENTER , wxCommandEventHandler(mmTransDialog::onTextEntered), nullptr, this); #ifdef __WXGTK__ // Workaround for bug http://trac.wxwidgets.org/ticket/11630 dpc_->Connect(ID_DIALOG_TRANS_BUTTONDATE, wxEVT_KILL_FOCUS , wxFocusEventHandler(mmTransDialog::OnDpcKillFocus), nullptr, this); #endif }
void mmStockDialog::CreateControls() { wxBoxSizer* mainBoxSizer = new wxBoxSizer(wxHORIZONTAL); this->SetSizer(mainBoxSizer); wxBoxSizer* leftBoxSizer = new wxBoxSizer(wxVERTICAL); mainBoxSizer->Add(leftBoxSizer, g_flags); wxStaticBox* itemStaticBoxSizer4Static = new wxStaticBox(this, wxID_ANY, _("Stock Investment Details")); wxStaticBoxSizer* itemStaticBoxSizer4 = new wxStaticBoxSizer(itemStaticBoxSizer4Static, wxVERTICAL); leftBoxSizer->Add(itemStaticBoxSizer4, g_flagsExpand); wxPanel* itemPanel5 = new wxPanel(this, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL); itemStaticBoxSizer4->Add(itemPanel5, g_flags); wxFlexGridSizer* itemFlexGridSizer6 = new wxFlexGridSizer(0, 2, 0, 0); itemPanel5->SetSizer(itemFlexGridSizer6); itemFlexGridSizer6->Add(new wxStaticText(itemPanel5, wxID_STATIC, _("Stock Name")), g_flags); stockName_ = new mmTextCtrl(itemPanel5, ID_TEXTCTRL_STOCKNAME, ""); itemFlexGridSizer6->Add(stockName_, g_flagsExpand); stockName_->SetToolTip(_("Enter the stock company name")); //Date itemFlexGridSizer6->Add(new wxStaticText(itemPanel5, wxID_STATIC, _("Date")), g_flags); dpc_ = new wxDatePickerCtrl(itemPanel5, ID_DPC_STOCK_PDATE , wxDefaultDateTime, wxDefaultPosition, wxSize(150, -1), wxDP_DROPDOWN | wxDP_SHOWCENTURY); itemFlexGridSizer6->Add(dpc_, g_flags); dpc_->SetToolTip(_("Specify the purchase date of the stock investment")); //Symbol wxStaticText* symbol = new wxStaticText(itemPanel5, wxID_STATIC, _("Symbol")); itemFlexGridSizer6->Add(symbol, g_flags); symbol->SetFont(this->GetFont().Bold()); stockSymbol_ = new mmTextCtrl( itemPanel5, ID_TEXTCTRL_STOCK_SYMBOL , "", wxDefaultPosition, wxSize(150, -1), 0); itemFlexGridSizer6->Add(stockSymbol_, g_flags); stockSymbol_->SetToolTip(_("Enter the stock symbol. (Optional) Include exchange. eg: IBM.BE")); //Number of Shares wxStaticText* number = new wxStaticText(itemPanel5, wxID_STATIC, _("Number of Shares")); itemFlexGridSizer6->Add(number, g_flags); number->SetFont(this->GetFont().Bold()); numShares_ = new mmTextCtrl(itemPanel5, ID_TEXTCTRL_NUMBER_SHARES, "" , wxDefaultPosition, wxSize(150, -1), wxALIGN_RIGHT | wxTE_PROCESS_ENTER, mmCalcValidator()); itemFlexGridSizer6->Add(numShares_, g_flags); numShares_->SetToolTip(_("Enter number of shares held")); numShares_->Connect(ID_TEXTCTRL_NUMBER_SHARES, wxEVT_COMMAND_TEXT_ENTER , wxCommandEventHandler(mmStockDialog::OnTextEntered), nullptr, this); //Purchase Price wxStaticText* pprice = new wxStaticText(itemPanel5, wxID_STATIC, _("Purchase Price")); itemFlexGridSizer6->Add(pprice, g_flags); pprice->SetFont(this->GetFont().Bold()); purchasePrice_ = new mmTextCtrl(itemPanel5, ID_TEXTCTRL_STOCK_PP, "" , wxDefaultPosition, wxSize(150, -1), wxALIGN_RIGHT | wxTE_PROCESS_ENTER, mmCalcValidator()); itemFlexGridSizer6->Add(purchasePrice_, g_flags); purchasePrice_->SetToolTip(_("Enter purchase price for each stock")); purchasePrice_->Connect(ID_TEXTCTRL_STOCK_PP, wxEVT_COMMAND_TEXT_ENTER , wxCommandEventHandler(mmStockDialog::OnTextEntered), nullptr, this); // itemFlexGridSizer6->Add(new wxStaticText(itemPanel5, wxID_STATIC, _("Current Price")), g_flags); currentPrice_ = new mmTextCtrl( itemPanel5, ID_TEXTCTRL_STOCK_CP, "" , wxDefaultPosition, wxSize(150, -1), wxALIGN_RIGHT | wxTE_PROCESS_ENTER, mmCalcValidator()); itemFlexGridSizer6->Add(currentPrice_, g_flags); currentPrice_->SetToolTip(_("Enter current stock price")); currentPrice_->Connect(ID_TEXTCTRL_STOCK_CP, wxEVT_COMMAND_TEXT_ENTER , wxCommandEventHandler(mmStockDialog::OnTextEntered), nullptr, this); // itemFlexGridSizer6->Add(new wxStaticText(itemPanel5, wxID_STATIC, _("Price Date")), g_flags); priceDate_ = new wxDatePickerCtrl(itemPanel5, ID_DPC_CP_PDATE , wxDefaultDateTime, wxDefaultPosition, wxSize(150, -1), wxDP_DROPDOWN | wxDP_SHOWCENTURY); itemFlexGridSizer6->Add(priceDate_, g_flags); priceDate_->SetToolTip(_("Specify the stock price date")); itemFlexGridSizer6->Add(new wxStaticText(itemPanel5, wxID_STATIC, _("Commission")), g_flags); commission_ = new mmTextCtrl( itemPanel5, ID_TEXTCTRL_STOCK_COMMISSION, "0" , wxDefaultPosition, wxSize(150, -1), wxALIGN_RIGHT | wxTE_PROCESS_ENTER, mmCalcValidator()); itemFlexGridSizer6->Add(commission_, g_flags); commission_->SetToolTip(_("Enter any commission paid")); commission_->Connect(ID_TEXTCTRL_STOCK_COMMISSION, wxEVT_COMMAND_TEXT_ENTER , wxCommandEventHandler(mmStockDialog::OnTextEntered), nullptr, this); // itemFlexGridSizer6->Add(new wxStaticText(itemPanel5, wxID_STATIC, _("Value")), g_flags); valueInvestment_ = new wxStaticText(itemPanel5, ID_STATIC_STOCK_VALUE, "--"); itemFlexGridSizer6->Add(valueInvestment_, g_flags); // itemFlexGridSizer6->Add(new wxStaticText(itemPanel5, wxID_STATIC, _("Notes")), g_flags); wxBoxSizer* iconsSizer = new wxBoxSizer(wxHORIZONTAL); itemFlexGridSizer6->Add(iconsSizer, wxSizerFlags(g_flags).Align(wxALIGN_RIGHT)); bAttachments_ = new wxBitmapButton(itemPanel5, wxID_FILE, mmBitmap(png::CLIP)); bAttachments_->SetToolTip(_("Organize attachments of this stock")); wxBitmapButton* itemButton31 = new wxBitmapButton(itemPanel5, wxID_INDEX, mmBitmap(png::WEB)); itemButton31->SetToolTip(_("Display the web page for the specified Stock symbol")); iconsSizer->Add(bAttachments_, g_flags); iconsSizer->Add(itemButton31, g_flags); notes_ = new mmTextCtrl(this, wxID_STATIC, "", wxDefaultPosition, wxSize(200, 90), wxTE_MULTILINE); itemStaticBoxSizer4->Add(notes_, g_flagsExpand); itemStaticBoxSizer4->AddSpacer(1); notes_->SetToolTip(_("Enter notes associated with this investment")); leftBoxSizer->AddSpacer(20); //History Panel wxBoxSizer* rightBoxSizer = new wxBoxSizer(wxVERTICAL); mainBoxSizer->Add(rightBoxSizer, g_flagsExpand); wxStaticBox* historyStaticBox = new wxStaticBox(this, wxID_ANY, _("Stock History Options")); wxStaticBoxSizer* historyStaticBoxSizer = new wxStaticBoxSizer(historyStaticBox, wxVERTICAL); rightBoxSizer->Add(historyStaticBoxSizer, g_flagsExpand); priceListBox_ = new wxListCtrl(this, wxID_ANY, wxDefaultPosition, wxSize(250, 150) , wxLC_REPORT); historyStaticBoxSizer->Add(priceListBox_, g_flagsExpand); priceListBox_->SetToolTip(_("Stock Price History")); // Add first column wxListItem col0; col0.SetId(0); col0.SetText( _("Date") ); col0.SetWidth(90); priceListBox_->InsertColumn(0, col0); // Add second column wxListItem col1; col1.SetId(1); col1.SetText( _("Price") ); col1.SetWidth(80); priceListBox_->InsertColumn(1, col1); // Add third column wxListItem col2; col2.SetId(2); col2.SetText( _("Diff.") ); col2.SetWidth(80); priceListBox_->InsertColumn(2, col2); //History Buttons wxPanel* buttons_panel = new wxPanel(this, wxID_ANY); historyStaticBoxSizer->Add(buttons_panel, wxSizerFlags(g_flags).Centre()); wxStdDialogButtonSizer* buttons_sizer = new wxStdDialogButtonSizer; buttons_panel->SetSizer(buttons_sizer); wxBitmapButton* buttonDownload = new wxBitmapButton(buttons_panel, ID_BUTTON_DOWNLOAD, mmBitmap(png::UPDATE)); buttonDownload->SetToolTip(_("Download Stock Price history")); wxBitmapButton* buttonImport = new wxBitmapButton(buttons_panel, ID_BUTTON_IMPORT, mmBitmap(png::IMPORT)); buttonImport->SetToolTip(_("Import Stock Price history (CSV Format)")); wxButton* buttonDel = new wxButton(buttons_panel, wxID_DELETE, _("&Delete ")); buttonDel->SetToolTip(_("Delete selected Stock Price")); wxButton* buttonAdd = new wxButton(buttons_panel, wxID_ADD, _("&Add ")); buttonAdd->SetToolTip(_("Add Stock Price to history")); buttons_sizer->Add(buttonDownload, g_flags); buttons_sizer->Add(buttonImport, g_flags); buttons_sizer->Add(buttonDel, g_flags); buttons_sizer->Add(buttonAdd, g_flags); //OK & Cancel buttons wxStdDialogButtonSizer* buttonsOK_CANCEL_sizer = new wxStdDialogButtonSizer; leftBoxSizer->Add(buttonsOK_CANCEL_sizer, wxSizerFlags(g_flags).Centre()); wxButton* itemButtonOK = new wxButton(this, wxID_SAVE, _("&Save ")); wxButton* itemButton30 = new wxButton(this, wxID_CANCEL, wxGetTranslation(g_CloseLabel)); if (edit_) itemButton30->SetFocus(); buttonsOK_CANCEL_sizer->Add(itemButtonOK, g_flags); buttonsOK_CANCEL_sizer->Add(itemButton30, g_flags); }
void mmMainCurrencyDialog::CreateControls() { wxBoxSizer* mainBoxSizer = new wxBoxSizer(wxHORIZONTAL); this->SetSizer(mainBoxSizer); wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL); mainBoxSizer->Add(itemBoxSizer2, g_flagsExpand); wxBoxSizer* itemBoxSizer22 = new wxBoxSizer(wxHORIZONTAL); itemBoxSizer2->Add(itemBoxSizer22, wxSizerFlags(g_flagsExpand).Proportion(0)); wxBitmapButton* update_button = new wxBitmapButton(this , wxID_STATIC, mmBitmap(png::UPDATE)); itemBoxSizer22->Add(update_button, g_flagsH); update_button->Connect(wxID_STATIC, wxEVT_COMMAND_BUTTON_CLICKED , wxCommandEventHandler(mmMainCurrencyDialog::OnOnlineUpdateCurRate), nullptr, this); update_button->SetToolTip(_("Online update currency rate")); itemBoxSizer22->AddSpacer(4); itemBoxSizer22->Add(new wxStaticText(this, wxID_STATIC , _("Online Update")), g_flagsH); itemBoxSizer22->AddSpacer(15); cbShowAll_ = new wxCheckBox(this, wxID_SELECTALL, _("Show All"), wxDefaultPosition , wxDefaultSize, wxCHK_2STATE); cbShowAll_->SetToolTip(_("Show all even the unused currencies")); cbShowAll_->Connect(wxID_SELECTALL, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(mmMainCurrencyDialog::OnShowHiddenChbClick), nullptr, this); itemBoxSizer22->Add(cbShowAll_, g_flagsH); wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxHORIZONTAL); itemBoxSizer2->Add(itemBoxSizer3, g_flagsExpand); //TODO:provide proper style and fix validator (does not working) currencyListBox_ = new wxDataViewListCtrl( this , wxID_ANY, wxDefaultPosition, wxSize(-1, 200)/*, wxDV_HORIZ_RULES, mmDoubleValidator(4)*/); currencyListBox_->AppendToggleColumn(ColName_[CURR_BASE], wxDATAVIEW_CELL_INERT, 30); currencyListBox_->AppendTextColumn(ColName_[CURR_SYMBOL], wxDATAVIEW_CELL_INERT, 60 , wxALIGN_LEFT, wxDATAVIEW_COL_SORTABLE); currencyListBox_->AppendTextColumn(ColName_[CURR_NAME], wxDATAVIEW_CELL_INERT, 170 , wxALIGN_LEFT, wxDATAVIEW_COL_SORTABLE); currencyListBox_->AppendTextColumn(ColName_[BASE_RATE], wxDATAVIEW_CELL_EDITABLE, 80); itemBoxSizer3->Add(currencyListBox_, g_flagsExpand); wxPanel* buttonsPanel = new wxPanel(this, wxID_ANY); itemBoxSizer2->Add(buttonsPanel, wxSizerFlags(g_flagsV).Center()); wxBoxSizer* buttonsSizer = new wxBoxSizer(wxVERTICAL); buttonsPanel->SetSizer(buttonsSizer); wxStdDialogButtonSizer* itemBoxSizer66 = new wxStdDialogButtonSizer; buttonsSizer->Add(itemBoxSizer66); wxButton* itemButton7 = new wxButton(buttonsPanel, wxID_ADD, _("&Add ")); itemBoxSizer66->Add(itemButton7, g_flagsH); itemButtonEdit_ = new wxButton(buttonsPanel, wxID_EDIT, _("&Edit ")); itemBoxSizer66->Add(itemButtonEdit_, g_flagsH); itemButtonEdit_->Disable(); itemButtonDelete_ = new wxButton(buttonsPanel, wxID_REMOVE, _("&Remove ")); itemBoxSizer66->Add(itemButtonDelete_, g_flagsH); itemButtonDelete_->Disable(); wxStdDialogButtonSizer* itemBoxSizer9 = new wxStdDialogButtonSizer; buttonsSizer->Add(itemBoxSizer9, wxSizerFlags(g_flagsExpand).Border(wxALL, 0)); wxButton* itemButtonSelect = new wxButton(buttonsPanel, wxID_SELECTALL, _("&Select")); itemBoxSizer9->Add(itemButtonSelect, wxSizerFlags(g_flagsExpand).Proportion(4)); //itemButtonSelect->SetToolTip(_("Select the currently selected currency as the selected currency for the account")); if (bEnableSelect_ == false) itemButtonSelect->Disable(); //Some interfaces has no any close buttons, it may confuse user. Cancel button added wxButton* itemCancelButton = new wxButton(buttonsPanel, wxID_CANCEL, wxGetTranslation(g_CloseLabel)); itemBoxSizer9->Add(itemCancelButton, g_flagsH); itemCancelButton->SetFocus(); //History Panel wxBoxSizer* rightBoxSizer = new wxBoxSizer(wxVERTICAL); mainBoxSizer->Add(rightBoxSizer, g_flagsExpand); historyStaticBox_ = new wxStaticBox(this, wxID_ANY, _("Currency History Options")); wxStaticBoxSizer* historyStaticBox_Sizer = new wxStaticBoxSizer(historyStaticBox_, wxVERTICAL); rightBoxSizer->Add(historyStaticBox_Sizer, g_flagsExpand); valueListBox_ = new wxListCtrl(this, wxID_ANY, wxDefaultPosition, wxSize(250, 150) , wxLC_REPORT); historyStaticBox_Sizer->Add(valueListBox_, g_flagsExpand); wxListItem col0, col1, col2; // Add first column col0.SetId(0); col0.SetText(_("Date")); col0.SetWidth(90); valueListBox_->InsertColumn(0, col0); // Add second column col1.SetId(1); col1.SetText(_("Value")); col1.SetWidth(100); valueListBox_->InsertColumn(1, col1); // Add third column col2.SetId(2); col2.SetText(_("Diff.")); col2.SetWidth(90); valueListBox_->InsertColumn(2, col2); //History Buttons wxPanel* values_panel = new wxPanel(this, wxID_ANY); historyStaticBox_Sizer->Add(values_panel, wxSizerFlags(g_flagsV).Centre()); wxStdDialogButtonSizer* values_sizer = new wxStdDialogButtonSizer; values_panel->SetSizer(values_sizer); values_sizer->Add(new wxStaticText(values_panel, wxID_STATIC, _("Date")), g_flagsH); valueDatePicker_ = new wxDatePickerCtrl(values_panel, wxID_ANY, wxDefaultDateTime, wxDefaultPosition, wxSize(120, -1), wxDP_DROPDOWN | wxDP_SHOWCENTURY); values_sizer->Add(valueDatePicker_, g_flagsH); valueDatePicker_->SetToolTip(_("Specify the date of currency value")); values_sizer->Add(new wxStaticText(values_panel, wxID_STATIC, _("Value")), g_flagsH); valueTextBox_ = new mmTextCtrl(values_panel, wxID_ANY, wxGetEmptyString() , wxDefaultPosition, wxSize(120, -1), wxALIGN_RIGHT | wxTE_PROCESS_ENTER , mmCalcValidator()); valueTextBox_->SetToolTip(_("Enter the currency value")); values_sizer->Add(valueTextBox_, g_flagsH); wxPanel* buttons_panel = new wxPanel(this, wxID_ANY); historyStaticBox_Sizer->Add(buttons_panel, wxSizerFlags(g_flagsV).Centre()); wxStdDialogButtonSizer* buttons_sizer = new wxStdDialogButtonSizer; buttons_panel->SetSizer(buttons_sizer); wxBitmapButton* buttonDownload = new wxBitmapButton(buttons_panel, HISTORY_UPDATE, mmBitmap(png::UPDATE)); buttonDownload->SetToolTip(_("Download Currency Values history")); historyButtonAdd_ = new wxButton(buttons_panel, HISTORY_ADD, _("&Add / Update "), wxDefaultPosition , wxSize(-1, buttonDownload->GetSize().GetY())); historyButtonAdd_->SetToolTip(_("Add Currency Values to history")); historyButtonDelete_ = new wxButton(buttons_panel, HISTORY_DELETE, _("&Delete "), wxDefaultPosition , wxSize(-1, buttonDownload->GetSize().GetY())); historyButtonDelete_->SetToolTip(_("Delete selected Currency Values")); wxBitmapButton* buttonDelUnusedHistory = new wxBitmapButton(buttons_panel , HISTORY_DELUNUSED, mmBitmap(png::VOID_STAT)); buttonDelUnusedHistory->SetToolTip(_("Delete Currency Values history for unused currencies")); buttons_sizer->Add(buttonDownload, g_flagsH); buttons_sizer->Add(historyButtonAdd_, g_flagsH); buttons_sizer->Add(historyButtonDelete_, g_flagsH); buttons_sizer->Add(buttonDelUnusedHistory, g_flagsH); this->SetMinSize(wxSize(800,550)); this->Fit(); }