1 #include <creaImageIOWxListenerPanel.h>
2 #include <creaImageIOSystem.h>
7 WxListenerPanel::WxListenerPanel(wxWindow *parent, wxDialog* dial, WxGimmickView* view, bool stat)
21 GimmickDebugMessage(1,"WxListener::WxListener"
24 /// \TODO fix warning: unused variable cp
25 wxStaticText * cp=new wxStaticText(this,-1,_T(" Drive to monitor: "), wxPoint(5,15));
26 const wxString choices[] = { _T("D:"),
30 drives=new wxComboBox(this, -1,crea::std2wx("E:"),wxPoint(100, 10),wxDefaultSize,4,choices);
32 addCheckBox = new wxCheckBox(this, -1, _T("Automatically add images to the database when CD/DVD is mounted?"), wxPoint(5,45) );
33 addCheckBox->SetValue(true);
34 removeCheckBox = new wxCheckBox(this, -1, _T("Automatically remove images from the database when CD/DVD is unmounted?"), wxPoint(5,75) );
35 removeCheckBox->SetValue(true);
36 Connect( addCheckBox->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &WxListenerPanel::OnAdd );
37 Connect( removeCheckBox->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &WxListenerPanel::OnRemove );
39 if (state){name="Start Monitoring Drive";}
40 else {name="Stop Monitoring Drive";}
41 wxButton *start = new wxButton(this,wxID_ANY,crea::std2wx(name), wxPoint(5,110) );
42 Connect( start->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WxListenerPanel::OnChangeThreadState );
44 wxButton *save = new wxButton(this,wxID_ANY,_T("Save Changes"), wxPoint(130,110) );
45 Connect( save->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WxListenerPanel::OnChangeListenState );
48 //topsizer->Add( mView,1,wxGROW,0);
50 // SetSizer( topsizer );
55 WxListenerPanel::~WxListenerPanel()
57 GimmickDebugMessage(1,"WxCustomizeConfigPanel::~WxCustomizeConfigPanel"
61 void WxListenerPanel::OnAdd(wxCommandEvent& event)
63 addFiles = addCheckBox->GetValue();
66 void WxListenerPanel::OnRemove(wxCommandEvent& event)
68 removeFiles = removeCheckBox->GetValue();
71 void WxListenerPanel::OnChangeListenState(wxCommandEvent& event)
73 mView->OnListenerCallback(crea::wx2std(drives->GetValue()),addFiles, removeFiles);
77 void WxListenerPanel::OnChangeThreadState(wxCommandEvent& event)
81 mView->StartListeningThread();
85 mView->StopListeningThread();
90 //======================================================================
92 //======================================================================
94 } // EO namespace creaImageIO