creaImageIO_lib
creaImageIO::WxListenerPanel Class Reference

#include <creaImageIOWxListenerPanel.h>

Inheritance diagram for creaImageIO::WxListenerPanel:
Collaboration diagram for creaImageIO::WxListenerPanel:

Public Member Functions

 WxListenerPanel ()
 
 WxListenerPanel (wxWindow *parent, wxDialog *dial, WxGimmickView *view, bool stat)
 
 ~WxListenerPanel ()
 Destructor. More...
 
void OnChangeListenState (wxCommandEvent &event)
 Saves the configuration. More...
 
void OnChangeThreadState (wxCommandEvent &event)
 Changes the thread state(start/stop) More...
 
void OnAdd (wxCommandEvent &event)
 Changes the state of the add boolean. More...
 
void OnRemove (wxCommandEvent &event)
 Changes the state of the remove boolean. More...
 

Private Attributes

bool addFiles
 
bool removeFiles
 
bool state
 
wxCheckBox * addCheckBox
 
wxCheckBox * removeCheckBox
 
wxComboBox * drives
 
wxDialog * dialog
 
WxGimmickViewmView
 

Detailed Description

Definition at line 44 of file creaImageIOWxListenerPanel.h.

Constructor & Destructor Documentation

creaImageIO::WxListenerPanel::WxListenerPanel ( )
creaImageIO::WxListenerPanel::WxListenerPanel ( wxWindow *  parent,
wxDialog *  dial,
WxGimmickView view,
bool  stat 
)

fix warning: unused variable cp

Definition at line 35 of file creaImageIOWxListenerPanel.cpp.

References addCheckBox, drives, GimmickDebugMessage, OnAdd(), OnChangeListenState(), OnChangeThreadState(), OnRemove(), removeCheckBox, and state.

36  : wxPanel( parent,
37  -1, wxDefaultPosition,
38  wxDefaultSize,
39  wxRESIZE_BORDER |
40  wxSYSTEM_MENU |
41  wxCLOSE_BOX |
42  wxMAXIMIZE_BOX |
43  wxMINIMIZE_BOX |
44  wxCAPTION
45  ),
46  dialog(dial),
47  mView(view)
48  {
49  GimmickDebugMessage(1,"WxListener::WxListener"
50  <<std::endl);
51  state=stat;
53  wxStaticText * cp=new wxStaticText(this,-1,_T(" Drive to monitor: "), wxPoint(5,15));
54  const wxString choices[] = { _T("D:"),
55  _T("E:"),
56  _T("F:"),
57  _T("G:") };
58  drives=new wxComboBox(this, -1,crea::std2wx("E:"),wxPoint(100, 10),wxDefaultSize,4,choices);
59 
60  addCheckBox = new wxCheckBox(this, -1, _T("Automatically add images to the database when CD/DVD is mounted?"), wxPoint(5,45) );
61  addCheckBox->SetValue(true);
62  removeCheckBox = new wxCheckBox(this, -1, _T("Automatically remove images from the database when CD/DVD is unmounted?"), wxPoint(5,75) );
63  removeCheckBox->SetValue(true);
64  Connect( addCheckBox->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &WxListenerPanel::OnAdd );
65  Connect( removeCheckBox->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &WxListenerPanel::OnRemove );
66  std::string name;
67  if (state){name="Start Monitoring Drive";}
68  else {name="Stop Monitoring Drive";}
69  wxButton *start = new wxButton(this,wxID_ANY,crea::std2wx(name), wxPoint(5,110) );
70  Connect( start->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WxListenerPanel::OnChangeThreadState );
71 
72  wxButton *save = new wxButton(this,wxID_ANY,_T("Save Changes"), wxPoint(130,110) );
73  Connect( save->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WxListenerPanel::OnChangeListenState );
74 
75 
76  //topsizer->Add( mView,1,wxGROW,0);
77 
78 // SetSizer( topsizer );
79  Layout();
80  }

Here is the call graph for this function:

creaImageIO::WxListenerPanel::~WxListenerPanel ( )

Destructor.

Definition at line 83 of file creaImageIOWxListenerPanel.cpp.

References GimmickDebugMessage.

84  {
85  GimmickDebugMessage(1,"WxCustomizeConfigPanel::~WxCustomizeConfigPanel"
86  <<std::endl);
87  }

Member Function Documentation

void creaImageIO::WxListenerPanel::OnAdd ( wxCommandEvent &  event)

Changes the state of the add boolean.

Definition at line 89 of file creaImageIOWxListenerPanel.cpp.

References addCheckBox, and addFiles.

Referenced by WxListenerPanel().

90  {
91  addFiles = addCheckBox->GetValue();
92  }

Here is the caller graph for this function:

void creaImageIO::WxListenerPanel::OnChangeListenState ( wxCommandEvent &  event)

Saves the configuration.

Definition at line 99 of file creaImageIOWxListenerPanel.cpp.

References addFiles, dialog, drives, mView, creaImageIO::WxGimmickView::OnListenerCallback(), and removeFiles.

Referenced by WxListenerPanel().

100  {
101  mView->OnListenerCallback(crea::wx2std(drives->GetValue()),addFiles, removeFiles);
102  dialog->Destroy();
103  }

Here is the call graph for this function:

Here is the caller graph for this function:

void creaImageIO::WxListenerPanel::OnChangeThreadState ( wxCommandEvent &  event)

Changes the thread state(start/stop)

Definition at line 105 of file creaImageIOWxListenerPanel.cpp.

References dialog, mView, creaImageIO::WxGimmickView::StartListeningThread(), state, and creaImageIO::WxGimmickView::StopListeningThread().

Referenced by WxListenerPanel().

106  {
107  if(state)
108  {
110  }
111  else
112  {
114  }
115  dialog->Destroy();
116  }

Here is the call graph for this function:

Here is the caller graph for this function:

void creaImageIO::WxListenerPanel::OnRemove ( wxCommandEvent &  event)

Changes the state of the remove boolean.

Definition at line 94 of file creaImageIOWxListenerPanel.cpp.

References removeCheckBox, and removeFiles.

Referenced by WxListenerPanel().

95  {
96  removeFiles = removeCheckBox->GetValue();
97  }

Here is the caller graph for this function:

Member Data Documentation

wxCheckBox* creaImageIO::WxListenerPanel::addCheckBox
private

Definition at line 68 of file creaImageIOWxListenerPanel.h.

Referenced by OnAdd(), and WxListenerPanel().

bool creaImageIO::WxListenerPanel::addFiles
private

Definition at line 65 of file creaImageIOWxListenerPanel.h.

Referenced by OnAdd(), and OnChangeListenState().

wxDialog* creaImageIO::WxListenerPanel::dialog
private

Definition at line 71 of file creaImageIOWxListenerPanel.h.

Referenced by OnChangeListenState(), and OnChangeThreadState().

wxComboBox* creaImageIO::WxListenerPanel::drives
private

Definition at line 70 of file creaImageIOWxListenerPanel.h.

Referenced by OnChangeListenState(), and WxListenerPanel().

WxGimmickView* creaImageIO::WxListenerPanel::mView
private

Definition at line 72 of file creaImageIOWxListenerPanel.h.

Referenced by OnChangeListenState(), and OnChangeThreadState().

wxCheckBox* creaImageIO::WxListenerPanel::removeCheckBox
private

Definition at line 69 of file creaImageIOWxListenerPanel.h.

Referenced by OnRemove(), and WxListenerPanel().

bool creaImageIO::WxListenerPanel::removeFiles
private

Definition at line 66 of file creaImageIOWxListenerPanel.h.

Referenced by OnChangeListenState(), and OnRemove().

bool creaImageIO::WxListenerPanel::state
private

Definition at line 67 of file creaImageIOWxListenerPanel.h.

Referenced by OnChangeThreadState(), and WxListenerPanel().


The documentation for this class was generated from the following files: