00001 #include <creaImageIOWxCustomizeConfigPanel.h>
00002 #include <creaImageIOSystem.h>
00003 namespace creaImageIO
00004 {
00005
00006 WxCustomizeConfigPanel::WxCustomizeConfigPanel(wxWindow *parent, wxDialog* dial, WxGimmickView* view, const std::string& cPath,
00007 const std::string& dPath,
00008 const std::string& sEvent,
00009 const std::string& sFreq)
00010 : wxPanel( parent,
00011 -1, wxDefaultPosition,
00012 wxDefaultSize,
00013 wxRESIZE_BORDER |
00014 wxSYSTEM_MENU |
00015 wxCLOSE_BOX |
00016 wxMAXIMIZE_BOX |
00017 wxMINIMIZE_BOX |
00018 wxCAPTION
00019 ),
00020 dialog(dial),
00021 copyP (cPath),
00022 databaseP(dPath),
00023 syncEv(sEvent),
00024 syncFr(sFreq),
00025 mView(view)
00026 {
00027 GimmickDebugMessage(1,"WxCustomizeConfigPanel::WxCustomizeConfigPanel"
00028 <<std::endl);
00029 wxStaticText * cp=new wxStaticText(this,-1,_T(" Copy Path: "), wxPoint(5,10));
00030 copyPath=new wxTextCtrl(this, wxID_ANY, crea::std2wx(copyP), wxPoint(150,10), wxSize(250,20));
00031
00032 wxStaticText * dp=new wxStaticText(this,-1,_T(" Database Path: "), wxPoint(5,40));
00033 dbPath=new wxTextCtrl(this, wxID_ANY, crea::std2wx(databaseP), wxPoint(150,40), wxSize(250,20));
00034
00035 wxStaticText * se=new wxStaticText(this,-1,_T(" Synchronization Event: "), wxPoint(5,70));
00036 syncEvent=new wxTextCtrl(this, wxID_ANY, crea::std2wx(syncEv), wxPoint(150,70), wxSize(250,20));
00037
00038 wxStaticText * sf=new wxStaticText(this,-1,_T(" Synchronization Frequency: "), wxPoint(5,100));
00039 syncFrequency=new wxTextCtrl(this, wxID_ANY, crea::std2wx(syncFr), wxPoint(150,100), wxSize(250,20));
00040
00041 wxButton *save = new wxButton(this,wxID_ANY,_T("Save Changes"), wxPoint(5,130) );
00042 Connect( save->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WxCustomizeConfigPanel::OnSaveConfig );
00043
00044 Layout();
00045 }
00046
00048 WxCustomizeConfigPanel::~WxCustomizeConfigPanel()
00049 {
00050 GimmickDebugMessage(1,"WxCustomizeConfigPanel::~WxCustomizeConfigPanel"
00051 <<std::endl);
00052 }
00053
00054 void WxCustomizeConfigPanel::OnSaveConfig(wxCommandEvent& event)
00055 {
00056 mView->OnSaveSettingsCallback(crea::wx2std(copyPath->GetValue()),
00057 crea::wx2std(dbPath->GetValue()),
00058 crea::wx2std(syncEvent->GetValue()),
00059 crea::wx2std(syncFrequency->GetValue()));
00060 dialog->Destroy();
00061 }
00062
00063
00064
00065
00066
00067 }
00068
00069