///////////////////////////////////////////////////////////////////////////// // $Header: $ // $Log: $ #include "stdwx.h" #include "DlgConfig.h" // WDR: class implementations //---------------------------------------------------------------------------- // scDlgConfig //---------------------------------------------------------------------------- // WDR: event table for scDlgConfig BEGIN_EVENT_TABLE(scDlgConfig,wxDialog) EVT_BUTTON( ID_ADD, scDlgConfig::OnAdd ) EVT_BUTTON( ID_SWISHE, scDlgConfig::OnSwishE ) EVT_BUTTON( ID_DELETE, scDlgConfig::OnDelete ) EVT_BUTTON( wxID_OK, scDlgConfig::OnOK ) EVT_INIT_DIALOG(scDlgConfig::OnInitDialog) END_EVENT_TABLE() scDlgConfig::scDlgConfig( wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &position, const wxSize& size, long style ) : wxDialog( parent, id, title, position, size, style ) { // WDR: dialog function createDlgConfig for scDlgConfig createDlgConfig( this, TRUE ); } void scDlgConfig::OnInitDialog(wxInitDialogEvent& event) { GetPath()->SetLabel (m_strPath); for (int i=0; iAppend (m_astrIndex[i]); if (m_astrAktiv[i] == "1") GetListbox()->Check (GetListbox()->GetCount() -1); } wxDialog::OnInitDialog(event); } // WDR: handler implementations for scDlgConfig void scDlgConfig::OnOK( wxCommandEvent &event ) { int i; m_astrAktiv.Empty(); m_astrIndex.Empty(); for (i=0; iGetCount(); i++) { m_astrIndex.Add (GetListbox()->GetString (i)); if (GetListbox()->IsChecked (i)) m_astrAktiv.Add ("1"); else m_astrAktiv.Add ("0"); } EndModal (wxID_OK); } void scDlgConfig::OnDelete( wxCommandEvent &event ) { int nSel = GetListbox()->GetSelection(); if (nSel >= 0) GetListbox()->Delete(nSel); } void scDlgConfig::OnSwishE( wxCommandEvent &event ) { wxFileDialog dlgFile (this, "Wähle swish-e Programmdatei"); if (dlgFile.ShowModal () != wxID_OK) return; m_strPath = dlgFile.GetPath(); GetPath()->SetLabel (m_strPath); } void scDlgConfig::OnAdd( wxCommandEvent &event ) { wxFileDialog dlgFile (this, "Wähle eine swish-e Indexdatei"); if (dlgFile.ShowModal () != wxID_OK) return; GetListbox()->Append (dlgFile.GetPath()); GetListbox()->Check (GetListbox()->GetCount() -1); }