]> Creatis software - creaImageIO.git/blob - src/creaImageIOWxCustomizeConfigPanel.cpp
3a1bc9c79359f9d1a863f03086d4477099b3978e
[creaImageIO.git] / src / creaImageIOWxCustomizeConfigPanel.cpp
1 #include <creaImageIOWxCustomizeConfigPanel.h>
2 #include <creaImageIOSystem.h>
3 namespace creaImageIO
4 {
5   // CTor
6   WxCustomizeConfigPanel::WxCustomizeConfigPanel(wxWindow *parent, wxDialog* dial, WxGimmickView* view, const std::string& cPath, 
7                 const std::string& dPath,
8                 const std::string& sEvent,
9                 const std::string& sFreq)
10  :   wxPanel( parent, 
11                   -1, wxDefaultPosition, 
12                   wxDefaultSize,
13                   wxRESIZE_BORDER | 
14               wxSYSTEM_MENU  |
15                   wxCLOSE_BOX |
16                   wxMAXIMIZE_BOX | 
17                   wxMINIMIZE_BOX | 
18                   wxCAPTION  
19                ),       
20                    dialog(dial),
21                    copyP (cPath), 
22                    databaseP(dPath), 
23                    syncEv(sEvent), 
24                    syncFr(sFreq),
25                    mView(view)
26   {
27     GimmickDebugMessage(1,"WxCustomizeConfigPanel::WxCustomizeConfigPanel"
28                         <<std::endl);
29         /// \TODO fix  warning: unused variable cp
30         wxStaticText * cp=new wxStaticText(this,-1,_T(" Copy Path: "), wxPoint(5,10));
31         copyPath=new wxTextCtrl(this, wxID_ANY, crea::std2wx(copyP), wxPoint(150,10), wxSize(250,20));
32
33         /// \TODO fix  warning: unused variable dp
34         wxStaticText * dp=new wxStaticText(this,-1,_T(" Database Path: "), wxPoint(5,40));
35         dbPath=new wxTextCtrl(this, wxID_ANY, crea::std2wx(databaseP), wxPoint(150,40), wxSize(250,20));
36
37         /// \TODO fix  warning: unused variable se
38         wxStaticText * se=new wxStaticText(this,-1,_T(" Synchronization Event: "), wxPoint(5,70));
39         syncEvent=new wxTextCtrl(this, wxID_ANY, crea::std2wx(syncEv), wxPoint(150,70), wxSize(250,20));
40
41         /// \TODO fix  warning: unused variable sf
42         wxStaticText * sf=new wxStaticText(this,-1,_T(" Synchronization Frequency: "), wxPoint(5,100));
43         syncFrequency=new wxTextCtrl(this, wxID_ANY, crea::std2wx(syncFr), wxPoint(150,100), wxSize(250,20));
44
45         wxButton *save = new wxButton(this,wxID_ANY,_T("Save Changes"), wxPoint(5,130) );
46         Connect( save->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WxCustomizeConfigPanel::OnSaveConfig ); 
47   
48     Layout(); 
49   }
50
51   /// Destructor
52   WxCustomizeConfigPanel::~WxCustomizeConfigPanel()
53   {
54     GimmickDebugMessage(1,"WxCustomizeConfigPanel::~WxCustomizeConfigPanel"
55                         <<std::endl);
56   }
57
58   void WxCustomizeConfigPanel::OnSaveConfig(wxCommandEvent& event)
59   {
60           mView->OnSaveSettingsCallback(crea::wx2std(copyPath->GetValue()),
61                   crea::wx2std(dbPath->GetValue()),
62                   crea::wx2std(syncEvent->GetValue()),
63                   crea::wx2std(syncFrequency->GetValue()));
64           dialog->Destroy();
65   }
66   
67 //======================================================================
68   
69 //====================================================================== 
70
71 } // EO namespace creaImageIO
72
73