1 /*******************************************************
2  This program is free software; you can redistribute it and/or modify
3  it under the terms of the GNU General Public License as published by
4  the Free Software Foundation; either version 2 of the License, or
5  (at your option) any later version.
6 
7  This program is distributed in the hope that it will be useful,
8  but WITHOUT ANY WARRANTY; without even the implied warranty of
9  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10  GNU General Public License for more details.
11 
12  You should have received a copy of the GNU General Public License
13  along with this program; if not, write to the Free Software
14  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
15  ********************************************************/
16 
17 #pragma once
18 
19 #include "model/Model_Asset.h"
20 #include "model/Model_Currency.h"
21 
22 class wxDatePickerCtrl;
23 class mmTextCtrl;
24 
25 class mmAssetDialog : public wxDialog
26 {
27     wxDECLARE_DYNAMIC_CLASS(mmAssetDialog);
28     wxDECLARE_EVENT_TABLE();
29 
30 public:
mmAssetDialog()31     mmAssetDialog(){};
32     mmAssetDialog(wxWindow *parent, Model_Asset::Data* asset);
33 
34     Model_Asset::Data* m_asset;
35 private:
36     bool Create(wxWindow* parent
37         , wxWindowID id
38         , const wxString& caption
39         , const wxPoint& pos
40         , const wxSize& size
41         , long style);
42     void CreateControls();
43     void OnOk(wxCommandEvent& event);
44     void OnCancel(wxCommandEvent& event);
45 	void OnAttachments(wxCommandEvent& event);
46     void OnChangeAppreciationType(wxCommandEvent& event);
47     void enableDisableRate(bool en);
48     void onTextEntered(wxCommandEvent& event);
49     void dataToControls();
50     void changeFocus(wxChildFocusEvent& event);
51     void OnQuit(wxCloseEvent& event);
52 
53     bool assetRichText;
54 
55     mmTextCtrl* m_assetName;
56     wxDatePickerCtrl* m_dpc;
57     mmTextCtrl* m_notes;
58     mmTextCtrl* m_value;
59     mmTextCtrl* m_valueChangeRate;
60     wxChoice*  m_assetType;
61     wxChoice*  m_valueChange;
62     wxStaticText* m_valueChangeRateLabel;
63 	wxBitmapButton* bAttachments_;
64 
65     enum
66     {
67         IDC_COMBO_TYPE = wxID_HIGHEST + 1100,
68         IDC_NOTES,
69         IDC_VALUE,
70         IDC_RATE,
71     };
72 };
73