// Implementation Template Instructions and Notes:
// 1. To create a new dialog class (using Visual Studio): 
// Use the Visual Studio Project > Add Class... wizard. Select the C++
// "Category" and "Add" button. Enter the ClassName in the "Class name:" edit
// box. The .h and .cpp edit boxes will prefix the ClassName with a 'C'.
// Prefix the .h name with ../../source/ and the .cpp name with ../../source/
// Put AIModalDialog as the "Base class:" edit box, and tick the "Virtual destructor"
// check box and finally click "Finish". Visual Studio adds ClassName.h and
// ClassName.cpp stub source files to the project (located in the adaptit/source/ dir).
// 2. Open the new .cpp file and copy and paste the entire contents of this 
// template text into the new class implementation .cpp file.
// 3. Find and Replace ClassName with the name of the actual class (less the C prefix)
// Note: In the Find and Replace dialog untick the "Match whole word" option.
// 4. Change the \author name as appropriate.
// 5. Fill in the \description for the "The CClassName class(does what)" part.
// 6. Implement the details of the new class.
// 7. After doing 2-6 above delete these Implementation Template Notes from the new .cpp file
/////////////////////////////////////////////////////////////////////////////
/// \project		adaptit
/// \file			ClassName.cpp
/// \author			Bill Martin
/// \date_created	10 July 2015
/// \rcs_id $Id$
/// \copyright		2015 Bruce Waters, Bill Martin, SIL International
/// \license		The Common Public License or The GNU Lesser General Public License (see license directory)
/// \description	This is the implementation file for the CClassName class. 
/// The CClassName class (does what)
/// \derivation		The CClassName class is derived from AIModalDialog.
/////////////////////////////////////////////////////////////////////////////

// the following improves GCC compilation performance
#if defined(__GNUG__) && !defined(__APPLE__)
    #pragma implementation "ClassName.h"
#endif

// For compilers that support precompilation, includes "wx.h".
#include <wx/wxprec.h>

#ifdef __BORLANDC__
#pragma hdrstop
#endif

#ifndef WX_PRECOMP
// Include your minimal set of headers here, or wx.h
#include <wx/wx.h>
#endif

// other includes
//#include <wx/docview.h> // needed for classes that reference wxView or wxDocument
//#include <wx/valgen.h> // for wxGenericValidator
//#include <wx/valtext.h> // for wxTextValidator
#include "Adapt_It.h"
#include "ClassName.h"

// event handler table
BEGIN_EVENT_TABLE(CClassName, AIModalDialog)
	EVT_INIT_DIALOG(CClassName::InitDialog)
	// Samples:
	EVT_BUTTON(wxID_OK, CClassName::OnOK)
	//EVT_MENU(ID_SOME_MENU_ITEM, CClassName::OnDoSomething)
	//EVT_UPDATE_UI(ID_SOME_MENU_ITEM, CClassName::OnUpdateDoSomething)
	//EVT_BUTTON(ID_SOME_BUTTON, CClassName::OnDoSomething)
	//EVT_CHECKBOX(ID_SOME_CHECKBOX, CClassName::OnDoSomething)
	//EVT_RADIOBUTTON(ID_SOME_RADIOBUTTON, CClassName::DoSomething)
	//EVT_LISTBOX(ID_SOME_LISTBOX, CClassName::DoSomething)
	//EVT_COMBOBOX(ID_SOME_COMBOBOX, CClassName::DoSomething)
	//EVT_TEXT(IDC_SOME_EDIT_CTRL, CClassName::OnEnChangeEditSomething)
	// ... other menu, button or control events
END_EVENT_TABLE()

CClassName::CClassName(wxWindow* parent) // dialog constructor
	: AIModalDialog(parent, -1, _("Dialog Title Here"),
				wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
{
	// This dialog function below is generated in wxDesigner, and defines the controls and sizers
	// for the dialog. The first parameter is the parent which should normally be "this".
	// The second and third parameters should both be TRUE to utilize the sizers and create the right
	// size dialog.
//	NameFromwxDesignerDlgFunc(this, TRUE, TRUE);
	// The declaration is: NameFromwxDesignerDlgFunc( wxWindow *parent, bool call_fit, bool set_sizer );
	
	// use wxValidator for simple dialog data transfer
	// sample text control initialization below:
	//wxTextCtrl* pEdit;
	//pEdit = (wxTextCtrl*)FindWindowById(IDC_TEXTCONTROL);
	//pEdit->SetValidator(wxGenericValidator(&m_stringVariable));
	//pEdit->SetBackgroundColour(sysColorBtnFace);

	// sample radio button control initialization below:
	//wxRadioButton* pRadioB;
	//pRadioB = (wxRadioButton*)FindWindowById(IDC_RADIO_BUTTON);
	//pRadioB->SetValue(TRUE);
	//pRadioB->SetValidator(wxGenericValidator(&m_bVariable));

	// other attribute initializations
}

CClassName::~CClassName() // destructor
{
	
}

void CClassName::InitDialog(wxInitDialogEvent& WXUNUSED(event)) // InitDialog is method of wxWindow
{
	//InitDialog() is not virtual, no call needed to a base class

}

// event handling functions

//CClassName::OnDoSomething(wxCommandEvent& event)
//{
//	// handle the event
	
//}

//CClassName::OnUpdateDoSomething(wxUpdateUIEvent& event)
//{
//	if (SomeCondition == TRUE)
//		event.Enable(TRUE);
//	else
//		event.Enable(FALSE);	
//}

// OnOK() calls wxWindow::Validate, then wxWindow::TransferDataFromWindow.
// If this returns TRUE, the function either calls EndModal(wxID_OK) if the
// dialog is modal, or sets the return value to wxID_OK and calls Show(FALSE)
// if the dialog is modeless.
void CClassName::OnOK(wxCommandEvent& event) 
{
	// sample code
	//wxListBox* pListBox;
	//pListBox = (wxListBox*)FindWindowById(IDC_LISTBOX_ADAPTIONS);
	//int nSel;
	//nSel = pListBox->GetSelection();
	//if (nSel == LB_ERR) // LB_ERR is #define -1
	//{
	//	wxMessageBox(_T("List box error when getting the current selection"), _T(""), wxICON_EXCLAMATION | wxOK);
	//}
	//m_projectName = pListBox->GetString(nSel);
	
	event.Skip(); //EndModal(wxID_OK); //AIModalDialog::OnOK(event); // not virtual in wxDialog
}


// other class methods

