///////////////////////////////////////////////////////////
// Author:			Stefan Liersch
// Contact:			stefan.liersch@googlemail.com,
//					stefan.liersch@ufz.de
//
// Date:			2008-04-10
// last modified:	2008-04-10
//
//---------------------------------------------------------
// DESCRIPTION
//---------------------------------------------------------
//
//---------------------------------------------------------
// ToDo
//---------------------------------------------------------
//	- 
///////////////////////////////////////////////////////////

//---------------------------------------------------------------------

#ifndef __PG_SOIL_SALINITY_DLG_BASE_H_
#define __PG_SOIL_SALINITY_DLG_BASE_H_
//---------------------------------------------------------------------

// Include wxWidgets' headers
#ifndef WX_PRECOMP
    #include <wx/wx.h>
#endif

#include "pgsql/pgdatabase.h"

#include "saga_gui/wksp_layer.h"
#include "saga_gui/wksp_simplefeature.h"
#include "saga_gui/wksp_data_manager.h" // g_pData
#include "saga_gui/wksp_simplefeature_manager.h"
//---------------------------------------------------------------------


class CSoilSalinityDlgBase
{
public:
	CSoilSalinityDlgBase(void);
	CSoilSalinityDlgBase(CSG_SimpleFeature* pSimpleFeature);
	//-----------------------------------------------------------------

	~CSoilSalinityDlgBase(void);
	//-----------------------------------------------------------------
protected:

	// last serial (automatically generated primary key)
	int									m_last_serial;

	wxArrayString						_Get_FeatureIDs(CSG_SimpleFeature* pSimpleFeature, int col);

	wxArrayString						_Get_Month_Array();

	CWKSP_SimpleFeature*				_Get_WKSP_SimpleFeature(CSG_SimpleFeature* pSimpleFeature);
	
	int									_Get_Selection(CSG_SimpleFeature* pSimpleFeature);

	wxArrayString						_Get_ColumnNames(CSG_SimpleFeature* pSimpleFeature);
	
	virtual CSG_String					_Get_AttributeTableName();
	
	virtual CSG_String					_Get_SettingsTableName();

	virtual CSG_String					_Get_WeightsTableName();

	int									m_nVariables; // number of salinity variables

	int									m_CurrentSelection;
	int									m_ID_Column; // selected column to identify fields

	void								_Set_ChoiceBox(wxChoice* pChoice, wxArrayString astr, int selection);

	virtual void						_Zero_Controls();

	//-----------------------------------------------------------------
	// EXTERNAL CLASSES
	//-----------------------------------------------------------------
	class CSG_SimpleFeature*			m_pSimpleFeature;
	class CWKSP_SimpleFeature*			m_pWKSP_SimpleFeature;
	class CWKSP_SimpleFeature_Manager*	m_pSimpleFeatureManager;

	//-----------------------------------------------------------------
	//
	//	SHARED DIALOG CONTROLS
	//
	//-----------------------------------------------------------------
	wxButton*							m_pButton_Save;
	wxButton*							m_pButton_Cancel;

	wxTextCtrl*							m_pTXTCtrlResultStr;
	wxTextCtrl*							m_pTXTCtrlResult;
	wxTextCtrl*							m_pTXTCtrl_MSLOW;
	wxTextCtrl*							m_pTXTCtrl_MSMEDIUM;
	wxTextCtrl*							m_pTXTCtrl_MSHIGH;


};
//---------------------------------------------------------------------
#endif /* __PG_SOIL_SALINITY_DLG_BASE_H_ */